using System;
using Server;
using Server.Multis;
using Server.Mobiles;
using Server.Targeting;
using Server.Misc;

namespace Server.Items
{
	[FlipableAttribute( 0x20D4, 0x20D5 )]
	public class TrophyBoard : Item
	{
		[Constructable]
		public TrophyBoard() : base( 0x1EBA )
		{
			Name = "trophy board";
			Weight = 1.0;
		}

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

		public override void OnDoubleClick(Mobile from)
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			else
			{
				from.SendLocalizedMessage( 1042595 ); // Target the corpse to make a trophy out of.
				from.Target = new CorpseTarget( this );
			}
		}

		private class CorpseTarget : Target
		{
			private TrophyBoard m_Trophy;

			public CorpseTarget( TrophyBoard boards ) : base( 3, false, TargetFlags.None )
			{
				m_Trophy = boards;
			}

			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_Trophy.Deleted )
					return;

				if ( targeted is Fish || targeted is BigFish )
				{
					Item fish = (Item)targeted;
					Item trophy = new TrophyFish();
					from.AddToBackpack( trophy );
					fish.Delete();
					m_Trophy.Delete();
				}
				else if ( !(targeted is Corpse) )
				{
					from.SendMessage("That cannot be mounted as a trophy!");
                    return;
				}
				else
				{
					object obj = targeted;
					Item i = null;

					if ( obj is Corpse )
						obj = ((Corpse)obj).Owner;

                    if ( obj != null )
                    {
						Corpse c = (Corpse)targeted;

						if ( c.VisitedByTaxidermist == true )
						{
							from.SendMessage("This has already been claimed as a trophy!");
							return;
						}
						else
						{
							if ( typeof( BlackBear ) == c.Owner.GetType() ){			i = new TrophyBear(); }
							else if ( typeof( BrownBear ) == c.Owner.GetType() ){		i = new TrophyBear(); }	
							else if ( typeof( GrizzlyBear ) == c.Owner.GetType() ){		i = new TrophyCaveBear(); }		
							else if ( typeof( CaveBear ) == c.Owner.GetType() ){		i = new TrophyCaveBear(); }
							else if ( typeof( KodiakBear ) == c.Owner.GetType() ){		i = new TrophyKodiak(); }
							else if ( typeof( SnowBear ) == c.Owner.GetType() ){		i = new TrophySnowBear(); }
							else if ( typeof( PolarBear ) == c.Owner.GetType() ){		i = new TrophyPolarBear(); }
							else if ( typeof( FrostTroll ) == c.Owner.GetType() ){		i = new TrophyTroll(); }
							else if ( typeof( Troll ) == c.Owner.GetType() ){			i = new TrophyTroll(); }
							else if ( typeof( Orc ) == c.Owner.GetType() ){				i = new TrophyOrc(); }
							else if ( typeof( OrcCaptain ) == c.Owner.GetType() ){		i = new TrophyOrc(); }
							else if ( typeof( OrcishLord ) == c.Owner.GetType() ){		i = new TrophyOrc(); }
							else if ( typeof( OrcishMage ) == c.Owner.GetType() ){		i = new TrophyOrc(); }
							else if ( typeof( OgreMagi ) == c.Owner.GetType() ){		i = new TrophyOgre(); }
							else if ( typeof( Ogre ) == c.Owner.GetType() ){			i = new TrophyOgre(); }
							else if ( typeof( ArcticOgreLord ) == c.Owner.GetType() ){	i = new TrophyOgreLord(); }
							else if ( typeof( OgreLord ) == c.Owner.GetType() ){		i = new TrophyOgreLord(); }
							else if ( typeof( GreatDeer ) == c.Owner.GetType() ){		i = new TrophyDeer(); }
							else if ( typeof( Deer ) == c.Owner.GetType() ){			i = new TrophyDeer(); }
							else if ( typeof( Gorilla ) == c.Owner.GetType() ){			i = new TrophyApe(); }
							else if ( typeof( Ape ) == c.Owner.GetType() ){				i = new TrophyApe(); }
							else if ( typeof( Nightmare ) == c.Owner.GetType() ){		i = new TrophyNightmare(); }
							else if ( typeof( Goblin ) == c.Owner.GetType() ){			i = new TrophyGoblin(); }
							else if ( typeof( GoblinArcher ) == c.Owner.GetType() ){	i = new TrophyGoblin(); }
							else if ( typeof( GoblinWarrior ) == c.Owner.GetType() ){	i = new TrophyGoblin(); }
							else if ( typeof( Minotaur ) == c.Owner.GetType() ){		i = new TrophyMinotaur(); }
							else if ( typeof( MinotaurLord ) == c.Owner.GetType() ){	i = new TrophyMinotaur(); }
							else if ( typeof( MinotaurChief ) == c.Owner.GetType() ){	i = new TrophyMinotaurLord(); }
							else if ( typeof( Ettin ) == c.Owner.GetType() ){			i = new TrophyEttin(); }
							else if ( typeof( SnowEttin ) == c.Owner.GetType() ){		i = new TrophyEttin(); }
							else if ( typeof( Cyclops ) == c.Owner.GetType() ){			i = new TrophyCyclops(); }
							else if ( typeof( CyclopsChief ) == c.Owner.GetType() ){	i = new TrophyCyclops(); }
							else if ( typeof( CyclopsLord ) == c.Owner.GetType() ){		i = new TrophyCyclops(); }
							else if ( typeof( FireGargoyle ) == c.Owner.GetType() ){	i = new TrophyGargoyle(); }
							else if ( typeof( Gargoyle ) == c.Owner.GetType() ){		i = new TrophyGargoyle(); }
							else if ( typeof( GargoyleMage ) == c.Owner.GetType() ){	i = new TrophyGargoyle(); }
							else if ( typeof( StoneGargoyle ) == c.Owner.GetType() ){	i = new TrophyGargoyle(); }
							else if ( typeof( GargoyleKnight ) == c.Owner.GetType() ){	i = new TrophyGargoyle(); }
							else if ( typeof( Ratman ) == c.Owner.GetType() ){			i = new TrophyRatman(); }
							else if ( typeof( RatmanArcher ) == c.Owner.GetType() ){	i = new TrophyRatman(); }
							else if ( typeof( RatmanMage ) == c.Owner.GetType() ){		i = new TrophyRatman(); }
							else if ( typeof( Lizardman ) == c.Owner.GetType() ){		i = new TrophyLizardman(); }
							else if ( typeof( SakkhraShaman ) == c.Owner.GetType() ){	i = new TrophyLizard(); }
							else if ( typeof( Sakkhra ) == c.Owner.GetType() ){			i = new TrophyLizard(); }
							else if ( typeof( Drasolisk ) == c.Owner.GetType() ){		i = new TrophyLizard(); }
							else if ( typeof( Silisk ) == c.Owner.GetType() ){			i = new TrophyLizard(); }
							else if ( typeof( GargoyleIce ) == c.Owner.GetType() ){		i = new TrophyDaemon(); i.Name = "mounted gargoyle"; i.Hue = 0x4A3; }
							else if ( typeof( GargoyleStone ) == c.Owner.GetType() ){	i = new TrophyDaemon(); i.Name = "mounted gargoyle"; i.Hue = 0x49D; }
							else if ( typeof( GargoyleWizard ) == c.Owner.GetType() ){	i = new TrophyDaemon(); i.Name = "mounted gargoyle"; i.Hue = 0x4A5; }
							else if ( typeof( GargoyleCrimson ) == c.Owner.GetType() ){	i = new TrophyDaemon(); i.Name = "mounted gargoyle"; i.Hue = 0x2B; }
							else if ( typeof( Balron ) == c.Owner.GetType() ){			i = new TrophyDaemon(); i.Hue = 0x668; }
							else if ( typeof( SeaDevil ) == c.Owner.GetType() ){		i = new TrophyDaemon(); i.Hue = 0x42F; }
							else if ( typeof( Daemon ) == c.Owner.GetType() ){			i = new TrophyDaemon(); i.Hue = 0x668; }
							else if ( typeof( IceFiend ) == c.Owner.GetType() ){		i = new TrophyDaemon(); i.Hue = 0x43C; }
							else if ( typeof( IceDevil ) == c.Owner.GetType() ){		i = new TrophyDaemon(); i.Hue = 0x43C; }
							else if ( typeof( AncientWyrm ) == c.Owner.GetType() ){		i = new TrophyDragon(); i.Hue = 0x429; }
							else if ( typeof( Dragon ) == c.Owner.GetType() ){			i = new TrophyDragon(); i.Hue = 0x429; }
							else if ( typeof( SwampDragon ) == c.Owner.GetType() ){		i = new TrophyDragon(); i.Hue = 0x84F; }
							else if ( typeof( ShadowWyrm ) == c.Owner.GetType() ){		i = new TrophyDragon(); i.Hue = 0x4D8; }
							else if ( typeof( SeaDragon ) == c.Owner.GetType() ){		i = new TrophyDragon(); i.Hue = 0x847; }
							else if ( typeof( WhiteWyrm ) == c.Owner.GetType() ){		i = new TrophyDragon(); i.Hue = 0x982; }

							if ( i != null )
							{
								from.AddToBackpack( i );
								c.VisitedByTaxidermist = true;
								m_Trophy.Delete();
							}
							else 
							{
								from.SendMessage("That cannot be mounted as a trophy!");
								return;
							}
						}
					}
					else
					{
						from.SendMessage("That cannot be mounted as a trophy!");
						return;
					}
				}

