@LabelIndex 384427
@StringIndex 56704
class 0 railman_abu : citizen {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( talker.level >= 39 && gg::HaveMemo(talker,117) == 0 && myself::GetOneTimeQuestFlag(talker,117) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"The Ocean of Distant Stars");
			}
			if( talker.level < 39 && gg::HaveMemo(talker,117) == 0 && myself::GetOneTimeQuestFlag(talker,117) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"The Ocean of Distant Stars");
			}
			if( gg::HaveMemo(talker,117) == 0 && myself::GetOneTimeQuestFlag(talker,117) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"The Ocean of Distant Stars (Done)");
			}
			if( gg::HaveMemo(talker,117) == 1 && myself::GetOneTimeQuestFlag(talker,117) == 0 && gg::GetMemoState(talker,117) == ( ( 1 * 10 ) + 1 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"The Ocean of Distant Stars (In Progress)");
			}
			if( gg::HaveMemo(talker,117) == 1 && gg::GetMemoState(talker,117) == ( ( 3 * 10 ) + 1 ) && myself::GetOneTimeQuestFlag(talker,117) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"The Ocean of Distant Stars (In Progress)");
			}
			if( gg::HaveMemo(talker,117) == 1 && gg::GetMemoState(talker,117) == ( ( 4 * 10 ) + 1 ) && myself::GetOneTimeQuestFlag(talker,117) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"The Ocean of Distant Stars (In Progress)");
			}
			if( gg::HaveMemo(talker,117) == 1 && gg::GetMemoState(talker,117) == ( ( 5 * 10 ) + 1 ) && myself::GetOneTimeQuestFlag(talker,117) == 0 && gg::OwnItemCount(talker,8488) >= 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"The Ocean of Distant Stars (In Progress)");
			}
			if( gg::HaveMemo(talker,117) == 1 && gg::GetMemoState(talker,117) == ( ( 6 * 10 ) + 1 ) && myself::GetOneTimeQuestFlag(talker,117) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"The Ocean of Distant Stars (In Progress)");
			}
			if( _choiceN > 1 ) {
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 ) {
			switch(_code) {
				case 0: {
					if( _from_choice == 0 || ( talker.level >= 39 && gg::HaveMemo(talker,117) == 0 && myself::GetOneTimeQuestFlag(talker,117) == 0 ) ) {
						myself::SetCurrentQuestID(117);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						if( myself::GetMemoCount(talker) < 26 ) {
							myself::FHTML_SetFileName(fhtml0,"railman_abu_q0117_0101.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",117);
							myself::ShowQuestFHTML(talker,fhtml0,117);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( talker.level < 39 && gg::HaveMemo(talker,117) == 0 && myself::GetOneTimeQuestFlag(talker,117) == 0 ) ) {
						myself::SetCurrentQuestID(117);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::ShowQuestPage(talker,"railman_abu_q0117_0103.htm",117);
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,117) == 0 && myself::GetOneTimeQuestFlag(talker,117) == 1 ) ) {
						myself::SetCurrentQuestID(117);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::ShowPage(talker,"finishedquest.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,117) == 1 && myself::GetOneTimeQuestFlag(talker,117) == 0 && gg::GetMemoState(talker,117) == ( ( 1 * 10 ) + 1 ) ) ) {
						myself::SetCurrentQuestID(117);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::ShowPage(talker,"railman_abu_q0117_0105.htm");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,117) == 1 && gg::GetMemoState(talker,117) == ( ( 3 * 10 ) + 1 ) && myself::GetOneTimeQuestFlag(talker,117) == 0 ) ) {
						myself::SetCurrentQuestID(117);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::SetHTMLCookie(talker,117,3);
						myself::ShowPage(talker,"railman_abu_q0117_0301.htm");
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,117) == 1 && gg::GetMemoState(talker,117) == ( ( 4 * 10 ) + 1 ) && myself::GetOneTimeQuestFlag(talker,117) == 0 ) ) {
						myself::SetCurrentQuestID(117);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::ShowPage(talker,"railman_abu_q0117_0403.htm");
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,117) == 1 && gg::GetMemoState(talker,117) == ( ( 5 * 10 ) + 1 ) && myself::GetOneTimeQuestFlag(talker,117) == 0 && gg::OwnItemCount(talker,8488) >= 1 ) ) {
						myself::SetCurrentQuestID(117);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::SetHTMLCookie(talker,117,5);
						myself::ShowPage(talker,"railman_abu_q0117_0501.htm");
					}
					break;
				}
				case 7: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,117) == 1 && gg::GetMemoState(talker,117) == ( ( 6 * 10 ) + 1 ) && myself::GetOneTimeQuestFlag(talker,117) == 0 ) ) {
						myself::SetCurrentQuestID(117);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::ShowPage(talker,"railman_abu_q0117_0603.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 117 ) {
			myself::SetCurrentQuestID(117);
			if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
				myself::ShowSystemMessage(talker,1118);
				return;
			}
			if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 && talker.level >= 39 && myself::GetOneTimeQuestFlag(talker,117) == 0 ) {
				talker.quest_last_reward_time = myself::GetCurrentTick();
				myself::SetMemo(talker,117);
				myself::SetMemoState(talker,117,( ( 1 * 10 ) + 1 ));
				gg::AddLog(1,talker,117);
				myself::SetFlagJournal(talker,117,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowQuestPage(talker,"railman_abu_q0117_0104.htm",117);
				myself::ShowQuestMark(talker,117);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,quest_id,reply,talker) {
		if( ask == 117 ) {
			myself::SetCurrentQuestID(117);
			if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
				myself::ShowSystemMessage(talker,1118);
				return;
			}
		}
		if( ask == 117 ) {
			i0 = myself::GetHTMLCookie(talker,117,( 4 - 1 ));
			if( i0 != -1 ) {
				if( reply == 1 && gg::HaveMemo(talker,117) == 1 && myself::GetOneTimeQuestFlag(talker,117) == 0 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::ShowPage(talker,"railman_abu_q0117_0401.htm");
					myself::SetMemoState(talker,117,( ( 4 * 10 ) + 1 ));
					myself::SetFlagJournal(talker,117,4);
					myself::ShowQuestMark(talker,117);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
		}
		if( ask == 117 ) {
			myself::SetCurrentQuestID(117);
			if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
				myself::ShowSystemMessage(talker,1118);
				return;
			}
		}
		if( ask == 117 ) {
			i0 = myself::GetHTMLCookie(talker,117,( 6 - 1 ));
			if( i0 != -1 ) {
				if( reply == 1 && gg::HaveMemo(talker,117) == 1 && myself::GetOneTimeQuestFlag(talker,117) == 0 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::ShowPage(talker,"railman_abu_q0117_0601.htm");
					myself::SetMemoState(talker,117,( ( 6 * 10 ) + 1 ));
					myself::SetFlagJournal(talker,117,6);
					myself::ShowQuestMark(talker,117);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
		}
		super;
	}

}
