//This manages attack speed (Adjusted by strenght and\or dexterity)
IfUsed
  tmpargument = 0         //only if non-magical
  IfArmorIs
    SetTargetToWhoeverIsHolding
    tmpargument = targetdex > 8		//Every point of dex increases speed by 1
    tmpargument = 50 - tmpargument
    SetReloadTime
  
//Set magic properties
IfSpawned
  SetTargetToSelf
  SetOwnerToTarget
    
  //Unidentified!
  IfNameIsKnown
    DoNothing
  Else
    tmpargument = 2
    ChangeArmor
    UnsparkleIcon    
    
  //Make it glow!
  tmpargument = 1
  IfArmorIs
    EnchantTarget
    tmpargument = BLUE
    SparkleIcon

//Electric sound
IfUsed
  tmpargument = 1
  IfArmorIs
    tmpargument = 3
    PlaySound
  
//Do kill count
IfScoredAHit
  
  //Normal blade
  tmpargument = 0
  IfArmorIs
    IfTargetIsAlive
      DoNothing
    Else
      tmpargument = selfcontent + 1
      SetContent
      tmpx = selfcontent
      tmpargument = 5
      SendMessageNear
    tmpx = selfcontent
    tmpy = 100
    IfXIsEqualToY
      tmpargument = 1
      ChangeArmor
      SetTargetToSelf
      EnchantTarget
      tmpargument = BLUE
      SparkleIcon
  
  //Magical blade
  tmpargument = 1
  IfArmorIs
    tmpargument = selfcontent - 1
    SetContent
    tmpx = selfcontent
    tmpargument = 6
    SendMessageNear

    tmpargument = 0
    IfContentIs
      tmpargument = 0
      ChangeArmor
      UndoEnchant
      UnsparkleIcon

    //Do magic sparklies
    tmpargument = 2
    tmpdistance = targetz
    tmpx = targetx
    tmpy = targety
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
      
  //Unidentified blade
  tmpargument = 2
  IfArmorIs
    IfNameIsKnown
      tmpargument = 0
      ChangeArmor
    
IfSpawned				//
  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
  KeepAction				  //
IfGrabbed				// Tell them what they've won...
  SetTargetToWhoeverIsHolding		  //
  IfTargetIsAPlayer			  //
    tmpargument = 0			  //
    SendMessageNear			  //
IfHitGround				// Make a sound
  tmpargument = 1			  //
  PlaySound				  //
IfNotDropped
  tmpargument = 2
  SendMessageNear
IfTakenOut
  tmpargument = 2
  PlaySound
  SetTargetToWhoeverIsHolding
  IfTargetIsAPlayer
    tmpargument = 4
    SendMessageNear
IfNotPutAway
  tmpargument = 3
  SendMessageNear
End					// All done
