class 1 fisher_pamfus : fisher
{
property:
	BuySellList SellList0 = {{"green_lure_easy";20};{"violet_lure_easy";20};{"yellow_lure_easy";20};{"green_lure_average";20};{"violet_lure_average";20};{"yellow_lure_average";20};{"green_luminous_lure";20};{"purple_luminous_lure";20};{"yellow_luminous_lure";20};{"prize_winning_fishing_lure";20};{"prize_winning_night_fishing_lure";20};{"prize_winning_novice_fishing_lure";20};{"fp_babyduck_rod";20};{"fp_albatros_rod";20};{"fp_pelican_rod";20};{"fp_kingfisher_rod";20};{"fp_cygnus_pole";20};{"fp_triton_pole";20};{"fishing_manual";20};{"fisherman_s_potion_green";20};{"fisherman_s_potion_jade";20};{"fisherman_s_potion_blue";20};{"fisherman_s_potion_yellow";20};{"fisherman_s_potion_orange";20};{"fisherman_s_potion_purple";20};{"fisherman_s_potion_red";20};{"fisherman_s_potion_white";20};{"fisherman_s_potion_black";20};{"fishing_potion";20}};

handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,426) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Quest for Fishing Shot");
			}
			if( myself::HaveMemo(talker,426) == 1 && myself::OwnItemCount(talker,7586) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Quest for Fishing Shot");
			}
			if( myself::HaveMemo(talker,426) == 1 && myself::OwnItemCount(talker,7586) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Quest for Fishing Shot");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || myself::HaveMemo(talker,426) == 0 )
					{
						myself::SetCurrentQuestID(426);
						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,"fisher_berix_q0426_01.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",426);
							myself::ShowFHTML(talker,fhtml0);
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,426) == 1 && myself::OwnItemCount(talker,7586) == 0 ) )
					{
						myself::SetCurrentQuestID(426);
						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,"fisher_berix_q0426_04.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,426) == 1 && myself::OwnItemCount(talker,7586) >= 1 ) )
					{
						myself::SetCurrentQuestID(426);
						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,"fisher_berix_q0426_05.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker)
	{
		if( quest_id == 426 )
		{
			myself::SetCurrentQuestID(426);
			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::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowPage(talker,"fisher_berix_q0426_03.htm");
				myself::AddLog(1,talker,quest_id);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 426 )
		{
			myself::SetCurrentQuestID(426);
			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 == 426 )
		{
			if( reply == 1 )
			{
				myself::ShowPage(talker,"fisher_berix_q0426_06.htm");
			}
			if( reply == 2 )
			{
				myself::ShowPage(talker,"fisher_berix_q0426_07.htm");
			}
			if( reply == 3 )
			{
				myself::RemoveMemo(talker,426);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
				myself::ShowPage(talker,"fisher_berix_q0426_08.htm");
			}
		}
		super;
	}

}
