class 1 steward : citizen
{
parameter:
	string	ShopName = "";
	string	fnHi = "ol_mahum_steward_tamutak001.htm";
	string	fnNotMyLord = "ol_mahum_steward_tamutak002.htm";
	string	fnSetGate = "ol_mahum_steward_tamutak003.htm";
	string	fnBanish = "ol_mahum_steward_tamutak004.htm";
	string	fnOptionList = "ol_mahum_steward_tamutak005.htm";
	string	fnAfterOpenGate = "ol_mahum_steward_tamutak006.htm";
	string	fnAfterCloseGate = "ol_mahum_steward_tamutak007.htm";
	string	fnAfterBanish = "ol_mahum_steward_tamutak008.htm";
	string	fnAlreadyHaveOption = "ol_mahum_steward_tamutak009.htm";
	string	fnNotEnoughAdena = "ol_mahum_steward_tamutak010.htm";
	string	fnNeedLowGrade = "ol_mahum_steward_tamutak011.htm";
	string	fnAfterOptionAdd = "ol_mahum_steward_tamutak012.htm";
	string	fnAddHPRegen1 = "ol_mahum_steward_tamutak013.htm";
	string	fnAddHPRegen2 = "ol_mahum_steward_tamutak014.htm";
	string	fnAddMPRegen1 = "ol_mahum_steward_tamutak015.htm";
	string	fnAddMPRegen2 = "ol_mahum_steward_tamutak016.htm";
	string	fnNoAuthority = "ol_mahum_steward_tamutak017.htm";
	string	fnIsUnderSiege = "ol_mahum_steward_tamutak018.htm";
	string	fnAddTeleporter1 = "ol_mahum_steward_tamutak019.htm";
	string	fnAddTeleporter2 = "ol_mahum_steward_tamutak020.htm";
	string	fnTeleportLevelZero = "ol_mahum_steward_tamutak021.htm";
	string	fnManage = "ol_mahum_AgitDecoManage.htm";
	string	fnWarehouse = "agitwarehouse.htm";
	string	fnDecoReset = "agitresetdeco.htm";
	string	fnAfterSetDeco = "agitaftersetdeco.htm";
	string	fnAfterResetDeco = "agitafterresetdeco.htm";
	string	fnFailtoSetDeco = "agitfailtosetdeco.htm";
	string	fnFailtoResetDeco = "agitfailtoresetdeco.htm";
	string	fnDecoFunction = "agitdecofunction.htm";
	string	fnFuncDisabled = "agitfuncdisabled.htm";
	string	fnAgitBuff = "agitbuff";
	string	fnAfterBuyItem = "agitafterbuyitem.htm";
	string	fnManageRegen = "ol_mahum_agitdeco_ar01.htm";
	string	fnManageEtc = "ol_mahum_agitdeco_ae01.htm";
	string	fnDecoAlreadySet = "agitdecoalreadyset.htm";
	string	fnAfterBuff = "agitafterbuff.htm";
	string	fnNeedCoolTime = "agitneedcooltime.htm";
	string	fnNotEnoughMP = "agitnotenoughmp.htm";
	string	shopname = "Store;
	int	cus_x1 = 0;
	int	cus_y1 = 0;
	int	cus_z1 = 0;
	int	cus_x2 = 0;
	int	cus_y2 = 0;
	int	cus_z2 = 0;
	int	cus_x3 = 0;
	int	cus_y3 = 0;
	int	cus_z3 = 0;
	int	decotype_hpregen = 1;
	int	decotype_mpregen = 2;
	int	decotype_cpregen = 3;
	int	decotype_xprestore = 4;
	int	decotype_teleport = 5;
	int	decotype_broadcast = 6;
	int	decotype_curtain = 7;
	int	decotype_hanging = 8;
	int	decotype_buff = 9;
	int	decotype_outerflag = 10;
	int	decotype_platform = 11;
	int	decotype_item = 12;

property:
	TelPosList Position1 = {{"Talking Island"; -84169; 244693; -3729; 100000; 0 }};
	TelPosList Position2 = {{"Talking Island"; -84169; 244693; -3729; 100000; 0 }};
	BuySellList SellList0 = {{"scroll_of_escape_to_agit";10};{"deluxe_food_for_strider";10}};
	BuySellList SellList1 = {{"scroll_of_escape_to_agit";10};{"blessed_scroll_of_escape_to_agit";10};{"deluxe_food_for_strider";10}};
	BuySellList SellList2 = {{"scroll_of_escape_to_agit";10};{"deluxe_food_for_strider";10}};
	BuySellList SellList3 = {{"scroll_of_escape_to_agit";10};{"deluxe_food_for_strider";10}};
	BuySellList SellList4 = {{"scroll_of_escape_to_agit";10};{"deluxe_food_for_strider";10}};
	BuySellList SellList5 = {{"scroll_of_escape_to_agit";10};{"deluxe_food_for_strider";10}};

handler:
	EventHandler CREATED()
	{
		myself::AddTimerEx(1077,1000);
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id,i0)
	{
		if( timer_id == 1077 )
		{
			if( myself::Agit_GetDecoLevel(decotype_buff) > 0 )
			{
				i0 = ( 1117697 + ( ( myself::Agit_GetDecoLevel(decotype_buff) - 10 ) * 256 ) );
				if( myself::Skill_GetConsumeMP(i0) < myself.sm.mp && myself::Skill_GetConsumeHP(i0) < myself.sm.hp && myself::Skill_InReuseDelay(i0) == 0 )
				{
					myself::AddUseSkillDesire(myself.sm,i0,1,1,1000000);
				}
			}
			else if( myself::Skill_GetConsumeMP(1117953) < myself.sm.mp && myself::Skill_GetConsumeHP(1117953) < myself.sm.hp && myself::Skill_InReuseDelay(1117953) == 0 )
			{
				myself::AddUseSkillDesire(myself.sm,1117953,1,1,1000000);
			}
			myself::AddTimerEx(1077,300000);
		}
		super;
	}

