@LabelIndex 380754
@StringIndex 55995
class 0 torant : citizen {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,113) == 1 && myself::GetOneTimeQuestFlag(talker,113) == 0 && gg::GetMemoState(talker,113) == ( ( 1 * 10 ) + 1 ) && gg::OwnItemCount(talker,8086) >= 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Status of the Beacon Tower (In Progress)");
			}
			if( talker.level >= 40 && gg::HaveMemo(talker,646) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Signs of Revolt");
			}
			if( talker.level < 40 && gg::HaveMemo(talker,646) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Signs of Revolt");
			}
			if( gg::HaveMemo(talker,646) == 1 && gg::GetMemoState(talker,646) >= ( ( 1 * 10 ) + 1 ) && gg::GetMemoState(talker,646) <= ( ( 1 * 10 ) + 2 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Signs of Revolt (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,113) == 1 && myself::GetOneTimeQuestFlag(talker,113) == 0 && gg::GetMemoState(talker,113) == ( ( 1 * 10 ) + 1 ) && gg::OwnItemCount(talker,8086) >= 1 ) ) {
						myself::SetCurrentQuestID(113);
						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::SetHTMLCookie(talker,113,1);
						myself::ShowPage(talker,"torant_q0113_0101.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( talker.level >= 40 && gg::HaveMemo(talker,646) == 0 ) ) {
						myself::SetCurrentQuestID(646);
						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::FHTML_SetFileName(fhtml0,"torant_q0646_0101.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",646);
							myself::ShowQuestFHTML(talker,fhtml0,646);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( talker.level < 40 && gg::HaveMemo(talker,646) == 0 ) ) {
						myself::SetCurrentQuestID(646);
						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,"torant_q0646_0102.htm",646);
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,646) == 1 && gg::GetMemoState(talker,646) >= ( ( 1 * 10 ) + 1 ) && gg::GetMemoState(talker,646) <= ( ( 1 * 10 ) + 2 ) ) ) {
						myself::SetCurrentQuestID(646);
						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::GetMemoState(talker,646) == ( ( 1 * 10 ) + 2 ) && gg::OwnItemCount(talker,8087) >= 180 ) {
							myself::SetHTMLCookie(talker,646,1);
							myself::ShowPage(talker,"torant_q0646_0105.htm");
						} else {
							myself::ShowPage(talker,"torant_q0646_0106.htm");
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 646 ) {
			myself::SetCurrentQuestID(646);
			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.level >= 40 ) {
				talker.quest_last_reward_time = myself::GetCurrentTick();
				myself::SetMemo(talker,646);
				myself::SetMemoState(talker,646,( ( 1 * 10 ) + 1 ));
				gg::AddLog(1,talker,646);
				myself::SetFlagJournal(talker,646,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowQuestPage(talker,"torant_q0646_0103.htm",646);
				myself::ShowQuestMark(talker,646);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,i1,quest_id,reply,talker) {
		if( ask == 113 ) {
			myself::SetCurrentQuestID(113);
			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 == 113 && myself::GetOneTimeQuestFlag(talker,113) == 0 ) {
			i0 = myself::GetHTMLCookie(talker,113,( 2 - 1 ));
			if( i0 != -1 ) {
				if( reply == 3 && gg::HaveMemo(talker,113) == 1 && gg::GetMemoState(talker,113) >= ( ( ( 2 - 1 ) * 10 ) + 1 ) ) {
					if( gg::OwnItemCount(talker,8086) >= 1 ) {
						myself::SetOneTimeQuestFlag(talker,113,1);
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,8086,gg::OwnItemCount(talker,8086));
							myself::GiveItem1(talker,57,21578);
							myself::IncrementParam(talker,0,76665);
							myself::IncrementParam(talker,1,5333);
							gg::AddLog(2,talker,113);
							myself::RemoveMemo(talker,113);
							myself::SoundEffect(talker,"ItemSound.quest_finish");
							myself::ShowPage(talker,"torant_q0113_0201.htm");
						}
					}
				}
			}
		}
		if( ask == 646 ) {
			myself::SetCurrentQuestID(646);
			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 == 646 ) {
			i0 = myself::GetHTMLCookie(talker,646,( 2 - 1 ));
			if( i0 != -1 ) {
				if( reply == 3 && gg::HaveMemo(talker,646) == 1 && gg::GetMemoState(talker,646) >= ( ( ( 2 - 1 ) * 10 ) + 1 ) ) {
					myself::ShowPage(talker,"torant_q0646_0201.htm");
				}
				if( reply >= 11 && reply <= 20 && gg::HaveMemo(talker,646) == 1 && gg::GetMemoState(talker,646) >= ( ( ( 2 - 1 ) * 10 ) + 1 ) ) {
					if( gg::OwnItemCount(talker,8087) >= 180 ) {
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,8087,gg::OwnItemCount(talker,8087));
							if( reply == 11 && gg::HaveMemo(talker,646) == 1 ) {
								myself::GiveItem1(talker,57,21600);
							}
							if( reply == 12 && gg::HaveMemo(talker,646) == 1 ) {
								myself::GiveItem1(talker,1881,12);
							}
							if( reply == 13 && gg::HaveMemo(talker,646) == 1 ) {
								myself::GiveItem1(talker,1880,9);
							}
							if( reply == 14 && gg::HaveMemo(talker,646) == 1 ) {
								myself::GiveItem1(talker,1882,20);
							}
							gg::AddLog(2,talker,646);
							gg::AddLog(3,talker,646);
							myself::RemoveMemo(talker,646);
							myself::SoundEffect(talker,"ItemSound.quest_finish");
							myself::ShowPage(talker,"torant_q0646_0202.htm");
						}
					}
				}
			}
		}
		super;
	}

}
