class 1 alankell : citizen
{
handler:
	EventHandler TALK_SELECTED(talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2784) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Test of the Searcher (Continue)");
			}
			if( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2785) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Test of the Searcher (Continue)");
			}
			if( myself::HaveMemo(talker,225) == 1 && ( myself::OwnItemCount(talker,2786) == 1 || myself::OwnItemCount(talker,2788) == 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Test of the Searcher (Continue)");
			}
			if( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2790) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Test of the Searcher (Continue)");
			}
			if( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2794) == 1 && myself::OwnItemCount(talker,2793) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Test of the Searcher (Continue)");
			}
			if( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2794) == 1 && ( myself::OwnItemCount(talker,2799) == 1 || myself::OwnItemCount(talker,2800) == 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Test of the Searcher (Continue)");
			}
			if( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2794) == 1 && myself::OwnItemCount(talker,2805) == 1 && myself::OwnItemCount(talker,2807) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Test of the Searcher (Continue)");
			}
			if( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2794) == 1 && myself::OwnItemCount(talker,2805) == 1 && myself::OwnItemCount(talker,2807) == 20 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Test of the Searcher (Continue)");
			}
			if( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2808) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 8;
				myself::AddChoice(8,"Test of the Searcher (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,225) == 1 && myself::OwnItemCount(talker,2784) == 1 ) )
					{
						myself::SetCurrentQuestID(225);
						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,"alankell_q0225_01.htm");
							myself::GiveItem1(talker,2785,1);
							myself::DeleteItem1(talker,2784,myself::OwnItemCount(talker,2784));
							myself::SetFlagJournal(talker,225,2);
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2785) == 1 ) )
					{
						myself::SetCurrentQuestID(225);
						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,"alankell_q0225_02.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,225) == 1 && ( myself::OwnItemCount(talker,2786) == 1 || myself::OwnItemCount(talker,2788) == 1 ) ) )
					{
						myself::SetCurrentQuestID(225);
						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,"alankell_q0225_03.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2790) == 1 ) )
					{
						myself::SetCurrentQuestID(225);
						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,"alankell_q0225_04.htm");
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2794) == 1 && myself::OwnItemCount(talker,2793) == 1 ) )
					{
						myself::SetCurrentQuestID(225);
						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,"alankell_q0225_08.htm");
					}
					break;
				}
				case 5:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2794) == 1 && ( myself::OwnItemCount(talker,2799) == 1 || myself::OwnItemCount(talker,2800) == 1 ) ) )
					{
						myself::SetCurrentQuestID(225);
						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,"alankell_q0225_09.htm");
					}
					break;
				}
				case 6:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2794) == 1 && myself::OwnItemCount(talker,2805) == 1 && myself::OwnItemCount(talker,2807) == 0 ) )
					{
						myself::SetCurrentQuestID(225);
						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,"alankell_q0225_10.htm");
					}
					break;
				}
				case 7:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2794) == 1 && myself::OwnItemCount(talker,2805) == 1 && myself::OwnItemCount(talker,2807) == 20 ) )
					{
						myself::SetCurrentQuestID(225);
						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,"alankell_q0225_11.htm");
							myself::DeleteItem1(talker,2794,1);
							myself::GiveItem1(talker,2808,1);
							myself::DeleteItem1(talker,2805,myself::OwnItemCount(talker,2805));
							myself::DeleteItem1(talker,2807,myself::OwnItemCount(talker,2807));
							myself::DeleteRadar(talker,10133,157155,-2383,2);
							myself::SetFlagJournal(talker,225,19);
						}
					}
					break;
				}
				case 8:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,225) == 1 && myself::OwnItemCount(talker,2808) == 1 ) )
					{
						myself::SetCurrentQuestID(225);
						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,"alankell_q0225_12.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 225 )
		{
			myself::SetCurrentQuestID(225);
			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 == 225 )
		{
			if( reply == 1 )
			{
				myself::ShowPage(talker,"alankell_q0225_05.htm");
			}
			if( reply == 2 )
			{
				myself::ShowPage(talker,"alankell_q0225_06.htm");
			}
			if( reply == 3 )
			{
				if( myself::OwnItemCount(talker,2790) >= 1 && myself::OwnItemCount(talker,2791) >= 1 )
				{
					if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
					{
						talker.quest_last_reward_time = myself::GetCurrentTick();
						myself::ShowPage(talker,"alankell_q0225_07.htm");
						myself::DeleteItem1(talker,2790,1);
						myself::GiveItem1(talker,2792,1);
						myself::DeleteItem1(talker,2791,1);
						myself::GiveItem1(talker,2793,1);
						myself::GiveItem1(talker,2794,1);
						myself::SetFlagJournal(talker,225,8);
					}
				}
			}
		}
		super;
	}

}
