@LabelIndex 397845
@StringIndex 59500
class 0 mark_q0060_1 : citizen {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,60) == 1 && gg::GetMemoState(talker,60) == 1 && myself::GetOneTimeQuestFlag(talker,60) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Good Work's Reward (In Progress)");
			}
			if( gg::HaveMemo(talker,60) == 1 && gg::GetMemoState(talker,60) == 2 && myself::GetOneTimeQuestFlag(talker,60) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Good Work's Reward (In Progress)");
			}
			if( gg::HaveMemo(talker,60) == 1 && gg::GetMemoState(talker,60) >= 3 && gg::GetMemoState(talker,60) < 7 && myself::GetOneTimeQuestFlag(talker,60) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Good Work's Reward (In Progress)");
			}
			if( gg::HaveMemo(talker,60) == 1 && gg::GetMemoState(talker,60) == 7 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Good Work's Reward (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,60) == 1 && gg::GetMemoState(talker,60) == 1 && myself::GetOneTimeQuestFlag(talker,60) == 0 ) ) {
						myself::SetCurrentQuestID(60);
						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.i_quest0 == 0 ) {
							myself::ShowPage(talker,"mark_q0060_1_q0060_01.htm");
						} else if( myself.i_quest0 == 1 && myself.i_quest1 == talker.dbid ) {
							myself::ShowPage(talker,"mark_q0060_1_q0060_03.htm");
						} else if( myself.i_quest0 == 1 && myself.i_quest1 != talker.dbid ) {
							myself::ShowPage(talker,"mark_q0060_1_q0060_02.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,60) == 1 && gg::GetMemoState(talker,60) == 2 && myself::GetOneTimeQuestFlag(talker,60) == 0 ) ) {
						myself::SetCurrentQuestID(60);
						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::GiveItem1(talker,10867,1);
						myself::SetMemoState(talker,60,3);
						myself::ShowPage(talker,"mark_q0060_1_q0060_06.htm");
						myself::SetFlagJournal(talker,60,3);
						myself::ShowQuestMark(talker,60);
						myself::SoundEffect(talker,"ItemSound.quest_middle");
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,60) == 1 && gg::GetMemoState(talker,60) >= 3 && gg::GetMemoState(talker,60) < 7 && myself::GetOneTimeQuestFlag(talker,60) == 0 ) ) {
						myself::SetCurrentQuestID(60);
						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,"mark_q0060_1_q0060_07.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,60) == 1 && gg::GetMemoState(talker,60) == 7 ) ) {
						myself::SetCurrentQuestID(60);
						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,"mark_q0060_1_q0060_09.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(c0,i0,npc0,timer_id) {
		myself::SetCurrentQuestID(60);
		if( timer_id == 6010 ) {
			if( myself.i_quest0 == 1 ) {
				myself.i_quest0 = 0;
			}
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker) {
		if( ask == 60 ) {
			myself::SetCurrentQuestID(60);
			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 == 60 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,60) == 1 && gg::GetMemoState(talker,60) == 1 && myself::GetOneTimeQuestFlag(talker,60) == 0 ) {
					if( myself.i_quest0 == 0 ) {
						myself::ShowPage(talker,"mark_q0060_1_q0060_04.htm");
						myself.i_quest0 = 1;
						myself.i_quest1 = talker.dbid;
						myself::CreateOnePrivateEx(1027340,"chaser_q0060",0,0,( gg::FloatToInt(myself.sm.x) + 50 ),( gg::FloatToInt(myself.sm.y) + 50 ),gg::FloatToInt(myself.sm.z),0,gg::GetIndexFromCreature(talker),talker.dbid,myself.sm.id);
					} else {
						myself::ShowPage(talker,"mark_q0060_1_q0060_05.htm");
					}
				}
			}
			if( reply == 3 ) {
				if( gg::HaveMemo(talker,60) == 1 && gg::GetMemoState(talker,60) == 7 && myself::GetOneTimeQuestFlag(talker,60) == 0 ) {
					myself::DeleteItem1(talker,10868,gg::OwnItemCount(talker,10868));
					myself::SetMemoState(talker,60,8);
					myself::ShowPage(talker,"mark_q0060_1_q0060_10.htm");
					myself::SetFlagJournal(talker,60,8);
					myself::ShowQuestMark(talker,60);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
					if( myself.i_quest0 == 1 ) {
						myself.i_quest0 = 0;
					}
				}
			}
		}
		super;
	}

}
