@LabelIndex 401075
@StringIndex 60055
class 0 wharf_soldier_plenos : citizen {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,702) == 0 && talker.level >= 78 && myself::GetOneTimeQuestFlag(talker,10273) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"A Trap for Revenge");
			}
			if( gg::HaveMemo(talker,702) == 0 && ( talker.level < 78 || myself::GetOneTimeQuestFlag(talker,10273) == 0 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"A Trap for Revenge");
			}
			if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"A Trap for Revenge (in progress)");
			}
			if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"A Trap for Revenge (in progress)");
			}
			if( gg::HaveMemo(talker,10270) == 0 && talker.level >= 75 && myself::GetOneTimeQuestFlag(talker,10270) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Birth of th Seed");
			}
			if( gg::HaveMemo(talker,10270) == 0 && talker.level < 75 && myself::GetOneTimeQuestFlag(talker,10270) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Birth of th Seed");
			}
			if( myself::GetOneTimeQuestFlag(talker,10270) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Birth of the Seed (complete)");
			}
			if( gg::HaveMemo(talker,10270) == 1 && gg::GetMemoState(talker,10270) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Birth of the Seed (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,702) == 0 && talker.level >= 78 && myself::GetOneTimeQuestFlag(talker,10273) == 1 ) ) {
						myself::SetCurrentQuestID(702);
						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::ShowQuestPage(talker,"wharf_soldier_plenos_q0702_01.htm",702);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,702) == 0 && ( talker.level < 78 || myself::GetOneTimeQuestFlag(talker,10273) == 0 ) ) ) {
						myself::SetCurrentQuestID(702);
						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::ShowQuestPage(talker,"wharf_soldier_plenos_q0702_02.htm",702);
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 1 ) ) {
						myself::SetCurrentQuestID(702);
						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,"wharf_soldier_plenos_q0702_05.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 ) ) {
						myself::SetCurrentQuestID(702);
						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,"wharf_soldier_plenos_q0702_06.htm");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,10270) == 0 && talker.level >= 75 && myself::GetOneTimeQuestFlag(talker,10270) == 0 ) ) {
						myself::SetCurrentQuestID(10270);
						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::ShowQuestPage(talker,"wharf_soldier_plenos_q10270_01.htm",10270);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,10270) == 0 && talker.level < 75 && myself::GetOneTimeQuestFlag(talker,10270) == 0 ) ) {
						myself::SetCurrentQuestID(10270);
						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::ShowQuestPage(talker,"wharf_soldier_plenos_q10270_02.htm",10270);
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || myself::GetOneTimeQuestFlag(talker,10270) == 1 ) {
						myself::SetCurrentQuestID(10270);
						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,"wharf_soldier_plenos_q10270_03.htm");
					}
					break;
				}
				case 7: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,10270) == 1 && gg::GetMemoState(talker,10270) == 1 ) ) {
						myself::SetCurrentQuestID(10270);
						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,"wharf_soldier_plenos_q10270_06.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(fhtml0,quest_id,talker) {
		if( quest_id == 702 ) {
			myself::SetCurrentQuestID(702);
			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,702) == 0 && talker.level >= 78 && myself::GetOneTimeQuestFlag(talker,10273) == 1 ) {
					myself::SetMemo(talker,702);
					myself::SetMemoState(talker,702,1);
					myself::ShowQuestPage(talker,"wharf_soldier_plenos_q0702_04.htm",702);
					myself::SetFlagJournal(talker,702,1);
					myself::ShowQuestMark(talker,702);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
					gg::AddLog(1,talker,702);
				}
			}
			return;
		}
		if( quest_id == 10270 ) {
			myself::SetCurrentQuestID(10270);
			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,10270) == 0 && talker.level >= 75 && myself::GetOneTimeQuestFlag(talker,10270) == 0 ) {
					myself::SetMemo(talker,10270);
					myself::SetMemoState(talker,10270,1);
					myself::ShowQuestPage(talker,"wharf_soldier_plenos_q10270_05.htm",10270);
					myself::SetFlagJournal(talker,10270,1);
					myself::ShowQuestMark(talker,10270);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
					gg::AddLog(1,talker,10270);
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,fhtml0,reply,talker) {
		if( ask == 702 ) {
			myself::SetCurrentQuestID(702);
			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 == 702 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,702) == 0 && talker.level >= 78 && myself::GetOneTimeQuestFlag(talker,10273) == 1 ) {
					myself::FHTML_SetFileName(fhtml0,"wharf_soldier_plenos_q0702_03.htm");
					myself::FHTML_SetInt(fhtml0,"quest_id",702);
					myself::ShowQuestFHTML(talker,fhtml0,702);
				}
			}
			if( reply == 10 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13877) < 1 ) {
					myself::ShowPage(talker,"wharf_soldier_plenos_q0702_07.htm");
				} else if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13877) >= 1 ) {
					myself::ShowPage(talker,"wharf_soldier_plenos_q0702_08.htm");
				}
			}
			if( reply == 11 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13877) >= 1 ) {
					myself::GiveItem1(talker,57,( gg::OwnItemCount(talker,13877) * 100 ));
					myself::DeleteItem1(talker,13877,gg::OwnItemCount(talker,13877));
					gg::AddLog(3,talker,702);
					myself::ShowPage(talker,"wharf_soldier_plenos_q0702_09.htm");
				}
			}
			if( reply == 12 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13877) >= 1 ) {
					myself::ShowPage(talker,"wharf_soldier_plenos_q0702_10.htm");
				}
			}
			if( reply == 20 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13880) < 1 ) {
					myself::ShowPage(talker,"wharf_soldier_plenos_q0702_11.htm");
				} else if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13880) >= 1 ) {
					myself::GiveItem1(talker,57,( gg::OwnItemCount(talker,13880) * 500000 ));
					myself::DeleteItem1(talker,13880,gg::OwnItemCount(talker,13880));
					gg::AddLog(3,talker,702);
					myself::ShowPage(talker,"wharf_soldier_plenos_q0702_12.htm");
				}
			}
			if( reply == 21 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 ) {
					myself::ShowPage(talker,"wharf_soldier_plenos_q0702_13.htm");
				}
			}
			if( reply == 22 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 ) {
					myself::RemoveMemo(talker,702);
					myself::SoundEffect(talker,"ItemSound.quest_finish");
					gg::AddLog(2,talker,702);
					myself::ShowPage(talker,"wharf_soldier_plenos_q0702_14.htm");
				}
			}
		}
		if( ask == 10270 ) {
			myself::SetCurrentQuestID(10270);
			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 == 10270 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,10270) == 0 && talker.level >= 75 && myself::GetOneTimeQuestFlag(talker,10270) == 0 ) {
					myself::FHTML_SetFileName(fhtml0,"wharf_soldier_plenos_q10270_04.htm");
					myself::FHTML_SetInt(fhtml0,"quest_id",10270);
					myself::ShowQuestFHTML(talker,fhtml0,10270);
				}
			}
		}
		super;
	}

}
