// This checks the pit for any dead bodies that can be removed...
IfTimeOut
  tmpargument = passage
  SetTargetToWhoeverIsInPassage
    tmpx = targetz
    tmpy = 0 - 100
    IfXIsLessThanY
      tmpargument = [HUMA]
      IfTargetHasID
        PoofTarget
          tmpargument = 0
          PlaySound
          GetContent
          tmpargument = tmpargument + 1
          SetContent
          tmpx = tmpargument
          tmpy = 2
          IfXIsMoreThanY
            // Drop goodies
            tmpargument = 49
            tmpturn = rand
            tmpdistance = 0
            tmpx = selfx
            tmpy = selfy
            SpawnExactCharacterXYZ
            SpawnPoof
            GoPoof
            tmpargument = 2
          Else
            tmpargument = 0
          SendMessageNear
        Else
          tmpargument = 3
          SendMessageNear
          GoPoof
      Else
        tmpargument = [FRTN]    //Fortune cookie!
        IfTargetHasID  
          PoofTarget
          tmpargument = 0
          PlaySound            
          tmpargument = selfstate + 1
          SetState
          IfStateIs5          //sacrificed 5 cookies
            DropItems     //cant spawn spellbooks
            SpawnPoof
            GoPoof
            tmpargument = 2
          Else
            tmpargument = 4       //keep on feedin!
          SendMessageNear
        Else
          PoofTarget
            tmpargument = 1
            SendMessageNear
            tmpargument = 0     //reset the sacrifical counter
            SetContent
            SetState
          Else
            tmpargument = 3
            SendMessageNear       //A player was sacrificed!
            GoPoof

  tmpargument = 50
  SetTime
End					// All done
