@LabelIndex 398265
@StringIndex 59570
class 0 pa61_start_npc : ai_pa61_start {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,129) == 1 && gg::GetMemoState(talker,129) == 2 && myself::GetOneTimeQuestFlag(talker,129) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Pailaka - Devil's Legacy (in progress)");
			}
			if( gg::HaveMemo(talker,129) == 1 && gg::GetMemoState(talker,129) > 2 && myself::GetOneTimeQuestFlag(talker,129) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Pailaka - Devil's Legacy (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,129) == 1 && gg::GetMemoState(talker,129) == 2 && myself::GetOneTimeQuestFlag(talker,129) == 0 ) ) {
						myself::SetCurrentQuestID(129);
						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,"pa61_start_npc_q0129_01.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,129) == 1 && gg::GetMemoState(talker,129) > 2 && myself::GetOneTimeQuestFlag(talker,129) == 0 ) ) {
						myself::SetCurrentQuestID(129);
						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,"pa61_start_npc_q0129_04.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker) {
		if( ask == 129 ) {
			myself::SetCurrentQuestID(129);
			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 == 129 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,129) == 1 && gg::GetMemoState(talker,129) == 2 && myself::GetOneTimeQuestFlag(talker,129) == 0 ) {
					myself::GiveItem1(talker,13042,1);
					myself::SetMemoState(talker,129,3);
					myself::ShowPage(talker,"pa61_start_npc_q0129_03.htm");
					myself::SetFlagJournal(talker,129,3);
					myself::ShowQuestMark(talker,129);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
		}
		super;
	}

}
