@LabelIndex 249909
@StringIndex 30800
class 0 hannavalt : master_lv3_hef {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,212) == 0 && myself::GetOneTimeQuestFlag(talker,212) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Trial of Duty");
			}
			if( gg::HaveMemo(talker,212) == 0 && myself::GetOneTimeQuestFlag(talker,212) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Trial of Duty (Done)");
			}
			if( gg::HaveMemo(talker,212) == 1 && gg::OwnItemCount(talker,2634) && gg::GetMemoState(talker,212) == 14 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Trial of Duty (In Progress)");
			}
			if( gg::HaveMemo(talker,212) == 1 && gg::GetMemoState(talker,212) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Trial of Duty (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,212) == 0 && myself::GetOneTimeQuestFlag(talker,212) == 0 ) ) {
						myself::SetCurrentQuestID(212);
						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( myself::IsInCategory(13,talker.occupation) && talker.level >= 35 ) {
								myself::FHTML_SetFileName(fhtml0,"hannavalt_q0212_03.htm");
								myself::FHTML_SetInt(fhtml0,"quest_id",212);
								myself::ShowQuestFHTML(talker,fhtml0,212);
							} else if( myself::IsInCategory(13,talker.occupation) ) {
								myself::ShowPage(talker,"hannavalt_q0212_01.htm");
							} else {
								myself::ShowPage(talker,"hannavalt_q0212_02.htm");
							}
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,212) == 0 && myself::GetOneTimeQuestFlag(talker,212) == 1 ) ) {
						myself::SetCurrentQuestID(212);
						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 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,212) == 1 && gg::OwnItemCount(talker,2634) && gg::GetMemoState(talker,212) == 14 ) ) {
						myself::SetCurrentQuestID(212);
						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::IncrementParam(talker,0,381288);
							myself::IncrementParam(talker,1,24729);
							myself::GiveItem1(talker,57,69484);
							myself::ShowPage(talker,"hannavalt_q0212_05.htm");
							myself::GiveItem1(talker,2633,1);
							myself::DeleteItem1(talker,2634,1);
							myself::SoundEffect(talker,"ItemSound.quest_finish");
							myself::SetOneTimeQuestFlag(talker,212,1);
							myself::RemoveMemo(talker,212);
							gg::AddLog(2,talker,212);
							gg::AddPCSocial(gg::GetIndexFromCreature(talker),3);
							if( myself::GetOneTimeQuestFlag(talker,54) == 0 ) {
								if( talker.occupation == 1 ) {
									myself::GiveItem1(talker,7562,61);
								} else if( talker.occupation == 4 ) {
									myself::GiveItem1(talker,7562,45);
								} else if( talker.occupation == 7 ) {
									myself::GiveItem1(talker,7562,128);
								} else if( talker.occupation == 11 ) {
									myself::GiveItem1(talker,7562,168);
								} else if( talker.occupation == 15 ) {
									myself::GiveItem1(talker,7562,49);
								} else if( talker.occupation == 19 ) {
									myself::GiveItem1(talker,7562,61);
								} else if( talker.occupation == 22 ) {
									myself::GiveItem1(talker,7562,128);
								} else if( talker.occupation == 26 ) {
									myself::GiveItem1(talker,7562,168);
								} else if( talker.occupation == 29 ) {
									myself::GiveItem1(talker,7562,49);
								} else if( talker.occupation == 32 ) {
									myself::GiveItem1(talker,7562,61);
								} else if( talker.occupation == 35 ) {
									myself::GiveItem1(talker,7562,128);
								} else if( talker.occupation == 39 ) {
									myself::GiveItem1(talker,7562,168);
								} else if( talker.occupation == 42 ) {
									myself::GiveItem1(talker,7562,49);
								} else if( talker.occupation == 45 ) {
									myself::GiveItem1(talker,7562,61);
								} else if( talker.occupation == 47 ) {
									myself::GiveItem1(talker,7562,61);
								} else if( talker.occupation == 50 ) {
									myself::GiveItem1(talker,7562,49);
								} else if( talker.occupation == 54 ) {
									myself::GiveItem1(talker,7562,85);
								} else if( talker.occupation == 56 ) {
									myself::GiveItem1(talker,7562,85);
								}
								myself::SetOneTimeQuestFlag(talker,54,1);
							}
						}
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,212) == 1 && gg::GetMemoState(talker,212) == 1 ) ) {
						myself::SetCurrentQuestID(212);
						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,"hannavalt_q0212_04.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 212 ) {
			myself::SetCurrentQuestID(212);
			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,212) == 0 && myself::GetOneTimeQuestFlag(talker,212) == 0 && myself::GetMemoCount(talker) < 26 && myself::IsInCategory(13,talker.occupation) && talker.level >= 35 ) {
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::SetMemo(talker,quest_id);
					myself::SoundEffect(talker,"ItemSound.quest_accept");
					gg::AddLog(1,talker,212);
					myself::SetMemoState(talker,212,1);
					myself::SetFlagJournal(talker,212,1);
					myself::ShowQuestMark(talker,212);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
					talker.flag = 0;
					if( myself::GetOneTimeQuestFlag(talker,54) == 0 ) {
						if( talker.occupation == 1 ) {
							myself::GiveItem1(talker,7562,61);
						} else if( talker.occupation == 4 ) {
							myself::GiveItem1(talker,7562,45);
						} else if( talker.occupation == 7 ) {
							myself::GiveItem1(talker,7562,128);
						} else if( talker.occupation == 11 ) {
							myself::GiveItem1(talker,7562,168);
						} else if( talker.occupation == 15 ) {
							myself::GiveItem1(talker,7562,49);
						} else if( talker.occupation == 19 ) {
							myself::GiveItem1(talker,7562,61);
						} else if( talker.occupation == 22 ) {
							myself::GiveItem1(talker,7562,128);
						} else if( talker.occupation == 26 ) {
							myself::GiveItem1(talker,7562,168);
						} else if( talker.occupation == 29 ) {
							myself::GiveItem1(talker,7562,49);
						} else if( talker.occupation == 32 ) {
							myself::GiveItem1(talker,7562,61);
						} else if( talker.occupation == 35 ) {
							myself::GiveItem1(talker,7562,128);
						} else if( talker.occupation == 39 ) {
							myself::GiveItem1(talker,7562,168);
						} else if( talker.occupation == 42 ) {
							myself::GiveItem1(talker,7562,49);
						} else if( talker.occupation == 45 ) {
							myself::GiveItem1(talker,7562,61);
						} else if( talker.occupation == 47 ) {
							myself::GiveItem1(talker,7562,61);
						} else if( talker.occupation == 50 ) {
							myself::GiveItem1(talker,7562,49);
						} else if( talker.occupation == 54 ) {
							myself::GiveItem1(talker,7562,85);
						} else if( talker.occupation == 56 ) {
							myself::GiveItem1(talker,7562,85);
						}
						myself::SetOneTimeQuestFlag(talker,54,1);
						myself::ShowQuestPage(talker,"hannavalt_q0212_04a.htm",212);
					} else {
						myself::ShowQuestPage(talker,"hannavalt_q0212_04.htm",212);
					}
				}
			}
			return;
		}
		super;
	}

}
