/**********************************************************
RunUO AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Red Squirrel on Sep-24-2011 10:26:28pm
Filepath: scripts\Engines\peerless\ML\Interred Grizzle\Champion\Ilhenir.cs
Lines of code: 138

Description: 

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


using System;
using System.Collections;
using Server.Items;
using Server.Network;
using Server.Mobiles;
using Server.Engines.CannedEvil;

namespace Server.Mobiles
{
	[CorpseName( "the remains of Ilhenir" )]
	public class Ilhenir : BaseChampion
	{
		public override ChampionSkullType SkullType{ get{ return ChampionSkullType.Venom; } }
		
		public override WeaponAbility GetWeaponAbility()
		{
			return WeaponAbility.DoubleStrike;
		}

		[Constructable]
		public Ilhenir() : base( AIType.AI_Super )
		{
			Name = "Ilhenir the Stained";
			Body = 259;	
			Hue = 1420;		
			BaseSoundID = 589;

			SetStr( 1190, 1200 );
			SetDex( 121, 170 );
			SetInt( 605, 750 );

			SetHits( 9000, 9500 );

			SetDamage( 15, 25 );

			SetDamageType( ResistanceType.Physical, 30 );
			SetDamageType( ResistanceType.Fire, 70 );

			SetResistance( ResistanceType.Physical, 56, 64 );
			SetResistance( ResistanceType.Fire, 51, 60 );
			SetResistance( ResistanceType.Cold, 63, 65 );
			SetResistance( ResistanceType.Poison, 90, 100 );
			SetResistance( ResistanceType.Energy, 75, 80);

			SetSkill( SkillName.EvalInt, 100.0, 103.0 );
			SetSkill( SkillName.Magery, 100.0, 103.0 );
			SetSkill( SkillName.SpiritSpeak, 110.0 );
			SetSkill( SkillName.Necromancy, 100.0 );
			SetSkill( SkillName.MagicResist, 120.0, 132.0);
			SetSkill( SkillName.Tactics, 111.7, 115.0 );
			SetSkill( SkillName.Wrestling, 114.2, 117.9 );

			Fame = 22500;
			Karma = -22500;

			VirtualArmor = 60;
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.UltraRich, 5 );
			AddLoot( LootPack.UltraRich, 5 );
			
			if(0.05>Utility.RandomDouble())
			{
				switch(Utility.Random(2))
				{
				case 0: PackItem(new IlhenirsDiseasedClaw());break;
				case 1: PackItem(new SashOfTheCorrupt());break;	
				case 2: PackItem(new IlhenirsDecayingArmBone());break;
				}
			}	
		}
		
		public override int GetAngerSound()
		{
			return 1410;
		}

		public override int GetIdleSound()
		{
			return 1409;
		}

		public override int GetAttackSound()
		{
			return 1408;
		}

		public override int GetHurtSound()
		{
			return 1411; 
		}

		public override int GetDeathSound()
		{
			return 1407; 
		}

		public override void OnDamage( int amount, Mobile from, bool willKill )
		{
			if ( !willKill )
			{
				if ( from != null && from != this && 0.2 >= Utility.RandomDouble())
				{
					this.PlaySound( 1411 );
					SpillFluids(from);
					SpillFluids(from);
					SpillFluids(from);
				}
			}

			base.OnDamage( amount, from, willKill );
		}

		public void SpillFluids(Mobile from)
		{
			Map map = from.Map;

			if ( map == null )
				return;

				int x = this.X + Utility.RandomMinMax( -1, 1 );
				int y = this.Y + Utility.RandomMinMax( -1, 1 );
				int z = this.Z;

				z = map.GetAverageZ( x, y );

				Item item = new GrizzleAcid();

				item.MoveToWorld( new Point3D( x, y, z ), map );
		}
		
		public override int Meat{ get{ return 1; } }
        public override bool BleedImmune{ get{ return true; } }
        public override bool AutoDispel{ get{ return true; } }
        public override double AutoDispelChance{ get{ return 0.4; } }
		public override bool BardImmune{ get{ return true; } }
		public override bool Unprovokable{ get{ return true; } }
		public override bool Uncalmable{ get{ return true; } }
		public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
		public override bool IsMLCreature { get { return true;} }
		public override bool IsMLBoss { get { return true;} }
		
		public override bool HasBreath{ get{ return true; } }
		public override int BreathPhysicalDamage{ get{ return 30; } } 
		public override int BreathFireDamage{ get{ return 70; } }
		public override double BreathDamageScalar{ get{ return (0.035); } }   
		public override int BreathEffectHue{ get{ return 1420; } }
		
		public override double BreathMinDelay{ get{ return 15.0; } }
		public override double BreathMaxDelay{ get{ return 20.0; } }

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

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

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