class 1 iz : merchant
{
property:
	BuySellList SellList0 = {{"hose_of_devotion";15};{"tunic_of_devotion";15};{"hose_of_magicpower";15};{"tunic_of_magicpower";15};{"cursed_hose";15};{"cursed_tunic";15};{"dark_hose";15};{"white_tunic";15};{"mage_s_hose";15};{"mage_s_tunic";15};{"hose_of_knowledge";15};{"tunic_of_knowledge";15};{"mithril_hose";15};{"mithril_tunic";15};{"round_shield";15};{"bone_shield";15};{"bronze_shield";15};{"aspis";15};{"hoplon";15};{"kite_shield";15};{"leather_gloves";15};{"bracer";15};{"excellence_leather_gloves";15};{"leather_gauntlet";15};{"gauntlet";15};{"gauntlet_of_repose_of_the_soul";15};{"low_boots";15};{"boots";15};{"leather_boots";15};{"blue_buckskin_boots";15};{"iron_boots";15};{"boots_of_power";15};{"leather_helmet";15};{"hard_leather_helmet";15};{"bone_helmet";15};{"bronze_helmet";15};{"helmet";15};{"cotton_shirt";20};{"linen_shirt";20};{"striped_cotton_shirt";20};{"striped_linen_shirt";20}};

handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,33) == 1 && myself::GetOneTimeQuestFlag(talker,33) == 0 && myself::GetMemoState(talker,33) == ( ( 4 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Make a pair of dress shoes");
			}
			if( myself::HaveMemo(talker,33) == 1 && myself::GetOneTimeQuestFlag(talker,33) == 0 && myself::GetMemoState(talker,33) == ( ( 5 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Make a pair of dress shoes");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,33) == 1 && myself::GetOneTimeQuestFlag(talker,33) == 0 && myself::GetMemoState(talker,33) == ( ( 4 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(33);
						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,33,4);
						myself::ShowPage(talker,"iz_q0033_0401.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,33) == 1 && myself::GetOneTimeQuestFlag(talker,33) == 0 && myself::GetMemoState(talker,33) == ( ( 5 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(33);
						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,"iz_q0033_0503.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,quest_id,reply,talker)
	{
		if( ask == 33 )
		{
			myself::SetCurrentQuestID(33);
			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 == 33 )
		{
			i0 = myself::GetHTMLCookie(talker,33,( 5 - 1 ));
			if( i0 != -1 )
			{
				if( reply == 1 && myself::HaveMemo(talker,33) == 1 && myself::GetOneTimeQuestFlag(talker,33) == 0 )
				{
					if( myself::OwnItemCount(talker,57) >= 300000 )
					{
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
						{
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,57,300000);
							myself::ShowPage(talker,"iz_q0033_0501.htm");
							myself::SetMemoState(talker,33,( ( 5 * 10 ) + 1 ));
							myself::SetFlagJournal(talker,33,5);
						}
					}
					else
					{
						myself::ShowPage(talker,"iz_q0033_0502.htm");
					}
				}
			}
		}
		super;
	}

}
