class 1 ariel : merchant_for_newbie
{
property:
	BuySellList SellList0 = {{"pants";15};{"shirt";15};{"leather_pants";15};{"leather_shirt";15};{"hard_leather_pants";15};{"wooden_gaiters";15};{"wooden_breastplate";15};{"tights_pants";15};{"tights_shirt";15};{"bone_breastplate";15};{"bone_gaiters";15};{"leather_shield";15};{"small_shield";15};{"buckler";15};{"round_shield";15};{"short_gloves";15};{"short_leather_gloves";15};{"gloves";15};{"leather_gloves";15};{"apprentice_s_shoes";15};{"cloth_shoes";15};{"leather_sandals";15};{"crude_leather_shoes";15};{"cotton_shoes";15};{"leather_shoes";15};{"low_boots";15};{"cloth_cap";15};{"leather_cap";15};{"wooden_helmet";15};{"leather_helmet";15};{"cotton_shirt";15};{"striped_cotton_shirt";15}};
	BuySellList SellList1 = {{"hose";15};{"tunic";15};{"cotton_hose";15};{"cotton_tunic";15};{"feriotic_hose";15};{"feriotic_tunic";15};{"leather_hose";15};{"leather_tunic";15};{"hose_of_devotion";15};{"tunic_of_devotion";15};{"leather_shield";15};{"small_shield";15};{"buckler";15};{"round_shield";15};{"short_gloves";15};{"short_leather_gloves";15};{"gloves";15};{"leather_gloves";15};{"apprentice_s_shoes";15};{"cloth_shoes";15};{"leather_sandals";15};{"crude_leather_shoes";15};{"cotton_shoes";15};{"leather_shoes";15};{"low_boots";15};{"cloth_cap";15};{"leather_cap";15};{"wooden_helmet";15};{"leather_helmet";15};{"cotton_shirt";15};{"striped_cotton_shirt";15}};

handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,7) == 1 && myself::GetOneTimeQuestFlag(talker,7) == 0 && myself::GetMemoState(talker,7) == ( ( 1 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"A Trip Begins");
			}
			if( myself::HaveMemo(talker,7) == 1 && myself::GetMemoState(talker,7) == ( ( 2 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"A Trip Begins");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,7) == 1 && myself::GetOneTimeQuestFlag(talker,7) == 0 && myself::GetMemoState(talker,7) == ( ( 1 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(7);
						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,7,1);
						myself::ShowPage(talker,"ariel_q0007_0101.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,7) == 1 && myself::GetMemoState(talker,7) == ( ( 2 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(7);
						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,"ariel_q0007_0202.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,quest_id,reply,talker)
	{
		if( ask == 7 )
		{
			myself::SetCurrentQuestID(7);
			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 == 7 )
		{
			i0 = myself::GetHTMLCookie(talker,7,( 2 - 1 ));
			if( i0 != -1 )
			{
				if( reply == 1 && myself::HaveMemo(talker,7) == 1 )
				{
					if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
					{
						talker.quest_last_reward_time = myself::GetCurrentTick();
						myself::GiveItem1(talker,7572,1);
						myself::ShowPage(talker,"ariel_q0007_0201.htm");
						myself::SetMemoState(talker,7,( ( 2 * 10 ) + 1 ));
						myself::SetFlagJournal(talker,7,2);
						myself::ShowQuestMark(talker,7);
						myself::SoundEffect(talker,"ItemSound.quest_middle");
					}
				}
			}
		}
		super;
	}

}
