//Give the target some kurses
SetTargetToWhoeverIsHolding
  UndoEnchant
  SetOwnerToTarget
  EnchantTarget
Else
  UndoEnchant

IfNotPutAway
  tmpargument = 4
  SendMessageNear

IfNotDropped
  tmpargument = 3
  SendMessageNear

IfUsed
  tmpargument = 100
  SetReloadTime

//The usual stuff
IfSpawned				//
  SetTargetToSelf
  tmpargument = ACTIONJB		  //
  DoAction				  //
  KeepAction				  //
  MakeCrushValid

IfCrushed
  tmpx = selfx
  tmpy = selfy
  tmpdistance = selfz
  tmpargument = 1
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  GoPoof
  tmpargument = 1
  SendMessageNear

IfDropped				// Make it lie on floor
  GetContent
  tmpx = tmpargument
  tmpy = 255
  IfXIsMoreThanY
    tmpargument = 255
    SetContent
  SetTargetToSelf
  KeepAction				  //

IfHitGround				// Make a sound
  tmpargument = 1			  //
  tmpdistance = rand & 2047 + 10000	  //
  PlaySound				  //

IfTakenOut				// Make a sound
  tmpargument = 2			  // 
  tmpdistance = rand & 2047 + 10000	  //
  PlaySound				  //
  SetTargetToWhoeverIsHolding		  //
  IfTargetIsAPlayer			  //
    tmpargument = 2			  //
    SendMessageNear			  //

IfGrabbed				// Tell them what they've won...
  SetTargetToWhoeverIsHolding		  //
  IfTargetIsAPlayer			  //
    tmpargument = 0			  //
    SendMessageNear			  //
 
End					// All done
