class 1 master_tobias : dark_elf_lv2_master
{
handler:
	EventHandler TALK_SELECTED(fhtml0,talker,reply)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,63) == 1 && myself::GetMemoState(talker,63) == 7 && myself::OwnItemCount(talker,9767) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Path of the Warder (Continue)");
			}
			if( myself::HaveMemo(talker,63) == 1 && myself::GetMemoState(talker,63) == 8 && myself::OwnItemCount(talker,9768) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Path of the Warder (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,63) == 1 && myself::OwnItemCount(talker,9767) == 1 ) )
					{
						myself::SetCurrentQuestID(63);
						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_tobias_q063_01.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,63) == 1 && myself::OwnItemCount(talker,9768) == 1 ) )
					{
						myself::SetCurrentQuestID(63);
						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_tobias_q063_05.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 63 )
		{
			myself::SetCurrentQuestID(63);
			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 == 63 && reply == 1 )
		{
			myself::ShowPage(talker,"master_tobias_q063_04.htm");
			myself::DeleteItem1(talker,9767,1);
			myself::GiveItem1(talker,9768,1);
			myself::SetMemoState(talker,63,8);
			myself::SetFlagJournal(talker,63,8);
			myself::SoundEffect(talker,"ItemSound.quest_middle");
		}
		super;
	}

}
