/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Death on Apr-18-2011 09:34:34pm
Filepath: scripts\_custom\events and scenarios\Easter 2011\ChocolateBunny.cs
Lines of code: 63
***********************************************************/


using System;
using Server;
using Server.Multis;
using Server.Items;
using Server.Mobiles;
using System.Collections;
using Server.Network;
using Server.Spells;

namespace Server.Items
{
	public class ChocolateBunny : Item
	{
	
		public bool UseDelay = false;  
		 
		[Constructable]
		public ChocolateBunny() : base( 8485 )
		{		
			Name = "an everlasting chocolate bunny"; 
			LootType=LootType.Blessed;
			Hue = Utility.RandomList(1150, 1190, 1192);
			Weight = 1.0;
		}
		
		public bool IsOwner( Mobile mob )
		{
			BaseHouse house = BaseHouse.FindHouseAt( this );

			return ( house != null && house.IsOwner( mob ) );
		}

		public override void OnDoubleClick( Mobile from )
		{
			if (UseDelay)
			{
				from.SendMessage( "You decide to wait before eating another piece of chocolate" );
			}
			else if (!UseDelay && from.Alive && from != null)
			{
				UseDelay=true;
			
				from.LocalOverheadMessage( MessageType.Regular, 0x3F, true, "*You bite off a chunk of chocolate from the bunny*" );
			
				Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerCallback( ResetDelay ) );
			}
		}
		
		public void ResetDelay( )
		{
			UseDelay = false; 
		}
		
		public override void GetProperties( ObjectPropertyList list)
		{
			base.GetProperties( list );
			list.Add( 1060658,"Easter \t" + "2011");
		}

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