/**********************************************************
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\Painted Caves\Grobu's Quest\Questgiver\TallinintheClothWeaver.cs
Lines of code: 79
***********************************************************/


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.Engines.Quests.Grobu
{

	public class TallinintheClothWeaver : BaseQuester
	{       
		[Constructable]
		public TallinintheClothWeaver()
		{
			Name = "Tallinin";
		    Title = "the Cloth Weaver";
            Body = 605;
            Hue = 33358;
            
            VirtualArmor = 50;
			CantWalk = true;

            Item hair = new Item( 12224);
            hair.Hue = 445;
		    hair.Layer = Layer.Hair;
            hair.Movable = false;
            AddItem( hair );

            AddItem(new Server.Items.MaleElvenRobe(0));
            AddItem(new Server.Items.ElvenBoots(0));

            GoldRing goldring = new GoldRing();
            goldring.Hue = 0;
            goldring.Movable = false;
            AddItem(goldring);	
		}
		
		
		public override void OnTalk( PlayerMobile from, bool contextMenu )
		{
			this.Direction = GetDirectionTo( from );

			GrobuQuest qs = from.Quest as GrobuQuest;

			if ( qs != null)
			{
			//check pack for items
			
			int amt=0;
		
			amt += from.Backpack.GetAmount(typeof(GrobusFur));
			
			if(amt<1)qs.AddConversation( new NotDoneConversation() );
			else qs.AddConversation(new EndConversation());
			
			}
			else
			{
				QuestSystem newQuest = new GrobuQuest( from);

				if ( from.Quest == null && QuestSystem.CanOfferQuest( from, typeof( GrobuQuest ) ) )
				{
					newQuest.SendOffer();
				}
				else
				{
					newQuest.AddConversation( new DontOfferConversation() );
				}
			}
		}		
		
		public TallinintheClothWeaver( Serial serial ) : base( serial )
		{
		}

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