@LabelIndex 398545
@StringIndex 59615
class 0 pa36_reward_npc : ai_pa36_reward {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,128) == 1 && gg::GetMemoState(talker,128) == 9 && myself::GetOneTimeQuestFlag(talker,128) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Pailaka - Song of Ice and Fire (in progress)");
			}
			if( myself::GetOneTimeQuestFlag(talker,128) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Pailaka - Song of Ice and Fire (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,128) == 1 && gg::GetMemoState(talker,128) == 9 && myself::GetOneTimeQuestFlag(talker,128) == 0 ) ) {
						myself::SetCurrentQuestID(128);
						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,"pa36_reward_npc_q0128_01.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || myself::GetOneTimeQuestFlag(talker,128) == 1 ) {
						myself::SetCurrentQuestID(128);
						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,"pa36_reward_npc_q0128_02.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker) {
		if( ask == 128 ) {
			myself::SetCurrentQuestID(128);
			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 == 128 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,128) == 1 && gg::GetMemoState(talker,128) == 9 && myself::GetOneTimeQuestFlag(talker,128) == 0 ) {
					myself::GiveItem1(talker,13293,1);
					myself::GiveItem1(talker,13294,1);
					myself::GiveItem1(talker,736,1);
					myself::IncrementParam(talker,0,810000);
					myself::IncrementParam(talker,1,50000);
					myself::AddUseSkillDesire(talker,378404865,1,0,9000000);
					myself::DeleteItem1(talker,13034,gg::OwnItemCount(talker,13034));
					myself::DeleteItem1(talker,13035,gg::OwnItemCount(talker,13035));
					myself::DeleteItem1(talker,13036,gg::OwnItemCount(talker,13036));
					myself::DeleteItem1(talker,13037,gg::OwnItemCount(talker,13037));
					myself::DeleteItem1(talker,13038,gg::OwnItemCount(talker,13038));
					myself::DeleteItem1(talker,13039,gg::OwnItemCount(talker,13039));
					myself::DeleteItem1(talker,13040,gg::OwnItemCount(talker,13040));
					myself::DeleteItem1(talker,13041,gg::OwnItemCount(talker,13041));
					myself::DeleteItem1(talker,13130,gg::OwnItemCount(talker,13130));
					myself::DeleteItem1(talker,13131,gg::OwnItemCount(talker,13131));
					myself::DeleteItem1(talker,13132,gg::OwnItemCount(talker,13132));
					myself::DeleteItem1(talker,13133,gg::OwnItemCount(talker,13133));
					myself::DeleteItem1(talker,13134,gg::OwnItemCount(talker,13134));
					myself::DeleteItem1(talker,13135,gg::OwnItemCount(talker,13135));
					myself::DeleteItem1(talker,13136,gg::OwnItemCount(talker,13136));
					myself::DeleteItem1(talker,13033,gg::OwnItemCount(talker,13033));
					myself::DeleteItem1(talker,13032,gg::OwnItemCount(talker,13032));
					myself::ShowPage(talker,"pa36_reward_npc_q0128_02z.htm");
					gg::AddLog(2,talker,128);
					myself::SetOneTimeQuestFlag(talker,128,1);
					myself::InstantZone_Finish(5);
					myself::RemoveMemo(talker,128);
					myself::SoundEffect(talker,"ItemSound.quest_finish");
				}
			}
			if( reply == 2 && myself::GetOneTimeQuestFlag(talker,128) == 1 ) {
				myself::InstantZone_Leave(talker);
				myself::ShowPage(talker,"pa36_reward_npc_q0128_03.htm");
			}
		}
		super;
	}

}
