IfTimeOut
  tmpargument = 30
  SetTime
  
  //bubbling sound
  tmpargument = 0
  IfContentIs
    tmpargument = 1
    PlaySound
    tmpargument = 4
    SetContent
  Else
    tmpargument = selfcontent - 1
    SetContent

  //Either check for a outburst or spawn fireballs
  IfStateIs0
    SetTargetToNearbyEnemy
      tmpx = rand & 255
      tmpy = 20
      IfXIsLessThanY        //Erupt!
        tmpargument = 8
        SetState
        tmpargument = 0
        SendMessage
  Else
    tmpargument = selfstate - 1
    SetState
    
    //Spawn a fireball
    tmpargument = 0
    tmpdistance = selfz + 100
    tmpx = selfx
    tmpy = selfy
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    
// ZZ> This function anounces your location
IfBumped			// 
  tmpargument = 0
  GetXY
  IfXIsEqualToY
    SetTargetToWhoeverBumped	  //
      IfTargetIsAPlayer
        tmpargument = rand & 3 + 1		        //
        SendMessage		        //
        tmpargument = 0
        tmpx = 180
        tmpy = 0
        SetXY

//Countdown the timer        
tmpargument = 0
GetXY
IfXIsMoreThanY
    tmpx = tmpx - 1
    tmpy = 0
    SetXY    
        
//This makes the player enter the module
IfAttacked
  SetTargetToWhoeverAttacked
  IfTargetIsAPlayer
    GetContent
    tmpargument = 0
    BeatModule
    EnableExport

    // Fix the end text
    ClearEndMessage
    GetContent
    AddEndMessage
    
    //palwater.mod
    tmpargument = 5
    FollowLink
End				// Finished with this character

End				// Finished with this character
