class 1 gantaki_zu_urutu : citizen
{
handler:
	EventHandler TALK_SELECTED(talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,415) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Path to an Orc Monk");
			}
			if( myself::HaveMemo(talker,415) == 1 && myself::OwnItemCount(talker,1603) == 0 && myself::OwnItemCount(talker,1593) == 1 && myself::OwnItemCount(talker,1605) == 0 && myself::OwnItemCount(talker,1604) == 0 && ( ( ( ( ( myself::OwnItemCount(talker,1594) + myself::OwnItemCount(talker,1595) ) + myself::OwnItemCount(talker,1596) ) + myself::OwnItemCount(talker,1597) ) + myself::OwnItemCount(talker,1598) ) + myself::OwnItemCount(talker,1599) ) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Path to an Orc Monk (Continue)");
			}
			if( myself::HaveMemo(talker,415) == 1 && myself::OwnItemCount(talker,1603) == 0 && myself::OwnItemCount(talker,1593) == 0 && myself::OwnItemCount(talker,1605) == 0 && myself::OwnItemCount(talker,1604) == 0 && ( ( ( ( ( myself::OwnItemCount(talker,1594) + myself::OwnItemCount(talker,1595) ) + myself::OwnItemCount(talker,1596) ) + myself::OwnItemCount(talker,1597) ) + myself::OwnItemCount(talker,1598) ) + myself::OwnItemCount(talker,1599) ) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Path to an Orc Monk (Continue)");
			}
			if( myself::HaveMemo(talker,415) == 1 && myself::OwnItemCount(talker,1603) == 1 && myself::OwnItemCount(talker,1593) == 0 && myself::OwnItemCount(talker,1605) == 0 && myself::OwnItemCount(talker,1604) == 1 && ( ( ( ( ( myself::OwnItemCount(talker,1594) + myself::OwnItemCount(talker,1595) ) + myself::OwnItemCount(talker,1596) ) + myself::OwnItemCount(talker,1597) ) + myself::OwnItemCount(talker,1598) ) + myself::OwnItemCount(talker,1599) ) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Path to an Orc Monk (Continue)");
			}
			if( myself::HaveMemo(talker,415) == 1 && myself::OwnItemCount(talker,1603) == 1 && myself::OwnItemCount(talker,1593) == 0 && myself::OwnItemCount(talker,1605) == 1 && myself::OwnItemCount(talker,1604) == 0 && ( ( ( ( ( myself::OwnItemCount(talker,1594) + myself::OwnItemCount(talker,1595) ) + myself::OwnItemCount(talker,1596) ) + myself::OwnItemCount(talker,1597) ) + myself::OwnItemCount(talker,1598) ) + myself::OwnItemCount(talker,1599) ) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Path to an Orc Monk (Continue)");
			}
			if( myself::HaveMemo(talker,415) == 1 && myself::OwnItemCount(talker,1603) == 1 && myself::OwnItemCount(talker,1593) == 0 && myself::OwnItemCount(talker,1605) == 0 && myself::OwnItemCount(talker,1604) == 0 && ( ( ( ( ( myself::OwnItemCount(talker,1594) + myself::OwnItemCount(talker,1595) ) + myself::OwnItemCount(talker,1596) ) + myself::OwnItemCount(talker,1597) ) + myself::OwnItemCount(talker,1598) ) + myself::OwnItemCount(talker,1599) ) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Path to an Orc Monk (Continue)");
			}
			if( myself::HaveMemo(talker,4) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Long Live the Pa'agrio Lord (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,415) == 0 )
					{
						myself::SetCurrentQuestID(415);
						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::GetMemoCount(talker) < 26 )
						{
							myself::ShowPage(talker,"gantaki_zu_urutu_q0415_01.htm");
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,415) == 1 && myself::OwnItemCount(talker,1603) == 0 && myself::OwnItemCount(talker,1593) == 1 && myself::OwnItemCount(talker,1605) == 0 && myself::OwnItemCount(talker,1604) == 0 && ( ( ( ( ( myself::OwnItemCount(talker,1594) + myself::OwnItemCount(talker,1595) ) + myself::OwnItemCount(talker,1596) ) + myself::OwnItemCount(talker,1597) ) + myself::OwnItemCount(talker,1598) ) + myself::OwnItemCount(talker,1599) ) == 0 ) )
					{
						myself::SetCurrentQuestID(415);
						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,"gantaki_zu_urutu_q0415_07.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,415) == 1 && myself::OwnItemCount(talker,1603) == 0 && myself::OwnItemCount(talker,1593) == 0 && myself::OwnItemCount(talker,1605) == 0 && myself::OwnItemCount(talker,1604) == 0 && ( ( ( ( ( myself::OwnItemCount(talker,1594) + myself::OwnItemCount(talker,1595) ) + myself::OwnItemCount(talker,1596) ) + myself::OwnItemCount(talker,1597) ) + myself::OwnItemCount(talker,1598) ) + myself::OwnItemCount(talker,1599) ) == 1 ) )
					{
						myself::SetCurrentQuestID(415);
						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,"gantaki_zu_urutu_q0415_08.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,415) == 1 && myself::OwnItemCount(talker,1603) == 1 && myself::OwnItemCount(talker,1593) == 0 && myself::OwnItemCount(talker,1605) == 0 && myself::OwnItemCount(talker,1604) == 1 && ( ( ( ( ( myself::OwnItemCount(talker,1594) + myself::OwnItemCount(talker,1595) ) + myself::OwnItemCount(talker,1596) ) + myself::OwnItemCount(talker,1597) ) + myself::OwnItemCount(talker,1598) ) + myself::OwnItemCount(talker,1599) ) == 0 ) )
					{
						myself::SetCurrentQuestID(415);
						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,"gantaki_zu_urutu_q0415_09.htm");
							myself::DeleteItem1(talker,1604,1);
							myself::GiveItem1(talker,1605,1);
							myself::SetFlagJournal(talker,415,9);
						}
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,415) == 1 && myself::OwnItemCount(talker,1603) == 1 && myself::OwnItemCount(talker,1593) == 0 && myself::OwnItemCount(talker,1605) == 1 && myself::OwnItemCount(talker,1604) == 0 && ( ( ( ( ( myself::OwnItemCount(talker,1594) + myself::OwnItemCount(talker,1595) ) + myself::OwnItemCount(talker,1596) ) + myself::OwnItemCount(talker,1597) ) + myself::OwnItemCount(talker,1598) ) + myself::OwnItemCount(talker,1599) ) == 0 ) )
					{
						myself::SetCurrentQuestID(415);
						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,"gantaki_zu_urutu_q0415_10.htm");
					}
					break;
				}
				case 5:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,415) == 1 && myself::OwnItemCount(talker,1603) == 1 && myself::OwnItemCount(talker,1593) == 0 && myself::OwnItemCount(talker,1605) == 0 && myself::OwnItemCount(talker,1604) == 0 && ( ( ( ( ( myself::OwnItemCount(talker,1594) + myself::OwnItemCount(talker,1595) ) + myself::OwnItemCount(talker,1596) ) + myself::OwnItemCount(talker,1597) ) + myself::OwnItemCount(talker,1598) ) + myself::OwnItemCount(talker,1599) ) == 0 ) )
					{
						myself::SetCurrentQuestID(415);
						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,"gantaki_zu_urutu_q0415_11.htm");
					}
					break;
				}
				case 6:
				{
					if( _from_choice == 0 || myself::HaveMemo(talker,4) == 1 )
					{
						myself::SetCurrentQuestID(4);
						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,1546) < 1 )
						{
							if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
							{
								talker.quest_last_reward_time = myself::GetCurrentTick();
								myself::ShowPage(talker,"gantaki_zu_urutu_q0004_01.htm");
								myself::GiveItem1(talker,1546,1);
								if( ( ( ( ( ( myself::OwnItemCount(talker,1541) + myself::OwnItemCount(talker,1542) ) + myself::OwnItemCount(talker,1543) ) + myself::OwnItemCount(talker,1544) ) + myself::OwnItemCount(talker,1545) ) + myself::OwnItemCount(talker,1546) ) >= 5 )
								{
									myself::SetFlagJournal(talker,4,2);
								}
								myself::SoundEffect(talker,"ItemSound.quest_itemget");
							}
						}
						else if( myself::OwnItemCount(talker,1546) >= 1 )
						{
							myself::ShowPage(talker,"gantaki_zu_urutu_q0004_02.htm");
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker)
	{
		if( quest_id == 415 )
		{
			myself::SetCurrentQuestID(415);
			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::SetMemo(talker,quest_id);
				myself::AddLog(1,talker,415);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowPage(talker,"gantaki_zu_urutu_q0415_06.htm");
				myself::GiveItem1(talker,1593,1);
				myself::SetFlagJournal(talker,415,1);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,fhtml0,quest_id,reply,talker)
	{
		if( ask == 415 )
		{
			myself::SetCurrentQuestID(415);
			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 == 415 && reply == 1 )
		{
			if( talker.occupation != 44 )
			{
				if( talker.occupation == 47 )
				{
					myself::ShowPage(talker,"gantaki_zu_urutu_q0415_02a.htm");
				}
				else
				{
					myself::ShowPage(talker,"gantaki_zu_urutu_q0415_02.htm");
				}
			}
			else if( talker.level < 19 )
			{
				myself::ShowPage(talker,"gantaki_zu_urutu_q0415_03.htm");
			}
			else if( myself::OwnItemCount(talker,1615) != 0 )
			{
				myself::ShowPage(talker,"gantaki_zu_urutu_q0415_04.htm");
			}
			else
			{
				myself::FHTML_SetFileName(fhtml0,"gantaki_zu_urutu_q0415_05.htm");
				myself::FHTML_SetInt(fhtml0,"quest_id",415);
				myself::ShowFHTML(talker,fhtml0);
			}
		}
		super;
	}

}
