@LabelIndex 71580
@StringIndex 11529
class 0 airship_npc : citizen {
parameter:
	int	airport_ID = 0;
	int	platform_ID = 0;
	int	airport_Type = 0;
	int	AirshipConfirm = 13559;
	int	EnergyStone = 13277;
	string	firstHTML_free1 = "air_manager_aden1001.htm";
	string	firstHTML_free2 = "air_manager_aden1001.htm";
	string	firstHTML_pledge = "air_manager_kserth1001.htm";

handler:
	EventHandler TALKED(talker,i0,i1,i2,i3,i4) {
		if( airport_ID == 1 ) {
			myself::ShowPage(talker,firstHTML_free1);
		} else if( airport_ID == 3 ) {
			myself::ShowPage(talker,firstHTML_free2);
		} else {
			myself::ShowPage(talker,firstHTML_pledge);
		}
	}

	EventHandler CREATED() {
		if( airport_ID < 100 ) {
			myself.i_ai1 = myself::RegisterAsAirportManager(airport_ID,platform_ID,1);
		} else {
			myself.i_ai1 = myself::RegisterAsAirportManager(airport_ID,platform_ID,0);
		}
	}

	EventHandler MENU_SELECTED(talker,ask,reply,i0,i1,i2,i3,i4,c0,pledge0) {
		if( ask == -1724 ) {
			pledge0 = myself::GetPledge(talker);
			if( reply == 1 ) {
				if( talker.transformID != 8 && talker.transformID != 9 && talker.transformID != 260 ) {
					if( talker.yongma_type == 0 ) {
						myself::GetOnAirShip(talker);
					} else {
						myself::ShowSystemMessage(talker,2258);
					}
				} else {
					myself::ShowSystemMessage(talker,2727);
				}
			} else if( reply == 2 ) {
				if( gg::IsNull(pledge0) == 0 ) {
					if( myself::HavePledgePower(talker,10) ) {
						if( airport_ID >= 100 ) {
							if( myself.i_ai1 > -1 ) {
								if( myself::IsOccupiedPlatform(myself.i_ai1) == 0 ) {
									if( gg::OwnItemCount(talker,EnergyStone) >= 5 ) {
										myself::SummonAirShip(talker,airport_ID,platform_ID);
									} else {
										myself::ShowSystemMessageStr(talker,gg::MakeFString(1800250,"","","","",""));
									}
								} else {
									myself::ShowSystemMessageStr(talker,gg::MakeFString(1800224,"","","","",""));
								}
							}
						}
					} else {
						myself::ShowSystemMessage(talker,794);
					}
				} else {
					myself::ShowSystemMessageStr(talker,gg::MakeFString(1800228,"","","","",""));
				}
			} else if( reply == 3 ) {
				if( gg::IsNull(pledge0) == 0 ) {
					if( pledge0.airship_count > 0 ) {
						myself::ShowSystemMessageStr(talker,gg::MakeFString(1800278,"","","","",""));
					} else if( gg::OwnItemCount(talker,AirshipConfirm) > 0 ) {
						myself::BuyAirShip(talker,2);
					} else {
						myself::ShowSystemMessageStr(talker,gg::MakeFString(1800277,"","","","",""));
					}
				} else {
					myself::ShowSystemMessageStr(talker,gg::MakeFString(1800228,"","","","",""));
				}
			} else if( reply == 4 ) {
				if( talker.transformID != 8 && talker.transformID != 9 && talker.transformID != 260 ) {
					if( talker.yongma_type == 0 ) {
						myself::GetOnAirShip(talker);
					} else {
						myself::ShowSystemMessage(talker,2258);
					}
				} else {
					myself::ShowSystemMessage(talker,2727);
				}
			}
		}
	}

	EventHandler ON_AIRSHIP_EVENT(state,i0,i1,i2,i3,i4,c0) {
		if( state == 0 ) {
			if( airport_ID == 1 ) {
				myself::Shout(gg::MakeFString(1800222,"","","","",""));
			} else if( airport_ID == 3 ) {
				myself::Shout(gg::MakeFString(1800220,"","","","",""));
			}
			myself.i_ai0 = 1;
		} else if( state == 1 ) {
			if( airport_ID == 1 ) {
				myself::Shout(gg::MakeFString(1800223,"","","","",""));
			} else if( airport_ID == 3 ) {
				myself::Shout(gg::MakeFString(1800221,"","","","",""));
			}
			myself.i_ai0 = 0;
		} else if( state == 2 ) {
			myself.i_ai0 = 1;
			myself::Shout(gg::MakeFString(1800219,"","","","",""));
		}
	}

}
