class 1 high_summoner_galatea : citizen
{
handler:
	EventHandler TALK_SELECTED(talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,230) == 0 && myself::GetOneTimeQuestFlag(talker,230) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Test of the Summoner");
			}
			if( myself::HaveMemo(talker,230) == 0 && myself::GetOneTimeQuestFlag(talker,230) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Test of the Summoner (Complete)");
			}
			if( myself::HaveMemo(talker,230) == 1 && myself::OwnItemCount(talker,3352) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Test of the Summoner (Continue)");
			}
			if( myself::HaveMemo(talker,230) == 1 && myself::OwnItemCount(talker,3352) == 0 && myself::OwnItemCount(talker,3353) < 1 )
			{
				if( myself::OwnItemCount(talker,3354) == 0 || myself::OwnItemCount(talker,3357) == 0 || myself::OwnItemCount(talker,3355) == 0 || myself::OwnItemCount(talker,3358) == 0 || myself::OwnItemCount(talker,3356) == 0 || myself::OwnItemCount(talker,3359) == 0 )
				{
					_choiceN = ( _choiceN + 1 );
					_code = 3;
					myself::AddChoice(3,"Test of the Summoner (Continue)");
				}
			}
			if( myself::HaveMemo(talker,230) == 1 && myself::OwnItemCount(talker,3352) == 0 && myself::OwnItemCount(talker,3353) >= 1 )
			{
				if( myself::OwnItemCount(talker,3354) == 0 || myself::OwnItemCount(talker,3357) == 0 || myself::OwnItemCount(talker,3355) == 0 || myself::OwnItemCount(talker,3358) == 0 || myself::OwnItemCount(talker,3356) == 0 || myself::OwnItemCount(talker,3359) == 0 )
				{
					_choiceN = ( _choiceN + 1 );
					_code = 4;
					myself::AddChoice(4,"Test of the Summoner (Continue)");
				}
			}
			if( myself::HaveMemo(talker,230) == 1 && myself::OwnItemCount(talker,3352) == 0 )
			{
				if( myself::OwnItemCount(talker,3354) >= 1 && myself::OwnItemCount(talker,3357) >= 1 && myself::OwnItemCount(talker,3355) >= 1 && myself::OwnItemCount(talker,3358) >= 1 && myself::OwnItemCount(talker,3356) >= 1 && myself::OwnItemCount(talker,3359) >= 1 )
				{
					_choiceN = ( _choiceN + 1 );
					_code = 5;
					myself::AddChoice(5,"Test of the Summoner (Continue)");
				}
			}
			if( talker.level >= 26 && myself::HaveMemo(talker,659) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"I'd Rather be Collecting Fairy Breath");
			}
			if( myself::HaveMemo(talker,659) == 1 && myself::GetMemoState(talker,659) == 1 && myself::OwnItemCount(talker,8286) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"I'd Rather be Collecting Fairy Breath (Continue)");
			}
			if( myself::HaveMemo(talker,659) == 1 && myself::GetMemoState(talker,659) == 1 && myself::OwnItemCount(talker,8286) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 8;
				myself::AddChoice(8,"I'd Rather be Collecting Fairy Breath (Continue)");
			}
			if( myself::HaveMemo(talker,133) == 1 && myself::GetMemoState(talker,133) == 2 && myself::OwnItemCount(talker,9785) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 9;
				myself::AddChoice(9,"That's Bloody Hot  ( In progress )");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,230) == 0 && myself::GetOneTimeQuestFlag(talker,230) == 0 ) )
					{
						myself::SetCurrentQuestID(230);
						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) < 16 )
						{
							if( ( talker.occupation == 11 || talker.occupation == 26 || talker.occupation == 39 ) && talker.level >= 39 )
							{
								myself::ShowPage(talker,"high_summoner_galatea_q0230_03.htm");
							}
							else if( talker.occupation == 11 || talker.occupation == 26 || talker.occupation == 39 )
							{
								myself::ShowPage(talker,"high_summoner_galatea_q0230_02.htm");
							}
							else
							{
								myself::ShowPage(talker,"high_summoner_galatea_q0230_01.htm");
							}
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,230) == 0 && myself::GetOneTimeQuestFlag(talker,230) == 1 ) )
					{
						myself::SetCurrentQuestID(230);
						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,"finishedquest.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,230) == 1 && myself::OwnItemCount(talker,3352) ) )
					{
						myself::SetCurrentQuestID(230);
						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,"high_summoner_galatea_q0230_09.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,230) == 1 && myself::OwnItemCount(talker,3352) == 0 && myself::OwnItemCount(talker,3353) < 1 ) )
					{
						if( myself::OwnItemCount(talker,3354) == 0 || myself::OwnItemCount(talker,3357) == 0 || myself::OwnItemCount(talker,3355) == 0 || myself::OwnItemCount(talker,3358) == 0 || myself::OwnItemCount(talker,3356) == 0 || myself::OwnItemCount(talker,3359) == 0 )
						{
							myself::SetCurrentQuestID(230);
							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,"high_summoner_galatea_q0230_10.htm");
						}
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,230) == 1 && myself::OwnItemCount(talker,3352) == 0 && myself::OwnItemCount(talker,3353) >= 1 ) )
					{
						if( myself::OwnItemCount(talker,3354) == 0 || myself::OwnItemCount(talker,3357) == 0 || myself::OwnItemCount(talker,3355) == 0 || myself::OwnItemCount(talker,3358) == 0 || myself::OwnItemCount(talker,3356) == 0 || myself::OwnItemCount(talker,3359) == 0 )
						{
							myself::SetCurrentQuestID(230);
							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,"high_summoner_galatea_q0230_11.htm");
						}
					}
					break;
				}
				case 5:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,230) == 1 && myself::OwnItemCount(talker,3352) == 0 ) )
					{
						if( myself::OwnItemCount(talker,3354) >= 1 && myself::OwnItemCount(talker,3357) >= 1 && myself::OwnItemCount(talker,3355) >= 1 && myself::OwnItemCount(talker,3358) >= 1 && myself::OwnItemCount(talker,3356) >= 1 && myself::OwnItemCount(talker,3359) >= 1 )
						{
							myself::SetCurrentQuestID(230);
							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::IncrementParam(talker,0,148409);
								myself::IncrementParam(talker,1,30000);
								myself::ShowPage(talker,"high_summoner_galatea_q0230_12.htm");
								myself::RemoveMemo(talker,230);
								myself::AddLog(2,talker,230);
								myself::SoundEffect(talker,"ItemSound.quest_finish");
								myself::SetOneTimeQuestFlag(talker,230,1);
								myself::GiveItem1(talker,3336,1);
								myself::DeleteItem1(talker,3347,myself::OwnItemCount(talker,3347));
								myself::DeleteItem1(talker,3348,myself::OwnItemCount(talker,3348));
								myself::DeleteItem1(talker,3349,myself::OwnItemCount(talker,3349));
								myself::DeleteItem1(talker,3350,myself::OwnItemCount(talker,3350));
								myself::DeleteItem1(talker,3351,myself::OwnItemCount(talker,3351));
								myself::DeleteItem1(talker,3354,myself::OwnItemCount(talker,3354));
								myself::DeleteItem1(talker,3357,myself::OwnItemCount(talker,3357));
								myself::DeleteItem1(talker,3355,myself::OwnItemCount(talker,3355));
								myself::DeleteItem1(talker,3358,myself::OwnItemCount(talker,3358));
								myself::DeleteItem1(talker,3356,myself::OwnItemCount(talker,3356));
								myself::DeleteItem1(talker,3359,myself::OwnItemCount(talker,3359));
							}
						}
					}
					break;
				}
				case 6:
				{
					if( _from_choice == 0 || ( talker.level >= 26 && myself::HaveMemo(talker,659) == 0 ) )
					{
						myself::SetCurrentQuestID(659);
						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) < 25 )
						{
							myself::ShowPage(talker,"high_summoner_galatea_q0659_01.htm");
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 7:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,659) == 1 && myself::GetMemoState(talker,659) == 1 && myself::OwnItemCount(talker,8286) == 0 ) )
					{
						myself::SetCurrentQuestID(659);
						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,"high_summoner_galatea_q0659_03.htm");
					}
					break;
				}
				case 8:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,659) == 1 && myself::GetMemoState(talker,659) == 1 && myself::OwnItemCount(talker,8286) >= 1 ) )
					{
						myself::SetCurrentQuestID(659);
						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,"high_summoner_galatea_q0659_04.htm");
					}
					break;
				}
				case 9:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,133) == 1 && myself::GetMemoState(talker,133) == 2 && myself::OwnItemCount(talker,9785) >= 1 ) )
					{
						myself::SetCurrentQuestID(133);
						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,"high_summoner_galatea_q0133_01.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker)
	{
		if( quest_id == 230 )
		{
			myself::SetCurrentQuestID(230);
			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::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowPage(talker,"high_summoner_galatea_q0230_08.htm");
				myself::AddLog(1,talker,230);
				myself::GiveItem1(talker,3352,1);
				myself::SetFlagJournal(talker,230,1);
			}
			return;
		}
		if( quest_id == 659 )
		{
			myself::SetCurrentQuestID(659);
			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::SetMemoState(talker,quest_id,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowPage(talker,"high_summoner_galatea_q0659_02.htm");
				myself::AddLog(1,talker,quest_id);
				myself::SetFlagJournal(talker,quest_id,1);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,fhtml0,reply,talker,i0)
	{
		if( ask == 230 )
		{
			myself::SetCurrentQuestID(230);
			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 == 230 )
		{
			if( reply == 1 )
			{
				myself::ShowPage(talker,"high_summoner_galatea_q0230_04.htm");
			}
			else if( reply == 2 )
			{
				myself::ShowPage(talker,"high_summoner_galatea_q0230_05.htm");
			}
			else if( reply == 3 )
			{
				myself::ShowPage(talker,"high_summoner_galatea_q0230_06.htm");
			}
			else if( reply == 4 )
			{
				myself::FHTML_SetFileName(fhtml0,"high_summoner_galatea_q0230_07.htm");
				myself::FHTML_SetInt(fhtml0,"quest_id",230);
				myself::ShowFHTML(talker,fhtml0);
			}
		}
		if( ask == 659 )
		{
			myself::SetCurrentQuestID(659);
			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 == 659 )
		{
			if( reply == 1 )
			{
				i0 = 0;
				if( myself::OwnItemCount(talker,8286) >= 10 )
				{
					i0 = 5365;
				}
				i0 = ( i0 + ( 50 * myself::OwnItemCount(talker,8286) ) );
				myself::GiveItem1(talker,57,i0);
				myself::DeleteItem1(talker,8286,myself::OwnItemCount(talker,8286));
				myself::ShowPage(talker,"high_summoner_galatea_q0659_05.htm");
			}
			if( reply == 2 )
			{
				myself::ShowPage(talker,"high_summoner_galatea_q0659_06.htm");
			}
			if( reply == 3 )
			{
				myself::RemoveMemo(talker,659);
				myself::AddLog(2,talker,659);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
			}
		}
		if( ask == 133 )
		{
			myself::SetCurrentQuestID(133);
			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 == 133 )
		{
			if( reply == 1 )
			{
				myself::ShowPage(talker,"high_summoner_galatea_q0133_04.htm");
				myself::RemoveMemo(talker,133);
				myself::DeleteItem1(talker,9785,1);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
				myself::SetOneTimeQuestFlag(talker,133,1);
				myself::IncrementParam(talker,0,1);
			}
		}
		super;
	}

}
