@LabelIndex 398632
@StringIndex 59629
class 0 pa73_reward_npc : ai_pa73_reward {
handler:
	EventHandler TALKED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( myself::GetOneTimeQuestFlag(talker,144) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Pailaka - Injured Dragon (in progress)");
			}
			if( _choiceN > 1 ) {
				myself::ShowChoicePage(talker,0);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 ) {
			switch(_code) {
				case 0: {
					if( _from_choice == 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::ShowPage(talker,"pa73_reward_npc_q0144_02.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,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) == 1 && gg::GetMemoState(talker,144) == 4 && myself::GetOneTimeQuestFlag(talker,144) == 0 ) {
					myself::GiveItem1(talker,13296,1);
					myself::GiveItem1(talker,736,1);
					myself::IncrementParam(talker,0,28000000);
					myself::IncrementParam(talker,1,2850000);
					myself::AddUseSkillDesire(talker,378404866,1,0,9000000);
					myself::DeleteItem1(talker,13052,gg::OwnItemCount(talker,13052));
					myself::DeleteItem1(talker,13053,gg::OwnItemCount(talker,13053));
					myself::DeleteItem1(talker,13054,gg::OwnItemCount(talker,13054));
					myself::DeleteItem1(talker,13055,gg::OwnItemCount(talker,13055));
					myself::DeleteItem1(talker,13056,gg::OwnItemCount(talker,13056));
					myself::DeleteItem1(talker,13057,gg::OwnItemCount(talker,13057));
					myself::DeleteItem1(talker,13058,gg::OwnItemCount(talker,13058));
					myself::DeleteItem1(talker,13033,gg::OwnItemCount(talker,13033));
					myself::DeleteItem1(talker,13032,gg::OwnItemCount(talker,13032));
					myself::ShowPage(talker,"pa73_reward_npc_q0144_02z.htm");
					myself::SetOneTimeQuestFlag(talker,144,1);
					myself::RemoveMemo(talker,144);
					myself::SoundEffect(talker,"ItemSound.quest_finish");
					gg::AddLog(2,talker,144);
					myself::InstantZone_Finish(5);
				} else {
					myself::ShowPage(talker,"noquest.htm");
				}
			}
			if( reply == 2 && myself::GetOneTimeQuestFlag(talker,144) == 1 ) {
				myself::InstantZone_Leave(talker);
				myself::ShowPage(talker,"pa73_reward_npc_q0144_03.htm");
			}
		}
		super;
	}

}
