@LabelIndex 405555
@StringIndex 60929
class 0 chamberlain_august : chamberlain {
property:
	TelPosList Position1 = {{"Front of the Schuttgart Castle"; 76358; -145548; -1176; 0; 0 };{"Schuttgart Town Square"; 87379; -142322; -1336; 0; 0 };{"Front of the Archaic Fortress"; 105007; -140874; -3360; 0; 0 }};
	TelPosList Position2 = {{"Front of the Schuttgart Castle"; 76358; -145548; -1176; 0; 0 };{"Schuttgart Town Square"; 87379; -142322; -1336; 0; 0 };{"Front of the Archaic Fortress"; 105007; -140874; -3360; 0; 0 };{"The Center of the Abandoned Coal Mines"; 144706; -173223; -1520; 500; 0 };{"Plunderous Plains"; 111965; -154172; -1528; 500; 0 };{"Den of Evil"; 68693; -110438; -1946; 500; 0 };{"Frozen Labyrinth"; 113903; -108752; -884; 500; 0 };{"Crypts of Disgrace"; 47692; -115745; -3744; 500; 0 }};
	BuySellList SellList0 = {{"advdeluxe_food_for_strider";10};{"pledge_shield_castle";10};{"circlet_of_schuttgart";10};{"agathion_seal_bracelet_schuttgart";10};{"13686";10}};

handler:
	EventHandler TALK_SELECTED(fhtml0,i0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,714) == 0 && myself::IsMyLord(talker) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Path to Becoming a Lord - Schuttgart");
			}
			if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Path to Becoming a Lord - Schuttgart (in progress)");
			}
			if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Path to Becoming a Lord - Schuttgart (in progress)");
			}
			if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) > 2 && gg::GetMemoState(talker,714) < 5 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Path to Becoming a Lord - Schuttgart (in progress)");
			}
			if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 5 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Path to Becoming a Lord - Schuttgart (in progress)");
			}
			if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) > 5 && gg::GetMemoState(talker,714) < 8 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Path to Becoming a Lord - Schuttgart (in progress)");
			}
			if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 8 && myself::IsMyLord(talker) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Path to Becoming a Lord - Schuttgart (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,714) == 0 && myself::IsMyLord(talker) == 1 ) ) {
						myself::SetCurrentQuestID(714);
						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::IsDominionOfLord(89) == 0 ) {
								myself::ShowQuestPage(talker,"chamberlain_august_q0714_01.htm",714);
							} else {
								myself::ShowQuestPage(talker,"chamberlain_august_q0714_03.htm",714);
							}
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 1 ) ) {
						myself::SetCurrentQuestID(714);
						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() - gg::GetMemoStateEx(talker,714,1) ) < 60 ) {
							myself::ShowPage(talker,"chamberlain_august_q0714_05.htm");
						} else {
							myself::SetMemoState(talker,714,2);
							myself::ShowPage(talker,"chamberlain_august_q0714_06.htm");
							myself::SetMemoStateEx(talker,714,1,0);
						}
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 2 ) ) {
						myself::SetCurrentQuestID(714);
						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,"chamberlain_august_q0714_07.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) > 2 && gg::GetMemoState(talker,714) < 5 ) ) {
						myself::SetCurrentQuestID(714);
						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,"chamberlain_august_q0714_09.htm");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 5 ) ) {
						myself::SetCurrentQuestID(714);
						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,"chamberlain_august_q0714_10.htm");
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) > 5 && gg::GetMemoState(talker,714) < 8 ) ) {
						myself::SetCurrentQuestID(714);
						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,"chamberlain_august_q0714_11.htm");
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 8 && myself::IsMyLord(talker) == 1 ) ) {
						myself::SetCurrentQuestID(714);
						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::GetDominionWarState(89) == 5 || myself::Castle_IsUnderSiege() ) {
							myself::ShowPage(talker,"chamberlain_august_q0714_12a.htm");
						} else if( gg::Fortress_GetContractStatus(111) == -1 ) {
							myself::ShowPage(talker,"chamberlain_august_q0714_12b.htm");
						} else {
							myself::ShowPage(talker,"chamberlain_august_q0714_12.htm");
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(i0,quest_id,talker) {
		if( quest_id == 714 ) {
			myself::SetCurrentQuestID(714);
			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,714) == 0 && myself::IsMyLord(talker) == 1 && myself::IsDominionOfLord(89) == 0 ) {
					i0 = myself::GetCurrentTick();
					myself::SetMemo(talker,quest_id);
					myself::SetMemoState(talker,714,1);
					myself::SetMemoStateEx(talker,714,1,i0);
					myself::SoundEffect(talker,"ItemSound.quest_accept");
					myself::ShowQuestPage(talker,"chamberlain_august_q0714_04.htm",714);
					myself::SetFlagJournal(talker,714,1);
					myself::ShowQuestMark(talker,714);
					myself::AddTimerEx(71401,( 1000 * 60 ));
				}
				gg::AddLog(1,talker,quest_id);
			}
			return;
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(i0,talker,timer_id) {
		myself::SetCurrentQuestID(714);
		if( timer_id == 71401 ) {
			myself::Say(gg::MakeFString(71451,"","","","",""));
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,fhtml0,reply,talker) {
		if( ask == 714 ) {
			myself::SetCurrentQuestID(714);
			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 == 714 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,714) == 0 && myself::IsMyLord(talker) == 1 && myself::IsDominionOfLord(89) == 0 ) {
					myself::FHTML_SetFileName(fhtml0,"chamberlain_august_q0714_02.htm");
					myself::FHTML_SetInt(fhtml0,"quest_id",714);
					myself::ShowQuestFHTML(talker,fhtml0,714);
				}
			}
			if( reply == 2 ) {
				if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 2 && myself::IsMyLord(talker) == 1 ) {
					myself::SetMemoState(talker,714,3);
					myself::ShowPage(talker,"chamberlain_august_q0714_08.htm");
					myself::SetFlagJournal(talker,714,2);
					myself::ShowQuestMark(talker,714);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
			if( reply == 3 ) {
				if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 8 && myself::IsMyLord(talker) == 1 && gg::GetDominionWarState(89) != 5 ) {
					myself::FHTML_SetFileName(fhtml0,"chamberlain_august_q0714_13.htm");
					myself::FHTML_SetStr(fhtml0,"name",talker.name);
					myself::ShowFHTML(talker,fhtml0);
					myself::Say(gg::MakeFString(71459,talker.name,"","","",""));
					myself::DeclareLord(89,talker);
					myself::RemoveMemo(talker,714);
					myself::SoundEffect(talker,"ItemSound.quest_finish");
					gg::AddLog(2,talker,714);
				}
			}
		}
		super;
	}

}
