@LabelIndex 402572
@StringIndex 60282
class 0 ssq_mammon : citizen {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,196) == 1 && gg::GetMemoState(talker,196) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Seven Signs, Seal of the Emperor (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,196) == 1 && gg::GetMemoState(talker,196) == 1 ) ) {
						myself::SetCurrentQuestID(196);
						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,"ssq_mammon_q0196_01.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(c0,npc0,timer_id) {
		myself::SetCurrentQuestID(196);
		if( timer_id == 1961 ) {
			c0 = gg::GetCreatureFromIndex(myself.sm.param1);
			npc0 = gg::GetNPCFromID(myself.sm.param3);
			if( gg::IsNull(npc0) == 0 ) {
				if( npc0.i_quest0 == 1 ) {
					npc0.i_quest0 = 0;
					myself::Say(gg::MakeFString(19605,"","","","",""));
				}
			}
			myself::Despawn();
		}
		super;
	}

	EventHandler CREATED(c0,npc0,timer_id) {
		myself::SetCurrentQuestID(196);
		c0 = gg::GetCreatureFromIndex(myself.sm.param1);
		myself::AddTimerEx(1961,( 1000 * 300 ));
		if( gg::IsNull(c0) == 0 ) {
			myself::Say(gg::MakeFString(19604,"","","","",""));
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker) {
		if( ask == 196 ) {
			myself::SetCurrentQuestID(196);
			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 == 196 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,196) == 1 && gg::GetMemoState(talker,196) == 1 ) {
					myself::ShowPage(talker,"ssq_mammon_q0196_02.htm");
				}
			}
			if( reply == 2 ) {
				if( gg::HaveMemo(talker,196) == 1 && gg::GetMemoState(talker,196) == 1 ) {
					myself::ShowPage(talker,"ssq_mammon_q0196_03.htm");
				}
			}
			if( reply == 3 ) {
				if( gg::HaveMemo(talker,196) == 1 && gg::GetMemoState(talker,196) == 1 ) {
					myself::ShowPage(talker,"ssq_mammon_q0196_04.htm");
				}
			}
			if( reply == 4 ) {
				if( gg::HaveMemo(talker,196) == 1 && gg::GetMemoState(talker,196) == 1 ) {
					myself::SetMemoState(talker,196,2);
					myself::ShowPage(talker,"ssq_mammon_q0196_05.htm");
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
		}
		super;
	}

}
