class 1 claudia_a : citizen
{
handler:
	EventHandler TALK_SELECTED(fhtml0,i0,i1,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,348) == 1 && myself::OwnItemCount(talker,4289) > 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"An Arrogant Search (Continue)");
			}
			if( myself::HaveMemo(talker,348) == 1 && myself::GetMemoState(talker,348) < 8 && ( ( myself::GetMemoStateEx(talker,348,1) % 1000 ) / 100 ) == 1 && myself::OwnItemCount(talker,4292) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"An Arrogant Search (Continue)");
			}
			if( myself::HaveMemo(talker,348) == 1 && myself::OwnItemCount(talker,4292) > 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"An Arrogant Search (Continue)");
			}
			if( myself::HaveMemo(talker,348) == 1 && myself::OwnItemCount(talker,4397) > 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"An Arrogant Search (Continue)");
			}
			if( myself::HaveMemo(talker,372) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Legacy of Insolence (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,348) == 1 && myself::OwnItemCount(talker,4289) > 0 ) )
					{
						myself::SetCurrentQuestID(348);
						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;
						}
						i0 = myself::GetMemoStateEx(talker,348,1);
						i0 = ( i0 + 100 );
						if( ( i0 % 10 ) == 0 )
						{
							myself::ShowRadar(talker,181472,7158,-2725,1);
						}
						else
						{
							myself::SetFlagJournal(talker,348,9);
						}
						myself::SetMemoStateEx(talker,348,1,i0);
						myself::DeleteItem1(talker,4289,1);
						myself::ShowPage(talker,"claudia_a_q0348_01.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,348) == 1 && myself::GetMemoState(talker,348) < 8 && ( ( myself::GetMemoStateEx(talker,348,1) % 1000 ) / 100 ) == 1 && myself::OwnItemCount(talker,4292) == 0 ) )
					{
						myself::SetCurrentQuestID(348);
						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::GetMemoStateEx(talker,348,1) % 10 ) == 0 )
						{
							myself::ShowRadar(talker,181472,7158,-2725,1);
						}
						myself::ShowPage(talker,"claudia_a_q0348_03.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,348) == 1 && myself::OwnItemCount(talker,4292) > 0 ) )
					{
						myself::SetCurrentQuestID(348);
						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::GetMemoStateEx(talker,348,1) % 10 ) == 0 )
						{
							myself::ShowRadar(talker,181472,7158,-2725,1);
						}
						myself::ShowPage(talker,"claudia_a_q0348_04.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,348) == 1 && myself::OwnItemCount(talker,4397) > 0 ) )
					{
						myself::SetCurrentQuestID(348);
						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,"claudia_a_q0348_05.htm");
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || myself::HaveMemo(talker,372) == 1 )
					{
						myself::SetCurrentQuestID(372);
						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();
							if( myself::OwnItemCount(talker,5972) < 1 || myself::OwnItemCount(talker,5973) < 1 || myself::OwnItemCount(talker,5974) < 1 || myself::OwnItemCount(talker,5975) < 1 || myself::OwnItemCount(talker,5976) < 1 || myself::OwnItemCount(talker,5977) < 1 || myself::OwnItemCount(talker,5978) < 1 )
							{
								myself::ShowPage(talker,"claudia_a_q0372_01.htm");
							}
							else if( myself::OwnItemCount(talker,5972) >= 1 && myself::OwnItemCount(talker,5973) >= 1 && myself::OwnItemCount(talker,5974) >= 1 && myself::OwnItemCount(talker,5975) >= 1 && myself::OwnItemCount(talker,5976) >= 1 && myself::OwnItemCount(talker,5977) >= 1 && myself::OwnItemCount(talker,5978) >= 1 )
							{
								myself::DeleteItem1(talker,5972,1);
								myself::DeleteItem1(talker,5973,1);
								myself::DeleteItem1(talker,5974,1);
								myself::DeleteItem1(talker,5975,1);
								myself::DeleteItem1(talker,5976,1);
								myself::DeleteItem1(talker,5977,1);
								myself::DeleteItem1(talker,5978,1);
								myself::AddLog(3,talker,372);
								i1 = gg::Rand(100);
								if( i1 < 31 )
								{
									myself::GiveItem1(talker,5502,1);
								}
								else if( i1 < 62 )
								{
									myself::GiveItem1(talker,5514,1);
								}
								else if( i1 < 75 )
								{
									myself::GiveItem1(talker,5527,1);
								}
								else if( i1 < 83 )
								{
									myself::GiveItem1(talker,5502,1);
									myself::GiveItem1(talker,5514,1);
									myself::GiveItem1(talker,5527,1);
								}
								else if( i1 < 100 )
								{
									myself::GiveItem1(talker,57,4000);
								}
								myself::ShowPage(talker,"claudia_a_q0372_02.htm");
							}
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 348 )
		{
			myself::SetCurrentQuestID(348);
			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 == 348 )
		{
			if( reply == 1 )
			{
				myself::ShowPage(talker,"claudia_a_q0348_02.htm");
			}
		}
		super;
	}

}
