class 1 glyvka : cleric_coach
{
handler:
	EventHandler TALK_SELECTED(talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,330) == 1 && myself::OwnItemCount(talker,1420) == 1 && ( ( ( ( ( ( ( myself::OwnItemCount(talker,1424) + myself::OwnItemCount(talker,1425) ) + myself::OwnItemCount(talker,1429) ) + myself::OwnItemCount(talker,1430) ) + myself::OwnItemCount(talker,1433) ) + myself::OwnItemCount(talker,1437) ) + myself::OwnItemCount(talker,1438) ) + myself::OwnItemCount(talker,1441) ) < 5 && myself::OwnItemCount(talker,1434) == 0 && ( myself::OwnItemCount(talker,1437) + myself::OwnItemCount(talker,1438) ) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Adept of Taste (Continue)");
			}
			if( myself::HaveMemo(talker,330) == 1 && myself::OwnItemCount(talker,1420) == 1 && ( ( ( ( ( ( ( myself::OwnItemCount(talker,1424) + myself::OwnItemCount(talker,1425) ) + myself::OwnItemCount(talker,1429) ) + myself::OwnItemCount(talker,1430) ) + myself::OwnItemCount(talker,1433) ) + myself::OwnItemCount(talker,1437) ) + myself::OwnItemCount(talker,1438) ) + myself::OwnItemCount(talker,1441) ) < 5 && myself::OwnItemCount(talker,1434) == 1 && ( myself::OwnItemCount(talker,1435) + myself::OwnItemCount(talker,1436) ) < 20 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Adept of Taste (Continue)");
			}
			if( myself::HaveMemo(talker,330) == 1 && myself::OwnItemCount(talker,1420) == 1 && ( ( ( ( ( ( ( myself::OwnItemCount(talker,1424) + myself::OwnItemCount(talker,1425) ) + myself::OwnItemCount(talker,1429) ) + myself::OwnItemCount(talker,1430) ) + myself::OwnItemCount(talker,1433) ) + myself::OwnItemCount(talker,1437) ) + myself::OwnItemCount(talker,1438) ) + myself::OwnItemCount(talker,1441) ) < 5 && myself::OwnItemCount(talker,1434) == 1 && ( myself::OwnItemCount(talker,1435) + myself::OwnItemCount(talker,1436) ) >= 20 && myself::OwnItemCount(talker,1436) < 20 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Adept of Taste (Continue)");
			}
			if( myself::HaveMemo(talker,330) == 1 && myself::OwnItemCount(talker,1420) == 1 && ( ( ( ( ( ( ( myself::OwnItemCount(talker,1424) + myself::OwnItemCount(talker,1425) ) + myself::OwnItemCount(talker,1429) ) + myself::OwnItemCount(talker,1430) ) + myself::OwnItemCount(talker,1433) ) + myself::OwnItemCount(talker,1437) ) + myself::OwnItemCount(talker,1438) ) + myself::OwnItemCount(talker,1441) ) < 5 && myself::OwnItemCount(talker,1434) == 1 && ( myself::OwnItemCount(talker,1435) + myself::OwnItemCount(talker,1436) ) >= 20 && myself::OwnItemCount(talker,1436) >= 20 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Adept of Taste (Continue)");
			}
			if( myself::HaveMemo(talker,330) == 1 && myself::OwnItemCount(talker,1420) == 1 && ( ( ( ( ( ( ( myself::OwnItemCount(talker,1424) + myself::OwnItemCount(talker,1425) ) + myself::OwnItemCount(talker,1429) ) + myself::OwnItemCount(talker,1430) ) + myself::OwnItemCount(talker,1433) ) + myself::OwnItemCount(talker,1437) ) + myself::OwnItemCount(talker,1438) ) + myself::OwnItemCount(talker,1441) ) < 5 && myself::OwnItemCount(talker,1434) == 0 && ( myself::OwnItemCount(talker,1437) + myself::OwnItemCount(talker,1438) ) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Adept of Taste (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,330) == 1 && myself::OwnItemCount(talker,1420) == 1 && ( ( ( ( ( ( ( myself::OwnItemCount(talker,1424) + myself::OwnItemCount(talker,1425) ) + myself::OwnItemCount(talker,1429) ) + myself::OwnItemCount(talker,1430) ) + myself::OwnItemCount(talker,1433) ) + myself::OwnItemCount(talker,1437) ) + myself::OwnItemCount(talker,1438) ) + myself::OwnItemCount(talker,1441) ) < 5 && myself::OwnItemCount(talker,1434) == 0 && ( myself::OwnItemCount(talker,1437) + myself::OwnItemCount(talker,1438) ) == 0 ) )
					{
						myself::SetCurrentQuestID(330);
						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,"glyvka_q0330_01.htm");
							myself::GiveItem1(talker,1434,1);
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,330) == 1 && myself::OwnItemCount(talker,1420) == 1 && ( ( ( ( ( ( ( myself::OwnItemCount(talker,1424) + myself::OwnItemCount(talker,1425) ) + myself::OwnItemCount(talker,1429) ) + myself::OwnItemCount(talker,1430) ) + myself::OwnItemCount(talker,1433) ) + myself::OwnItemCount(talker,1437) ) + myself::OwnItemCount(talker,1438) ) + myself::OwnItemCount(talker,1441) ) < 5 && myself::OwnItemCount(talker,1434) == 1 && ( myself::OwnItemCount(talker,1435) + myself::OwnItemCount(talker,1436) ) < 20 ) )
					{
						myself::SetCurrentQuestID(330);
						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,"glyvka_q0330_02.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,330) == 1 && myself::OwnItemCount(talker,1420) == 1 && ( ( ( ( ( ( ( myself::OwnItemCount(talker,1424) + myself::OwnItemCount(talker,1425) ) + myself::OwnItemCount(talker,1429) ) + myself::OwnItemCount(talker,1430) ) + myself::OwnItemCount(talker,1433) ) + myself::OwnItemCount(talker,1437) ) + myself::OwnItemCount(talker,1438) ) + myself::OwnItemCount(talker,1441) ) < 5 && myself::OwnItemCount(talker,1434) == 1 && ( myself::OwnItemCount(talker,1435) + myself::OwnItemCount(talker,1436) ) >= 20 && myself::OwnItemCount(talker,1436) < 20 ) )
					{
						myself::SetCurrentQuestID(330);
						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,"glyvka_q0330_03.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,330) == 1 && myself::OwnItemCount(talker,1420) == 1 && ( ( ( ( ( ( ( myself::OwnItemCount(talker,1424) + myself::OwnItemCount(talker,1425) ) + myself::OwnItemCount(talker,1429) ) + myself::OwnItemCount(talker,1430) ) + myself::OwnItemCount(talker,1433) ) + myself::OwnItemCount(talker,1437) ) + myself::OwnItemCount(talker,1438) ) + myself::OwnItemCount(talker,1441) ) < 5 && myself::OwnItemCount(talker,1434) == 1 && ( myself::OwnItemCount(talker,1435) + myself::OwnItemCount(talker,1436) ) >= 20 && myself::OwnItemCount(talker,1436) >= 20 ) )
					{
						myself::SetCurrentQuestID(330);
						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,"glyvka_q0330_06.htm");
							myself::DeleteItem1(talker,1434,1);
							myself::DeleteItem1(talker,1435,myself::OwnItemCount(talker,1435));
							myself::DeleteItem1(talker,1436,myself::OwnItemCount(talker,1436));
							myself::GiveItem1(talker,1438,1);
						}
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,330) == 1 && myself::OwnItemCount(talker,1420) == 1 && ( ( ( ( ( ( ( myself::OwnItemCount(talker,1424) + myself::OwnItemCount(talker,1425) ) + myself::OwnItemCount(talker,1429) ) + myself::OwnItemCount(talker,1430) ) + myself::OwnItemCount(talker,1433) ) + myself::OwnItemCount(talker,1437) ) + myself::OwnItemCount(talker,1438) ) + myself::OwnItemCount(talker,1441) ) < 5 && myself::OwnItemCount(talker,1434) == 0 && ( myself::OwnItemCount(talker,1437) + myself::OwnItemCount(talker,1438) ) == 1 ) )
					{
						myself::SetCurrentQuestID(330);
						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,"glyvka_q0330_07.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 330 )
		{
			myself::SetCurrentQuestID(330);
			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 == 330 )
		{
			if( reply == 1 && myself::OwnItemCount(talker,1434) == 1 && ( myself::OwnItemCount(talker,1435) + myself::OwnItemCount(talker,1436) ) >= 20 && myself::OwnItemCount(talker,1436) < 20 )
			{
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
				{
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::ShowPage(talker,"glyvka_q0330_05.htm");
					myself::DeleteItem1(talker,1434,1);
					myself::DeleteItem1(talker,1435,myself::OwnItemCount(talker,1435));
					myself::DeleteItem1(talker,1436,myself::OwnItemCount(talker,1436));
					myself::GiveItem1(talker,1437,1);
				}
			}
		}
		super;
	}

}
