@LabelIndex 270508
@StringIndex 34828
class 0 trader_rolento : merchant_for_chaotic {
property:
	BuySellList SellList0 = {{"soulshot_none";50};{"spiritshot_none";50};{"blessed_spiritshot_none";50};{"comp_bspiritshot_none";50};{"comp_spiritshot_none";50};{"comp_soulshot_none";50};{"adv_comp_bspiritshot_none";50};{"adv_comp_spiritshot_none";50};{"adv_comp_soulshot_none";50};{"wooden_arrow";50};{"bone_arrow";50};{"fine_steel_arrow";50};{"lesser_healing_potion";50};{"healing_potion";50};{"antidote";50};{"advanced_antidote";50};{"bandage";50};{"emergency_dressing";50};{"quick_step_potion";50};{"swift_attack_potion";50};{"potion_of_acumen2";50};{"scroll_of_awake";50};{"scroll_of_escape";50};{"scroll_of_resurrection";50};{"scroll_of_escape_to_agit";50};{"spirit_ore";50};{"soul_ore";50};{"energy_stone";50};{"key_of_thief";50};{"rope_of_magic_d";50};{"rope_of_magic_c";50};{"rope_of_magic_b";50};{"gemstone_d";50};{"bone_bolt";50};{"steel_bolt";50};{"scroll_recovery_ng";50};{"scroll_recovery_d";50};{"scroll_recovery_c";50};{"scroll_recovery_b";50};{"elixir_of_life_ng";50};{"elixir_of_life_d";50};{"elixir_of_life_c";50};{"elixir_of_men_str_d";50};{"elixir_of_cp_ng";50};{"elixir_of_cp_d";50};{"elixir_of_cp_c";50};{"elixir_of_cp_b";50};{"summoning_crystal";50};{"a_bottle_of_souls";50};{"dice_heart";50};{"dice_spade";50};{"dice_clover";50};{"dice_diamond";50}};

handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,329) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Curiosity of a Dwarf");
			}
			if( gg::HaveMemo(talker,329) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Curiosity of a Dwarf (In Progress)");
			}
			if( gg::HaveMemo(talker,171) == 1 && gg::GetMemoState(talker,171) == 8 && myself::GetOneTimeQuestFlag(talker,171) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Acts of Evil (In Progress)");
			}
			if( gg::HaveMemo(talker,171) == 1 && gg::GetMemoState(talker,171) == 9 && myself::GetOneTimeQuestFlag(talker,171) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Acts of Evil (In Progress)");
			}
			if( gg::HaveMemo(talker,171) == 1 && gg::GetMemoState(talker,171) >= 10 && myself::GetOneTimeQuestFlag(talker,171) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Acts of Evil (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,329) == 0 ) {
						myself::SetCurrentQuestID(329);
						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( talker.level >= 33 ) {
								myself::FHTML_SetFileName(fhtml0,"trader_rolento_q0329_02.htm");
								myself::FHTML_SetInt(fhtml0,"quest_id",329);
								myself::ShowQuestFHTML(talker,fhtml0,329);
							} else {
								myself::ShowQuestPage(talker,"trader_rolento_q0329_01.htm",329);
							}
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || gg::HaveMemo(talker,329) == 1 ) {
						myself::SetCurrentQuestID(329);
						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::OwnItemCount(talker,1365) + gg::OwnItemCount(talker,1346) ) > 0 ) {
							if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
								talker.quest_last_reward_time = myself::GetCurrentTick();
								if( ( gg::OwnItemCount(talker,1365) + gg::OwnItemCount(talker,1346) ) >= 10 ) {
									myself::GiveItem1(talker,57,( ( 1183 + ( 50 * gg::OwnItemCount(talker,1365) ) ) + ( 1000 * gg::OwnItemCount(talker,1346) ) ));
								} else {
									myself::GiveItem1(talker,57,( ( 50 * gg::OwnItemCount(talker,1365) ) + ( 1000 * gg::OwnItemCount(talker,1346) ) ));
								}
								myself::DeleteItem1(talker,1365,gg::OwnItemCount(talker,1365));
								myself::DeleteItem1(talker,1346,gg::OwnItemCount(talker,1346));
								myself::ShowPage(talker,"trader_rolento_q0329_05.htm");
								gg::AddLog(3,talker,329);
							}
						} else {
							myself::ShowPage(talker,"trader_rolento_q0329_04.htm");
						}
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,171) == 1 && gg::GetMemoState(talker,171) == 8 && myself::GetOneTimeQuestFlag(talker,171) == 0 ) ) {
						myself::SetCurrentQuestID(171);
						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_rolento_q0171_02.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,171) == 1 && gg::GetMemoState(talker,171) == 9 && myself::GetOneTimeQuestFlag(talker,171) == 0 ) ) {
						myself::SetCurrentQuestID(171);
						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_rolento_q0171_05.htm");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,171) == 1 && gg::GetMemoState(talker,171) >= 10 && myself::GetOneTimeQuestFlag(talker,171) == 0 ) ) {
						myself::SetCurrentQuestID(171);
						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_rolento_q0171_06.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 329 ) {
			myself::SetCurrentQuestID(329);
			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.quest_last_reward_time = myself::GetCurrentTick();
				myself::SetMemo(talker,quest_id);
				myself::ShowQuestMark(talker,quest_id);
				gg::AddLog(1,talker,329);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowQuestPage(talker,"trader_rolento_q0329_03.htm",329);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker) {
		if( ask == 329 ) {
			myself::SetCurrentQuestID(329);
			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 == 329 ) {
			if( reply == 1 ) {
				myself::ShowPage(talker,"trader_rolento_q0329_06.htm");
				myself::RemoveMemo(talker,329);
				gg::AddLog(2,talker,329);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
			} else if( reply == 2 ) {
				myself::ShowPage(talker,"trader_rolento_q0329_07.htm");
			}
		}
		if( ask == 171 ) {
			myself::SetCurrentQuestID(171);
			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 == 171 ) {
			if( reply == 1 ) {
				myself::ShowPage(talker,"trader_rolento_q0171_02.htm");
			}
			if( reply == 2 ) {
				myself::ShowPage(talker,"trader_rolento_q0171_03.htm");
			}
			if( reply == 3 ) {
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::GiveItem1(talker,4247,1);
					myself::GiveItem1(talker,4248,1);
					myself::DeleteItem1(talker,4245,gg::OwnItemCount(talker,4245));
					myself::SetMemoState(talker,171,9);
					myself::SetFlagJournal(talker,171,9);
					myself::ShowQuestMark(talker,171);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
					myself::ShowPage(talker,"trader_rolento_q0171_04.htm");
				}
			}
		}
		super;
	}

}
