/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\Engines\CannedEvil\ChampionSkull.cs
Lines of code: 60
***********************************************************/


using System;
using Server;
using Server.Engines.CannedEvil;

namespace Server.Items
{
	public class ChampionSkull : Item
	{
		private ChampionSkullType m_Type;

		[CommandProperty( AccessLevel.GameMaster )]
		public ChampionSkullType Type{ get{ return m_Type; } set{ m_Type = value; InvalidateProperties(); } }

		public override int LabelNumber{ get{ return 1049479 + (int)m_Type; } }

		[Constructable]
		public ChampionSkull( ChampionSkullType type ) : base( 0x1AE1 )
		{
			m_Type = type;
			LootType = LootType.Cursed;

			// TODO: All hue values
			switch ( type )
			{
				case ChampionSkullType.Power: Hue = 0x159; break;
				case ChampionSkullType.Venom: Hue = 0x172; break;
				case ChampionSkullType.Greed: Hue = 0x1EE; break;
				case ChampionSkullType.Death: Hue = 0x025; break;
				case ChampionSkullType.Pain:  Hue = 0x035; break;
				case ChampionSkullType.Grease:  Hue = 1745; Name="Skull of Grease"; break;
				case ChampionSkullType.Elements:  Hue = 24; Name="Skull of Elements"; break;
				case ChampionSkullType.Orc:  Hue = 998; Name="Skull of Orc"; break;
			}
		}

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

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

			writer.Write( (int) 1 ); // version

			writer.Write( (int) m_Type );
		}

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

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				case 0:
				{
					m_Type = (ChampionSkullType)reader.ReadInt();

					break;
				}
			}
			
			if( version == 0 )
			{
				if ( LootType != LootType.Cursed )
					LootType = LootType.Cursed;
	
				if ( Insured )
					Insured = false;
			}
		}
	}
}