/**********************************************************
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\Chief Paroxymous\Quest Keys\chiefparoxysmuscauldron.cs
Lines of code: 51
***********************************************************/


using System;
using Server;
using Server.Items;

namespace Server.Items
{

	public class chiefparoxysmuscauldron : Item
	{
	
		[Constructable]
		public chiefparoxysmuscauldron() : base(2421)
		{
		Hue = 332;
		Movable=false;
		}
		
		public override void OnDoubleClick( Mobile from )
		{
		if(!from.InRange(this,1))return;
		
		int amt=0;
		
		amt = from.Backpack.GetAmount(typeof(GelatanousSkull));
		if(amt<1){MissingItemMsg(from,"Gelatanous Skull");	return;	}

		amt = from.Backpack.GetAmount(typeof(PartiallyDigestedTorso));
		if(amt<1){MissingItemMsg(from,"Partially Digested Torso");	return;	}

		amt = from.Backpack.GetAmount(typeof(CoagulatedLegs));
		if(amt<1){MissingItemMsg(from,"Coagulated Legs");	return;	}

		amt = from.Backpack.GetAmount(typeof(PutrefierSpleen));
		if(amt<1){MissingItemMsg(from,"Putrefier Spleen");	return;	}		
		

		//if we made it here, we have all the components, so we can consume them		
		
		from.Backpack.ConsumeTotal(typeof(GelatanousSkull),1 );
		from.Backpack.ConsumeTotal(typeof(PartiallyDigestedTorso),1 );
		from.Backpack.ConsumeTotal(typeof(CoagulatedLegs),1 );
		from.Backpack.ConsumeTotal(typeof(PutrefierSpleen),1 );
		
		
		//and finally, give key bag
		
		from.AddToBackpack(new peerlesskeybag(new ChiefParoxysmusKey(this.Map==Map.Felucca ? Map.Felucca : Map.Trammel), 3,0,1));
		from.SendMessage("You are given a bag of keys which will summon the beast");
		}		
		
		void MissingItemMsg(Mobile from,string type)
		{
		from.SendMessage("You are missing a {0} to get the key",type);
		}
		
		
		public chiefparoxysmuscauldron( 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();
		}
	}
	
	

}