/**********************************************************
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\Melisande\Rare Drop\MelsHairDye.cs
Lines of code: 71
***********************************************************/


using System;
using System.Text;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;

namespace Server.Items
{
	public class MelsHairDye : Item
	{
		public override string DefaultName
		{
			get { return "Melisande's Hair Dye"; }
		}

		[Constructable]
		public MelsHairDye() : base( 3623 )
		{
			Weight = 1.0;
			switch ( Utility.Random( 20 ) )
			{
				default:
				case 0: Hue = 1177;break;
				case 1: Hue = 2210;break;
				case 2: Hue = 1173;break;
				case 3: Hue = 1168;break;
				case 4: Hue = 1151;break;
				case 5: Hue = 1160;break;
				case 6: Hue = 1165;break;
				case 7: Hue = 16;break;
				case 8: Hue = 1169;break;
				case 9: Hue = 1150;break;
				case 10: Hue = 1175;break;
				case 11: Hue = 1;break;
				case 12: Hue = 1155;break;
				case 13: Hue = 1153;break;
				case 14: Hue = 1164;break;
				case 15: Hue = 1152;break;
				case 16: Hue = 1157;break;
				case 17: Hue = 1166;break;
				case 18: Hue = 33;break;
				case 19: Hue = 1154;break;
			}
		}

		public MelsHairDye( 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( 1060640 );
			}
			else
			{
				//Mobile m = from.Mobile;
				from.HairHue = Hue;
							
				from.SendLocalizedMessage( 501199 );  // You dye your hair
				from.PlaySound( 0x4E );
				this.Delete();
			}
					
		}
	}
}