IfOrdered
  tmpx = selforder
  tmpy = [SPOR]
  IfXIsEqualToY
    GetContent
    tmpargument = tmpargument +1		//Remember the number of sporks used
    SetContent

//Do spelly effects
IfTimeOut

  //STAGE 0 - Waiting for sporks
  IfStateIs0
    tmpargument = 50
    SetTime
    tmpargument = 5
    IfContentIs					//All 5 are in place
      tmpargument = 1				//Goto spell effect stage 1
      SetState
  Else
    GetContent
    tmpx = tmpargument
    tmpy = 0
    IfXIsMoreThanY
      tmpargument = tmpargument -1
      SetContent
      tmpargument = 1
      PlaySound

  //STAGE 3 - Final Stage
  IfStateIs14
    tmpargument = 7
    tmpx = 1100
    tmpy = 3570
    tmpturn = 33000			//Make it face towards the doors
    SpawnExactParticle			//Blast the door!
    GoPoof
    SpawnPoof				//Make it destroyed
    SpawnPoof
    tmpargument = 300			//Award some xp
    tmpdistance = EXPQUEST
    GiveExperienceToGoodTeam
    tmpargument = 2			//Door explodes
    PlayFullSound
    tmpargument = passage		//Make it open
    OpenPassage

  //STAGE 2 - Random lightnings
  tmpx = selfstate
  tmpy = 1
  IfXIsMoreThanY
    tmpargument = 5 + selfstate
    SetTime
    tmpargument = selfstate + 1
    SetState
    tmpargument = 0
    tmpx = rand % 600
    tmpx = selfx - tmpx - 250
    tmpy = rand & 511 + selfy - 256
    tmpdistance = rand & 128 + 50
    SpawnExactParticle

  //STAGE 1 - Big blast
  IfStateIs1
    tmpargument = 50
    SetTime
    tmpargument = 3
    tmpx = 1100
    tmpy = 3570
    tmpdistance = rand & 128 + 150
    SpawnExactParticle
    tmpargument = 2
    SetState
    tmpargument = 1
    PlaySound


//Just to make sure
IfSpawned
  tmpargument = passage
  ClosePassage

// See if there is a character in the detect passage
IfTimeOut
  tmpargument = 10
  SetTime
  KeepAction

  tmpargument = passage + 1
  SetTargetToWhoeverIsInPassage
    IfTargetCanOpenStuff
      tmpargument = passage
      OpenPassage
  Else
    tmpargument = passage
    IfPassageOpen
      ClosePassage
		      //
End				// Finished with this character
