@LabelIndex 411582
@StringIndex 62071
class 0 pvp_merchant_lepidus : merchant_for_pvp {
handler:
	EventHandler TALK_SELECTED(fhtml0,i0,i1,i2,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,176) == 0 && myself::GetOneTimeQuestFlag(talker,176) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"One step toward honor (completed)");
			}
			if( gg::HaveMemo(talker,176) == 0 && myself::GetOneTimeQuestFlag(talker,176) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"One step toward honor");
			}
			if( gg::HaveMemo(talker,176) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"One step toward honor (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,176) == 0 && myself::GetOneTimeQuestFlag(talker,176) == 1 ) ) {
						myself::SetCurrentQuestID(176);
						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,"pvp_merchant_lepidus_q0176_01.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,176) == 0 && myself::GetOneTimeQuestFlag(talker,176) == 0 ) ) {
						myself::SetCurrentQuestID(176);
						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.level < 80 ) {
								myself::ShowPage(talker,"pvp_merchant_lepidus_q0176_02.htm");
							} else {
								myself::FHTML_SetFileName(fhtml0,"pvp_merchant_lepidus_q0176_03.htm");
								myself::FHTML_SetInt(fhtml0,"quest_id",176);
								myself::ShowFHTML(talker,fhtml0);
							}
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || gg::HaveMemo(talker,176) == 1 ) {
						myself::SetCurrentQuestID(176);
						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;
						}
						i0 = myself::GetDominionSiegeID(talker);
						if( gg::GetDominionWarState(i0) == 5 ) {
							myself::ShowPage(talker,"pvp_merchant_lepidus_q0176_05.htm");
						} else if( gg::HaveMemo(talker,176) == 1 && gg::GetMemoState(talker,176) == 1 && myself::GetOneTimeQuestFlag(talker,176) == 0 ) {
							myself::ShowPage(talker,"pvp_merchant_lepidus_q0176_06.htm");
						} else if( gg::HaveMemo(talker,176) == 1 && gg::GetMemoState(talker,176) == 2 && myself::GetOneTimeQuestFlag(talker,176) == 0 ) {
							myself::SetMemoState(talker,176,3);
							myself::SetMemoStateEx(talker,176,1,0);
							myself::ShowPage(talker,"pvp_merchant_lepidus_q0176_07.htm");
							myself::SetFlagJournal(talker,176,3);
							myself::ShowQuestMark(talker,176);
							myself::SoundEffect(talker,"ItemSound.quest_middle");
						} else if( gg::HaveMemo(talker,176) == 1 && gg::GetMemoState(talker,176) == 3 && myself::GetOneTimeQuestFlag(talker,176) == 0 ) {
							myself::ShowPage(talker,"pvp_merchant_lepidus_q0176_08.htm");
						} else if( gg::HaveMemo(talker,176) == 1 && gg::GetMemoState(talker,176) == 4 && myself::GetOneTimeQuestFlag(talker,176) == 0 ) {
							myself::SetMemoState(talker,176,5);
							myself::SetMemoStateEx(talker,176,1,0);
							myself::ShowPage(talker,"pvp_merchant_lepidus_q0176_09.htm");
							myself::SetFlagJournal(talker,176,5);
							myself::ShowQuestMark(talker,176);
							myself::SoundEffect(talker,"ItemSound.quest_middle");
						} else if( gg::HaveMemo(talker,176) == 1 && gg::GetMemoState(talker,176) == 5 && myself::GetOneTimeQuestFlag(talker,176) == 0 ) {
							myself::ShowPage(talker,"pvp_merchant_lepidus_q0176_10.htm");
						} else if( gg::HaveMemo(talker,176) == 1 && gg::GetMemoState(talker,176) == 6 && myself::GetOneTimeQuestFlag(talker,176) == 0 ) {
							myself::SetMemoState(talker,176,7);
							myself::SetMemoStateEx(talker,176,1,0);
							myself::ShowPage(talker,"pvp_merchant_lepidus_q0176_11.htm");
							myself::SetFlagJournal(talker,176,7);
							myself::ShowQuestMark(talker,176);
							myself::SoundEffect(talker,"ItemSound.quest_middle");
						} else if( gg::HaveMemo(talker,176) == 1 && gg::GetMemoState(talker,176) == 7 && myself::GetOneTimeQuestFlag(talker,176) == 0 ) {
							myself::ShowPage(talker,"pvp_merchant_lepidus_q0176_12.htm");
						} else if( gg::HaveMemo(talker,176) == 1 && gg::GetMemoState(talker,176) == 8 && myself::GetOneTimeQuestFlag(talker,176) == 0 ) {
							myself::GiveItem1(talker,14603,1);
							myself::RemoveMemo(talker,176);
							myself::SetOneTimeQuestFlag(talker,176,1);
							myself::SoundEffect(talker,"ItemSound.quest_finish");
							gg::AddLog(2,talker,176);
							gg::AddLog(3,talker,176);
							myself::ShowPage(talker,"pvp_merchant_lepidus_q0176_13.htm");
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 176 ) {
			myself::SetCurrentQuestID(176);
			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,176) == 0 && myself::GetOneTimeQuestFlag(talker,176) == 0 && talker.level >= 80 ) {
					myself::SetMemoState(talker,176,1);
					myself::SetMemo(talker,quest_id);
					myself::SetMemoStateEx(talker,176,1,0);
					myself::SoundEffect(talker,"ItemSound.quest_accept");
					myself::ShowPage(talker,"pvp_merchant_lepidus_q0176_04.htm");
					myself::SetFlagJournal(talker,176,1);
					myself::ShowQuestMark(talker,176);
					gg::AddLog(1,talker,quest_id);
				}
			}
			return;
		}
		super;
	}

}
