class 1 trader_leon : merchant
{
property:
	BuySellList SellList0 = {{"long_sword";20};{"throw_knife";20};{"bow_of_forest";20};{"short_spear";20};{"falchion";20};{"sword_breaker";20};{"composition_bow";20};{"buzdygan";20};{"iron_hammer";20};{"long_spear";20};{"saber";20};{"steel_sword";20};{"handiwork_dagger";20};{"assassin_knife";20};{"strengthening_bow";20};{"hand_axe";20};{"heavy_mace";20};{"work_hammer";20};{"trident";20};{"bastard_sword";20};{"artisan_s_sword";20};{"poniard_dagger";20};{"long_bow";20};{"elven_bow";20};{"dark_elven_bow";20};{"tomahawk";20};{"pike";20};{"dwarven_trident";20};{"two-handed_sword";20};{"crimson_sword";20};{"elven_sword";20};{"kukuri";20};{"gastraphetes";20};{"spike_club";20};{"war_hammer";20};{"dwarven_pike";20};{"sword_of_revolution";20};{"maingauche";20};{"cursed_maingauche";20};{"strengthening_long_bow";20};{"tarbar";20};{"titan_sword";20};{"titan_hammer";20};{"heavy_bone_club";20};{"hammer_in_flames";20};{"winged_spear";20};{"cestus";20};{"viper_s_canine";20};{"bagh-nakh";20};{"single-edged_jamadhr";20};{"triple-edged_jamadhr";20};{"bich_hwa";20};{"zweihander";20};{"heavy_sword";20}};
	BuySellList SellList1 = {{"apprentice_s_staff";20};{"relic_of_saints";20};{"mage_staff";20};{"crucifix_of_blessing";20};{"voodoo_doll";20};{"bone_staff";20};{"scroll_of_wisdom";20};{"priest_sword";20};{"branch_of_life";20};{"proof_of_revenge";20};{"mace_of_prayer";20};{"doom_hammer";20};{"mystic_staff";20};{"staff_of_mana";20};{"divine_tome";20};{"sword_of_magic";20};{"sword_of_mystic";20};{"sword_of_occult";20};{"dagger_of_mana";20};{"mystic_knife";20};{"conjure_knife";20};{"knife_o__silenus";20};{"staff_of_magicpower";20};{"blood_of_saints";20};{"tome_of_blood";20};{"goathead_staff";20};{"sword_of_magic_fog";20};{"priest_mace";20};{"crucifix_of_blood";20};{"demon_fangs";20}};

handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,11) == 1 && myself::GetOneTimeQuestFlag(talker,11) == 0 && myself::GetMemoState(talker,11) == ( ( 1 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Secret Meeting With Ketra Orcs");
			}
			if( myself::HaveMemo(talker,11) == 1 && myself::GetOneTimeQuestFlag(talker,11) == 0 && myself::GetMemoState(talker,11) == ( ( 2 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Secret Meeting With Ketra Orcs");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,11) == 1 && myself::GetOneTimeQuestFlag(talker,11) == 0 && myself::GetMemoState(talker,11) == ( ( 1 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(11);
						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,11,1);
						myself::ShowPage(talker,"trader_leon_q0011_0101.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,11) == 1 && myself::GetOneTimeQuestFlag(talker,11) == 0 && myself::GetMemoState(talker,11) == ( ( 2 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(11);
						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,"trader_leon_q0011_0202.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

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

}
