@LabelIndex 409086
@StringIndex 61603
class 0 aden_gi_fort_campkeeper : extended_zone_controller {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,511) == 0 && talker.level >= 60 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Awl Under Foot");
			}
			if( gg::HaveMemo(talker,511) == 0 && talker.level < 60 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Awl Under Foot");
			}
			if( gg::HaveMemo(talker,511) == 1 && gg::OwnItemCount(talker,9797) <= 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Awl Under Foot (In Progress)");
			}
			if( gg::HaveMemo(talker,511) == 1 && gg::OwnItemCount(talker,9797) > 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Awl Under Foot (In Progress)");
			}
			if( gg::HaveMemo(talker,726) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Light within the Darkness");
			}
			if( gg::HaveMemo(talker,726) == 1 && gg::GetMemoState(talker,726) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Light within the Darkness (in progress)");
			}
			if( gg::HaveMemo(talker,726) == 1 && gg::GetMemoState(talker,726) == 3 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Light within the Darkness (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,511) == 0 && talker.level >= 60 ) ) {
						myself::SetCurrentQuestID(511);
						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::IsMyLord(talker) || ( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id > 0 ) ) {
								myself::FHTML_SetFileName(fhtml0,"gludio_fort_a_campkeeper_q0511_01.htm");
								myself::FHTML_SetInt(fhtml0,"quest_id",511);
								myself::ShowQuestFHTML(talker,fhtml0,511);
							} else {
								myself::ShowQuestPage(talker,"gludio_fort_a_campkeeper_q0511_01a.htm",511);
							}
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,511) == 0 && talker.level < 60 ) ) {
						myself::SetCurrentQuestID(511);
						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,"gludio_fort_a_campkeeper_q0511_02.htm",511);
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,511) == 1 && gg::OwnItemCount(talker,9797) <= 0 ) ) {
						myself::SetCurrentQuestID(511);
						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,"gludio_fort_a_campkeeper_q0511_08.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,511) == 1 && gg::OwnItemCount(talker,9797) > 0 ) ) {
						myself::SetCurrentQuestID(511);
						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::GiveItem1(talker,9912,gg::OwnItemCount(talker,9797));
							myself::DeleteItem1(talker,9797,gg::OwnItemCount(talker,9797));
							myself::ShowPage(talker,"gludio_fort_a_campkeeper_q0511_09.htm");
							gg::AddLog(3,talker,511);
						}
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || gg::HaveMemo(talker,726) == 0 ) {
						myself::SetCurrentQuestID(726);
						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::IsMyLord(talker) || ( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id > 0 ) ) {
								if( talker.level >= 70 ) {
									myself::ShowQuestPage(talker,"gludio_fort_a_campkeeper_q0726_01.htm",726);
								} else {
									myself::ShowQuestPage(talker,"gludio_fort_a_campkeeper_q0726_04.htm",726);
								}
							} else {
								myself::ShowQuestPage(talker,"gludio_fort_a_campkeeper_q0726_03.htm",726);
							}
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,726) == 1 && gg::GetMemoState(talker,726) == 1 ) ) {
						myself::SetCurrentQuestID(726);
						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,"gludio_fort_a_campkeeper_q0726_15.htm");
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,726) == 1 && gg::GetMemoState(talker,726) == 3 ) ) {
						myself::SetCurrentQuestID(726);
						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::RemoveMemo(talker,726);
						myself::SoundEffect(talker,"ItemSound.quest_finish");
						gg::AddLog(2,talker,726);
						myself::ShowPage(talker,"gludio_fort_a_campkeeper_q0726_16.htm");
						myself::GiveItem1(talker,9912,152);
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 511 ) {
			myself::SetCurrentQuestID(511);
			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,511) == 0 && talker.level >= 60 ) {
					if( myself::IsMyLord(talker) || ( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id > 0 ) ) {
						myself::SetMemo(talker,quest_id);
						myself::SoundEffect(talker,"ItemSound.quest_accept");
						myself::ShowQuestPage(talker,"gludio_fort_a_campkeeper_q0511_03.htm",511);
						myself::SetFlagJournal(talker,511,1);
						myself::ShowQuestMark(talker,511);
					} else {
						myself::ShowQuestPage(talker,"gludio_fort_a_campkeeper_q0511_01a.htm",511);
					}
				}
				gg::AddLog(1,talker,quest_id);
			}
			return;
		}
		if( quest_id == 726 ) {
			myself::SetCurrentQuestID(726);
			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( myself::IsMyLord(talker) || ( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id > 0 ) ) {
					if( talker.level >= 70 ) {
						myself::SetMemoState(talker,726,1);
						myself::SetMemo(talker,quest_id);
						myself::SoundEffect(talker,"ItemSound.quest_accept");
						myself::ShowQuestPage(talker,"gludio_fort_a_campkeeper_q0726_05.htm",726);
						myself::SetFlagJournal(talker,726,1);
						myself::ShowQuestMark(talker,726);
					}
				}
				gg::AddLog(1,talker,quest_id);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,c0,c1,fhtml0,i1,i2,party0,pledge0,reply,talker) {
		if( ask == 511 ) {
			myself::SetCurrentQuestID(511);
			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 == 511 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,511) == 1 ) {
					myself::ShowPage(talker,"gludio_fort_a_campkeeper_q0511_05.htm");
				}
			}
			if( reply == 2 ) {
				if( gg::HaveMemo(talker,511) == 1 ) {
					myself::ShowPage(talker,"gludio_fort_a_campkeeper_q0511_06.htm");
				}
			}
			if( reply == 3 ) {
				if( gg::HaveMemo(talker,511) == 1 ) {
					myself::ShowPage(talker,"gludio_fort_a_campkeeper_q0511_07.htm");
				}
			}
			if( reply == 4 ) {
				if( gg::HaveMemo(talker,511) == 1 ) {
					myself::ShowPage(talker,"gludio_fort_a_campkeeper_q0511_10.htm");
				}
			}
			if( reply == 5 ) {
				if( gg::HaveMemo(talker,511) == 1 ) {
					myself::RemoveMemo(talker,511);
					myself::SoundEffect(talker,"ItemSound.quest_finish");
					myself::ShowPage(talker,"gludio_fort_a_campkeeper_q0511_11.htm");
					gg::AddLog(2,talker,511);
				}
			}
			if( reply == 20 ) {
				if( gg::HaveMemo(talker,511) == 1 ) {
					myself::ShowPage(talker,"gludio_fort_a_campkeeper_q0511_12.htm");
				}
			}
		}
		if( ask == 726 ) {
			myself::SetCurrentQuestID(726);
			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 == 726 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,726) == 0 && talker.level >= 70 ) {
					if( myself::IsMyLord(talker) || ( myself::Castle_GetPledgeId() == talker.pledge_id && talker.pledge_id > 0 ) ) {
						myself::FHTML_SetFileName(fhtml0,"gludio_fort_a_campkeeper_q0726_02.htm");
						myself::FHTML_SetInt(fhtml0,"quest_id",726);
						myself::ShowQuestFHTML(talker,fhtml0,726);
					}
				}
			}
			if( reply == 3 ) {
				if( gg::HaveMemo(talker,726) == 1 && gg::GetMemoState(talker,726) == 1 ) {
					myself::ShowPage(talker,"gludio_fort_a_campkeeper_q0726_14.htm");
				}
			}
		}
		super;
	}

}
