class 1 master_karamon : fighter_coach
{
handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,71) == 1 && talker.occupation == 20 && myself::GetMemoState(talker,71) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Succession to the Legend, Eva's Templar");
			}
			if( myself::HaveMemo(talker,71) == 1 && talker.occupation == 20 && myself::GetMemoState(talker,71) >= 2 && myself::GetMemoState(talker,71) <= 4 && myself::OwnItemCount(talker,7535) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Succession to the Legend, Eva's Templar");
			}
			if( myself::HaveMemo(talker,71) == 1 && talker.occupation == 20 && myself::GetMemoState(talker,71) >= 2 && myself::GetMemoState(talker,71) <= 4 && myself::OwnItemCount(talker,7535) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Succession to the Legend, Eva's Templar");
			}
			if( myself::HaveMemo(talker,71) == 1 && talker.occupation == 20 && myself::GetMemoState(talker,71) == 5 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Succession to the Legend, Eva's Templar");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,71) == 1 && talker.occupation == 20 && myself::GetMemoState(talker,71) == 1 ) )
					{
						myself::SetCurrentQuestID(71);
						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,"master_karamon_q0071_0101.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,71) == 1 && talker.occupation == 20 && myself::GetMemoState(talker,71) >= 2 && myself::GetMemoState(talker,71) <= 4 && myself::OwnItemCount(talker,7535) == 0 ) )
					{
						myself::SetCurrentQuestID(71);
						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,"master_karamon_q0071_0102.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,71) == 1 && talker.occupation == 20 && myself::GetMemoState(talker,71) >= 2 && myself::GetMemoState(talker,71) <= 4 && myself::OwnItemCount(talker,7535) >= 1 ) )
					{
						myself::SetCurrentQuestID(71);
						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,"master_karamon_q0071_0103.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,71) == 1 && talker.occupation == 20 && myself::GetMemoState(talker,71) == 5 ) )
					{
						myself::SetCurrentQuestID(71);
						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,"master_karamon_q0071_0104.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 71 )
		{
			myself::SetCurrentQuestID(71);
			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 == 71 )
		{
			if( reply == 1 )
			{
				if( myself::HaveMemo(talker,71) == 1 && talker.occupation == 20 && myself::GetMemoState(talker,71) == 1 )
				{
					myself::SetMemoState(talker,71,2);
					myself::ShowPage(talker,"master_karamon_q0071_0105.htm");
					myself::SetFlagJournal(talker,71,2);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
			if( reply == 2 )
			{
				if( myself::HaveMemo(talker,71) == 1 && talker.occupation == 20 && myself::GetMemoState(talker,71) >= 2 && myself::GetMemoState(talker,71) <= 4 && myself::OwnItemCount(talker,7535) >= 1 )
				{
					if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
					{
						talker.quest_last_reward_time = myself::GetCurrentTick();
						myself::GiveItem1(talker,7269,1);
						myself::DeleteItem1(talker,7535,myself::OwnItemCount(talker,7535));
						myself::SetMemoState(talker,71,5);
						myself::ShowPage(talker,"master_karamon_q0071_0106.htm");
						myself::SetFlagJournal(talker,71,5);
						myself::SoundEffect(talker,"ItemSound.quest_middle");
					}
				}
			}
		}
		super;
	}

}
