@LabelIndex 393176
@StringIndex 58448
class 0 master_selsia : kamael_coach {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) < 11 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 11 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 12 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 13 && gg::GetMemoStateEx(talker,66,1) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 13 && gg::GetMemoStateEx(talker,66,1) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 20 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 21 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 22 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) >= 23 && gg::GetMemoState(talker,66) < 30 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 8;
				myself::AddChoice(8,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 30 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 9;
				myself::AddChoice(9,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 31 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 10;
				myself::AddChoice(10,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 32 && gg::OwnItemCount(talker,9781) < 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 11;
				myself::AddChoice(11,"Certified Arbalester (In Progress)");
			}
			if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 32 && gg::OwnItemCount(talker,9781) >= 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 12;
				myself::AddChoice(12,"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) == 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_selsia_q0066_01.htm");
					}
					break;
				}
				case 1: {
					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_selsia_q0066_02.htm");
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 12 ) ) {
						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_selsia_q0066_04.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 13 && gg::GetMemoStateEx(talker,66,1) == 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::SetMemoStateEx(talker,66,1,0);
						myself::ShowPage(talker,"master_selsia_q0066_07.htm");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 13 && gg::GetMemoStateEx(talker,66,1) == 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;
						}
						myself::SetMemoStateEx(talker,66,1,0);
						myself::ShowPage(talker,"master_selsia_q0066_08.htm");
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 20 ) ) {
						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::SetMemoState(talker,66,21);
						myself::ShowPage(talker,"master_selsia_q0066_14.htm");
						myself::SoundEffect(talker,"ItemSound.quest_middle");
						myself::SetFlagJournal(talker,66,11);
						myself::ShowQuestMark(talker,66);
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 21 ) ) {
						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_selsia_q0066_15.htm");
					}
					break;
				}
				case 7: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 22 ) ) {
						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_selsia_q0066_16.htm");
					}
					break;
				}
				case 8: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) >= 23 && gg::GetMemoState(talker,66) < 30 ) ) {
						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_selsia_q0066_17.htm");
					}
					break;
				}
				case 9: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 30 ) ) {
						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::SetMemoState(talker,66,31);
						myself::ShowPage(talker,"master_selsia_q0066_18.htm");
					}
					break;
				}
				case 10: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 31 ) ) {
						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_selsia_q0066_20.htm");
					}
					break;
				}
				case 11: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 32 && gg::OwnItemCount(talker,9781) < 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;
						}
						myself::ShowPage(talker,"master_selsia_q0066_27.htm");
					}
					break;
				}
				case 12: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 32 && gg::OwnItemCount(talker,9781) >= 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( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::GiveItem1(talker,9782,1);
							myself::DeleteItem1(talker,9781,gg::OwnItemCount(talker,9781));
							myself::ShowPage(talker,"master_selsia_q0066_28.htm");
							myself::RemoveMemo(talker,66);
							myself::SoundEffect(talker,"ItemSound.quest_finish");
							gg::AddLog(2,talker,66);
							myself::SetOneTimeQuestFlag(talker,66,1);
							gg::AddPCSocial(gg::GetIndexFromCreature(talker),3);
							myself::IncrementParam(talker,0,214773);
							myself::IncrementParam(talker,1,14738);
							myself::GiveItem1(talker,57,38833);
						}
					}
					break;
				}
			}
			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) == 11 ) {
					myself::DeleteItem1(talker,9777,gg::OwnItemCount(talker,9777));
					myself::SetMemoState(talker,66,12);
					myself::ShowPage(talker,"master_selsia_q0066_03.htm");
				}
			}
			if( reply == 2 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 12 ) {
					myself::SetMemoState(talker,66,13);
					myself::ShowPage(talker,"master_selsia_q0066_05.htm");
				}
			}
			if( reply == 3 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 13 ) {
					myself::SetMemoStateEx(talker,66,1,0);
					myself::ShowPage(talker,"master_selsia_q0066_06.htm");
				}
			}
			if( reply == 4 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 13 ) {
					myself::ShowPage(talker,"master_selsia_q0066_09.htm");
				}
			}
			if( reply == 5 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 13 ) {
					myself::ShowPage(talker,"master_selsia_q0066_10.htm");
				}
			}
			if( reply == 10 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 13 ) {
					myself::SetMemoState(talker,66,13);
					myself::SetMemoStateEx(talker,66,1,1);
					myself::ShowPage(talker,"master_selsia_q0066_11.htm");
				}
			}
			if( reply == 11 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 13 ) {
					myself::SetMemoState(talker,66,13);
					myself::SetMemoStateEx(talker,66,1,1);
					myself::ShowPage(talker,"master_selsia_q0066_12.htm");
				}
			}
			if( reply == 13 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 13 ) {
					myself::SetMemoState(talker,66,13);
					myself::SetMemoStateEx(talker,66,1,1);
					myself::ShowPage(talker,"master_selsia_q0066_13.htm");
				}
			}
			if( reply == 12 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 13 ) {
					myself::SetMemoState(talker,66,20);
					myself::SetMemoStateEx(talker,66,1,0);
					myself::ShowPage(talker,"master_selsia_q0066_13a.htm");
				}
			}
			if( reply == 20 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 20 ) {
					myself::SetMemoState(talker,66,21);
					myself::ShowPage(talker,"master_selsia_q0066_13b.htm");
					myself::SoundEffect(talker,"ItemSound.quest_middle");
					myself::SetFlagJournal(talker,66,11);
					myself::ShowQuestMark(talker,66);
				}
			}
		}
		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) == 31 ) {
					myself::ShowPage(talker,"master_selsia_q0066_19.htm");
				}
			}
			if( reply == 2 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 31 ) {
					myself::ShowPage(talker,"master_selsia_q0066_21.htm");
				}
			}
			if( reply == 3 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 31 ) {
					myself::ShowPage(talker,"master_selsia_q0066_22.htm");
				}
			}
			if( reply == 4 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 31 ) {
					myself::ShowPage(talker,"master_selsia_q0066_23.htm");
				}
			}
			if( reply == 5 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 31 ) {
					myself::ShowPage(talker,"master_selsia_q0066_24.htm");
				}
			}
			if( reply == 6 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 31 ) {
					myself::ShowPage(talker,"master_selsia_q0066_25.htm");
				}
			}
			if( reply == 7 ) {
				if( gg::HaveMemo(talker,66) == 1 && gg::GetMemoState(talker,66) == 31 ) {
					myself::SetMemoStateEx(talker,66,1,0);
					myself::SetMemoState(talker,66,32);
					myself::ShowPage(talker,"master_selsia_q0066_26.htm");
					myself::SoundEffect(talker,"ItemSound.quest_middle");
					myself::SetFlagJournal(talker,66,19);
					myself::ShowQuestMark(talker,66);
				}
			}
		}
		super;
	}

}
