IfTimeOut
  tmpargument = 0
  SetState

IfBumped
  SetTargetToWhoeverBumped
  IfTargetIsAPlayer
    IfStateIs0
      tmpargument = 1
      SetState
      tmpargument = 100		//2 seconds
      SetTime
      GetContent
      tmpx = tmpargument

      //Royal crypt
      tmpy = 0
      IfXIsEqualToY
        tmpargument = 0
        SendMessageNear

      //Crypt Quest Unlock
      tmpy = 1
      IfXIsEqualToY
        tmpargument = [CRYP]
        IfTargetHasQuest
          //Unlock the module if it isnt already
          tmpargument = [CRYP]
          tmpdistance = 1
          AddQuestAllPlayers
          tmpargument = 1
          SendMessageNear
          tmpargument = 2
          SendMessage
          tmpargument = 2
          SetContent
          tmpargument = 0
          PlayFullSound
        Else                //They know nothing about this crypt quest
          tmpargument = 7
          SendMessageNear

      //Crypt Quest
      tmpy = 2
      IfXIsEqualToY
        tmpargument = 1
        SendMessageNear

      //Crypt for Developers
      tmpy = 3
      IfXIsEqualToY
        tmpargument = 3
        SendMessageNear
        tmpargument = 4
        SendMessageNear
        tmpargument = 5
        SendMessageNear

      //Vladula crypt
      tmpy = 4
      IfXIsEqualToY
        tmpargument = 6
        SendMessageNear
End
