class 1 lennunt_chief_harak : citizen
{
handler:
	EventHandler TALK_SELECTED(talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,220) == 1 && myself::OwnItemCount(talker,3209) && myself::OwnItemCount(talker,3210) && myself::OwnItemCount(talker,3215) == 0 && myself::OwnItemCount(talker,3232) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Testimony of Glory (Continue)");
			}
			if( myself::HaveMemo(talker,220) == 1 && myself::OwnItemCount(talker,3209) && myself::OwnItemCount(talker,3210) && myself::OwnItemCount(talker,3215) == 0 && myself::OwnItemCount(talker,3232) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Testimony of Glory (Continue)");
			}
			if( myself::HaveMemo(talker,220) == 1 && myself::OwnItemCount(talker,3209) && myself::OwnItemCount(talker,3210) && myself::OwnItemCount(talker,3215) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Testimony of Glory (Continue)");
			}
			if( myself::HaveMemo(talker,220) == 1 && ( myself::OwnItemCount(talker,3216) || myself::OwnItemCount(talker,3217) || myself::OwnItemCount(talker,3220) ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Testimony of Glory (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,220) == 1 && myself::OwnItemCount(talker,3209) && myself::OwnItemCount(talker,3210) && myself::OwnItemCount(talker,3215) == 0 && myself::OwnItemCount(talker,3232) == 0 ) )
					{
						myself::SetCurrentQuestID(220);
						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,"lennunt_chief_harak_q0220_01.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,220) == 1 && myself::OwnItemCount(talker,3209) && myself::OwnItemCount(talker,3210) && myself::OwnItemCount(talker,3215) == 0 && myself::OwnItemCount(talker,3232) ) )
					{
						myself::SetCurrentQuestID(220);
						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,"lennunt_chief_harak_q0220_02.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,220) == 1 && myself::OwnItemCount(talker,3209) && myself::OwnItemCount(talker,3210) && myself::OwnItemCount(talker,3215) ) )
					{
						myself::SetCurrentQuestID(220);
						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,"lennunt_chief_harak_q0220_04.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,220) == 1 && ( myself::OwnItemCount(talker,3216) || myself::OwnItemCount(talker,3217) || myself::OwnItemCount(talker,3220) ) ) )
					{
						myself::SetCurrentQuestID(220);
						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,"lennunt_chief_harak_q0220_05.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 220 )
		{
			myself::SetCurrentQuestID(220);
			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 == 220 )
		{
			if( reply == 1 && myself::OwnItemCount(talker,3232) > 0 )
			{
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
				{
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::ShowPage(talker,"lennunt_chief_harak_q0220_03.htm");
					myself::GiveItem1(talker,3215,1);
					myself::DeleteItem1(talker,3232,1);
					if( myself::OwnItemCount(talker,3214) >= 1 && myself::OwnItemCount(talker,3212) >= 1 && myself::OwnItemCount(talker,3211) >= 1 && myself::OwnItemCount(talker,3213) >= 1 )
					{
						myself::SetFlagJournal(talker,220,5);
					}
				}
			}
		}
		super;
	}

}
