class 1 mysterious_knight : citizen
{
handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,242) == 1 && talker.subjob_id == 0 && myself::GetOneTimeQuestFlag(talker,242) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Possessor of a Precious Soul - 2 (Continue)");
			}
			if( myself::HaveMemo(talker,242) == 1 && talker.subjob_id != 0 && myself::GetMemoState(talker,242) == 3 && myself::GetOneTimeQuestFlag(talker,242) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Possessor of a Precious Soul - 2 (Continue)");
			}
			if( myself::HaveMemo(talker,242) == 1 && talker.subjob_id != 0 && myself::GetMemoState(talker,242) == 4 && myself::GetOneTimeQuestFlag(talker,242) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Possessor of a Precious Soul - 2 (Continue)");
			}
			if( myself::HaveMemo(talker,242) == 1 && talker.subjob_id != 0 && myself::GetMemoState(talker,242) == 5 && myself::GetOneTimeQuestFlag(talker,242) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Possessor of a Precious Soul - 2 (Continue)");
			}
			if( myself::HaveMemo(talker,242) == 1 && talker.subjob_id != 0 && myself::GetMemoState(talker,242) == 6 && myself::GetOneTimeQuestFlag(talker,242) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Possessor of a Precious Soul - 2 (Continue)");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,242) == 1 && talker.subjob_id == 0 && myself::GetOneTimeQuestFlag(talker,242) == 0 ) )
					{
						myself::SetCurrentQuestID(242);
						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,"quest_not_subclass001.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,242) == 1 && talker.subjob_id != 0 && myself::GetMemoState(talker,242) == 3 && myself::GetOneTimeQuestFlag(talker,242) == 0 ) )
					{
						myself::SetCurrentQuestID(242);
						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,"mysterious_knight_q0242_01.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,242) == 1 && talker.subjob_id != 0 && myself::GetMemoState(talker,242) == 4 && myself::GetOneTimeQuestFlag(talker,242) == 0 ) )
					{
						myself::SetCurrentQuestID(242);
						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,"mysterious_knight_q0242_03.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,242) == 1 && talker.subjob_id != 0 && myself::GetMemoState(talker,242) == 5 && myself::GetOneTimeQuestFlag(talker,242) == 0 ) )
					{
						myself::SetCurrentQuestID(242);
						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::SetMemoState(talker,242,6);
						myself::SetFlagJournal(talker,242,6);
						myself::ShowPage(talker,"mysterious_knight_q0242_04.htm");
						myself::AddTimerEx(24204,( 1000 * 10 ));
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,242) == 1 && talker.subjob_id != 0 && myself::GetMemoState(talker,242) == 6 && myself::GetOneTimeQuestFlag(talker,242) == 0 ) )
					{
						myself::SetCurrentQuestID(242);
						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,"mysterious_knight_q0242_05.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id)
	{
		myself::SetCurrentQuestID(242);
		if( timer_id == 24203 )
		{
			myself::Despawn();
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 242 )
		{
			myself::SetCurrentQuestID(242);
			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 == 242 )
		{
			if( reply == 1 && myself::GetMemoState(talker,242) >= 3 )
			{
				myself::SetMemoState(talker,242,4);
				myself::ShowPage(talker,"mysterious_knight_q0242_02.htm");
				myself::SetFlagJournal(talker,242,4);
			}
		}
		super;
	}

}
