class 1 castle_instant_teleporter : citizen
{
parameter:
	string	fnHi = "thi.htm";
	string	fnNotMyPledge = "";
	int	pos_x1 = 1;
	int	pos_y1 = 1;
	int	pos_z1 = 1;
	int	pos_x2 = 1;
	int	pos_y2 = 1;
	int	pos_z2 = 1;

handler:
	EventHandler TALKED(talker)
	{
		if( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 )
		{
			myself::ShowPage(talker,fnHi);
		}
		else
		{
			myself::ShowPage(talker,fnNotMyPledge);
		}
	}

	EventHandler TELEPORT_REQUESTED(talker)
	{
		if( gg::Rand(100) < 50 )
		{
			myself::InstantTeleport(talker,pos_x1,pos_y1,pos_z1);
		}
		else
		{
			myself::InstantTeleport(talker,pos_x2,pos_y2,pos_z2);
		}
	}

}
