// ZZ> This function controls the burning of the fire holder
IfSpawned
  tmpargument = rand & 15		  // Initial flicker
  SetFrame
  GetContent
  SetState
  IfStateIs0
    // Off to begin
    DisaffirmCharacter
  IfStateIs1
    // On permanently
    tmpargument = 2
    SetState
  IfStateIs3
    // Off to begin, close passage when fire gone
    DisaffirmCharacter
    tmpargument = 0
    SetState
IfStateIs0
  // Not lit...
  IfReaffirmed
    tmpargument = 1
    SetState
    tmpargument = 500			  // Burn for 10 seconds
    SetTime
    // Open the passage
    tmpargument = passage
    OpenPassage
      tmpargument = 2
      tmpdistance = 11025
      PlaySound
      tmpargument = 1
      SendMessageNear
      tmpargument = selfmoney
      tmpdistance = EXPSECRET
      GiveExperienceToGoodTeam
IfStateIs1
  // Lit...
  IfReaffirmed
    tmpargument = 500
    SetTime
  IfTimeOut
    DisaffirmCharacter
    tmpargument = 0
    SetState
    SendMessageNear
    // Fade out the light
    tmpargument = 3
    tmpx = 0
    tmpy = 0
    tmpdistance = SPAWNLAST
    SpawnParticle

    // Check for content==3
    GetContent
    tmpx = tmpargument
    tmpy = 3
    IfXIsEqualToY
      // Close the passage
      tmpargument = passage
      ClosePassage
IfReaffirmed
  tmpargument = 50
  SetReloadTime
End					// All done
