/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Death on Oct-30-2011 08:24:12pm
Filepath: scripts\_custom\events and scenarios\Halloween2011\Candy\BaseCandy.cs
Lines of code: 52
***********************************************************/


using System;
using Server;
using Server.Network;
using Server.Targeting;
using Server.Items;
using Server.Mobiles;
using Server.Targets;

namespace Server.Items
{
	public class BaseCandy : Item
	{
		private int CandyItemID;
		private int CandyHue;
		private string CandyName;
	
		[Constructable]
		public BaseCandy(string CandyName, int CandyItemID, int CandyHue ) : base()
		{
			Name = CandyName;
			ItemID = CandyItemID;
			Hue = CandyHue;
		}
	
		public BaseCandy( Serial serial ) : base( serial )
		{
		}

		public override void OnDoubleClick( Mobile from )
		{
			if (from.Alive && from != null)
			{
				if ( from.InRange( this.GetWorldLocation(), 2 ) )
				{
					from.SendLocalizedMessage(1077387);
					from.PlaySound(Utility.RandomList(0x03A, 0x03B, 0x03C));
					this.Consume();
				}
				else
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
				}
			}
		}

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