/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\Items\Weapons\Abilities\BladeWeave.cs
Lines of code: 42
***********************************************************/


//Bladeweave by Red Squirrel

using System;
using Server;
using System.Collections;

namespace Server.Items
{
	/// <summary>
	/// performs a random special shot
	/// </summary>
	public class BladeWeave : WeaponAbility
	{
		private static Hashtable m_Registry = new Hashtable();
		public static Hashtable Registry { get { return m_Registry; } }

		public BladeWeave()
		{
		}

		public override int BaseMana { get { return 25; } }

		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if( !Validate( attacker ) || !CheckMana( attacker, false ) )
				return;

			ClearCurrentAbility( attacker );
			UseDelaySystem.RemoveContext(attacker,DelayContextType.WeaponAbility);

			attacker.PlaySound( 1468 );
			
			
			int random=Utility.Random(12);
			//check if attacker has enough mana to perform a special that uses 35 mana, if not, we set the random ranger lower
			if(attacker.Mana<35)random=Utility.Random(5);
			
		//	attacker.SendMessage("random {0}",random);   //debug
		
		string attack="[undefined]";
			
			//randomize a special attack and call it's onhit function
			switch(random)
			{
				case 0: ConcussionBlow.OnBeforeDamage( attacker,  defender );attack="Concussion Blow";break;
				case 1: CrushingBlow.OnHit(attacker,defender,damage);attack="Crushing Blow";break;				
				case 2: MortalStrike.OnHit(attacker,defender,damage);attack="Mortal Strike";break;		
				case 3: Dismount.OnHit(attacker,defender,damage);attack="Dismount";break; 
				case 4: ParalyzingBlow.OnHit(attacker,defender,damage);attack="Paralyzing Blow";break;
				case 5: ArmorIgnore.OnHit(attacker,defender,damage);attack="Armor Ignore";break;
				case 6: BleedAttack.OnHit(attacker,defender,damage);attack="Bleed Attack";break;
				case 7: DoubleStrike.OnHit(attacker,defender,damage);attack="Double Strike";break;
				case 8: Feint.OnHit(attacker,defender,damage);attack="Feint";break;
				case 9: Block.OnHit(attacker,defender,damage);attack="Block";break;
				case 10: DefenseMastery.OnHit(attacker,defender,damage);attack="Defense Mastery";break;
				case 11: DualWield.OnHit(attacker,defender,damage);attack="Dual Wield";break;
			}
			
		attacker.SendLocalizedMessage(1072841,attack);
		}

		
	}
}