@LabelIndex 392029
@StringIndex 58248
class 0 master_tbwain : kamael_coach {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,62) == 0 && myself::GetOneTimeQuestFlag(talker,62) == 0 && talker.race == 5 && talker.occupation == 123 && talker.level >= 18 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Path of the Trooper");
			}
			if( gg::HaveMemo(talker,62) == 0 && myself::GetOneTimeQuestFlag(talker,62) == 0 && talker.race == 5 && talker.occupation == 123 && talker.level < 18 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Path of the Trooper");
			}
			if( gg::HaveMemo(talker,62) == 0 && myself::GetOneTimeQuestFlag(talker,62) == 0 && talker.race == 5 && talker.occupation != 123 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Path of the Trooper");
			}
			if( gg::HaveMemo(talker,62) == 0 && myself::GetOneTimeQuestFlag(talker,62) == 0 && talker.race != 5 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Path of the Trooper");
			}
			if( gg::HaveMemo(talker,62) == 0 && myself::GetOneTimeQuestFlag(talker,62) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Path of the Trooper (In Progress)");
			}
			if( gg::HaveMemo(talker,62) == 1 && ( gg::GetMemoState(talker,62) == 1 || gg::GetMemoState(talker,62) == 2 || gg::GetMemoState(talker,62) == 3 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Path of the Trooper (In Progress)");
			}
			if( gg::HaveMemo(talker,62) == 1 && gg::GetMemoState(talker,62) == 4 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Path of the Trooper (In Progress)");
			}
			if( gg::HaveMemo(talker,62) == 1 && gg::GetMemoState(talker,62) == 5 && gg::OwnItemCount(talker,9751) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Path of the Trooper (In Progress)");
			}
			if( gg::HaveMemo(talker,62) == 1 && gg::GetMemoState(talker,62) == 5 && gg::OwnItemCount(talker,9751) >= 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 8;
				myself::AddChoice(8,"Path of the Trooper (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,62) == 0 && myself::GetOneTimeQuestFlag(talker,62) == 0 && talker.race == 5 && talker.occupation == 123 && talker.level >= 18 ) ) {
						myself::SetCurrentQuestID(62);
						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_tbwain_q0062_01.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",62);
							myself::ShowQuestFHTML(talker,fhtml0,62);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,62) == 0 && myself::GetOneTimeQuestFlag(talker,62) == 0 && talker.race == 5 && talker.occupation == 123 && talker.level < 18 ) ) {
						myself::SetCurrentQuestID(62);
						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_tbwain_q0062_02.htm");
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,62) == 0 && myself::GetOneTimeQuestFlag(talker,62) == 0 && talker.race == 5 && talker.occupation != 123 ) ) {
						myself::SetCurrentQuestID(62);
						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_tbwain_q0062_03.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,62) == 0 && myself::GetOneTimeQuestFlag(talker,62) == 0 && talker.race != 5 ) ) {
						myself::SetCurrentQuestID(62);
						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_tbwain_q0062_04.htm");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,62) == 0 && myself::GetOneTimeQuestFlag(talker,62) == 1 ) ) {
						myself::SetCurrentQuestID(62);
						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_tbwain_q0062_05.htm");
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,62) == 1 && ( gg::GetMemoState(talker,62) == 1 || gg::GetMemoState(talker,62) == 2 || gg::GetMemoState(talker,62) == 3 ) ) ) {
						myself::SetCurrentQuestID(62);
						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_tbwain_q0062_07.htm");
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,62) == 1 && gg::GetMemoState(talker,62) == 4 ) ) {
						myself::SetCurrentQuestID(62);
						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::DeleteItem1(talker,9752,gg::OwnItemCount(talker,9752));
						myself::SetMemoState(talker,62,5);
						myself::ShowPage(talker,"master_tbwain_q0062_08.htm");
						myself::SoundEffect(talker,"ItemSound.quest_middle");
						myself::SetFlagJournal(talker,62,5);
						myself::ShowQuestMark(talker,62);
					}
					break;
				}
				case 7: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,62) == 1 && gg::GetMemoState(talker,62) == 5 && gg::OwnItemCount(talker,9751) == 0 ) ) {
						myself::SetCurrentQuestID(62);
						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_tbwain_q0062_09.htm");
					}
					break;
				}
				case 8: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,62) == 1 && gg::GetMemoState(talker,62) == 5 && gg::OwnItemCount(talker,9751) >= 1 ) ) {
						myself::SetCurrentQuestID(62);
						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,9753,1);
							myself::DeleteItem1(talker,9751,gg::OwnItemCount(talker,9751));
							myself::RemoveMemo(talker,62);
							myself::SoundEffect(talker,"ItemSound.quest_finish");
							myself::ShowPage(talker,"master_tbwain_q0062_10.htm");
							myself::SetOneTimeQuestFlag(talker,62,1);
							gg::AddLog(2,talker,62);
							gg::AddPCSocial(gg::GetIndexFromCreature(talker),3);
							if( myself::GetOneTimeQuestFlag(talker,145) == 0 ) {
								myself::SetOneTimeQuestFlag(talker,145,1);
								if( talker.level >= 20 ) {
									myself::IncrementParam(talker,0,160267);
									myself::IncrementParam(talker,1,10424);
									myself::GiveItem1(talker,57,81900);
								} else if( talker.level >= 19 ) {
									myself::IncrementParam(talker,0,228064);
									myself::IncrementParam(talker,1,13773);
									myself::GiveItem1(talker,57,81900);
								} else {
									myself::IncrementParam(talker,0,295862);
									myself::IncrementParam(talker,1,17122);
									myself::GiveItem1(talker,57,81900);
								}
							}
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 62 ) {
			myself::SetCurrentQuestID(62);
			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( gg::HaveMemo(talker,62) == 0 && myself::GetOneTimeQuestFlag(talker,62) == 0 && talker.race == 5 && talker.occupation == 123 && talker.level >= 18 ) {
					myself::SetMemoState(talker,62,1);
					myself::SetMemo(talker,quest_id);
					myself::SoundEffect(talker,"ItemSound.quest_accept");
					myself::ShowQuestPage(talker,"master_tbwain_q0062_06.htm",62);
					myself::SetFlagJournal(talker,62,1);
					myself::ShowQuestMark(talker,62);
				}
				gg::AddLog(1,talker,quest_id);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker) {
		if( ask == 62 ) {
			myself::SetCurrentQuestID(62);
			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 == 62 ) {
		}
		super;
	}

}
