@LabelIndex 398122
@StringIndex 59547
class 0 pa73_intro_npc : ai_pa73_intro {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,144) == 0 && myself::GetOneTimeQuestFlag(talker,144) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Pailaka - Injured Dragon");
			}
			if( gg::HaveMemo(talker,144) == 0 && myself::GetOneTimeQuestFlag(talker,144) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Pailaka - Injured Dragon (done)");
			}
			if( gg::HaveMemo(talker,144) == 1 && gg::GetMemoState(talker,144) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Pailaka - Injured Dragon (in progress)");
			}
			if( gg::HaveMemo(talker,144) == 1 && gg::GetMemoState(talker,144) > 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Pailaka - Injured Dragon (in progress)");
			}
			if( _choiceN > 1 ) {
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 ) {
			switch(_code) {
				case 0: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,144) == 0 && myself::GetOneTimeQuestFlag(talker,144) == 0 ) ) {
						myself::SetCurrentQuestID(144);
						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::ShowQuestPage(talker,"pa73_intro_npc_q0144_01.htm",144);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,144) == 0 && myself::GetOneTimeQuestFlag(talker,144) == 1 ) ) {
						myself::SetCurrentQuestID(144);
						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,"pa73_intro_npc_q0144_02.htm",144);
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,144) == 1 && gg::GetMemoState(talker,144) == 1 ) ) {
						myself::SetCurrentQuestID(144);
						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,"pa73_intro_npc_q0144_08.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,144) == 1 && gg::GetMemoState(talker,144) > 1 ) ) {
						myself::SetCurrentQuestID(144);
						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,"pa73_intro_npc_q0144_10.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 144 ) {
			myself::SetCurrentQuestID(144);
			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.quest_last_reward_time = myself::GetCurrentTick();
				if( gg::HaveMemo(talker,144) == 0 && myself::GetOneTimeQuestFlag(talker,144) == 0 && talker.level >= 73 && talker.level <= 77 ) {
					myself::SetMemoState(talker,144,1);
					myself::ShowQuestPage(talker,"pa73_intro_npc_q0144_07.htm",144);
					myself::SetFlagJournal(talker,144,1);
					myself::ShowQuestMark(talker,144);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
					gg::AddLog(1,talker,quest_id);
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,fhtml0,reply,talker) {
		if( ask == 144 ) {
			myself::SetCurrentQuestID(144);
			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 == 144 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,144) == 0 && myself::GetOneTimeQuestFlag(talker,144) == 0 ) {
					if( talker.level < 73 ) {
						myself::ShowQuestPage(talker,"pa73_intro_npc_q0144_03.htm",144);
					} else if( talker.level > 77 ) {
						myself::ShowQuestPage(talker,"pa73_intro_npc_q0144_04z.htm",144);
					} else {
						myself::ShowQuestPage(talker,"pa73_intro_npc_q0144_04.htm",144);
					}
				}
			}
			if( reply == 2 ) {
				if( gg::HaveMemo(talker,144) == 0 && myself::GetOneTimeQuestFlag(talker,144) == 0 && talker.level >= 73 ) {
					myself::FHTML_SetFileName(fhtml0,"pa73_intro_npc_q0144_06.htm");
					myself::FHTML_SetInt(fhtml0,"quest_id",144);
					myself::ShowQuestFHTML(talker,fhtml0,144);
				}
			}
		}
		super;
	}

}
