/**********************************************************
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\shimering effusion\Quest Giver\TicketSalesman.cs
Lines of code: 78
***********************************************************/


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.Mobiles
{
	[CorpseName( "a ticket salesman corpse" )]
	public class TicketSalesman : Mobile
	{
        public virtual bool IsInvulnerable{ get{ return true; } }
                
		[Constructable]
		public TicketSalesman()
		{
			Name = "Lefty the Ticket Salesman";
            Body = 400;
            Hue = 33770;
            VirtualArmor = 50;
			CantWalk = true;
			
			InitStats( 125, 125, 125 );


            AddItem(new Server.Items.LongPants(368));
			AddItem(new Server.Items.FancyShirt(368));
			AddItem(new Server.Items.Cloak(288));

			Blessed = true;
			
		}
		public TicketSalesman( Serial serial ) : base( serial )
		{
		}

		public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list ) 
	    { 
			base.GetContextMenuEntries( from, list ); 
			list.Add( new TicketEntry( from, this ) ); 
	    } 

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

		public class TicketEntry : ContextMenuEntry
		{
			private Mobile m_Mobile;
			private Mobile m_Giver;
			
			public TicketEntry( Mobile from, Mobile giver ) : base( 6146, 3 )
			{
				m_Mobile = from;
				m_Giver = giver;
			}

			public override void OnClick()
            {
                
				PlayerMobile mobile = (PlayerMobile)m_Mobile;
							
				Item am = mobile.Backpack.FindItemByType(typeof(PrismOfLightTicket));
				if (am == null)
				{
					mobile.SendGump(new TicketGuyQuestGump(mobile));
				}
				else
				{
					mobile.SendMessage("'Why are you still poking around me? You got your ticket now go away!");
				}
             }			
        }
	}	
}

