@LabelIndex 392705
@StringIndex 58360
class 0 master_orkurus : kamael_coach {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,64) == 0 && myself::GetOneTimeQuestFlag(talker,64) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Certified Berserker");
			}
			if( gg::HaveMemo(talker,64) == 0 && myself::GetOneTimeQuestFlag(talker,64) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Certified Berserker (Done)");
			}
			if( gg::HaveMemo(talker,64) == 1 && gg::GetMemoState(talker,64) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Certified Berserker (In Progress)");
			}
			if( gg::HaveMemo(talker,64) == 1 && gg::GetMemoState(talker,64) >= 2 && gg::GetMemoState(talker,64) < 11 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Certified Berserker (In Progress)");
			}
			if( gg::HaveMemo(talker,64) == 1 && gg::GetMemoState(talker,64) == 11 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Certified Berserker (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,64) == 0 && myself::GetOneTimeQuestFlag(talker,64) == 0 ) ) {
						myself::SetCurrentQuestID(64);
						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 ) {
							if( talker.race == 5 ) {
								if( talker.occupation == 125 ) {
									if( talker.level >= 39 ) {
										myself::FHTML_SetFileName(fhtml0,"master_orkurus_q0064_01.htm");
										myself::FHTML_SetInt(fhtml0,"quest_id",64);
										myself::ShowQuestFHTML(talker,fhtml0,64);
									} else {
										myself::ShowPage(talker,"master_orkurus_q0064_02.htm");
									}
								} else {
									myself::ShowPage(talker,"master_orkurus_q0064_03.htm");
								}
							} else {
								myself::ShowPage(talker,"master_orkurus_q0064_04.htm");
							}
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,64) == 0 && myself::GetOneTimeQuestFlag(talker,64) == 1 ) ) {
						myself::SetCurrentQuestID(64);
						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_orkurus_q0064_05.htm");
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,64) == 1 && gg::GetMemoState(talker,64) == 1 ) ) {
						myself::SetCurrentQuestID(64);
						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_orkurus_q0064_07.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,64) == 1 && gg::GetMemoState(talker,64) >= 2 && gg::GetMemoState(talker,64) < 11 ) ) {
						myself::SetCurrentQuestID(64);
						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_orkurus_q0064_08.htm");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,64) == 1 && gg::GetMemoState(talker,64) == 11 ) ) {
						myself::SetCurrentQuestID(64);
						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_orkurus_q0064_09.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

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

	EventHandler MENU_SELECTED(ask,fhtml0,reply,talker) {
		if( ask == 64 ) {
			myself::SetCurrentQuestID(64);
			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 == 64 ) {
			if( reply == 1 && gg::HaveMemo(talker,64) == 1 && gg::GetMemoState(talker,64) == 11 ) {
				myself::ShowPage(talker,"master_orkurus_q0064_10.htm");
			}
			if( reply == 2 && gg::HaveMemo(talker,64) == 1 && gg::GetMemoState(talker,64) == 11 ) {
				myself::GiveItem1(talker,9760,1);
				myself::GiveItem1(talker,57,31552);
				myself::IncrementParam(talker,0,174503);
				myself::IncrementParam(talker,1,11974);
				myself::DeleteItem1(talker,9759,gg::OwnItemCount(talker,9759));
				myself::RemoveMemo(talker,64);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
				myself::ShowPage(talker,"master_orkurus_q0064_11.htm");
				gg::AddLog(2,talker,64);
				myself::SetOneTimeQuestFlag(talker,64,1);
				gg::AddPCSocial(gg::GetIndexFromCreature(talker),3);
			}
		}
		super;
	}

}
