class 1 printessa_spirit : printessa_spirit_old
{
handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( talker.level >= 74 && myself::GetOneTimeQuestFlag(talker,119) == 0 && myself::HaveMemo(talker,119) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Last Imperial Prince");
			}
			if( myself::HaveMemo(talker,119) == 0 && myself::GetOneTimeQuestFlag(talker,119) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Last Imperial Prince");
			}
			if( talker.level >= 74 && myself::HaveMemo(talker,119) == 1 && myself::GetMemoState(talker,119) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Last Imperial Prince - In Progress");
			}
			if( talker.level >= 74 && myself::HaveMemo(talker,119) == 1 && myself::GetMemoState(talker,119) == 2 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Last Imperial Prince - In Progress");
			}
			if( myself::HaveMemo(talker,654) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 8;
				myself::AddChoice(8,"Journey to a Settlement");
			}
			if( myself::HaveMemo(talker,654) == 1 && myself::GetMemoState(talker,654) == 2 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 9;
				myself::AddChoice(9,"Journey to a Settlement - In Progress");
			}
			if( myself::HaveMemo(talker,654) == 1 && myself::GetMemoState(talker,654) == 3 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 10;
				myself::AddChoice(10,"Journey to a Settlement - In Progress");
			}
			if( myself::HaveMemo(talker,654) == 1 && myself::GetMemoState(talker,654) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 11;
				myself::AddChoice(11,"Journey to a Settlement - In Progress");
			}
		}
		if( _from_choice )
		{
			switch(_code)
			{
				case 4:
				{
					if( _from_choice == 0 || ( talker.level >= 74 && myself::GetOneTimeQuestFlag(talker,119) == 0 && myself::HaveMemo(talker,119) == 0 ) )
					{
						myself::SetCurrentQuestID(119);
						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 )
						{
							if( talker.level >= 74 )
							{
								myself::FHTML_SetFileName(fhtml0,"printessa_spirit_q119_001.htm");
								myself::FHTML_SetInt(fhtml0,"quest_id",119);
								myself::ShowFHTML(talker,fhtml0);
							}
							else
							{
								myself::ShowPage(talker,"printessa_spirit_q119_004.htm");
							}
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 5:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,119) == 0 && myself::GetOneTimeQuestFlag(talker,119) == 1 ) )
					{
						myself::SetCurrentQuestID(119);
						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,"printessa_spirit_q119_002.htm");
					}
					break;
				}
				case 6:
				{
					if( _from_choice == 0 || ( talker.level >= 74 && myself::HaveMemo(talker,119) == 1 && myself::GetMemoState(talker,119) == 1 ) )
					{
						myself::SetCurrentQuestID(119);
						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,"printessa_spirit_q119_003.htm");
					}
					break;
				}
				case 7:
				{
					if( _from_choice == 0 || ( talker.level >= 74 && myself::HaveMemo(talker,119) == 1 && myself::GetMemoState(talker,119) == 2 ) )
					{
						myself::SetCurrentQuestID(119);
						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,"printessa_spirit_q119_005.htm");
						myself::GiveItem1(talker,57,68787);
						myself::RemoveMemo(talker,119);
						myself::SoundEffect(talker,"ItemSound.quest_finish");
					}
					break;
				}
				case 8:
				{
					if( _from_choice == 0 || myself::HaveMemo(talker,654) == 0 )
					{
						myself::SetCurrentQuestID(654);
						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 )
						{
							if( talker.level >= 74 && myself::GetOneTimeQuestFlag(talker,119) == 1 )
							{
								myself::FHTML_SetFileName(fhtml0,"printessa_spirit_q0654_01.htm");
								myself::FHTML_SetInt(fhtml0,"quest_id",654);
								myself::ShowFHTML(talker,fhtml0);
							}
							else
							{
								myself::ShowPage(talker,"printessa_spirit_q0654_02.htm");
							}
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 9:
				{
					if( _from_choice == 0 || myself::GetMemoState(talker,654) == 2 )
					{
						myself::SetCurrentQuestID(654);
						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,"printessa_spirit_q0654_05.htm");
					}
					break;
				}
				case 10:
				{
					if( _from_choice == 0 || myself::GetMemoState(talker,654) == 3 )
					{
						myself::SetCurrentQuestID(654);
						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,"printessa_spirit_q0654_06.htm");
					}
					break;
				}
				case 11:
				{
					if( _from_choice == 0 || myself::GetMemoState(talker,654) == 1 )
					{
						myself::SetCurrentQuestID(654);
						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,"printessa_spirit_q0654_03.htm");
					}
					break;
				}
			}
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker)
	{
		if( quest_id == 119 )
		{
			myself::SetMemo(talker,119);
			myself::SetMemoState(talker,119,1);
			myself::AddLog(1,talker,119);
			myself::SetFlagJournal(talker,119,1);
			myself::SetOneTimeQuestFlag(talker,119,1);
			myself::SoundEffect(talker,"ItemSound.quest_accept");
			myself::ShowPage(talker,"printessa_spirit_q119_003.htm");
			return;
		}
		if( quest_id == 654 )
		{
			myself::SetMemo(talker,654);
			myself::SetMemoState(talker,654,1);
			myself::AddLog(1,talker,654);
			myself::SetFlagJournal(talker,654,1);
			myself::SoundEffect(talker,"ItemSound.quest_accept");
			myself::ShowPage(talker,"printessa_spirit_q0654_03.htm");
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 654 )
		{
			myself::SetCurrentQuestID(654);
			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 == 654 )
		{
			if( reply == 1 )
			{
				myself::SetMemoState(talker,654,2);
				myself::SetFlagJournal(talker,654,2);
				myself::ShowPage(talker,"printessa_spirit_q0654_04.htm");
				myself::SoundEffect(talker,"ItemSound.quest_middle");
			}
			if( reply == 2 )
			{
				myself::RemoveMemo(talker,654);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
				myself::DeleteItem1(talker,8072,myself::OwnItemCount(talker,8072));
				myself::GiveItem1(talker,8073,1);
				myself::AddLog(3,talker,654);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
				myself::ShowPage(talker,"printessa_spirit_q0654_07.htm");
			}
		}
		super;
	}

}
