/**********************************************************
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\Jormundgand\Mobiles\Regular\Lorkest.cs
Lines of code: 113
***********************************************************/


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

namespace Server.Mobiles
{
	[CorpseName( "a lorkest corpse" )]
	public class Lorkest : BaseCreature
	{
		[Constructable]
		public Lorkest() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "a lorkest";
			Body = 77;
			Hue = 286; 
			BaseSoundID = 353;

			SetStr( 756, 780 );
			SetDex( 800, 900 );
			SetInt( 26, 40 );

			SetHits( 600, 868 );
			SetMana( 0 );

			SetDamage( 60, 70 );

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

			SetResistance( ResistanceType.Physical, 45, 55 );
			SetResistance( ResistanceType.Fire, 30, 40 );
			SetResistance( ResistanceType.Cold, 30, 40 );
			SetResistance( ResistanceType.Poison, 20, 30 );
			SetResistance( ResistanceType.Energy, 10, 20 );

			SetSkill( SkillName.MagicResist, 15.1, 20.0 );
			SetSkill( SkillName.Tactics, 120 );
			SetSkill( SkillName.Wrestling, 120 );

			Fame = 25000;
			Karma = -25000;

			VirtualArmor = 50;

			CanSwim = true;
			CantWalk = false;
		}
		
		public override void OnDeath( Container c )
		{
			if ( Utility.Random( 5 ) == 0 )
			{		
				Item item;

				switch ( Utility.Random( 1 ))
				{
								default:
					case 1: item = new MinionKey(); break;
							}

				c.DropItem( item );
			}

			base.OnDeath( c );
		}
		
		public override void OnThink()
		{

			if (this.Combatant != null && 0.05 >= Utility.RandomDouble() && 0.8 >= Utility.RandomDouble() && !this.Combatant.Blessed && this.Combatant.InRange( this, 10 ) && this.InLOS(  this.Combatant ))
			{
			Mobile Target = this.Combatant; 
			Target.SendMessage( "The Lorkest drags you in with its barbed tail" );
			Target.Location = this.Location;
			}
			
			base.OnThink();
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.FilthyRich, 5 );
		}
		
		public override double BonusPetDamageScalar{ get{ return 25.0; } }
		public override bool Unprovokable{ get{ return true; } }
		public override bool Uncalmable{ get{ return true; } }
		public override bool ReacquireOnMovement{ get{ return true; } }
		public override bool CantbeSupreme { get { return true;} }
		public override bool IsMLCreature { get { return true;} } 
		
		public override void OnGaveMeleeAttack(Mobile defender)
 		{
			if ( 0.2 > Utility.RandomDouble())
			{
				defender.SendMessage( "The Lorkest slices you in half with its fangs");
				defender.Damage(200);
			}
			base.OnGaveMeleeAttack(defender);
		}
		
			
		public override void OnGotMeleeAttack(Mobile attacker)
 		{
			if ( 0.3 > Utility.RandomDouble() && !attacker.InRange( this, 1 ))
			{
				attacker.SendMessage( "The Lorkest drags you in with its barbed tail" );
				attacker.Location = this.Location;
			}
		}
		
		public override void OnDamagedBySpell(Mobile attacker)
		{
			if ( 0.3 > Utility.RandomDouble() && !attacker.InRange( this, 2 ))
			{
				attacker.SendMessage( "The Lorkest drags you in with its barbed tail" );
				attacker.Location = this.Location;
			}
		}

		public override int TreasureMapLevel{ get{ return 6; } }

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