class 1 enfeux : citizen
{
handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( ( myself::HaveMemo(talker,627) == 1 && ( ( 1 == 1 && myself::OwnItemCount(talker,7170) >= 1 ) || 1 == 0 ) ) && myself::GetMemoState(talker,627) == ( ( 2 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Heart in Search of Power (Continue)");
			}
			if( myself::HaveMemo(talker,627) == 1 && myself::GetMemoState(talker,627) == ( ( 3 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Heart in Search of Power (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,627) == 1 && ( ( 1 == 1 && myself::OwnItemCount(talker,7170) >= 1 ) || 1 == 0 ) ) && myself::GetMemoState(talker,627) == ( ( 2 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(627);
						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::SetHTMLCookie(talker,627,2);
						myself::ShowPage(talker,"enfeux_q0627_0201.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,627) == 1 && myself::GetMemoState(talker,627) == ( ( 3 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(627);
						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,"enfeux_q0627_0303.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,quest_id,reply,talker)
	{
		if( ask == 627 )
		{
			myself::SetCurrentQuestID(627);
			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 == 627 )
		{
			i0 = myself::GetHTMLCookie(talker,627,( 3 - 1 ));
			if( i0 != -1 )
			{
				if( reply == 1 && myself::HaveMemo(talker,627) == 1 )
				{
					if( ( ( ( 1 == 1 && myself::OwnItemCount(talker,7170) >= 1 ) || 1 == 0 ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) )
					{
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
						{
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,7170,1);
							myself::DeleteItem1(talker,0,0);
							myself::DeleteItem1(talker,0,0);
							myself::GiveItem1(talker,7172,1);
							myself::ShowPage(talker,"enfeux_q0627_0301.htm");
							myself::SetMemoState(talker,627,( ( 3 * 10 ) + 1 ));
							myself::SetFlagJournal(talker,627,4);
						}
					}
					else
					{
						myself::ShowPage(talker,"enfeux_q0627_0302.htm");
					}
				}
			}
		}
		super;
	}

}
