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

namespace Server.Mobiles
{
	[CorpseName( "a dwarven corpse" )]
	public class Dwarf : BaseCreature
	{
		[Constructable]
		public Dwarf() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = NameList.RandomName( "dwarf" );
			HiddenTitle = "the dwarf";
			Body = 288;
			BaseSoundID = 0x5FB;
			Clan = Clan.Humanoid;

			SetStr( 96, 120 );
			SetDex( 81, 105 );
			SetInt( 36, 60 );

			SetHits( 58, 72 );

			SetDamage( 5, 7 );

			SetSkill( SkillName.MagicResist, 50.1, 75.0 );
			SetSkill( SkillName.Tactics, 55.1, 80.0 );
			SetSkill( SkillName.HandToHand, 50.1, 70.0 );

			Fame = 1500;
			Karma = -1500;

			VirtualArmor = 28;

			switch ( Utility.Random( 6 ) )
			{
				case 0: PackItem( new StuddedGorget() );  break;
				case 1: PackItem( new StuddedChest() ); break;
				case 2: PackItem( new StuddedLegs() ); break;
				case 3: PackItem( new StuddedArms() ); break;
				case 4: PackItem( new StuddedGloves() ); break;
				case 5: PackItem( new Helmet() ); break;
			}

			PackItem( new Axe() );
		}

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

		public override bool CanRummageCorpses{ get{ return true; } }
		public override int Meat{ get{ return 1; } }

		public override int GetIdleSound()
		{
			return Utility.RandomList( 0x41D, 0x41F, 0x420, 0x42E, 0x442, 0x444, 0x448 );
		}

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