//Make it Glow
IfSpawned
  ReaffirmCharacter

//Blacken Status bars
IfHeld
  SetTargetToWhoeverIsHolding
  IfStateIs0
    SetOwnerToTarget
    EnchantTarget
    tmpargument = 1
    SetState
Else
  UndoEnchant
  tmpargument = 0
  SetState

IfPutAway
  tmpargument = 0
  SetState
  UndoEnchant

// ZZ> This function makes an item fall to the floor when spawned
IfSpawned				//
  tmpargument = ACTIONJB		  //
  DoAction				  //
  KeepAction				  //
  MakeCrushValid

//Poof if crushed
IfCrushed
  tmpx = selfx
  tmpy = selfy
  tmpdistance = selfz
  tmpargument = 1
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  GoPoof
  tmpargument = 1
  SendMessageNear

//Scream every so often
IfTimeOut
  tmpargument = rand & 63 + 90
  SetTime
  SetTargetToWhoeverIsHolding
    IfTargetIsAPlayer
      tmpx = 15
      tmpy = rand & 511
      IfXIsMoreThanY
        tmpargument = 5
        SendMessageNear
        PlaySound

IfDropped				// Make it lie on floor
  KeepAction				  //
  UndoEnchant

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

//Make a sound if dropped on ground
IfHitGround				// Make a sound
  tmpargument = 1			  //
  PlaySound				  //

//Tell its kursed
IfNotDropped
  tmpargument = 2
  SendMessageNear
//IfNotPutAway
//  tmpargument = 3         //No longer needed, this is handled by the sourcecode now...
//  SendMessageNear

//Tell the players what they got
IfTakenOut
  SetTargetToWhoeverIsHolding
  IfTargetIsAPlayer
    tmpargument = 4
    SendMessageNear

//Remove enchant if not holding
IfPutAway
  UndoEnchant

End					// All done
