class 1 lucas : chief_guard
{
handler:
	EventHandler TALK_SELECTED(talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,214) == 1 && myself::OwnItemCount(talker,2675) >= 1 && myself::OwnItemCount(talker,2689) >= 1 && myself::OwnItemCount(talker,2679) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Trial of the Scholar");
			}
			if( myself::HaveMemo(talker,214) == 1 && myself::OwnItemCount(talker,2675) >= 1 && myself::OwnItemCount(talker,2689) >= 1 && ( myself::OwnItemCount(talker,2680) >= 1 || myself::OwnItemCount(talker,2683) >= 1 || myself::OwnItemCount(talker,2682) >= 1 || myself::OwnItemCount(talker,2684) >= 1 || myself::OwnItemCount(talker,2681) >= 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Trial of the Scholar");
			}
			if( myself::HaveMemo(talker,214) == 1 && myself::OwnItemCount(talker,2675) >= 1 && myself::OwnItemCount(talker,2689) >= 1 && myself::OwnItemCount(talker,2685) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Trial of the Scholar");
			}
			if( myself::HaveMemo(talker,214) == 1 && myself::OwnItemCount(talker,2675) >= 1 && myself::OwnItemCount(talker,2689) >= 1 && myself::OwnItemCount(talker,2686) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Trial of the Scholar");
			}
			if( myself::HaveMemo(talker,214) == 1 && ( myself::OwnItemCount(talker,2693) >= 1 || myself::OwnItemCount(talker,2676) >= 1 || myself::OwnItemCount(talker,2677) >= 1 || myself::OwnItemCount(talker,2688) >= 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Trial of the Scholar");
			}
			if( myself::HaveMemo(talker,65) == 1 && myself::GetMemoState(talker,65) == 7 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Certified Soul Breaker (Continue)");
			}
			if( myself::HaveMemo(talker,65) == 1 && myself::GetMemoState(talker,65) == 8 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Certified Soul Breaker (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,214) == 1 && myself::OwnItemCount(talker,2675) >= 1 && myself::OwnItemCount(talker,2689) >= 1 && myself::OwnItemCount(talker,2679) >= 1 ) )
					{
						myself::SetCurrentQuestID(214);
						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::ShowPage(talker,"lucas_q0214_01.htm");
							myself::SetFlagJournal(talker,214,4);
							myself::DeleteItem1(talker,2679,1);
							myself::GiveItem1(talker,2681,1);
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,214) == 1 && myself::OwnItemCount(talker,2675) >= 1 && myself::OwnItemCount(talker,2689) >= 1 && ( myself::OwnItemCount(talker,2680) >= 1 || myself::OwnItemCount(talker,2683) >= 1 || myself::OwnItemCount(talker,2682) >= 1 || myself::OwnItemCount(talker,2684) >= 1 || myself::OwnItemCount(talker,2681) >= 1 ) ) )
					{
						myself::SetCurrentQuestID(214);
						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,"lucas_q0214_02.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,214) == 1 && myself::OwnItemCount(talker,2675) >= 1 && myself::OwnItemCount(talker,2689) >= 1 && myself::OwnItemCount(talker,2685) >= 1 ) )
					{
						myself::SetCurrentQuestID(214);
						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,"lucas_q0214_03.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,214) == 1 && myself::OwnItemCount(talker,2675) >= 1 && myself::OwnItemCount(talker,2689) >= 1 && myself::OwnItemCount(talker,2686) >= 1 ) )
					{
						myself::SetCurrentQuestID(214);
						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,2687) < 5 )
						{
							myself::ShowPage(talker,"lucas_q0214_05.htm");
						}
						else
						{
							myself::ShowPage(talker,"lucas_q0214_06.htm");
						}
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,214) == 1 && ( myself::OwnItemCount(talker,2693) >= 1 || myself::OwnItemCount(talker,2676) >= 1 || myself::OwnItemCount(talker,2677) >= 1 || myself::OwnItemCount(talker,2688) >= 1 ) ) )
					{
						myself::SetCurrentQuestID(214);
						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,"lucas_q0214_07.htm");
					}
					break;
				}
				case 5:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,65) == 1 && myself::GetMemoState(talker,65) == 7 ) )
					{
						myself::SetCurrentQuestID(65);
						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,"lucas_q065_01.htm");
					}
					break;
				}
				case 6:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,65) == 1 && myself::GetMemoState(talker,65) == 8 ) )
					{
						myself::SetCurrentQuestID(65);
						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,"lucas_q065_03.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 214 )
		{
			myself::SetCurrentQuestID(214);
			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( reply == 1 )
			{
				if( myself::OwnItemCount(talker,2685) >= 1 )
				{
					if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
					{
						talker.quest_last_reward_time = myself::GetCurrentTick();
						myself::ShowPage(talker,"lucas_q0214_04.htm");
						myself::SetFlagJournal(talker,214,10);
						myself::DeleteItem1(talker,2685,1);
						myself::GiveItem1(talker,2686,1);
					}
				}
			}
		}
		if( ask == 65 )
		{
			myself::SetCurrentQuestID(65);
			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( reply == 1 )
			{
				myself::ShowPage(talker,"lucas_q065_02.htm");
				myself::SetMemoState(talker,65,8);
				myself::SetFlagJournal(talker,65,8);
			}
		}
		super;
	}

}
