using System;
using Server.Items;

namespace Server.ContextMenus
{
	public class OpenInnEntry : ContextMenuEntry
	{
		private Mobile m_Innkeeper;

		public OpenInnEntry( Mobile from, Mobile inn ) : base( 6105, 12 )
		{
			m_Innkeeper = inn;
		}

		public override void OnClick()
		{
			if ( !Owner.From.CheckAlive() )
				return;

			if ( Owner.From.Criminal )
			{
				m_Innkeeper.Say( 500378 ); // Thou art a criminal and cannot access thy inn chest.
			}
			else
			{
				this.Owner.From.InnBox.Open();
			}
		}
	}
}