Page 1 of 1

Wizard door peek

Posted: Fri Nov 28, 2014 11:10 pm
by msyblade
This is the wizard checking the door slot event from log 2, minus the checks for items so you can just hook it to a floor trigger, or a doorbell. Make sure to place a scriptable wizard behind a castle entrance door, and which direction the party should be facing the door.

Code: Select all

    lastKnockTime = nil

    function wizardPeep()
       
          -- fail

          -- cooldown for door check animation
          local playTime = GameMode.getStatistic("play_time")
          if lastKnockTime and playTime - lastKnockTime < 100 then return end
          lastKnockTime = playTime

          if party.facing == 3 then
             if wizard_door.brain:performAction("checkDoor") then
                castle_entrance_door_1.animation:play("hatch")
                hudPrint ("Go away!")
             end
          end
       end

Enjoy!