class 1 chamberlain_frederick : chamberlain
{
parameter:
	string	fnHi = "chamberlain_frederick001.htm";

property:
	BuySellList SellList0 = {{"advdeluxe_food_for_strider";10};{"pledge_shield_castle";10};{"circlet_of_rune";10};{"agathion_seal_bracelet_rune";10}};
	TelPosList Position1 = {{"Village Square"; 43835; -47749; -796; 0; 0};{"South Gate Entrance"; 43197; -46767; -808; 0; 0};{"North Gate Entrance"; 38956; -53648; -1343; 0; 0}};
	TelPosList Position2 = {{"Village Square"; 43835; -47749; -796; 0; 0};{"South Gate Entrance"; 43197; -46767; -808; 0; 0};{"North Gate Entrance"; 38956; -53648; -1343; 0; 0};{"Forest of the Dead"; 52107; -54328; -3158; 500; 0};{"Wild Beast Pastures"; 43805; -88010; -2752; 500; 0};{"Swamp of Screams"; 69340; -50203; -3314; 500; 0};{"Valley of Saints"; 65307; -71445; -3688; 500; 0};{"Monastery of Silence"; 106414; -87799; -2920; 500; 0}};

handler:
	EventHandler MENU_SELECTED(talker,ask,i0,i1)
	{
		if( ask == 1200 )
		{
			if( ( myself::Castle_GetRawSiegeTime() - myself::Castle_GetRawSystemTime() ) < 86400 && ( myself::Castle_GetRawSiegeTime() - myself::Castle_GetRawSystemTime() ) > 43200 )
			{
				if( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 )
				{
					myself::InstantTeleport(talker,11882,-49261,-3008);
				}
				else
				{
					myself::ShowPage(talker,fnNotMyLord);
				}
			}
			else
			{
				i0 = ( myself::Castle_GetRawSiegeTime() - myself::Castle_GetRawSystemTime() );
				i1 = ( i0 / 3600 );
				myself::Say("Not time! The siege will begin in " + myself::IntToStr(i1) + " hours");
			}
		}
		super;
	}

}