	EventHandler TALKED(talker)
	{
		if( myself::IsMyLord(talker) || ( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) )
		{
			if( myself::Castle_IsUnderSiege() )
			{
				myself::ShowPage(talker,fnIsUnderSiege);
			}
			else
			{
				myself::ShowPage(talker,fnHi);
			}
		}
		else
		{
			myself::ShowPage(talker,fnNotMyLord);
		}
	}

	EventHandler SET_AGIT_DECO_RETURNED(talker,reply)
	{
		if( reply )
		{
			if( myself::OwnItemCount(talker,57) >= myself::GetCookie(talker,"AgitDecoFee") )
			{
				myself::DeleteItem1(talker,57,myself::GetCookie(talker,"AgitDecoFee"));
				myself::ShowPage(talker,fnAfterSetDeco);
			}
			else
			{
				myself::ShowPage(talker,fnNotEnoughAdena);
			}
		}
		else
		{
			myself::ShowPage(talker,fnFailtoSetDeco);
		}
	}

	EventHandler RESET_AGIT_DECO_RETURNED(talker,reply)
	{
		if( reply )
		{
			myself::ShowPage(talker,fnAfterResetDeco);
		}
		else
		{
			myself::ShowPage(talker,fnFailtoResetDeco);
		}
	}

	EventHandler MENU_SELECTED(talker,ask,reply,fhtml0,i0,i1,i2,i3,s0,s1)
	{
		super;
		if( ask == 0 )
		{
			if( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 )
			{
				myself::ShowPage(talker,fnHi);
			}
			else
			{
				myself::ShowPage(talker,fnNotMyLord);
			}
		}
		if( ask == -201 )
		{
			switch(reply)
			{
				case 0:
				{
					if( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 )
					{
						myself::ShowPage(talker,fnHi);
					}
					else
					{
						myself::ShowPage(talker,fnNotMyLord);
					}
					break;
				}
				case 1:
				{
					if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,4) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) )
					{
						if( myself::Castle_IsUnderSiege() )
						{
							myself::ShowPage(talker,fnIsUnderSiege);
						}
						else
						{
							myself::ShowPage(talker,fnSetGate);
						}
					}
					else
					{
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 2:
				{
					if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,6) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) )
					{
						if( myself::Castle_IsUnderSiege() )
						{
							myself::ShowPage(talker,fnIsUnderSiege);
						}
						else
						{
							myself::ShowPage(talker,fnBanish);
						}
					}
					else
					{
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 3:
				{
					if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,5) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) )
					{
						myself::FHTML_SetFileName(fhtml0,fnDecoFunction);
						if( myself::Agit_GetDecoLevel(decotype_hpregen) == 0 )
						{
							myself::FHTML_SetInt(fhtml0,"HPDepth",0);
						}
						else
						{
							myself::FHTML_SetInt(fhtml0,"HPDepth",( ( myself::Agit_GetDecoLevel(decotype_hpregen) - 10 ) * 20 ));
						}
						if( myself::Agit_GetDecoLevel(decotype_mpregen) == 0 )
						{
							myself::FHTML_SetInt(fhtml0,"MPDepth",0);
						}
						else
						{
							myself::FHTML_SetInt(fhtml0,"MPDepth",( ( myself::Agit_GetDecoLevel(decotype_mpregen) - 10 ) * 5 ));
						}
						if( myself::Agit_GetDecoLevel(decotype_xprestore) == 0 )
						{
							myself::FHTML_SetInt(fhtml0,"XPDepth",0);
						}
						else
						{
							myself::FHTML_SetInt(fhtml0,"XPDepth",( ( myself::Agit_GetDecoLevel(decotype_xprestore) - 10 ) * 5 ));
						}
						myself::ShowFHTML(talker,fhtml0);
					}
					else
					{
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 4:
				{
					if( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 )
					{
						myself::ShowPage(talker,fnWarehouse);
					}
					else
					{
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 5:
				{
					if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,5) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) )
					{
						myself::ShowPage(talker,fnManage);
					}
					else
					{
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 6:
				{
					if( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 )
					{
						myself::ShowPage(talker,fnWarehouse);
					}
					else
					{
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 7:
				{
					if( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 )
					{
						if( myself::Agit_GetDecoLevel(decotype_buff) == 0 )
						{
							myself::ShowPage(talker,fnFuncDisabled);
						}
						else
						{
							myself::FHTML_SetFileName(fhtml0,fnAgitBuff + "_" + myself::IntToStr(( myself::Agit_GetDecoLevel(decotype_buff) - 10 )) + ".htm");
							myself::FHTML_SetInt(fhtml0,"MPLeft",myself::FloatToInt(myself.sm.mp));
							myself::ShowFHTML(talker,fhtml0);
						}
					}
					else
					{
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 12:
				{
					if( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 )
					{
						if( myself::Agit_GetDecoLevel(decotype_item) == 0 )
						{
							myself::ShowPage(talker,fnFuncDisabled);
						}
						switch((myself::Agit_GetDecoLevel(decotype_item)-10))
						{
							case 1:
							{
								myself::Sell(talker,SellList0,ShopName,fnAfterBuyItem,fnNotEnoughAdena,"");
								break;
							}
							case 2:
							{
								myself::Sell(talker,SellList1,ShopName,fnAfterBuyItem,fnNotEnoughAdena,"");
								break;
							}
							case 3:
							{
								myself::Sell(talker,SellList2,ShopName,fnAfterBuyItem,fnNotEnoughAdena,"");
								break;
							}
							case 4:
							{
								myself::Sell(talker,SellList3,ShopName,fnAfterBuyItem,fnNotEnoughAdena,"");
								break;
							}
							case 5:
							{
								myself::Sell(talker,SellList4,ShopName,fnAfterBuyItem,fnNotEnoughAdena,"");
								break;
							}
							case 6:
							{
								myself::Sell(talker,SellList5,ShopName,fnAfterBuyItem,fnNotEnoughAdena,"");
								break;
							}
						}
					}
					else
					{
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 51:
				{
					if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,5) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) )
					{
						myself::FHTML_SetFileName(fhtml0,fnManageRegen);
						if( myself::Agit_GetDecoLevel(decotype_hpregen) == 0 )
						{
							myself::FHTML_SetStr(fhtml0,"HP" + "Depth",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"HP" + "Expire",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"HP" + "Reset","");
						}
						else
						{
							i0 = ( myself::Agit_GetDecoLevel(decotype_hpregen) - 10 );
							myself::FHTML_SetStr(fhtml0,"HP" + "Depth",myself::IntToStr(( i0 * 20 )) + "%");
							myself::FHTML_SetStr(fhtml0,"HP" + "Cost","(" + myself::MakeFString(6,myself::IntToStr(myself::Agit_GetDecoFee(decotype_hpregen,myself::Agit_GetDecoLevel(decotype_hpregen))),myself::IntToStr(myself::Agit_GetDecoDay(decotype_hpregen,myself::Agit_GetDecoLevel(decotype_hpregen))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"HP" + "Expire",myself::MakeFString(5,myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_hpregen),1)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_hpregen),2)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_hpregen),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"HP" + "Reset",myself::MakeFString(7,fnBracketL,myself::IntToStr(decotype_hpregen),fnBracketR,"",""));
						}
						if( myself::Agit_GetDecoLevel(decotype_mpregen) == 0 )
						{
							myself::FHTML_SetStr(fhtml0,"MP" + "Depth",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"MP" + "Expire",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"MP" + "Reset","");
						}
						else
						{
							i0 = ( myself::Agit_GetDecoLevel(decotype_mpregen) - 10 );
							myself::FHTML_SetStr(fhtml0,"MP" + "Depth",myself::IntToStr(( i0 * 5 )) + "%");
							myself::FHTML_SetStr(fhtml0,"MP" + "Cost","(" + myself::MakeFString(6,myself::IntToStr(myself::Agit_GetDecoFee(decotype_mpregen,myself::Agit_GetDecoLevel(decotype_mpregen))),myself::IntToStr(myself::Agit_GetDecoDay(decotype_mpregen,myself::Agit_GetDecoLevel(decotype_mpregen))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"MP" + "Expire",myself::MakeFString(5,myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_mpregen),1)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_mpregen),2)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_mpregen),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"MP" + "Reset",myself::MakeFString(7,fnBracketL,myself::IntToStr(decotype_mpregen),fnBracketR,"",""));
						}
						if( myself::Agit_GetDecoLevel(decotype_xprestore) == 0 )
						{
							myself::FHTML_SetStr(fhtml0,"XP" + "Depth",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"XP" + "Expire",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"XP" + "Reset","");
						}
						else
						{
							i0 = ( myself::Agit_GetDecoLevel(decotype_xprestore) - 10 );
							myself::FHTML_SetStr(fhtml0,"XP" + "Depth",myself::IntToStr(( i0 * 5 )) + "%");
							myself::FHTML_SetStr(fhtml0,"XP" + "Cost","(" + myself::MakeFString(6,myself::IntToStr(myself::Agit_GetDecoFee(decotype_xprestore,myself::Agit_GetDecoLevel(decotype_xprestore))),myself::IntToStr(myself::Agit_GetDecoDay(decotype_xprestore,myself::Agit_GetDecoLevel(decotype_xprestore))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"XP" + "Expire",myself::MakeFString(5,myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_xprestore),1)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_xprestore),2)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_xprestore),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"XP" + "Reset",myself::MakeFString(7,fnBracketL,myself::IntToStr(decotype_xprestore),fnBracketR,"",""));
						}
						myself::ShowFHTML(talker,fhtml0);
					}
					else
					{
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 52:
				{
					if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,5) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) )
					{
						myself::FHTML_SetFileName(fhtml0,fnManageEtc);
						s0 = myself::MakeFString(8,"","","","","");
						if( myself::Agit_GetDecoLevel(decotype_teleport) == 0 )
						{
							myself::FHTML_SetStr(fhtml0,"TP" + "Depth",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"TP" + "Expire",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"TP" + "Reset","");
						}
						else
						{
							i0 = ( myself::Agit_GetDecoLevel(decotype_teleport) - 10 );
							myself::FHTML_SetStr(fhtml0,"TP" + "Depth",myself::IntToStr(( i0 * 1 )) + s0);
							myself::FHTML_SetStr(fhtml0,"TP" + "Cost","(" + myself::MakeFString(6,myself::IntToStr(myself::Agit_GetDecoFee(decotype_teleport,myself::Agit_GetDecoLevel(decotype_teleport))),myself::IntToStr(myself::Agit_GetDecoDay(decotype_teleport,myself::Agit_GetDecoLevel(decotype_teleport))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"TP" + "Expire",myself::MakeFString(5,myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_teleport),1)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_teleport),2)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_teleport),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"TP" + "Reset",myself::MakeFString(7,fnBracketL,myself::IntToStr(decotype_teleport),fnBracketR,"",""));
						}
						s0 = myself::MakeFString(8,"","","","","");
						if( myself::Agit_GetDecoLevel(decotype_broadcast) == 0 )
						{
							myself::FHTML_SetStr(fhtml0,"BC" + "Depth",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"BC" + "Expire",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"BC" + "Reset","");
						}
						else
						{
							i0 = ( myself::Agit_GetDecoLevel(decotype_broadcast) - 10 );
							myself::FHTML_SetStr(fhtml0,"BC" + "Depth",myself::IntToStr(( i0 * 1 )) + s0);
							myself::FHTML_SetStr(fhtml0,"BC" + "Cost","(" + myself::MakeFString(6,myself::IntToStr(myself::Agit_GetDecoFee(decotype_broadcast,myself::Agit_GetDecoLevel(decotype_broadcast))),myself::IntToStr(myself::Agit_GetDecoDay(decotype_broadcast,myself::Agit_GetDecoLevel(decotype_broadcast))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"BC" + "Expire",myself::MakeFString(5,myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_broadcast),1)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_broadcast),2)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_broadcast),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"BC" + "Reset",myself::MakeFString(7,fnBracketL,myself::IntToStr(decotype_broadcast),fnBracketR,"",""));
						}
						s0 = myself::MakeFString(8,"","","","","");
						if( myself::Agit_GetDecoLevel(decotype_item) == 0 )
						{
							myself::FHTML_SetStr(fhtml0,"IC" + "Depth",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"IC" + "Expire",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"IC" + "Reset","");
						}
						else
						{
							i0 = ( myself::Agit_GetDecoLevel(decotype_item) - 10 );
							myself::FHTML_SetStr(fhtml0,"IC" + "Depth",myself::IntToStr(( i0 * 1 )) + s0);
							myself::FHTML_SetStr(fhtml0,"IC" + "Cost","(" + myself::MakeFString(6,myself::IntToStr(myself::Agit_GetDecoFee(decotype_item,myself::Agit_GetDecoLevel(decotype_item))),myself::IntToStr(myself::Agit_GetDecoDay(decotype_item,myself::Agit_GetDecoLevel(decotype_item))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"IC" + "Expire",myself::MakeFString(5,myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_item),1)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_item),2)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_item),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"IC" + "Reset",myself::MakeFString(7,fnBracketL,myself::IntToStr(decotype_item),fnBracketR,"",""));
						}
						s0 = myself::MakeFString(8,"","","","","");
						if( myself::Agit_GetDecoLevel(decotype_buff) == 0 )
						{
							myself::FHTML_SetStr(fhtml0,"BF" + "Depth",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"BF" + "Expire",myself::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"BF" + "Reset","");
						}
						else
						{
							i0 = ( myself::Agit_GetDecoLevel(decotype_buff) - 10 );
							myself::FHTML_SetStr(fhtml0,"BF" + "Depth",myself::IntToStr(( i0 * 1 )) + s0);
							myself::FHTML_SetStr(fhtml0,"BF" + "Cost","(" + myself::MakeFString(6,myself::IntToStr(myself::Agit_GetDecoFee(decotype_buff,myself::Agit_GetDecoLevel(decotype_buff))),myself::IntToStr(myself::Agit_GetDecoDay(decotype_buff,myself::Agit_GetDecoLevel(decotype_buff))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"BF" + "Expire",myself::MakeFString(5,myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_buff),1)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_buff),2)),myself::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_buff),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"BF" + "Reset",myself::MakeFString(7,fnBracketL,myself::IntToStr(decotype_buff),fnBracketR,"",""));
						}
						myself::ShowFHTML(talker,fhtml0);
					}
					else
					{
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
			}
		}
		else if( ask == -202 )
		{
			if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,4) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) )
			{
				switch(reply)
				{
					case 1:
					{
						if( myself::Castle_IsUnderSiege() )
						{
							myself::ShowPage(talker,fnIsUnderSiege);
						}
						else
						{
							myself::Castle_GateOpenClose(0);
							myself::ShowPage(talker,fnAfterOpenGate);
						}
						break;
					}
					case 2:
					{
						if( myself::Castle_IsUnderSiege() )
						{
							myself::ShowPage(talker,fnIsUnderSiege);
						}
						else
						{
							myself::Castle_GateOpenClose(1);
							myself::ShowPage(talker,fnAfterCloseGate);
						}
						break;
					}
				}
			}
			else
			{
				myself::ShowPage(talker,fnNoAuthority);
			}
		}
		else if( ask == -203 )
		{
			if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,6) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) )
			{
				if( reply == 1 )
				{
					if( myself::Castle_IsUnderSiege() )
					{
						myself::ShowPage(talker,fnIsUnderSiege);
					}
					else
					{
						myself::Castle_BanishOthers();
						myself::ShowPage(talker,fnAfterBanish);
					}
				}
			}
			else
			{
				myself::ShowPage(talker,fnNoAuthority);
			}
		}
		else if( ask == -270 )
		{
			if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,5) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) )
			{
				i0 = myself::FloatToInt(( reply / 1000 ));
				i1 = ( reply - ( i0 * 1000 ) );
				if( i1 == 0 )
				{
					myself::FHTML_SetFileName(fhtml0,fnDecoReset);
					myself::FHTML_SetInt(fhtml0,"AgitDecoSubmit",reply);
				}
				else if( myself::Agit_GetDecoLevel(i0) == i1 )
				{
					myself::FHTML_SetFileName(fhtml0,fnDecoAlreadySet);
				}
				else
				{
					myself::FHTML_SetFileName(fhtml0,"ol_mahum_agitdeco__" + myself::IntToStr(i0) + ".htm");
					myself::FHTML_SetStr(fhtml0,"AgitDecoCost",myself::MakeFString(6,myself::IntToStr(myself::Agit_GetDecoFee(i0,i1)),myself::IntToStr(myself::Agit_GetDecoDay(i0,i1)),"","",""));
					myself::FHTML_SetInt(fhtml0,"AgitDecoSubmit",reply);
				}
				if( i0 == decotype_hpregen )
				{
					myself::FHTML_SetStr(fhtml0,"AgitDecoEffect",myself::IntToStr(( ( i1 - 10 ) * 20 )) + "%");
				}
				else if( i0 == decotype_mpregen )
				{
					myself::FHTML_SetStr(fhtml0,"AgitDecoEffect",myself::IntToStr(( ( i1 - 10 ) * 5 )) + "%");
				}
				else if( i0 == decotype_xprestore )
				{
					myself::FHTML_SetStr(fhtml0,"AgitDecoEffect",myself::IntToStr(( ( i1 - 10 ) * 5 )) + "%");
				}
				else if( i0 == decotype_teleport )
				{
					myself::FHTML_SetStr(fhtml0,"AgitDecoEffect",myself::IntToStr(( i1 - 10 )) + myself::MakeFString(8,"","","","",""));
				}
				else if( i0 == decotype_broadcast )
				{
					myself::FHTML_SetStr(fhtml0,"AgitDecoEffect",myself::IntToStr(( i1 - 10 )) + myself::MakeFString(8,"","","","",""));
				}
				else if( i0 == decotype_item )
				{
					myself::FHTML_SetStr(fhtml0,"AgitDecoEffect",myself::IntToStr(( i1 - 10 )) + myself::MakeFString(8,"","","","",""));
				}
				else if( i0 == decotype_buff )
				{
					myself::FHTML_SetStr(fhtml0,"AgitDecoEffect",myself::IntToStr(( i1 - 10 )) + myself::MakeFString(8,"","","","",""));
				}
				else
				{
					myself::FHTML_SetStr(fhtml0,"AgitDecoEffect",myself::IntToStr(( i1 - 10 )) + myself::MakeFString(8,"","","","",""));
				}
				myself::ShowFHTML(talker,fhtml0);
			}
			else
			{
				myself::ShowPage(talker,fnNoAuthority);
			}
		}
		else if( ask == -271 )
		{
			if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,5) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) )
			{
				i0 = myself::FloatToInt(( reply / 1000 ));
				i1 = ( reply - ( i0 * 1000 ) );
				if( i1 == 0 )
				{
					myself::Agit_ResetDeco(talker,i0);
				}
				else if( myself::OwnItemCount(talker,57) >= myself::Agit_GetDecoFee(i0,i1) )
				{
					myself::SetCookie(talker,"AgitDecoFee",myself::Agit_GetDecoFee(i0,i1));
					if( i0 == decotype_buff )
					{
						if( i1 > 0 )
						{
							i2 = ( ( ( 1117697 + i1 ) - 10 ) * 256 );
							if( myself::Skill_GetConsumeMP(i2) < myself.sm.mp && myself::Skill_GetConsumeHP(i2) < myself.sm.hp && myself::Skill_InReuseDelay(i2) == 0 )
							{
								myself::AddUseSkillDesire(myself.sm,i2,1,1,1000000);
							}
						}
						else if( myself::Skill_GetConsumeMP(1117953) < myself.sm.mp && myself::Skill_GetConsumeHP(1117953) < myself.sm.hp && myself::Skill_InReuseDelay(1117953) == 0 )
						{
							myself::AddUseSkillDesire(myself.sm,1117953,1,1,1000000);
						}
					}
					myself::Agit_SetDeco(talker,i0,i1);
				}
				else
				{
					myself::ShowPage(talker,fnNotEnoughAdena);
				}
			}
			else
			{
				myself::ShowPage(talker,fnNoAuthority);
			}
		}
		else if( ask == -208 )
		{
			if( myself::Skill_GetConsumeMP(reply) < myself.sm.mp )
			{
				if( myself::Skill_GetConsumeHP(reply) < myself.sm.hp && myself::Skill_InReuseDelay(reply) == 0 )
				{
					myself::AddUseSkillDesire(talker,reply,1,0,1000000);
					myself::FHTML_SetFileName(fhtml0,fnAfterBuff);
				}
				else
				{
					myself::FHTML_SetFileName(fhtml0,fnNeedCoolTime);
				}
			}
			else
			{
				myself::FHTML_SetFileName(fhtml0,fnNotEnoughMP);
			}
			myself::FHTML_SetInt(fhtml0,"MPLeft",myself::FloatToInt(myself.sm.mp));
			myself::ShowFHTML(talker,fhtml0);
		}
	}

	EventHandler TELEPORT_REQUESTED(talker)
	{
		if( myself::IsMyLord(talker) || ( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) )
		{
			if( myself::Agit_GetDecoLevel(decotype_teleport) == 11 )
			{
				myself::Teleport(talker,Position1,ShopName,"","","",57,"");
			}
			else if( myself::Agit_GetDecoLevel(decotype_teleport) == 12 )
			{
				myself::Teleport(talker,Position2,ShopName,"","","",57,"");
			}
			else
			{
				myself::ShowPage(talker,fnFuncDisabled);
			}
		}
		else
		{
			myself::ShowPage(talker,fnNoAuthority);
		}
	}

}
