/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\quests\kill quests\Tokuno Quest\Part 3 Bad Beetles\BadBeetlesKillQuest.cs
Lines of code: 66
***********************************************************/


using System;
using Server;
using Server.Mobiles;
using Server.Items;

namespace Server.Engines.Quests.BadBeetlesKillQuest
{

	public class BadBeetlesKillQuest : QuestSystem
	{
		private static Type[] m_TypeReferenceTable = new Type[]
			{
				typeof( DontOfferConversation ),
				typeof( AcceptConversation ),
				typeof( EndConversation )				
			};

		public override Type[] TypeReferenceTable{ get{ return m_TypeReferenceTable; } }
		

		private static RequiredItem[] m_RequiredItems = new RequiredItem[]
		{
			new RequiredItem(typeof(JurosWhip),1)
		};
		
		public override RequiredItem[] RequiredItems { get{return m_RequiredItems;}	}			
		

		public override object Name
		{
			get
			{
				return "Bad Beetles";
			}
		}

		public override object OfferMessage
		{
				get
				{
					return "Ah, you have my brother's whip? You must know of him then, he wouldn't entrust his whip to any stranger. Perhaps he sent you to help me out? Well, I do in fact have a task for you. I keep rune beetles as pets and sell them off to tamers. Unfortunately, a group of evil mages came in and stormed my ranch! They cursed my beetles and they broke out of their pens. I tried, but I can't control them anymore. Please, kill them off before they wander off and start hurting people. Help me kill off those evil mages too, it's their fault I'm in this mess! Will you offer your assistance in helping me out of this fiasco?";
				}
		}

		public override TimeSpan RestartDelay{ get{ return TimeSpan.Zero; } }
		public override bool IsTutorial{ get{ return false; } }

		public override int Picture{ get{ return 0x15CA; } }

		public BadBeetlesKillQuest( PlayerMobile from,Mobile questgiver) : base( from )
		{
		}
		
		// Serialization
		public BadBeetlesKillQuest()
		{
		}

		public override void ChildDeserialize( GenericReader reader )
		{
			int version = reader.ReadEncodedInt();
		}

		public override void ChildSerialize( GenericWriter writer )
		{
			writer.WriteEncodedInt( (int) 0 ); // version
		}

		public override void Accept()
		{
			base.Accept();
			
			//from.SendMessage("Can access.");

			AddConversation( new AcceptConversation() );
		}

		public static void GiveRewardTo( PlayerMobile from)
		{
			BadBeetlesKillQuest qs = from.Quest as BadBeetlesKillQuest;
			
			Item reward = new LargeBagOfTreasure();

			from.SendMessage("Come back any time to visit my ranch!");
			from.PlaceInBackpack( reward );
			
			qs.Complete();			
		}
	}	
}