/**********************************************************
RunUO AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Death on Apr-06-2012 04:35:42pm
Filepath: scripts\events and scenarios\Easter 2012\SpringtimeSquirrelNPC.cs
Lines of code: 95

Description: 

***********************************************************/


using System;
using Server;
using Server.ContextMenus;
using Server.Accounting;
using Server.Gumps;
using Server.Items;
using Server.Menus;
using Server.Menus.Questions;
using Server.Mobiles;
using Server.Network;
using Server.Prompts;
using Server.Regions;
using Server.Misc;
using System.Collections;
using System.Collections.Generic;

namespace Server.Mobiles
{
	[CorpseName( "The corpse of the poor Easter Bunny" )]
	public class SpringtimeSquirrelNPC : BaseCreature
	{
		public override bool ClickTitle{ get { return false; } }
		
		public virtual int AutoTalkRange{ get{ return -1; } }
		public virtual int AutoSpeakRange{ get{ return 3; } }		
		public virtual TimeSpan SpeakDelay{ get{ return TimeSpan.FromSeconds( 10 ); } }
		
		private DateTime m_Spoken;	
                
		[Constructable]
		public SpringtimeSquirrelNPC() : base( AIType.AI_Animal, FightMode.None, 10, 1, 0.2, 0.4 )
		{
			InitBody();
			Blessed = true;
			Name = "Springtime Squirrel";
			Hue = 75;	
			Body = 278;
			BaseSoundID = 0x188;
			
			Fame = 110000;
			Karma = 110000;				
		}
		
		public SpringtimeSquirrelNPC( Serial serial ) : base( serial )
		{
		}
		
		public virtual void InitBody()
		{
			InitStats( 125, 125, 125 );

			SpeechHue = 1153;

			Body=205;
		}
		
		public virtual void SmallTalk()
		{
			switch (Utility.RandomMinMax( 0, 5 ))
			{
				case 0: 
				Say("On my way to becoming the next Easter bunny! Help me collect eggs"); break;
				case 1: 
				Say("If you find any eggs, double click the squirrel statue to make your donation"); break;
				case 2: 
				Say("I've got plenty of unique prizes to give to those who help me collect Easter eggs!"); break;
				case 3: 
				Say("There are four different rarities of Easter eggs. I'll give you more points for exotic varieties!"); break;
				case 4: 
				Say("So many eggs, so little time! Gather them quickly, Easter won't be around for long!"); break;
				case 5: 
				Say("You can find eggs all over the place in trammel. They will be on the ground so look carefully!"); break;
			}
		}
		
		public override void OnMovement( Mobile m, Point3D oldLocation )
		{
			if ( m.Alive && !m.Hidden && m is PlayerMobile )
			{
				PlayerMobile pm = (PlayerMobile)m;

				int range = AutoTalkRange;
					
				range = AutoSpeakRange;
				
				if ( range >= 0 && InRange( m, range ) && !InRange( oldLocation, range ) && DateTime.Now >= m_Spoken + SpeakDelay )
				{
					if ( Utility.Random( 100 ) < 50 ) {
						if ( m.Alive && m is PlayerMobile ) {
							PlayerMobile mobile = (PlayerMobile)m;
							SmallTalk();
						}	
					}
					m_Spoken = DateTime.Now;
				}
			}
		}

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

