@LabelIndex 390968
@StringIndex 58052
class 0 trader_erinu : merchant_for_newbie {
property:
	BuySellList SellList0 = {{"small_sword";15};{"club";15};{"bone_dagger";15};{"short_bow";15};{"broad_sword";15};{"heavy_chisel";15};{"knife";15};{"doomed_dagger";15};{"bow";15};{"mace";15};{"sickle";15};{"brandish";15};{"gladius";15};{"orcish_sword";15};{"handmade_sword";15};{"dwarven_mace";15};{"dirk";15};{"hunting_bow";15};{"long_sword";15};{"throw_knife";15};{"bow_of_forest";15};{"short_spear";15};{"zweihander";15};{"spike_glove";15};{"iron_glove";15};{"fox_s_nail";15};{"cestus";15}};
	BuySellList SellList1 = {{"apprentice_s_rod";15};{"buffalo_horn";15};{"willow_staff";15};{"apprentice_s_spellbook";15};{"cedar_staff";15};{"apprentice_s_staff";15};{"relic_of_saints";15};{"cotton_shirt";15};{"striped_cotton_shirt";15}};

handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,174) == 1 && gg::GetMemoState(talker,174) < 5 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Supply Check (In Progress)");
			}
			if( gg::HaveMemo(talker,174) == 1 && gg::GetMemoState(talker,174) == 5 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Supply Check (In Progress)");
			}
			if( gg::HaveMemo(talker,174) == 1 && gg::GetMemoState(talker,174) == 6 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Supply Check (In Progress)");
			}
			if( gg::HaveMemo(talker,174) == 1 && gg::GetMemoState(talker,174) > 6 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Supply Check (In Progress)");
			}
			if( talker.level >= 17 && gg::HaveMemo(talker,286) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Fabulous Feathers");
			}
			if( talker.level < 17 && gg::HaveMemo(talker,286) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Fabulous Feathers");
			}
			if( gg::HaveMemo(talker,286) == 1 && gg::GetMemoState(talker,286) >= ( ( 1 * 10 ) + 1 ) && gg::GetMemoState(talker,286) <= ( ( 1 * 10 ) + 2 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Fabulous Feathers (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,174) == 1 && gg::GetMemoState(talker,174) < 5 ) ) {
						myself::SetCurrentQuestID(174);
						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_erinu_q0174_01.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,174) == 1 && gg::GetMemoState(talker,174) == 5 ) ) {
						myself::SetCurrentQuestID(174);
						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::GiveItem1(talker,9794,1);
						myself::SetMemoState(talker,174,6);
						myself::ShowPage(talker,"trader_erinu_q0174_02.htm");
						myself::SoundEffect(talker,"itemsound.quest_middle");
						myself::SetFlagJournal(talker,174,6);
						myself::ShowQuestMark(talker,174);
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,174) == 1 && gg::GetMemoState(talker,174) == 6 ) ) {
						myself::SetCurrentQuestID(174);
						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_erinu_q0174_03.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,174) == 1 && gg::GetMemoState(talker,174) > 6 ) ) {
						myself::SetCurrentQuestID(174);
						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_erinu_q0174_04.htm");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( talker.level >= 17 && gg::HaveMemo(talker,286) == 0 ) ) {
						myself::SetCurrentQuestID(286);
						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 ) {
							myself::FHTML_SetFileName(fhtml0,"trader_erinu_q0286_0101.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",286);
							myself::ShowQuestFHTML(talker,fhtml0,286);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( talker.level < 17 && gg::HaveMemo(talker,286) == 0 ) ) {
						myself::SetCurrentQuestID(286);
						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_erinu_q0286_0102.htm",286);
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,286) == 1 && gg::GetMemoState(talker,286) >= ( ( 1 * 10 ) + 1 ) && gg::GetMemoState(talker,286) <= ( ( 1 * 10 ) + 2 ) ) ) {
						myself::SetCurrentQuestID(286);
						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( gg::GetMemoState(talker,286) == ( ( 1 * 10 ) + 2 ) && gg::OwnItemCount(talker,9746) >= 80 ) {
							myself::SetHTMLCookie(talker,286,1);
							myself::ShowPage(talker,"trader_erinu_q0286_0105.htm");
						} else {
							myself::ShowPage(talker,"trader_erinu_q0286_0106.htm");
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 286 ) {
			myself::SetCurrentQuestID(286);
			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::GetCurrentTick() - talker.quest_last_reward_time ) > 1 && talker.level >= 17 ) {
				talker.quest_last_reward_time = myself::GetCurrentTick();
				myself::SetMemo(talker,286);
				myself::SetMemoState(talker,286,( ( 1 * 10 ) + 1 ));
				gg::AddLog(1,talker,286);
				myself::SetFlagJournal(talker,286,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowQuestPage(talker,"trader_erinu_q0286_0103.htm",286);
				myself::ShowQuestMark(talker,286);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,i1,quest_id,reply,talker) {
		if( ask == 174 ) {
			myself::SetCurrentQuestID(174);
			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 == 174 ) {
		}
		if( ask == 286 ) {
			myself::SetCurrentQuestID(286);
			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 == 286 ) {
			i0 = myself::GetHTMLCookie(talker,286,( 2 - 1 ));
			if( i0 != -1 ) {
				if( reply == 3 && gg::HaveMemo(talker,286) == 1 && gg::GetMemoState(talker,286) >= ( ( ( 2 - 1 ) * 10 ) + 1 ) ) {
					if( gg::OwnItemCount(talker,9746) >= 80 ) {
						i1 = gg::Rand(1000);
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,9746,gg::OwnItemCount(talker,9746));
							myself::GiveItem1(talker,57,4160);
						}
						gg::AddLog(2,talker,286);
						gg::AddLog(3,talker,286);
						myself::RemoveMemo(talker,286);
						myself::SoundEffect(talker,"ItemSound.quest_finish");
						myself::ShowPage(talker,"trader_erinu_q0286_0201.htm");
					} else {
						myself::ShowPage(talker,"trader_erinu_q0286_0202.htm");
					}
				}
			}
		}
		super;
	}

}
