/**********************************************************
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\Evil Side\InvadingNecromancer.cs
Lines of code: 112

Description: 

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


using System; 
using Server;
using Server.Items;
using Server.Targeting;
using Server.Network;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace Server.Mobiles
{
	[CorpseName( "a necromancer corpse" )]
	public class InvasionNecromancer : BaseCreature
	{
		public override bool ClickTitle{ get{ return false; } }
		public override double SwitchWeaponChance{ get{ return 0.4; } }
		private DateTime lastability;

		[Constructable]
		public InvasionNecromancer() : base( AIType.AI_Super, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			SpeechHue = Utility.RandomDyedHue();
			Hue = Utility.RandomSkinHue();
			Name = "an invading necromancer";
			Body = 0x190;
			
			Hue = Utility.RandomSkinHue();

			SetStr( 151, 175 );
			SetDex( 61, 85 );
			SetInt( 151, 175 );
			
			SetHits( 300, 300 );
			SetMana( 200, 200 );

			SetResistance( ResistanceType.Physical, 40, 60 );
			SetResistance( ResistanceType.Fire, 40, 60 );
			SetResistance( ResistanceType.Cold, 40, 60 );
			SetResistance( ResistanceType.Energy, 40, 60 );
			SetResistance( ResistanceType.Poison, 40, 60 );

			VirtualArmor = 32;

			SetSkill( SkillName.Macing, 110.0, 120.0 );
			SetSkill( SkillName.Fencing, 110.0, 120.0 );
			SetSkill( SkillName.Swords, 110.0, 120.0 );
			SetSkill( SkillName.Wrestling, 110.0, 120.0 );
			SetSkill( SkillName.Tactics, 110.0, 120.0 );
			SetSkill( SkillName.MagicResist, 110.0, 120.0 );
			SetSkill( SkillName.Healing, 110.0, 120.0 );
			SetSkill( SkillName.Anatomy, 110.0, 120.0 );

			SetSkill( SkillName.Magery, 110.0, 120.0 );
			SetSkill( SkillName.Necromancy, 110.0, 120.0 );
			SetSkill( SkillName.SpiritSpeak, 110.0, 120.0 );
			SetSkill( SkillName.EvalInt, 110.0, 120.0 );
			SetSkill( SkillName.Meditation, 110.0, 120.0 );

			Fame = -5000;
			Karma = -15500;

			Item shroud = new HoodedShroudOfShadows();
			shroud.Hue = 1109;
			shroud.Movable = false;
			AddItem( shroud );
			
			PackItem( new GnarledStaff() );
			PackItem( new ExecutionersAxe() );
			PackItem(new Dagger());
			PackItem(new BlackStaff());	

			SwapWeapon(0);		

			PackItem( new Spellbook() );	
			PackItem( new NecromancerSpellbook() );				
		}

		public override double WeaponAbilityChance{ get{ return 0.5; } }

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

		public override bool Unprovokable{ get{ return true; } }
		public override bool Uncalmable{ get{ return true; } }
		public override bool CantbeSupreme { get { return true;} }
		public override bool CantbeParagon { get { return true;} }	
		public override bool AlwaysMurderer{ get{ return true; } }
		public override bool NoFlee { 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 InvasionNecromancer( 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();
		}
	}
}
