class 1 test_agit_messenger : citizen
{
parameter:
	string	fnHi = "agit_oel_mahum_messeger_1.htm";

handler:
	EventHandler TALKED(talker)
	{
		myself::ShowPage(talker,fnHi);
	}

	EventHandler MENU_SELECTED(talker,ask,reply)
	{
		if( ask == 1 )
		{
			if( reply == 1 )
			{
				myself::TB_GetPledgeRegisterStatus(talker,0);
			}
			else if( reply == 2 )
			{
				if( talker.is_pledge_master != 1 )
				{
					myself::TB_RegisterMember(talker);
				}
				else
				{
					myself::ShowPage(talker,"agit_oel_mahum_messeger_5.htm");
				}
			}
			else if( reply == 3 )
			{
				myself::TB_GetNpcType(talker);
			}
			else if( reply == 4 )
			{
				myself::TB_SetNpcType(talker,2);
			}
			else if( reply == 5 )
			{
				myself::TB_SetNpcType(talker,1);
			}
			else if( reply == 6 )
			{
				myself::TB_SetNpcType(talker,3);
			}
			else if( reply == 7 )
			{
				myself::TB_SetNpcType(talker,4);
			}
			else if( reply == 8 )
			{
				myself::TB_SetNpcType(talker,5);
			}
			else if( reply == 9 )
			{
				myself::TB_GetNpcType(talker);
			}
		}
	}

	EventHandler TB_REGISTER_PLEDGE_RETURNED(talker,reply)
	{
		if( reply < 0 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_3.htm");
		}
		else if( reply == 0 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_4a.htm");
		}
		else if( reply == 1 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_4b.htm");
		}
		else if( reply == 2 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_4c.htm");
		}
		else if( reply == 3 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_4d.htm");
		}
		else if( reply == 4 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_4e.htm");
		}
	}

	EventHandler TB_GET_PLEDGE_REGISTER_STATUS_INFORMED(talker,reply)
	{
		if( reply == -2 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_21.htm");
		}
		else if( reply == -1 )
		{
			if( myself::IsMyLord(talker) )
			{
				myself::ShowPage(talker,"agit_oel_mahum_messeger_22.htm");
			}
			else
			{
				myself::TB_RegisterPledge(talker);
			}
		}
		else if( reply == 0 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_4a.htm");
		}
		else if( reply == 1 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_4b.htm");
		}
		else if( reply == 2 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_4c.htm");
		}
		else if( reply == 3 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_4d.htm");
		}
		else if( reply == 4 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_4e.htm");
		}
	}

	EventHandler TB_REGISTER_MEMBER_RETURNED(talker,reply)
	{
		if( reply == 0 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_7.htm");
		}
		else if( reply == 1 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_8.htm");
		}
		else if( reply == 2 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_9.htm");
		}
	}

	EventHandler TB_SET_NPC_TYPE_RETURNED(talker,reply)
	{
		if( reply == -1 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_7.htm");
		}
		else if( reply >= 1 && reply <= 5 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_9.htm");
		}
	}

	EventHandler TB_GET_NPC_TYPE_INFORMED(talker,reply)
	{
		if( reply == -1 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_7.htm");
		}
		else if( reply == 0 )
		{
			if( talker.is_pledge_master == 1 )
			{
				myself::ShowPage(talker,"agit_oel_mahum_messeger_6.htm");
			}
			else
			{
				myself::ShowPage(talker,"agit_oel_mahum_messeger_10.htm");
			}
		}
		else if( reply == 1 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_16.htm");
		}
		else if( reply == 2 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_17.htm");
		}
		else if( reply == 3 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_18.htm");
		}
		else if( reply == 4 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_19.htm");
		}
		else if( reply == 5 )
		{
			myself::ShowPage(talker,"agit_oel_mahum_messeger_23.htm");
		}
	}

}
