@LabelIndex 314545
@StringIndex 43433
class 0 trader_espen : merchant {
property:
	BuySellList SellList0 = {{"tights_pants";20};{"tights_shirt";20};{"bone_breastplate";20};{"bone_gaiters";20};{"piece_bone_breastplate";20};{"bronze_breastplate";20};{"hard_leather_gaiters";20};{"piece_bone_gaiters";20};{"hard_leather_shirt";20};{"bronze_gaiters";20};{"puma_skin_gaiters";20};{"ring_breastplate";20};{"puma_skin_shirt";20};{"iron_plate_gaiters";20};{"lion_skin_gaiters";20};{"lion_skin_shirt";20};{"scale_mail";20};{"compound_scale_mail";20};{"dwarven_scale_mail";20};{"mithril_breastplate";20};{"mithril_gaiters";20};{"reinforce_leather_gaiters";20};{"scale_gaiters";20};{"blast_plate";20};{"compound_scale_gaiters";20};{"dwarven_scale_gaiters";20};{"mithril_banded_mail";20};{"mithril_banded_gaiters";20};{"reinforce_leather_shirt";20};{"brigandine_gaiters";20};{"brigandine";20};{"manticor_skin_shirt";20};{"manticor_skin_gaiters";20};{"mithril_scale_gaiters";20};{"half_plate";20};{"plate_gaiters";20};{"slamander_skin_mail";20};{"round_shield";20};{"bone_shield";20};{"bronze_shield";20};{"aspis";20};{"hoplon";20};{"kite_shield";20};{"brigandine_shield";20};{"square_shield";20};{"plate_shield";20};{"leather_gloves";20};{"bracer";20};{"excellence_leather_gloves";20};{"leather_gauntlet";20};{"gauntlet";20};{"gauntlet_of_repose_of_the_soul";20};{"reinforce_leather_gloves";20};{"manticor_skin_gloves";20};{"mithril_glove";20};{"ogre_power_gauntlet";20};{"low_boots";20};{"boots";20};{"leather_boots";20};{"blue_buckskin_boots";20};{"iron_boots";20};{"boots_of_power";20};{"reinforce_leather_boots";20};{"manticor_skin_boots";20};{"brigandine_boots";20};{"assault_boots";20};{"slamander_skin_boots";20};{"plate_boots";20};{"leather_helmet";20};{"hard_leather_helmet";20};{"bone_helmet";20};{"bronze_helmet";20};{"helmet";20};{"brigandine_helmet";20};{"plate_helmet";20};{"cotton_shirt";20};{"linen_shirt";20};{"striped_cotton_shirt";20};{"striped_linen_shirt";20}};
	BuySellList SellList1 = {{"hose_of_devotion";20};{"tunic_of_devotion";20};{"hose_of_magicpower";20};{"tunic_of_magicpower";20};{"cursed_hose";20};{"cursed_tunic";20};{"dark_hose";20};{"white_tunic";20};{"mage_s_hose";20};{"mage_s_tunic";20};{"hose_of_knowledge";20};{"tunic_of_knowledge";20};{"mithril_hose";20};{"mithril_tunic";20};{"sage_s_rag";20};{"round_shield";20};{"bone_shield";20};{"bronze_shield";20};{"aspis";20};{"hoplon";20};{"kite_shield";20};{"brigandine_shield";20};{"square_shield";20};{"plate_shield";20};{"leather_gloves";20};{"bracer";20};{"excellence_leather_gloves";20};{"leather_gauntlet";20};{"gauntlet";20};{"gauntlet_of_repose_of_the_soul";20};{"gloves_of_knowledge";20};{"elven_mithril_gloves";20};{"mithril_glove";20};{"ogre_power_gauntlet";20};{"sage_s_worn_gloves";20};{"low_boots";20};{"boots";20};{"leather_boots";20};{"blue_buckskin_boots";20};{"iron_boots";20};{"boots_of_power";20};{"boots_of_knowledge";20};{"elven_mithril_boots";20};{"assault_boots";20};{"slamander_skin_boots";20};{"plate_boots";20};{"leather_helmet";20};{"hard_leather_helmet";20};{"bone_helmet";20};{"bronze_helmet";20};{"helmet";20};{"brigandine_helmet";20};{"plate_helmet";20};{"cotton_shirt";20};{"linen_shirt";20};{"striped_cotton_shirt";20};{"striped_linen_shirt";20}};
	BuySellList SellList4 = {{"12014";20};{"12008";20};{"12015";20};{"12012";20};{"12020";20};{"12021";20};{"12024";20};{"12032";20};{"12030";20};{"12031";20};{"12041";20};{"12034";20};{"12023";20};{"12044";20};{"12049";20};{"12039";20};{"12043";20};{"12042";20};{"12036";20};{"12060";20};{"12059";20};{"12056";20};{"12054";20};{"12052";20};{"12081";20};{"12080";20};{"12074";20};{"12013";20};{"12025";20};{"12051";20};{"12069";20};{"12073";20};{"12078";20};{"12007";20};{"12016";20};{"12038";20};{"12068";20};{"12037";20};{"12072";20};{"12076";20};{"12006";20};{"12029";20};{"12033";20};{"12070";20};{"12035";20};{"12071";20};{"12075";20};{"12077";20};{"12009";20};{"12028";20};{"12050";20};{"12079";20}};
	BuySellList SellList5 = {{"12011";20};{"12010";20};{"12017";20};{"12022";20};{"12019";20};{"12018";20};{"12048";20};{"12047";20};{"12058";20};{"12057";20};{"12083";20};{"12013";20};{"12025";20};{"12051";20};{"12069";20};{"12063";20};{"12073";20};{"12078";20};{"12007";20};{"12016";20};{"12038";20};{"12068";20};{"12046";20};{"12065";20};{"12072";20};{"12076";20};{"12082";20};{"12006";20};{"12029";20};{"12033";20};{"12070";20};{"12045";20};{"12066";20};{"12071";20};{"12075";20};{"12077";20};{"12009";20};{"12028";20};{"12050";20};{"12079";20}};

handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,383) == 0 && talker.level < 42 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Treasure Hunt");
			}
			if( gg::HaveMemo(talker,383) == 0 && talker.level >= 42 && gg::OwnItemCount(talker,5915) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Treasure Hunt");
			}
			if( gg::HaveMemo(talker,383) == 0 && talker.level >= 42 && gg::OwnItemCount(talker,5915) > 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Treasure Hunt");
			}
			if( gg::HaveMemo(talker,383) == 1 && gg::GetMemoState(talker,383) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Treasure Hunt (In Progress)");
			}
			if( gg::HaveMemo(talker,383) == 1 && gg::GetMemoState(talker,383) == 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Treasure Hunt (In Progress)");
			}
			if( _choiceN > 1 ) {
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 ) {
			switch(_code) {
				case 0: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,383) == 0 && talker.level < 42 ) ) {
						myself::SetCurrentQuestID(383);
						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_espen_q0383_01.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,383) == 0 && talker.level >= 42 && gg::OwnItemCount(talker,5915) == 0 ) ) {
						myself::SetCurrentQuestID(383);
						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_espen_q0383_02.htm");
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,383) == 0 && talker.level >= 42 && gg::OwnItemCount(talker,5915) > 0 ) ) {
						myself::SetCurrentQuestID(383);
						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::ShowQuestPage(talker,"trader_espen_q0383_03.htm",383);
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,383) == 1 && gg::GetMemoState(talker,383) == 1 ) ) {
						myself::SetCurrentQuestID(383);
						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_espen_q0383_13.htm");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,383) == 1 && gg::GetMemoState(talker,383) == 2 ) ) {
						myself::SetCurrentQuestID(383);
						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_espen_q0383_14.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 383 ) {
			myself::SetCurrentQuestID(383);
			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( gg::HaveMemo(talker,383) == 0 && talker.level >= 42 && gg::OwnItemCount(talker,5915) > 0 ) {
					if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
						talker.quest_last_reward_time = myself::GetCurrentTick();
						myself::DeleteItem1(talker,5915,1);
						myself::SetMemoState(talker,383,1);
						myself::SetJournal(talker,383,1);
						myself::SetMemo(talker,quest_id);
						myself::ShowQuestMark(talker,quest_id);
						myself::SoundEffect(talker,"ItemSound.quest_accept");
						myself::ShowQuestPage(talker,"trader_espen_q0383_08.htm",383);
						gg::AddLog(1,talker,quest_id);
					}
				}
			} else {
				myself::ShowPage(talker,"fullquest.htm");
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,fhtml0,quest_id,reply,talker) {
		if( ask == 383 ) {
			myself::SetCurrentQuestID(383);
			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 == 383 ) {
			if( reply == 1 ) {
				myself::ShowQuestPage(talker,"trader_espen_q0383_04.htm",383);
			}
			if( reply == 2 && gg::OwnItemCount(talker,5915) > 0 ) {
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::GiveItem1(talker,57,1000);
					myself::RemoveMemo(talker,383);
					gg::AddLog(2,talker,383);
					myself::DeleteItem1(talker,5915,1);
					myself::ShowQuestPage(talker,"trader_espen_q0383_05.htm",383);
				}
			}
			if( reply == 3 ) {
				if( gg::OwnItemCount(talker,5915) > 0 ) {
					myself::FHTML_SetFileName(fhtml0,"trader_espen_q0383_06.htm");
					myself::FHTML_SetInt(fhtml0,"quest_id",383);
					myself::ShowQuestFHTML(talker,fhtml0,383);
				} else {
					myself::ShowPage(talker,"trader_espen_q0383_07.htm");
				}
			}
			if( reply == 4 ) {
				myself::ShowPage(talker,"trader_espen_q0383_09.htm");
			}
			if( reply == 5 ) {
				myself::ShowPage(talker,"trader_espen_q0383_10.htm");
			}
			if( reply == 6 ) {
				myself::ShowPage(talker,"trader_espen_q0383_11.htm");
			}
			if( reply == 7 ) {
				if( gg::HaveMemo(talker,383) == 1 && gg::GetMemoState(talker,383) == 1 ) {
					myself::SetMemoState(talker,383,2);
					myself::SetJournal(talker,383,2);
					myself::ShowQuestMark(talker,383);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
					myself::ShowPage(talker,"trader_espen_q0383_12.htm");
				}
			}
		}
		super;
	}

}
