class 1 dufner : fighter_coach
{
handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,213) == 0 && myself::GetOneTimeQuestFlag(talker,213) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Trial of the Seeker");
			}
			if( myself::HaveMemo(talker,213) == 0 && myself::GetOneTimeQuestFlag(talker,213) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Trial of the Seeker (Complete)");
			}
			if( myself::HaveMemo(talker,213) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Trial of the Seeker (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,213) == 0 && myself::GetOneTimeQuestFlag(talker,213) == 0 ) )
					{
						myself::SetCurrentQuestID(213);
						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 )
						{
							if( talker.occupation == 7 || talker.occupation == 22 || talker.occupation == 35 ) == 0
							{
								myself::ShowPage(talker,"dufner_q0213_00.htm");
							}
							else if( ( talker.occupation == 7 || talker.occupation == 22 || talker.occupation == 35 ) && talker.level < 35 )
							{
								myself::ShowPage(talker,"dufner_q0213_02.htm");
							}
							else
							{
								myself::ShowPage(talker,"dufner_q0213_03.htm");
							}
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,213) == 0 && myself::GetOneTimeQuestFlag(talker,213) == 1 ) )
					{
						myself::SetCurrentQuestID(213);
						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,"finishedquest.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || myself::HaveMemo(talker,213) == 1 )
					{
						myself::SetCurrentQuestID(213);
						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::OwnItemCount(talker,2647) == 1 && myself::OwnItemCount(talker,2672) == 0 )
						{
							myself::ShowPage(talker,"dufner_q0213_06.htm");
						}
						else if( myself::OwnItemCount(talker,2647) == 0 && myself::OwnItemCount(talker,2672) == 0 )
						{
							myself::ShowPage(talker,"dufner_q0213_07.htm");
						}
						else if( myself::OwnItemCount(talker,2647) == 0 && myself::OwnItemCount(talker,2672) == 1 )
						{
							if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
							{
								talker.quest_last_reward_time = myself::GetCurrentTick();
								myself::IncrementParam(talker,0,72126);
								myself::IncrementParam(talker,1,11000);
								myself::GiveItem1(talker,7562,8);
								myself::ShowPage(talker,"dufner_q0213_08.htm");
								myself::RemoveMemo(talker,213);
								myself::SoundEffect(talker,"ItemSound.quest_finish");
								myself::SetOneTimeQuestFlag(talker,213,1);
								myself::DeleteItem1(talker,2672,myself::OwnItemCount(talker,2672));
								myself::GiveItem1(talker,2673,1);
							}
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker)
	{
		if( quest_id == 213 )
		{
			myself::SetCurrentQuestID(213);
			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.quest_last_reward_time = myself::GetCurrentTick();
				myself::SetMemo(talker,quest_id);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				if( myself::OwnItemCount(talker,2647) == 0 )
				{
					myself::GiveItem1(talker,2647,1);
				}
				myself::ShowPage(talker,"dufner_q0213_05.htm");
				myself::SetFlagJournal(talker,213,1);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,fhtml0,reply,talker)
	{
		if( ask == 213 )
		{
			myself::SetCurrentQuestID(213);
			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 == 213 )
		{
			if( reply == 1 )
			{
				myself::FHTML_SetFileName(fhtml0,"dufner_q0213_04.htm");
				myself::FHTML_SetInt(fhtml0,"quest_id",213);
				myself::ShowFHTML(talker,fhtml0);
			}
		}
		super;
	}

}
