@LabelIndex 392546
@StringIndex 58332
class 0 master_ryndy : kamael_coach {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,66) == 0 && talker.level >= 39 && myself::GetOneTimeQuestFlag(talker,66) <= 0 && talker.occupation == 126 && gg::OwnItemCount(talker,9782) <= 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Certified Arbalester");
			}
			if( gg::HaveMemo(talker,66) == 0 && talker.level < 39 && talker.occupation == 126 && gg::OwnItemCount(talker,9782) <= 0 && myself::GetOneTimeQuestFlag(talker,66) <= 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Certified Arbalester");
			}
			if( gg::HaveMemo(talker,66) == 0 && talker.occupation != 126 && talker.occupation != 130 && gg::OwnItemCount(talker,9782) <= 0 && myself::GetOneTimeQuestFlag(talker,66) <= 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Certified Arbalester");
			}
			if( gg::HaveMemo(talker,66) == 0 && myself::GetOneTimeQuestFlag(talker,66) >= 1 && gg::OwnItemCount(talker,9782) < 0 && talker.occupation != 130 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Certified Arbalester");
			}
			if( gg::HaveMemo(talker,66) == 0 && talker.occupation == 130 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Certified Arbalester");
			}
			if( gg::HaveMemo(talker,66) == 0 && gg::OwnItemCount(talker,9782) > 0 && talker.occupation != 130 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Certified Arbalester");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) > 2 && gg::GetMemoState(talker,66) < 11 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 8;
				myself::AddChoice(8,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) >= 11 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 9;
				myself::AddChoice(9,"Certified Arbalester (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,66) == 0 && talker.level >= 39 && myself::GetOneTimeQuestFlag(talker,66) <= 0 && talker.occupation == 126 && gg::OwnItemCount(talker,9782) <= 0 ) ) {
						myself::SetCurrentQuestID(66);
						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,"master_ryndy_q0066_01.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",66);
							myself::ShowQuestFHTML(talker,fhtml0,66);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 0 && talker.level < 39 && talker.occupation == 126 && gg::OwnItemCount(talker,9782) <= 0 && myself::GetOneTimeQuestFlag(talker,66) <= 0 ) ) {
						myself::SetCurrentQuestID(66);
						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,"master_ryndy_q0066_02.htm");
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 0 && talker.occupation != 126 && talker.occupation != 130 && gg::OwnItemCount(talker,9782) <= 0 && myself::GetOneTimeQuestFlag(talker,66) <= 0 ) ) {
						myself::SetCurrentQuestID(66);
						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,"master_ryndy_q0066_03.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 0 && myself::GetOneTimeQuestFlag(talker,66) >= 1 && gg::OwnItemCount(talker,9782) < 0 && talker.occupation != 130 ) ) {
						myself::SetCurrentQuestID(66);
						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 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 0 && talker.occupation == 130 ) ) {
						myself::SetCurrentQuestID(66);
						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,"master_ryndy_q0066_05.htm");
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 0 && gg::OwnItemCount(talker,9782) > 0 && talker.occupation != 130 ) ) {
						myself::SetCurrentQuestID(66);
						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,"master_ryndy_q0066_06.htm");
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 1 ) ) {
						myself::SetCurrentQuestID(66);
						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( gg::HaveMemo(talker,66) == 1 ) {
							myself::SetMemoState(talker,66,2);
							myself::ShowPage(talker,"master_ryndy_q0066_09.htm");
							myself::SoundEffect(talker,"ItemSound.quest_middle");
							myself::SetFlagJournal(talker,66,2);
							myself::ShowQuestMark(talker,66);
						}
					}
					break;
				}
				case 7: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 2 ) ) {
						myself::SetCurrentQuestID(66);
						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,"master_ryndy_q0066_10.htm");
					}
					break;
				}
				case 8: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) > 2 && gg::GetMemoState(talker,66) < 11 ) ) {
						myself::SetCurrentQuestID(66);
						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,"master_ryndy_q0066_11.htm");
					}
					break;
				}
				case 9: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) >= 11 ) ) {
						myself::SetCurrentQuestID(66);
						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,"master_ryndy_q0066_12.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 66 ) {
			myself::SetCurrentQuestID(66);
			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( talker.level >= 39 && myself::GetOneTimeQuestFlag(talker,66) <= 0 && talker.occupation == 126 && gg::OwnItemCount(talker,9782) <= 0 ) {
					myself::SetMemoState(talker,66,1);
					myself::SetMemo(talker,quest_id);
					myself::SoundEffect(talker,"ItemSound.quest_accept");
					myself::SetFlagJournal(talker,66,1);
					myself::ShowQuestMark(talker,66);
					myself::SetMemoState(talker,66,1);
					if( myself::GetOneTimeQuestFlag(talker,54) == 0 ) {
						myself::GiveItem1(talker,7562,64);
						myself::SetOneTimeQuestFlag(talker,54,1);
						myself::ShowQuestPage(talker,"master_ryndy_q0066_07a.htm",66);
					} else {
						myself::ShowQuestPage(talker,"master_ryndy_q0066_07.htm",66);
					}
				}
				gg::AddLog(1,talker,66);
			}
			return;
		}
		super;
	}

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

}
