/**********************************************************
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\Painted Caves\Troglodyte.cs
Lines of code: 94
***********************************************************/


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

namespace Server.Mobiles
{
	[CorpseName( "a troglodyte corpse" )]
	//[TypeAlias( "Server.Mobiles.ArticOgreLord" )]
	
	
	//When archers attack them, they gang up on them. Can write a flagging method. 
	
	public class Troglodyte : BaseCreature
	{
		[Constructable]
		public Troglodyte() : base( AIType.AI_Super, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "a troglodyte";
			Body = 267;
			//BaseSoundID = 1437;

			SetStr( 161, 207 );
			SetDex( 98, 118 );
			SetInt( 55, 70 );

			SetHits( 304, 338 );

			SetDamage( 26, 38 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 30, 33 );
			SetResistance( ResistanceType.Fire, 21, 29 );
			SetResistance( ResistanceType.Cold, 35, 40 );
			SetResistance( ResistanceType.Poison, 30, 40 );
			SetResistance( ResistanceType.Energy, 30, 40 );

			SetSkill( SkillName.MagicResist, 50.3, 64.6 );
			SetSkill( SkillName.Tactics, 82.0, 94.3 );
			SetSkill( SkillName.Wrestling, 70.7, 93.2 );
			SetSkill( SkillName.Healing, 70.9, 93.3 );
			SetSkill( SkillName.Anatomy, 74.8, 94.3 );

			Fame = 7000;
			Karma = -7000;

			VirtualArmor = 50;

			PackItem(new Bandage(Utility.RandomMinMax(7, 13)));
		}
		
		public override int GetAngerSound()
		{
			return 1440;
		}

		public override int GetIdleSound()
		{
			return 1439;
		}

		public override int GetAttackSound()
		{
			return 1438;
		}

		public override int GetHurtSound()
		{
			return 1441;
		}

		public override int GetDeathSound()
		{
			return 1437;
		}

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

		public override Poison PoisonImmune{ get{ return Poison.Regular; } }
		public override int TreasureMapLevel{ get{ return 2; } }
		public override int Meat{ get{ return 5; } }
		public override int Hides{ get{ return 5; } }
		public override HideType HideType{ get{ return HideType.Spined; } }	
		public override bool IsMLCreature { get { return true;} } 

		public Troglodyte( Serial serial ) : base( serial )
		{
		}
		
		public override void OnGotMeleeAttack( Mobile attacker )
		{
			base.OnGaveMeleeAttack( attacker );
			
			if (!attacker.InRange( this, 2 ))
			{ 
				foreach ( Mobile m in this.GetMobilesInRange( 30 ) )
				{
					if (m is Troglodyte)
					{
						m.Combatant = attacker;
					}
				}
			} 
		}

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