/**********************************************************
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\Interred Grizzle\Quest Items\grizzletable.cs
Lines of code: 38
***********************************************************/


using System;
using Server;
using Server.Items;

namespace Server.Items
{

	public class grizzletable : Item
	{
	
		[Constructable]
		public grizzletable() : base(2869)
		{
			Movable=false;
			Name="Double click to put library key";
		}
		
		public override void OnDoubleClick( Mobile from )
		{
			if(!from.InRange(this,1))return;
			
			int amt=0;
			
			amt = from.Backpack.GetAmount(typeof(LibraryKey));
			if(amt<1){from.SendMessage("You do not have the library key!");	return;	}

			
			

			//if we made it here, we have all the components, so we can consume them		
			
			from.Backpack.ConsumeTotal(typeof(LibraryKey),1 );
			
			
			//and finally, give key bag
			from.AddToBackpack(new peerlesskeybag(new MonstrousInterredGrizzleKey(), 3,0,1));
			from.SendMessage("You are given a bag of keys which will summon the beast");
		}		
		
		
		
		public grizzletable( 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();
		}
	}
	
	

}