@LabelIndex 396808
@StringIndex 59268
class 0 keitnat_q0236a : citizen {
handler:
	EventHandler TALK_SELECTED(c0,fhtml0,npc0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,236) == 1 && gg::GetMemoState(talker,236) == 3 && gg::GetMemoStateEx(talker,236,1) == 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Seeds of Chaos (In Progress)");
			}
			if( gg::HaveMemo(talker,236) == 1 && gg::GetMemoState(talker,236) == 7 && gg::OwnItemCount(talker,9744) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Seeds of Chaos (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,236) == 1 && gg::GetMemoState(talker,236) == 3 && gg::GetMemoStateEx(talker,236,1) == 2 ) ) {
						myself::SetCurrentQuestID(236);
						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;
						}
						c0 = gg::GetCreatureFromIndex(myself.sm.param1);
						npc0 = gg::GetNPCFromID(myself.sm.param3);
						if( talker == c0 ) {
							myself::ShowPage(talker,"keitnat_q0236a_q0236_01b.htm");
						} else {
							myself::ShowPage(talker,"keitnat_q0236a_q0236_01z.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,236) == 1 && gg::GetMemoState(talker,236) == 7 && gg::OwnItemCount(talker,9744) == 0 ) ) {
						myself::SetCurrentQuestID(236);
						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,"keitnat_q0236a_q0236_05z.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(c0,npc0,timer_id) {
		myself::SetCurrentQuestID(236);
		if( timer_id == 23612 ) {
			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(23662,"","","","",""));
				}
			}
			myself::Despawn();
		}
		super;
	}

	EventHandler CREATED(c0,c1,i0) {
		myself::SetCurrentQuestID(236);
		c0 = gg::GetCreatureFromIndex(myself.sm.param1);
		myself::AddTimerEx(23612,( 1000 * 120 ));
		if( gg::IsNull(c0) == 0 ) {
			myself::Say(gg::MakeFString(23661,c0.name,"","","",""));
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,c0,npc0,reply,talker) {
		if( ask == 236 ) {
			myself::SetCurrentQuestID(236);
			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 == 236 ) {
			if( reply == 5 ) {
				if( gg::HaveMemo(talker,236) == 1 && gg::GetMemoState(talker,236) == 3 && gg::GetMemoStateEx(talker,236,1) == 2 ) {
					c0 = gg::GetCreatureFromIndex(myself.sm.param1);
					if( talker == c0 ) {
						myself::SetMemoState(talker,236,7);
						myself::SetMemoStateEx(talker,236,1,0);
						myself::ShowPage(talker,"keitnat_q0236a_q0236_05b.htm");
						myself::SetFlagJournal(talker,236,8);
						myself::ShowQuestMark(talker,236);
						myself::SoundEffect(talker,"ItemSound.quest_middle");
					}
				}
			}
			if( reply == 50 ) {
				c0 = gg::GetCreatureFromIndex(myself.sm.param1);
				npc0 = gg::GetNPCFromID(myself.sm.param3);
				if( talker == c0 ) {
					if( gg::IsNull(npc0) == 0 ) {
						npc0.i_quest0 = 0;
					}
					myself::Say(gg::MakeFString(23663,"","","","",""));
					myself::Despawn();
				}
			}
		}
		super;
	}

}
