/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Death on Oct-30-2011 08:24:13pm
Filepath: scripts\_custom\events and scenarios\Halloween2011\Quests\Quest Rewards\Hint Scrolls\BaseHintScroll.cs
Lines of code: 114
***********************************************************/


using System;
using Server;
using Server.Items;
using Server.Gumps;
using Server.Network;
using Server.Menus;
using System.Collections;
using System.Collections.Generic;
using System.IO;

namespace Server.Items
{
	public class BaseHintScroll : Item
	{		
		public override string DefaultName { get { return String.Format("{0}",hintname); } }
		
	
		bool opened=false;		
		
		public Item Prototype=null;

		public virtual string hintname { get { return "default"; } }
		public virtual int hintid { get { return 0; } }
		public virtual int hinthue { get { return 0; } }
		public virtual string hintdesc { get { return "default"; } }
		public virtual string hintbonus { get { return "default"; } }
		
		public BaseHintScroll() : base( 10289 )
		{
			Weight = 1.0;		
			Hue = 1169;
		}	

		public override void OnDoubleClick( Mobile from )
		{
			if (!IsChildOf( from.Backpack ) )return;
					
			if(opened)from.CloseGump(typeof(HintScrollGump));
			from.SendGump(new HintScrollGump(from,this));
			opened=true;
		}
		
		public void OnCancel(Mobile from)
		{
		opened=false;
		from.SendMessage("You decide not to craft the item");
		}
		
		public override void OnDelete()
		{
		base.OnDelete();
		}		


		public BaseHintScroll( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 1 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
}




namespace Server.Gumps
{


	public class HintScrollGump : Gump
	{
	Mobile m_from;
	BaseHintScroll m_recipe;
	
	static int spacing=20;					

		public HintScrollGump(Mobile from, BaseHintScroll recipe)	: base( 40, 40 )
		{
			m_from=from;
			m_recipe=recipe;		
			
			int maxcount=1;

			this.Closable=true;
			this.Disposable=true;
			this.Dragable=true;
			this.Resizable=false;
			this.AddPage(0);
			this.AddBackground(70, 49, 650, 234+(spacing*maxcount), 9300);			
		
			this.AddItem( 85, 76, m_recipe.hintid, m_recipe.hinthue);
			
			this.AddLabel(226, 75, 0, @m_recipe.hintname);
			
			this.AddLabel(92, 169, 1324, @"Keep this scroll in your pack for the following special bonus");
			this.AddImageTiled(115, 188, 552, 13, 58);
			this.AddLabel(94, 117, 0, @m_recipe.hintdesc);
			this.AddImage(85, 188, 57);
			this.AddImage(667, 188, 59);
			this.AddImageTiled(115, 58, 552, 13, 58);
			this.AddImage(85, 58, 57);
			this.AddImage(667, 58, 59);
			
			
			this.AddLabel(92,210, 0, @m_recipe.hintbonus);	
			
			this.AddImageTiled(115, 219+(spacing*maxcount), 552, 13, 58);
			this.AddImage(667, 219+(spacing*maxcount), 59);
			this.AddImage(85, 219+(spacing*maxcount), 57);
			this.AddButton(359, 242+(spacing*maxcount), 247, 248, (int)Buttons.ok, GumpButtonType.Reply, 0); 
			this.AddImage(54, 23, 10600);
			this.AddImage(49, 278+(spacing*maxcount), 10600);
			this.AddImage(662, 23, 10602);
			this.AddImageTiled(124, 24, 594, 29, 10601);
			this.AddImageTiled(88, 278+(spacing*maxcount), 603, 29, 10601);
			this.AddImage(661, 278+(spacing*maxcount), 10602);

		}
		
		public enum Buttons
		{
			TextEntry1,
			ok,
			cancel
		}
		
		public override void OnResponse( NetState state, RelayInfo info )
		{
			if ( info.ButtonID == (int)Buttons.ok )
			{
			}
			else
			{
			}
		}		
	}
}



