@LabelIndex 7896
@StringIndex 1520
class 0 castle_merchant : citizen {
parameter:
	string	fnHi = "castle_merchant001.htm";
	string	fnMyLord = "castle_merchant002.htm";
	string	fnSellCrop = "castle_merchant003.htm";
	string	fnAfterSellCrop = "castle_merchant004.htm";
	string	fnHaveNoCrop = "castle_merchant005.htm";
	string	ShopName = "";
	int	manor_id = 1;

property:
	BuySellList SellList0 = {{"reaping_machine";0}};

handler:
	EventHandler TALKED(talker) {
		if( myself::IsMyLord(talker) ) {
			myself::ShowPage(talker,fnMyLord);
		} else {
			myself::ShowPage(talker,fnHi);
		}
	}

	EventHandler MENU_SELECTED(talker,ask,reply,state,fhtml0,i0,i1,i2) {
		if( ask == -231 ) {
			if( reply == 1 ) {
				myself::ShowSellSeedList(talker,manor_id);
			} else if( reply == 2 ) {
				myself::ShowProcureCropList(talker,manor_id);
			} else if( reply == 3 ) {
				myself::FHTML_SetFileName(fhtml0,"seed_client_info" + state + ".htm");
				for(i2 = 1; i2 <= 25; i2++) {
					myself::FHTML_SetInt(fhtml0,"CurrentSeedCount" + i2,myself::GetCurrentSeedSellCountSet(state,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentSeedPrice" + i2,myself::GetCurrentSeedPrice(state,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentSeedRemain" + i2,myself::GetCurrentSeedRemainCount(state,i2));
				}
				myself::ShowFHTML(talker,fhtml0);
			} else if( reply == 7 ) {
				myself::FHTML_SetFileName(fhtml0,"seed_client_info_improve" + state + ".htm");
				for(i2 = 1; i2 <= 25; i2++) {
					myself::FHTML_SetInt(fhtml0,"CurrentSeedCount" + i2,myself::GetCurrentSeedSellCountSet(state,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentSeedPrice" + i2,myself::GetCurrentSeedPrice(state,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentSeedRemain" + i2,myself::GetCurrentSeedRemainCount(state,i2));
				}
				myself::ShowFHTML(talker,fhtml0);
			} else if( reply == 4 ) {
				myself::FHTML_SetFileName(fhtml0,"crop_client_info" + manor_id + ".htm");
				for(i2 = 1; i2 <= 25; i2++) {
					myself::FHTML_SetInt(fhtml0,"RemainCropCount" + i2,myself::GetRemainProcureCropCount(manor_id,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentCropProcureCount" + i2,myself::GetProcurementCount(manor_id,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentCropPrice" + i2,myself::GetProcurementRate(manor_id,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentProcureType" + i2,myself::GetProcurementType(manor_id,i2));
				}
				myself::ShowFHTML(talker,fhtml0);
			} else if( reply == 5 ) {
				myself::Sell(talker,SellList0,"",fnHi,"","");
			} else if( reply == 6 ) {
				myself::FHTML_SetFileName(fhtml0,"crop_client_info" + state + ".htm");
				for(i2 = 1; i2 <= 25; i2++) {
					myself::FHTML_SetInt(fhtml0,"RemainCropCount" + i2,myself::GetRemainProcureCropCount(state,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentCropProcureCount" + i2,myself::GetProcurementCount(state,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentCropPrice" + i2,myself::GetProcurementRate(state,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentProcureType" + i2,myself::GetProcurementType(state,i2));
				}
				myself::ShowFHTML(talker,fhtml0);
			} else if( reply == 8 ) {
				myself::FHTML_SetFileName(fhtml0,"imcrop_client_info" + state + ".htm");
				for(i2 = 1; i2 <= 25; i2++) {
					myself::FHTML_SetInt(fhtml0,"RemainCropCount" + i2,myself::GetRemainProcureCropCount(state,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentCropProcureCount" + i2,myself::GetProcurementCount(state,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentCropPrice" + i2,myself::GetProcurementRate(state,i2));
					myself::FHTML_SetInt(fhtml0,"CurrentProcureType" + i2,myself::GetProcurementType(state,i2));
				}
				myself::ShowFHTML(talker,fhtml0);
			} else if( reply == 9 ) {
				myself::FHTML_SetFileName(fhtml0,"next_crop_client_info" + state + ".htm");
				for(i2 = 1; i2 <= 25; i2++) {
					myself::FHTML_SetInt(fhtml0,"NextProcureCount" + i2,myself::GetNextProcurementCount(state,i2));
					myself::FHTML_SetInt(fhtml0,"NextProcurePrice" + i2,myself::GetNextProcurementRate(state,i2));
					myself::FHTML_SetInt(fhtml0,"NextProcureType" + i2,myself::GetNextProcurementType(state,i2));
				}
				myself::ShowFHTML(talker,fhtml0);
			} else if( reply == 10 ) {
				myself::FHTML_SetFileName(fhtml0,"next_imcrop_client_info" + state + ".htm");
				for(i2 = 1; i2 <= 25; i2++) {
					myself::FHTML_SetInt(fhtml0,"NextProcureCount" + i2,myself::GetNextProcurementCount(state,i2));
					myself::FHTML_SetInt(fhtml0,"NextProcurePrice" + i2,myself::GetNextProcurementRate(state,i2));
					myself::FHTML_SetInt(fhtml0,"NextProcureType" + i2,myself::GetNextProcurementType(state,i2));
				}
				myself::ShowFHTML(talker,fhtml0);
			} else if( reply == 11 ) {
				if( myself::IsManorSettingTime() == 1 ) {
					myself::FHTML_SetFileName(fhtml0,"manor_timeinfo_client.htm");
				} else if( myself::IsManorSettingTime() == 0 ) {
					myself::FHTML_SetFileName(fhtml0,"manor_crop_client_info_next.htm");
				}
				myself::ShowFHTML(talker,fhtml0);
			} else if( reply == 12 ) {
				myself::FHTML_SetFileName(fhtml0,"next_seed_client_info" + state + ".htm");
				for(i2 = 1; i2 <= 25; i2++) {
					myself::FHTML_SetInt(fhtml0,"NextSeedCount" + i2,myself::GetNextSeedSellCountSet(state,i2));
					myself::FHTML_SetInt(fhtml0,"NextSeedPrice" + i2,myself::GetNextSeedPrice(state,i2));
				}
				myself::ShowFHTML(talker,fhtml0);
			} else if( reply == 13 ) {
				myself::FHTML_SetFileName(fhtml0,"next_seed_client_info_improve" + state + ".htm");
				for(i2 = 1; i2 <= 25; i2++) {
					myself::FHTML_SetInt(fhtml0,"NextSeedCount" + i2,myself::GetNextSeedSellCountSet(state,i2));
					myself::FHTML_SetInt(fhtml0,"NextSeedPrice" + i2,myself::GetNextSeedPrice(state,i2));
				}
				myself::ShowFHTML(talker,fhtml0);
			} else if( reply == 14 ) {
				if( myself::IsManorSettingTime() == 1 ) {
					myself::FHTML_SetFileName(fhtml0,"manor_timeinfo_client.htm");
				} else if( myself::IsManorSettingTime() == 0 ) {
					myself::FHTML_SetFileName(fhtml0,"manor_seed_client_info_next.htm");
				}
				myself::ShowFHTML(talker,fhtml0);
			}
		}
		super;
	}

	EventHandler MANOR_MENU_SELECTED(talker,ask,state,time) {
		if( ask == 1 ) {
			myself::ShowSellSeedList(talker,manor_id);
		} else if( ask == 2 ) {
			myself::ShowProcureCropList(talker,manor_id);
		} else if( ask == 3 ) {
			if( state == -1 ) {
				myself::ShowSeedInfo(talker,manor_id,time);
			} else {
				myself::ShowSeedInfo(talker,state,time);
			}
		} else if( ask == 4 ) {
			if( state == -1 ) {
				myself::ShowCropInfo(talker,manor_id,time);
			} else {
				myself::ShowCropInfo(talker,state,time);
			}
		} else if( ask == 5 ) {
			myself::ShowManorDefaultInfo(talker);
		} else if( ask == 6 ) {
			myself::Sell(talker,SellList0,"",fnHi,"","");
		} else if( ask == 9 ) {
			myself::ShowProcureCropDetail(talker,state);
		}
	}

}
