/**********************************************************
RunUO AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Red Squirrel on May-15-2012 07:15:47pm
Filepath: scripts\events and scenarios\Long Live the King 2012\Britain Undead Invasions\Good Side\DupreFighter.cs
Lines of code: 109

Description: 

***********************************************************/


using System;
using System.Collections;
using Server.Items;

namespace Server.Mobiles
{
	[CorpseName( "Dupre's corpse" )]
	public class DupreFighter : BaseCreature
	{
		public override bool ClickTitle{ get{ return false; } }
		private DateTime lastability;

		[Constructable]
		public DupreFighter() : base( AIType.AI_Super, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
		{
			SpeechHue = Utility.RandomDyedHue();
			Hue = 33809;
			Name = "Dupre";
			Body = 0x190;
			
			HairItemID = 8272;
			HairHue = 0;

			SetStr( 326, 375 );
			SetDex( 121, 234 );
			SetInt( 70, 80 );

	        SetHits( 700, 700 );
			SetMana( 101, 110 );

			SetDamage( 17, 25 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 55, 75 );
			SetResistance( ResistanceType.Fire, 40, 60 );
			SetResistance( ResistanceType.Cold, 35, 55 );
			SetResistance( ResistanceType.Poison, 50, 70 );
			SetResistance( ResistanceType.Energy, 55, 75 );

			SetSkill( SkillName.MagicResist, 42.6, 57.5 );
			SetSkill( SkillName.Tactics, 115.1, 130.0 );
			SetSkill( SkillName.Wrestling, 92.6, 107.5 );
			SetSkill( SkillName.Anatomy, 110.1, 125.0 );
			SetSkill( SkillName.Chivalry, 100.1, 120.0 );
			SetSkill( SkillName.Parry, 100.1, 120.0 );

			SetSkill( SkillName.Fencing, 120, 120 );
			SetSkill( SkillName.Macing, 120, 120 );
			SetSkill( SkillName.Swords, 120, 120 );

			Fame = 5000;
			Karma = 15500;

			Item shoes = new ThighBoots();
			shoes.Movable = false;
			AddItem( shoes );	
			
			Item shield = new Aegis();
			shield.Movable = false;
			shield.Hue = 2213;
			AddItem( shield );	
			
			BladeOfTheRighteous weapon = new BladeOfTheRighteous();
			weapon.Movable = false;
			weapon.Hue = 1254;
			AddItem( weapon );	
		}
		
		public override bool OnBeforeDeath()
		{
			this.Blessed = true;
			this.Say("I must retreat to heal my wounds!");
			Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( Delete ) );
			return false;
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.Rich );
		}

		public override bool NoFlee { get { return true; } }
		public override bool BardImmune{ get{ return true; } }
		public override bool CantbeSupreme { get { return true;} }
		public override bool CantbeParagon { get { return true;} }
		
		public override void OnThink()
		{
			if (0.2 > Utility.RandomDouble() && lastability < DateTime.Now) {
				Steal();
			}

			base.OnThink();		
		}
		
		public void Steal()
		{
			ArrayList ilist = new ArrayList();
			ArrayList list = new ArrayList();
			
			foreach ( Item i in this.GetItemsInRange( 1 ) )
			{
				if ( i.Movable == false || i == null)
					continue;
				else
					ilist.Add( i );
			}
			
			foreach ( Item i in ilist )
			{
				this.GiveItem(i);
			}
			
			lastability=DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax( 40, 60 ));
		}
		
		public DupreFighter( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			this.Delete();
		}
	}
}
