//Spawn particles and recharge
IfTimeOut
  tmpx = selfammo
  tmpy = 5
  IfXIsLessThanY
    tmpargument = selfcontent + 1
    SetContent
    tmpargument = 10        //10*10=100 which is 2 seconds
    IfContentIs
      IncreaseAmmo
      tmpargument = 0
      SetContent
      
  //Lightning on spear
  tmpargument = 3
  tmpx = 0
  tmpy = 0
  tmpdistance = rand & 31
  SpawnParticle
  tmpdistance = rand & 31
  SpawnParticle
  tmpdistance = rand & 31
  SpawnParticle
  
  tmpargument = 10
  SetTime
  tmpargument = BLUE
  SparkleIcon

IfUsed
  UnsparkleIcon
  tmpargument = 0
  PlaySound
  
  //Reset timer when used (slower recharge)
  tmpargument = 100
  SetTime			

// ZZ> This function makes an item fall to the floor when spawned
IfSpawned				//
  tmpargument = ACTIONJB		  //
  DoAction				  //
  KeepAction				  //
  MakeCrushValid
  MakeAmmoKnown
IfCrushed
  tmpx = selfx
  tmpy = selfy
  tmpdistance = selfz
  tmpargument = 1
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  GoPoof
  tmpargument = 2
  SendMessageNear
IfThrown				// Make it attack
  tmpargument = 2
  tmpdistance = 1
  SpawnAttachedParticle
  tmpargument = 1			//Mark spear as thrown (Fake)
  SetState
IfNotDropped				// Say oops, that's kursed
  SetTargetToWhoeverIsHolding		  //
  tmpargument = 1			  //
  SendMessageNear			  //
  
//IfNotPutAway
//  SetTargetToWhoeverIsHolding
//  tmpargument = 3         //No longer needed, this is handled by the sourcecode now...
//  SendMessageNear

IfDropped				// Make it lie on floor
  KeepAction				  //
IfHitGround				// Make a sound			
  DisaffirmCharacter			  // Stop thrown attack
  IfStateIs1	
    GoPoof
  Else
    tmpargument = 1
    PlaySound
IfGrabbed				// Tell them what they've won...
  SetTargetToWhoeverIsHolding		  //
  IfTargetIsAPlayer			  //
    tmpargument = 0			  //
    SendMessageNear			  //
End					// All done
