/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\mobiles\Coeurl.cs
Lines of code: 117
***********************************************************/


using System;
using System.Collections;
using Server.Items;
using Server.Targeting;
using Server.Mobiles;

namespace Server.Mobiles
{
	[CorpseName( "a coeurl corpse" )]
	public class Coeurl : BaseCreature
	{
		[Constructable]
		public Coeurl() : base( AIType.AI_Super, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "a coeurl";
			Hue = 502; 
			Body = 127;
			BaseSoundID = 0xBA;

			SetStr( 160, 210 );
			SetDex( 81, 105 );
			SetInt( 36, 60 );

			SetHits( 190, 320 );

			SetDamage( 15, 19 );

			SetDamageType( ResistanceType.Physical, 20 );
			SetDamageType( ResistanceType.Energy, 80 );

			SetResistance( ResistanceType.Physical, 40, 50 );
			SetResistance( ResistanceType.Fire, 40, 50 );
			SetResistance( ResistanceType.Cold, 30, 50 );
			SetResistance( ResistanceType.Poison, 20, 30 );
			SetResistance( ResistanceType.Energy, 70, 90 );
			
			SetSkill( SkillName.EvalInt, 46.7, 62.8 );
			SetSkill( SkillName.Magery, 30.7, 45.8 );
			SetSkill( SkillName.MagicResist, 46.1, 63.7 );
			SetSkill( SkillName.Anatomy, 30.1, 40.0 );
			SetSkill( SkillName.Tactics, 30.1, 40.0 );
			SetSkill( SkillName.Wrestling, 72.1, 77.0 );

			Fame = 5400;
			Karma = -5400;

			VirtualArmor = 30;

			Tamable = true;
			ControlSlots = 2;
			MinTameSkill = 84.5;
		}

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

		public override int Meat{ get{ return 4; } }
		public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }
		public override PackInstinct PackInstinct{ get{ return PackInstinct.Feline; } }

		public override void OnThink()
		{

			if (this.Combatant != null && 0.05 >= Utility.RandomDouble() && 0.05 >= Utility.RandomDouble() && 0.3 >= Utility.RandomDouble() && this.Combatant.Player && !this.Combatant.Blessed && this.Combatant.InRange( this, 20 ))
			{
			Mobile Target = this.Combatant; 
			Target.SendMessage( "You have been petrified" );
			this.MovingParticles( Target, 0x36D4, 7, 0, false, true, 997, 3, 9502, 4019, 0x47E, 0x100 );
			Target.Kill(); 
					
				if (Target.Corpse != null)
				{
					Target.Corpse.Hue = 997; 
					Target.Corpse.Name = Target.Name + " (Petrified)"; 
				}
			}
			
			base.OnThink();	
		}

		public Coeurl( Serial serial ) : base( serial )
		{
		}
		
		public override void OnGaveMeleeAttack( Mobile from )
		{
			if ( 0.2 >= Utility.RandomDouble())
			{
				from.BoltEffect( 0 );
				AOS.Damage( from, this, Utility.RandomMinMax( 20, 25 ), 0, 0, 0, 0, 100 );
			}
			
			
			if (0.05 >= Utility.RandomDouble() && 0.5 >= Utility.RandomDouble() && from.Player && !from.Blessed)
			{
			Mobile Target = from; 
			Target.SendMessage( "You have been petrified" );
			this.MovingParticles( Target, 0x36D4, 7, 0, false, true, 997, 3, 9502, 4019, 0x47E, 0x100 );
			Target.Kill(); 
					
				if (Target.Corpse != null)
				{
					Target.Corpse.Hue = 997; 
					Target.Corpse.Name = Target.Name + " (Petrified)"; 
				}
			}	
		}

		public override void OnGotMeleeAttack( Mobile from )
		{
			if ( 0.2 >= Utility.RandomDouble())
			{
				from.BoltEffect( 0 );
				AOS.Damage( from, this, Utility.RandomMinMax( 20, 25 ), 0, 0, 0, 0, 100 );
			}
		}
		
		public override void OnDamagedBySpell( Mobile from )
		{
			if ( 0.2 >= Utility.RandomDouble() && !from.InRange( this, 2 ))
			{
				from.BoltEffect( 0 );
				AOS.Damage( from, this, Utility.RandomMinMax( 20, 25 ), 0, 0, 0, 0, 100 );
			}
		}

		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();
		}
	}
}