// ZZ> This function makes an item fall to the floor when spawned
IfSpawned				//
  tmpargument = ACTIONJB		  //
  DoAction				  //
  KeepAction				  //
  MakeCrushValid
IfTakenOut
  ReaffirmCharacter
IfCrushed
  tmpx = selfx
  tmpy = selfy
  tmpdistance = selfz
  tmpargument = 1
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  GoPoof
  tmpargument = 1
  SendMessageNear
IfDropped				// Make it lie on floor
  KeepAction				  //
IfHitGround				// Make a sound
  tmpargument = 1			  //
  PlaySound				  //

IfGrabbed				// Tell them what they've won...
  SetTargetToWhoeverIsHolding		  //
  IfTargetIsAPlayer			  //
    tmpargument = 0			  //
    SendMessageNear			  //
  SetTargetToWhoeverIsHolding
  tmpargument = 1
  SetState
  SetOwnerToTarget

//Do the enchantment bonus
IfHeld
  SetTargetToWhoeverIsHolding
  IfStateIs0
    SetOwnerToTarget
    EnchantTarget
    tmpargument = 512
    CostTargetMana
    tmpargument = 1
    SetState
Else
  SetTargetToWhoeverIsHolding
  SetOwnerToTarget
  UndoEnchant
  tmpargument = 0
  SetState

IfDropped
  SetTargetToWhoeverIsHolding
  SetOwnerToTarget
  UndoEnchant
  tmpargument = 0
  SetState

IfPutAway
  SetTargetToWhoeverIsHolding
  SetOwnerToTarget
  UndoEnchant
  tmpargument = 0
  SetState

IfTakenOut
  SetTargetToWhoeverIsHolding
  SetOwnerToTarget
  UndoEnchant
  tmpargument = 0
  SetState

End					// All done

