/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\engines\ML Peerless + misc areas\demitel\Dark Palace\Mobiles\AnimatedLongbow.cs
Lines of code: 77
***********************************************************/


using System; 
using Server.Items; 

namespace Server.Mobiles 
{ 
    
	public class AnimatedLongbow : BaseCreature 
	{ 
		public override bool DeleteCorpseOnDeath{ get{ return true; } }

		public override WeaponAbility GetWeaponAbility()
		{
			switch ( Utility.Random( 2 ) )
			{
				default:
				case 0: return WeaponAbility.Dismount;
				case 1: return WeaponAbility.InfectiousStrike;
				case 2: return WeaponAbility.ParalyzingBlow;
			}
		}
		[Constructable] 
		public AnimatedLongbow() : base( AIType.AI_Archer, FightMode.Closest, 10, 4, 0.2, 0.4 ) 
		{ 
			Body = 950; 
			Hue = 33; 
			Name = "an animated longbow"; 

			Bow weapon = new Bow();
			weapon.Hue = 1359;
			weapon.Movable = false;
			AddItem( weapon );

			SetStr( 101, 110 ); 
			SetDex( 666, 666 ); 
			SetInt( 101, 110 );

			SetHits( 255 );
			SetStam( 191, 200 );

			SetDamage( 10, 22 );

			SetDamageType( ResistanceType.Physical, 75 );
			SetDamageType( ResistanceType.Cold, 25 );

			SetResistance( ResistanceType.Physical, 35, 45 );
			SetResistance( ResistanceType.Fire, 10, 20 );
			SetResistance( ResistanceType.Cold, 65, 70 );
			SetResistance( ResistanceType.Poison, 20, 30 );
			SetResistance( ResistanceType.Energy, 20, 30 );

			SetSkill( SkillName.Wrestling, 75.1, 100.0 ); 
			SetSkill( SkillName.Tactics, 90.1, 100.0 ); 
			SetSkill( SkillName.MagicResist, 90.1, 100 ); 

			VirtualArmor = 40; 
			Fame = 7000; 
			Karma = -50000;             
		}

		public override bool OnBeforeDeath()
		{

			if ( Utility.Random( 40 ) == 0 )
			{
				BloodclanBow weapon = new BloodclanBow();
				weapon.MoveToWorld( Location, Map );
			}

			Effects.SendLocationEffect( Location, Map, 0x376A, 10, 1 );
			return true;
		}

		public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
		public override bool BleedImmune{ get{ return true; } }
		public override bool IgnoreYoungProtection { get { return true; } }
		public override bool Unprovokable{ get{ return true; } }
		public override bool Uncalmable{ get{ return true; } }

		public AnimatedLongbow( Serial serial ) : base( serial ) 
		{ 
		} 

		public override void Serialize( GenericWriter writer ) 
		{ 
			base.Serialize( writer ); 
			writer.Write( (int) 0 ); 
		} 

		public override void Deserialize( GenericReader reader ) 
		{ 
			base.Deserialize( reader ); 
			int version = reader.ReadInt(); 
		} 
	} 
}