using System;
using System.Collections;
using Server.Items;
using Server.ContextMenus;
using Server.Misc;
using Server.Network;

namespace Server.Mobiles
{
	public class Pirate : BaseCreature
	{
		[Constructable]
		public Pirate() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			SpeechHue = Utility.RandomSpeechHue();
			Hue = Utility.RandomSkinHue();
			Clan = Clan.Humanoid;

			Title = "the pirate";
			switch ( Utility.Random( 4 ))
			{
				case 0: Title = "the pirate"; break;
				case 1: Title = "the sailor"; break;
				case 2: Title = "the privateer"; break;
				case 3: Title = "the freebooter"; break;
			}

			int hair = Utility.RandomHairHue();

			if ( this.Female = Utility.RandomBool() )
			{
				Body = 0x191;
				Name = NameList.RandomName( "female" );
			}
			else
			{
				Body = 0x190;
				Name = NameList.RandomName( "male" );
				if ( Utility.RandomBool() ){ Utility.AssignRandomFacialHair( this, hair ); }
			}

			Utility.AssignRandomHair( this, hair );

			SetStr( 96, 110 );
			SetDex( 91, 105 );
			SetInt( 71, 85 );

			SetDamage( 10, 23 );

			SetSkill( SkillName.Fencing, 76.0, 97.5 );
			SetSkill( SkillName.Bludgeoning, 75.0, 87.5 );
			SetSkill( SkillName.MagicResist, 35.0, 47.5 );
			SetSkill( SkillName.Swords, 75.0, 87.5 );
			SetSkill( SkillName.Tactics, 75.0, 87.5 );
			SetSkill( SkillName.HandToHand, 25.0, 37.5 );

			Fame = 1500;
			Karma = -1500;

			switch ( Utility.Random( 7 ))
			{
				case 0: AddItem( new Longsword() ); break;
				case 1: AddItem( new Cutlass() ); break;
				case 2: AddItem( new Scimitar() ); break;
				case 3: AddItem( new Kryss() ); break;
				case 4: AddItem( new Dagger() ); break;
				case 5: AddItem( new Spear() ); break;
				case 6: AddItem( new Rapier() ); break;
			}

			switch ( Utility.Random( 5 ) )
			{
				case 0: AddItem( new FancyShirt( Utility.RandomHue() ) ); break;
				case 1: AddItem( new Doublet( Utility.RandomHue() ) ); break;
				case 2: AddItem( new Shirt( Utility.RandomHue() ) ); break;
				case 3: AddItem( new Tunic( Utility.RandomHue() ) ); break;
				case 4: AddItem( new Surcoat( Utility.RandomHue() ) ); break;
			}

			if ( Female )
			{
				switch ( Utility.Random( 4 ) )
				{
					case 0: AddItem( new Skirt( Utility.RandomHue() ) ); break;
					case 1: AddItem( new Kilt( Utility.RandomHue() ) ); break;
					case 2: AddItem( new LongPants( Utility.RandomHue() ) ); break;
					case 3: AddItem( new ShortPants( Utility.RandomHue() ) ); break;
				}
			}
			else
			{
				switch ( Utility.Random( 3 ) )
				{
					case 0: AddItem( new LongPants( Utility.RandomHue() ) ); break;
					case 1: AddItem( new ShortPants( Utility.RandomHue() ) ); break;
					case 2: AddItem( new Kilt( Utility.RandomHue() ) ); break;
				}
			}

			switch ( Utility.Random( 4 ) )
			{
				case 0: AddItem( new Shoes( Utility.RandomNeutralHue() ) ); break;
				case 1: AddItem( new Boots( Utility.RandomNeutralHue() ) );	break;
				case 2: AddItem( new Sandals( Utility.RandomNeutralHue() ) );	break;
				case 3: AddItem( new ThighBoots( Utility.RandomNeutralHue() ) );	break;
			}

			switch ( Utility.Random( 4 ) )
			{
				case 0: AddItem( new SkullCap( Utility.RandomHue() ) ); break;
				case 1: AddItem( new SkullCap( Utility.RandomHue() ) ); break;
				case 2: AddItem( new SkullCap( Utility.RandomHue() ) ); break;
				case 3: AddItem( new Bandana( Utility.RandomHue() ) ); break;
			}
		}

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

		public override bool ClickTitle{ get{ return false; } }
		public override bool ShowFameTitle{ get{ return false; } }

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

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}
}