@LabelIndex 11765
@StringIndex 3113
class 0 custodian : citizen {
parameter:
	string	ShopName = "";
	string	fnHi = "black001.htm";
	string	fnNotMyLord = "black002.htm";
	string	fnGetOut = "black003.htm";
	string	fnOptionList = "black005.htm";
	string	fnAlreadyHaveOption = "black009.htm";
	string	fnNeedLowGrade = "black011.htm";
	string	fnAfterOptionAdd = "black012.htm";
	string	fnAddHPRegen1 = "black013.htm";
	string	fnAddHPRegen2 = "black014.htm";
	string	fnAddMPRegen1 = "black015.htm";
	string	fnAddMPRegen2 = "black016.htm";
	string	fnAddTeleporter1 = "black017.htm";
	string	fnAddTeleporter2 = "black020.htm";
	string	fnMyPledge = "black019.htm";
	string	fnTeleportLevelZero = "black021.htm";
	string	fnWarehouse = "agitwarehouse.htm";
	string	fnFunction = "agitfunction.htm";
	string	fnManage = "agitdecomanage.htm";
	string	fnManageRegen = "agitdeco_ar01.htm";
	string	fnManageEtc = "agitdeco_ae01.htm";
	string	fnManageDeco = "agitdeco_ad01.htm";
	string	fnBanish = "agitbanish.htm";
	string	fnAfterBanish = "agitafterbanish.htm";
	string	fnDoor = "agitdoor.htm";
	string	fnAfterDoorOpen = "agitafterdooropen.htm";
	string	fnAfterDoorClose = "agitafterdoorclose.htm";
	string	fnDecoFunction = "agitdecofunction.htm";
	string	fnAfterSetDeco = "agitaftersetdeco.htm";
	string	fnAfterResetDeco = "agitafterresetdeco.htm";
	string	fnFailtoSetDeco = "agitfailtosetdeco.htm";
	string	fnFailtoResetDeco = "agitfailtoresetdeco.htm";
	string	fnDecoAlreadySet = "agitdecoalreadyset.htm";
	string	fnDecoReset = "agitresetdeco.htm";
	string	fnAgitBuff = "agitbuff";
	string	fnAfterBuff = "agitafterbuff.htm";
	string	fnAfterBuyItem = "agitafterbuyitem.htm";
	string	fnNoAuthority = "noauthority.htm";
	string	fnNotEnoughAdena = "agitnotenoughadena.htm";
	string	fnUnableToSell = "agitunabletosell.htm";
	string	fnFuncDisabled = "agitfuncdisabled.htm";
	string	fnNotEnoughMP = "agitnotenoughmp.htm";
	string	fnNeedCoolTime = "agitneedcooltime.htm";
	string	fnCostFail = "agitcostfail.htm";
	string	shopname = "?";
	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;
	int	fstr_stage_lv = 9;
	int	fstr_percent = 10;

property:
	TelPosList Position1 = {{"Talking Island Village"; -84169; 244693; -3729; 100000; 0 }};
	TelPosList Position2 = {{"Talking Island Village"; -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);
		myself.int_list::Add(1115649);
		myself.int_list::Add(1115651);
		myself.int_list::Add(1113858);
		myself.int_list::Add(1113862);
		myself.int_list::Add(1116161);
		myself.int_list::Add(1116163);
		myself.int_list::Add(1111809);
		myself.int_list::Add(1111811);
		myself.int_list::Add(1113601);
		myself.int_list::Add(1113604);
		myself.int_list::Add(1112321);
		myself.int_list::Add(1113345);
		myself.int_list::Add(1113346);
		myself.int_list::Add(1112577);
		myself.int_list::Add(1112580);
		myself.int_list::Add(1114625);
		myself.int_list::Add(1114628);
		myself.int_list::Add(1114113);
		myself.int_list::Add(1114114);
		myself::RegisterTeleporterType(1,0);
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id,i0) {
		if( timer_id == 1077 ) {
			if( myself::Agit_GetDecoLevel(decotype_buff) > 0 ) {
				i0 = ( 286130177 + ( ( myself::Agit_GetDecoLevel(decotype_buff) * 256 ) * 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(286195713) < myself.sm.mp && myself::Skill_GetConsumeHP(286195713) < myself.sm.hp && myself::Skill_InReuseDelay(286195713) == 0 ) {
				myself::AddUseSkillDesire(myself.sm,286195713,1,1,1000000);
			}
			myself::AddTimerEx(1077,300000);
		}
		super;
	}

	EventHandler TALKED(talker,fhtml0) {
		if( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) {
			if( myself::Agit_GetCostFailDay() == 0 ) {
				myself::ShowPage(talker,fnHi);
			} else {
				myself::FHTML_SetFileName(fhtml0,fnCostFail);
				myself::FHTML_SetInt(fhtml0,"CostFailDayLeft",( 8 - myself::Agit_GetCostFailDay() ));
				myself::ShowFHTML(talker,fhtml0);
			}
		} else {
			myself::ShowPage(talker,fnNotMyLord);
		}
	}

	EventHandler SET_AGIT_DECO_RETURNED(talker,reply) {
		if( reply ) {
			if( gg::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,i4,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,11) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) ) {
						myself::ShowPage(talker,fnDoor);
					} else {
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 2: {
					if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,14) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) ) {
						myself::ShowPage(talker,fnBanish);
					} else {
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 3: {
					if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,12) && 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) * 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) * 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) * 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::AuctionAgit_GetAgitCostInfo(talker);
					} else {
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 5: {
					if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,15) && 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::HavePledgePower(talker,12) && 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 + "_" + gg::IntToStr(myself::Agit_GetDecoLevel(decotype_buff)) + ".htm");
							myself::FHTML_SetInt(fhtml0,"MPLeft",gg::FloatToInt(myself.sm.mp));
							myself::ShowFHTML(talker,fhtml0);
						}
					} else {
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 12: {
					if( myself::HavePledgePower(talker,12) && 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)) {
							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,15) && 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",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"HP" + "Expire",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"HP" + "Reset","");
						} else {
							myself::FHTML_SetStr(fhtml0,"HP" + "Depth",gg::MakeFString(fstr_percent,gg::IntToStr(( myself::Agit_GetDecoLevel(decotype_hpregen) * 20 )),"","","",""));
							myself::FHTML_SetStr(fhtml0,"HP" + "Cost","(" + gg::MakeFString(6,gg::IntToStr(myself::Agit_GetDecoFee(decotype_hpregen,myself::Agit_GetDecoLevel(decotype_hpregen))),gg::IntToStr(myself::Agit_GetDecoDay(decotype_hpregen,myself::Agit_GetDecoLevel(decotype_hpregen))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"HP" + "Expire",gg::MakeFString(5,gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_hpregen),1)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_hpregen),2)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_hpregen),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"HP" + "Reset",gg::MakeFString(7,fnBracketL,gg::IntToStr(decotype_hpregen),fnBracketR,"",""));
						}
						if( myself::Agit_GetDecoLevel(decotype_mpregen) == 0 ) {
							myself::FHTML_SetStr(fhtml0,"MP" + "Depth",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"MP" + "Expire",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"MP" + "Reset","");
						} else {
							myself::FHTML_SetStr(fhtml0,"MP" + "Depth",gg::MakeFString(fstr_percent,gg::IntToStr(( myself::Agit_GetDecoLevel(decotype_mpregen) * 5 )),"","","",""));
							myself::FHTML_SetStr(fhtml0,"MP" + "Cost","(" + gg::MakeFString(6,gg::IntToStr(myself::Agit_GetDecoFee(decotype_mpregen,myself::Agit_GetDecoLevel(decotype_mpregen))),gg::IntToStr(myself::Agit_GetDecoDay(decotype_mpregen,myself::Agit_GetDecoLevel(decotype_mpregen))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"MP" + "Expire",gg::MakeFString(5,gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_mpregen),1)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_mpregen),2)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_mpregen),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"MP" + "Reset",gg::MakeFString(7,fnBracketL,gg::IntToStr(decotype_mpregen),fnBracketR,"",""));
						}
						if( myself::Agit_GetDecoLevel(decotype_xprestore) == 0 ) {
							myself::FHTML_SetStr(fhtml0,"XP" + "Depth",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"XP" + "Expire",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"XP" + "Reset","");
						} else {
							myself::FHTML_SetStr(fhtml0,"XP" + "Depth",gg::MakeFString(fstr_percent,gg::IntToStr(( myself::Agit_GetDecoLevel(decotype_xprestore) * 5 )),"","","",""));
							myself::FHTML_SetStr(fhtml0,"XP" + "Cost","(" + gg::MakeFString(6,gg::IntToStr(myself::Agit_GetDecoFee(decotype_xprestore,myself::Agit_GetDecoLevel(decotype_xprestore))),gg::IntToStr(myself::Agit_GetDecoDay(decotype_xprestore,myself::Agit_GetDecoLevel(decotype_xprestore))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"XP" + "Expire",gg::MakeFString(5,gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_xprestore),1)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_xprestore),2)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_xprestore),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"XP" + "Reset",gg::MakeFString(7,fnBracketL,gg::IntToStr(decotype_xprestore),fnBracketR,"",""));
						}
						myself::ShowFHTML(talker,fhtml0);
					} else {
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 52: {
					if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,15) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) ) {
						myself::FHTML_SetFileName(fhtml0,fnManageEtc);
						if( myself::Agit_GetDecoLevel(decotype_teleport) == 0 ) {
							myself::FHTML_SetStr(fhtml0,"TP" + "Depth",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"TP" + "Expire",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"TP" + "Reset","");
						} else {
							myself::FHTML_SetStr(fhtml0,"TP" + "Depth",gg::MakeFString(fstr_stage_lv,gg::IntToStr(( myself::Agit_GetDecoLevel(decotype_teleport) * 1 )),"","","",""));
							myself::FHTML_SetStr(fhtml0,"TP" + "Cost","(" + gg::MakeFString(6,gg::IntToStr(myself::Agit_GetDecoFee(decotype_teleport,myself::Agit_GetDecoLevel(decotype_teleport))),gg::IntToStr(myself::Agit_GetDecoDay(decotype_teleport,myself::Agit_GetDecoLevel(decotype_teleport))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"TP" + "Expire",gg::MakeFString(5,gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_teleport),1)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_teleport),2)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_teleport),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"TP" + "Reset",gg::MakeFString(7,fnBracketL,gg::IntToStr(decotype_teleport),fnBracketR,"",""));
						}
						if( myself::Agit_GetDecoLevel(decotype_broadcast) == 0 ) {
							myself::FHTML_SetStr(fhtml0,"BC" + "Depth",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"BC" + "Expire",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"BC" + "Reset","");
						} else {
							myself::FHTML_SetStr(fhtml0,"BC" + "Depth",gg::MakeFString(fstr_stage_lv,gg::IntToStr(( myself::Agit_GetDecoLevel(decotype_broadcast) * 1 )),"","","",""));
							myself::FHTML_SetStr(fhtml0,"BC" + "Cost","(" + gg::MakeFString(6,gg::IntToStr(myself::Agit_GetDecoFee(decotype_broadcast,myself::Agit_GetDecoLevel(decotype_broadcast))),gg::IntToStr(myself::Agit_GetDecoDay(decotype_broadcast,myself::Agit_GetDecoLevel(decotype_broadcast))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"BC" + "Expire",gg::MakeFString(5,gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_broadcast),1)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_broadcast),2)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_broadcast),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"BC" + "Reset",gg::MakeFString(7,fnBracketL,gg::IntToStr(decotype_broadcast),fnBracketR,"",""));
						}
						if( myself::Agit_GetDecoLevel(decotype_item) == 0 ) {
							myself::FHTML_SetStr(fhtml0,"IC" + "Depth",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"IC" + "Expire",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"IC" + "Reset","");
						} else {
							myself::FHTML_SetStr(fhtml0,"IC" + "Depth",gg::MakeFString(fstr_stage_lv,gg::IntToStr(( myself::Agit_GetDecoLevel(decotype_item) * 1 )),"","","",""));
							myself::FHTML_SetStr(fhtml0,"IC" + "Cost","(" + gg::MakeFString(6,gg::IntToStr(myself::Agit_GetDecoFee(decotype_item,myself::Agit_GetDecoLevel(decotype_item))),gg::IntToStr(myself::Agit_GetDecoDay(decotype_item,myself::Agit_GetDecoLevel(decotype_item))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"IC" + "Expire",gg::MakeFString(5,gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_item),1)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_item),2)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_item),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"IC" + "Reset",gg::MakeFString(7,fnBracketL,gg::IntToStr(decotype_item),fnBracketR,"",""));
						}
						if( myself::Agit_GetDecoLevel(decotype_buff) == 0 ) {
							myself::FHTML_SetStr(fhtml0,"BF" + "Depth",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"BF" + "Expire",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"BF" + "Reset","");
						} else {
							myself::FHTML_SetStr(fhtml0,"BF" + "Depth",gg::MakeFString(fstr_stage_lv,gg::IntToStr(( myself::Agit_GetDecoLevel(decotype_buff) * 1 )),"","","",""));
							myself::FHTML_SetStr(fhtml0,"BF" + "Cost","(" + gg::MakeFString(6,gg::IntToStr(myself::Agit_GetDecoFee(decotype_buff,myself::Agit_GetDecoLevel(decotype_buff))),gg::IntToStr(myself::Agit_GetDecoDay(decotype_buff,myself::Agit_GetDecoLevel(decotype_buff))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"BF" + "Expire",gg::MakeFString(5,gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_buff),1)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_buff),2)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_buff),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"BF" + "Reset",gg::MakeFString(7,fnBracketL,gg::IntToStr(decotype_buff),fnBracketR,"",""));
						}
						myself::ShowFHTML(talker,fhtml0);
					} else {
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
				case 53: {
					if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,15) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) ) {
						myself::FHTML_SetFileName(fhtml0,fnManageDeco);
						if( myself::Agit_GetDecoLevel(decotype_curtain) == 0 ) {
							myself::FHTML_SetStr(fhtml0,"7_" + "Depth",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"7_" + "Expire",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"7_" + "Reset","");
						} else {
							myself::FHTML_SetStr(fhtml0,"7_" + "Depth",gg::MakeFString(fstr_stage_lv,gg::IntToStr(( myself::Agit_GetDecoLevel(decotype_curtain) * 1 )),"","","",""));
							myself::FHTML_SetStr(fhtml0,"7_" + "Cost","(" + gg::MakeFString(6,gg::IntToStr(myself::Agit_GetDecoFee(decotype_curtain,myself::Agit_GetDecoLevel(decotype_curtain))),gg::IntToStr(myself::Agit_GetDecoDay(decotype_curtain,myself::Agit_GetDecoLevel(decotype_curtain))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"7_" + "Expire",gg::MakeFString(5,gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_curtain),1)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_curtain),2)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_curtain),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"7_" + "Reset",gg::MakeFString(7,fnBracketL,gg::IntToStr(decotype_curtain),fnBracketR,"",""));
						}
						if( myself::Agit_GetDecoLevel(decotype_platform) == 0 ) {
							myself::FHTML_SetStr(fhtml0,"11_" + "Depth",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"11_" + "Expire",gg::MakeFString(4,"","","","",""));
							myself::FHTML_SetStr(fhtml0,"11_" + "Reset","");
						} else {
							myself::FHTML_SetStr(fhtml0,"11_" + "Depth",gg::MakeFString(fstr_stage_lv,gg::IntToStr(( myself::Agit_GetDecoLevel(decotype_platform) * 1 )),"","","",""));
							myself::FHTML_SetStr(fhtml0,"11_" + "Cost","(" + gg::MakeFString(6,gg::IntToStr(myself::Agit_GetDecoFee(decotype_platform,myself::Agit_GetDecoLevel(decotype_platform))),gg::IntToStr(myself::Agit_GetDecoDay(decotype_platform,myself::Agit_GetDecoLevel(decotype_platform))),"","","") + ")");
							myself::FHTML_SetStr(fhtml0,"11_" + "Expire",gg::MakeFString(5,gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_platform),1)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_platform),2)),gg::IntToStr(gg::GetDateTime(myself::Agit_GetDecoExpire(decotype_platform),3)),"",""));
							myself::FHTML_SetStr(fhtml0,"11_" + "Reset",gg::MakeFString(7,fnBracketL,gg::IntToStr(decotype_platform),fnBracketR,"",""));
						}
						myself::ShowFHTML(talker,fhtml0);
					} else {
						myself::ShowPage(talker,fnNoAuthority);
					}
					break;
				}
			}
		} else if( ask == -203 ) {
			if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,11) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) ) {
				switch(reply) {
					case 1: {
						myself::Castle_GateOpenClose(0);
						myself::ShowPage(talker,fnAfterDoorOpen);
						break;
					}
					case 2: {
						myself::Castle_GateOpenClose(1);
						myself::ShowPage(talker,fnAfterDoorClose);
						break;
					}
				}
			} else {
				myself::ShowPage(talker,fnNoAuthority);
			}
		} else if( ask == -219 ) {
			if( reply == 1 ) {
				if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,14) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) ) {
					myself::Castle_BanishOthers();
					myself::ShowPage(talker,fnAfterBanish);
				} else {
					myself::ShowPage(talker,fnNoAuthority);
				}
			}
		} else if( ask == -270 ) {
			if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,15) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) ) {
				i0 = gg::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,"agitdeco__" + gg::IntToStr(i0) + ".htm");
					myself::FHTML_SetStr(fhtml0,"AgitDecoCost",gg::MakeFString(6,gg::IntToStr(myself::Agit_GetDecoFee(i0,i1)),gg::IntToStr(myself::Agit_GetDecoDay(i0,i1)),"","",""));
					myself::FHTML_SetInt(fhtml0,"AgitDecoSubmit",reply);
				}
				if( i0 == decotype_hpregen ) {
					myself::FHTML_SetStr(fhtml0,"AgitDecoEffect",gg::MakeFString(fstr_percent,gg::IntToStr(( i1 * 20 )),"","","",""));
				} else if( i0 == decotype_mpregen ) {
					myself::FHTML_SetStr(fhtml0,"AgitDecoEffect",gg::MakeFString(fstr_percent,gg::IntToStr(( i1 * 5 )),"","","",""));
				} else if( i0 == decotype_xprestore ) {
					myself::FHTML_SetStr(fhtml0,"AgitDecoEffect",gg::MakeFString(fstr_percent,gg::IntToStr(( i1 * 5 )),"","","",""));
				} else {
					myself::FHTML_SetStr(fhtml0,"AgitDecoEffect",gg::MakeFString(fstr_stage_lv,gg::IntToStr(i1),"","","",""));
				}
				myself::ShowFHTML(talker,fhtml0);
			} else {
				myself::ShowPage(talker,fnNoAuthority);
			}
		} else if( ask == -271 ) {
			if( myself::IsMyLord(talker) || ( myself::HavePledgePower(talker,15) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) ) {
				i0 = gg::FloatToInt(( reply / 1000 ));
				i1 = ( reply - ( i0 * 1000 ) );
				if( i1 == 0 ) {
					myself::Agit_ResetDeco(talker,i0);
				} else if( gg::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 = ( 286130177 + ( ( i1 * 256 ) * 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(286195713) < myself.sm.mp && myself::Skill_GetConsumeHP(286195713) < myself.sm.hp && myself::Skill_InReuseDelay(286195713) == 0 ) {
							myself::AddUseSkillDesire(myself.sm,286195713,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::IsMyLord(talker) || ( myself::HavePledgePower(talker,12) && myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) ) {
				if( myself::Skill_GetConsumeMP(reply) < myself.sm.mp ) {
					if( myself::Skill_GetConsumeHP(reply) < myself.sm.hp && myself::Skill_InReuseDelay(reply) == 0 ) {
						switch(reply) {
							case 284557313: {
							}
							case 284557314: {
							}
							case 284622849: {
							}
							case 284622850: {
							}
							case 284622851: {
							}
							case 284688385: {
							}
							case 284688386: {
							}
							case 284688387: {
							}
							case 284753921: {
							}
							case 284753922: {
							}
							case 284753923: {
							}
							case 284819457: {
							}
							case 284819458: {
							}
							case 284819459: {
							}
							case 284819460: {
							}
							case 284884993: {
							}
							case 284884994: {
							}
							case 284884995: {
							}
							case 284884996: {
							}
							case 284884997: {
							}
							case 284884998: {
							}
							case 284950529: {
							}
							case 284950530: {
							}
							case 284950531: {
							}
							case 284950532: {
							}
							case 284950533: {
							}
							case 284950534: {
							}
							case 285016065: {
							}
							case 285016066: {
							}
							case 285081601: {
							}
							case 285081602: {
							}
							case 285081603: {
							}
							case 285081604: {
							}
							case 285147137: {
							}
							case 285147138: {
							}
							case 285147139: {
							}
							case 285147140: {
							}
							case 285147141: {
							}
							case 285147142: {
							}
							case 285212673: {
							}
							case 285212674: {
							}
							case 285278209: {
							}
							case 285278210: {
							}
							case 285278211: {
							}
							case 285278212: {
							}
							case 285278213: {
							}
							case 285278214: {
							}
							case 285343745: {
							}
							case 285343746: {
							}
							case 285343747: {
							}
							case 285343748: {
							}
							case 285409281: {
							}
							case 285409282: {
							}
							case 285409283: {
							}
							case 285474817: {
							}
							case 285474818: {
							}
							case 285474819: {
							}
							case 285540353: {
							}
							case 285540354: {
							}
							case 285605889: {
							}
							case 285605890: {
							}
							case 285605891: {
							}
							case 285671425: {
							}
							case 285671426: {
							}
							case 285671427: {
							}
							case 285736961: {
							}
							case 285736962: {
							}
							case 285736963: {
								myself::CastBuffForAgitManager(talker,reply);
								myself::FHTML_SetFileName(fhtml0,fnAfterBuff);
								break;
							}
						}
					} else {
						myself::FHTML_SetFileName(fhtml0,fnNeedCoolTime);
					}
				} else {
					myself::FHTML_SetFileName(fhtml0,fnNotEnoughMP);
				}
			}
			myself::FHTML_SetInt(fhtml0,"MPLeft",gg::FloatToInt(myself.sm.mp));
			myself::ShowFHTML(talker,fhtml0);
		}
	}

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

	EventHandler AUCTION_AGIT_GET_COST_INFO_RETURNED(talker,reply,s0,fhtml0) {
		if( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id != 0 ) {
			myself::FHTML_SetFileName(fhtml0,fnWarehouse);
			myself::FHTML_SetInt(fhtml0,"agit_lease",reply);
			myself::FHTML_SetStr(fhtml0,"pay_time",s0);
			myself::ShowFHTML(talker,fhtml0);
		}
	}

}
