@LabelIndex 728
@StringIndex 94
class 0 wyvern_keeper : citizen {
parameter:
	string	fnMyLord = "wkeeper001.htm";
	string	fnSSQDusk = "wkeeper001_dusk.htm";
	string	fnNotMyLord = "wkeeper002.htm";
	string	fnStriderHelp = "wkeeper003.htm";
	string	fnAfterRide = "wkeeper004.htm";
	string	fnStriderNotReady = "wkeeper005.htm";
	string	fnNotEnoughFee = "wkeeper006.htm";
	int	ride_wyvern_level = 55;
	int	ride_wyvern_fee = 25;
	int	SsqEffect = 1;

handler:
	EventHandler TALKED(talker,fhtml0,c0) {
		if( myself::IsMyLord(talker) ) {
			if( SsqEffect == 1 ) {
				if( myself::GetSSQSealOwner(3) == 1 && myself::GetSSQStatus() == 3 ) {
					myself::FHTML_SetFileName(fhtml0,fnSSQDusk);
				} else {
					myself::FHTML_SetFileName(fhtml0,fnMyLord);
					myself::FHTML_SetStr(fhtml0,"feud_name",gg::MakeFString(( 1001000 + myself.sm.residence_id ),"","","","",""));
					myself::FHTML_SetInt(fhtml0,"ride_wyvern_level",ride_wyvern_level);
					myself::FHTML_SetInt(fhtml0,"ride_wyvern_fee",ride_wyvern_fee);
				}
			} else {
				myself::FHTML_SetFileName(fhtml0,fnMyLord);
				myself::FHTML_SetStr(fhtml0,"feud_name",gg::MakeFString(( 1001000 + myself.sm.residence_id ),"","","","",""));
				myself::FHTML_SetInt(fhtml0,"ride_wyvern_level",ride_wyvern_level);
				myself::FHTML_SetInt(fhtml0,"ride_wyvern_fee",ride_wyvern_fee);
			}
		} else {
			myself::FHTML_SetFileName(fhtml0,fnNotMyLord);
		}
		myself::ShowFHTML(talker,fhtml0);
	}

	EventHandler MENU_SELECTED(talker,ask,reply,fhtml0) {
		if( ask == 0 ) {
			if( myself::IsMyLord(talker) ) {
				if( SsqEffect == 1 ) {
					if( myself::GetSSQSealOwner(3) == 1 && myself::GetSSQStatus() == 3 ) {
						myself::FHTML_SetFileName(fhtml0,fnSSQDusk);
					} else {
						myself::FHTML_SetFileName(fhtml0,fnMyLord);
						myself::FHTML_SetStr(fhtml0,"feud_name",gg::MakeFString(( 1001000 + myself.sm.residence_id ),"","","","",""));
						myself::FHTML_SetInt(fhtml0,"ride_wyvern_level",ride_wyvern_level);
						myself::FHTML_SetInt(fhtml0,"ride_wyvern_fee",ride_wyvern_fee);
					}
				} else {
					myself::FHTML_SetFileName(fhtml0,fnMyLord);
					myself::FHTML_SetStr(fhtml0,"feud_name",gg::MakeFString(( 1001000 + myself.sm.residence_id ),"","","","",""));
					myself::FHTML_SetInt(fhtml0,"ride_wyvern_level",ride_wyvern_level);
					myself::FHTML_SetInt(fhtml0,"ride_wyvern_fee",ride_wyvern_fee);
				}
			} else {
				myself::FHTML_SetFileName(fhtml0,fnNotMyLord);
			}
			myself::ShowFHTML(talker,fhtml0);
		}
		if( ask == -17 ) {
			if( reply == 1 ) {
				if( SsqEffect == 0 ) {
					myself::FHTML_SetFileName(fhtml0,"hephaeston003.htm");
				} else {
					myself::FHTML_SetFileName(fhtml0,fnStriderHelp);
				}
				myself::FHTML_SetInt(fhtml0,"ride_wyvern_level",ride_wyvern_level);
				myself::FHTML_SetInt(fhtml0,"ride_wyvern_fee",ride_wyvern_fee);
			} else if( reply == 2 ) {
				if( myself::GetSSQSealOwner(3) == 1 && myself::GetSSQStatus() == 3 ) {
					myself::FHTML_SetFileName(fhtml0,fnSSQDusk);
				} else if( talker.yongma_type == 1 && talker.strider_level >= ride_wyvern_level ) {
					if( myself::IsMyLord(talker) && gg::OwnItemCount(talker,1460) >= ride_wyvern_fee ) {
						myself::DeleteItem1(talker,1460,ride_wyvern_fee);
						myself::RideWyvern(talker,1012621);
						myself::FHTML_SetFileName(fhtml0,fnAfterRide);
					} else {
						myself::FHTML_SetFileName(fhtml0,fnNotEnoughFee);
						myself::FHTML_SetInt(fhtml0,"ride_wyvern_fee",ride_wyvern_fee);
					}
				} else {
					myself::FHTML_SetFileName(fhtml0,fnStriderNotReady);
					myself::FHTML_SetInt(fhtml0,"ride_wyvern_level",ride_wyvern_level);
					myself::FHTML_SetInt(fhtml0,"ride_wyvern_fee",ride_wyvern_fee);
				}
			}
			myself::ShowFHTML(talker,fhtml0);
		}
	}

}
