// Someone cast an unlock spell
IfOrdered
  tmpx = selforder
  tmpy = 491  // The unique code for an unlock order
  IfXIsEqualToY
      tmpargument = 2		//Tell them its warded
      SendMessageNear


// This function makes the button open the passage
tmpx = 20				// Threshold weight
tmpy = weight				// Weight of characters on top
IfXIsLessThanY				// Open it
  SetTargetToWhoeverBumped		  //
  tmpargument = passage
  IfPassageOpen
    DoNothing
  Else
    IfStateIs0
      tmpargument = [KEYB]	  //Only for bosskey
      CostTargetItemID			  // Check for Key
        tmpargument = [OPEN]
        IssueOrder				    //

        tmpargument = 10
        tmpdistance = EXPSECRET
        GiveExperienceToTarget

        tmpargument = 0			      //
        SendMessageNear			      //
        tmpargument = 1
        SetState

tmpargument = passage			//
IfPassageOpen				// Go down
  IfStateIs0				  //
    tmpargument = ACTIONMG		    //
    DoAction				    //
      tmpargument = 1			      // 1 is down
      SetState				      //
      KeepAction			      // Make it stay on last frame
      tmpargument = 0			      //
      SetBumpHeight			      //
Else					// Pop up
  IfStateIs1				  //
    tmpargument = ACTIONMJ		    //
    DoAction				    //
      KeepAction			      // Make it stay on last frame
      tmpargument = 30			      //
      SetBumpHeight			      //
    tmpargument = 2
    SetState				//dont repeat
End					// Finished with this character