				if ( m_Trophy.Deleted )
					from.SendMessage("You mount that as a trophy.");
			}
		}
	}
}

namespace Server.Items
{
	[FlipableAttribute( 0x1E62, 0x1E69 )]
	public class TrophyFish : Item
	{
		[Constructable]
		public TrophyFish() : base( 0x1E62 )
		{
			Name = "mounted fish";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x1E60, 0x1E67 )]
	public class TrophyBear : Item
	{
		[Constructable]
		public TrophyBear() : base( 0x1E60 )
		{
			Name = "mounted bear";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x1E61, 0x1E68 )]
	public class TrophyDeer : Item
	{
		[Constructable]
		public TrophyDeer() : base( 0x1E61 )
		{
			Name = "mounted deer";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x1E63, 0x1E6A )]
	public class TrophyApe : Item
	{
		[Constructable]
		public TrophyApe() : base( 0x1E63 )
		{
			Name = "mounted ape";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x1E64, 0x1E6B )]
	public class TrophyOrc : Item
	{
		[Constructable]
		public TrophyOrc() : base( 0x1E64 )
		{
			Name = "mounted orc";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x1E65, 0x1E6C )]
	public class TrophyPolarBear : Item
	{
		[Constructable]
		public TrophyPolarBear() : base( 0x1E65 )
		{
			Name = "mounted bear";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x1E66, 0x1E6D )]
	public class TrophyTroll : Item
	{
		[Constructable]
		public TrophyTroll() : base( 0x1E66 )
		{
			Name = "mounted troll";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20D6, 0x20D7 )]
	public class TrophySnowBear : Item
	{
		[Constructable]
		public TrophySnowBear() : base( 0x20D6 )
		{
			Name = "mounted bear";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20D8, 0x20D9 )]
	public class TrophyCaveBear : Item
	{
		[Constructable]
		public TrophyCaveBear() : base( 0x20D8 )
		{
			Name = "mounted bear";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20DA, 0x20DB )]
	public class TrophyKodiak : Item
	{
		[Constructable]
		public TrophyKodiak() : base( 0x20DA )
		{
			Name = "mounted bear";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20DC, 0x20DD )]
	public class TrophyLizard : Item
	{
		[Constructable]
		public TrophyLizard() : base( 0x20DC )
		{
			Name = "mounted lizardman";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20DE, 0x20DF )]
	public class TrophyLizardman : Item
	{
		[Constructable]
		public TrophyLizardman() : base( 0x20DE )
		{
			Name = "mounted lizardman";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20E0, 0x20E1 )]
	public class TrophyNightmare : Item
	{
		[Constructable]
		public TrophyNightmare() : base( 0x20E0 )
		{
			Name = "mounted nightmare";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20E2, 0x20E3 )]
	public class TrophyOgre : Item
	{
		[Constructable]
		public TrophyOgre() : base( 0x20E2 )
		{
			Name = "mounted ogre";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20E4, 0x20E5 )]
	public class TrophyRatman : Item
	{
		[Constructable]
		public TrophyRatman() : base( 0x20E4 )
		{
			Name = "mounted ratman";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20E6, 0x20E7 )]
	public class TrophyEttin : Item
	{
		[Constructable]
		public TrophyEttin() : base( 0x20E6 )
		{
			Name = "mounted ettin";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20E8, 0x20E9 )]
	public class TrophyOgreLord : Item
	{
		[Constructable]
		public TrophyOgreLord() : base( 0x20E8 )
		{
			Name = "mounted ogre";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20EA, 0x20EB )]
	public class TrophyCyclops : Item
	{
		[Constructable]
		public TrophyCyclops() : base( 0x20EA )
		{
			Name = "mounted cyclops";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20EC, 0x20ED )]
	public class TrophyGargoyle : Item
	{
		[Constructable]
		public TrophyGargoyle() : base( 0x20EC )
		{
			Name = "mounted gargoyle";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20EE, 0x20EF )]
	public class TrophyMinotaur : Item
	{
		[Constructable]
		public TrophyMinotaur() : base( 0x20EE )
		{
			Name = "mounted minotaur";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20F0, 0x20F1 )]
	public class TrophyGoblin : Item
	{
		[Constructable]
		public TrophyGoblin() : base( 0x20F0 )
		{
			Name = "mounted goblin";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20F2, 0x20F3 )]
	public class TrophyMinotaurLord : Item
	{
		[Constructable]
		public TrophyMinotaurLord() : base( 0x20F2 )
		{
			Name = "mounted minotaur";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20F4, 0x20F5 )]
	public class TrophyDragon : Item
	{
		[Constructable]
		public TrophyDragon() : base( 0x20F4 )
		{
			Name = "mounted dragon";
			Weight = 1.0;
		}

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

	[FlipableAttribute( 0x20F6, 0x20F7 )]
	public class TrophyDaemon : Item
	{
		[Constructable]
		public TrophyDaemon() : base( 0x20F6 )
		{
			Name = "mounted daemon";
			Weight = 1.0;
		}

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