// ZZ> This function makes an item fall to the floor when spawned
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			  //


// Charge the Sword
IfTargetIsDefending
  tmpargument = YELLOW
  SparkleIcon


  GetContent
  tmpx = tmpargument + 4
  tmpy = 256
  IfXIsMoreThanY
    tmpx = 256
  tmpargument = tmpx
  SetContent
  tmpy = 4
  IfXIsEqualToY
    // Start charge sound
    tmpargument = 3
    tmpdistance = 11025
    PlaySound


// Charge falls off quickly if not stable
Else
  GetContent
  tmpx = tmpargument
  tmpy = 256
  IfXIsLessThanY
    tmpx = tmpx - 16
    tmpy = 0
    IfXIsLessThanY
      tmpx = tmpy
      UnsparkleIcon
    tmpargument = tmpx
    SetContent



// Unleash the power of The Mana Sword...  Dum De Dum!
IfUsed
  GetContent
  tmpx = tmpargument
  tmpy = 256
  IfXIsEqualToY
    // Fully charged sound
    tmpargument = 4
    tmpdistance = 15000
    PlaySound
    UnsparkleIcon


    // Mana chop
    tmpx = targetx
    tmpy = targety
    tmpdistance = targetz
    tmpargument = 4
    SpawnExactParticle
    tmpargument = 7
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
  tmpargument = 0
  SetContent



// Drip Mana depending on charge
GetContent
tmpx = tmpargument
tmpy = rand & 255
IfXIsMoreThanY
  tmpargument = 2
  tmpx = 0
  tmpy = 0
  tmpdistance = rand % 9 // Pick a vertex along the blade ( look at model )
  SpawnParticle




 
End					// All done
