class 1 pet_manager_cooper : merchant
{
property:
	BuySellList SellList0 = {{"iron_canine";20};{"shining_canine";20};{"ghost_canine";20};{"mithril_canine";20};{"sylvan_canine";20};{"orikarukon_canine";20};{"fang_of_saltydog";20};{"wolve_s_leather_mail";20};{"wolves_hide_armor";20};{"wolves_hard_leather_mail";20};{"wolves_wooden_armor";20};{"wolves_ring_mail";20};{"wolves_bone_armor";20};{"wolves_scale_mail";20};{"food_for_wolves";20};{"viperbite";20};{"shadow_fang";20};{"alya_fang";20};{"torturer";20};{"serpentine_grinder";20};{"fang_of_dahak";20};{"crimson_bloodfang";20};{"draconic_chopper";20};{"diabolic_grinder";20};{"hatchlings_scale_mail";20};{"hatchlings_brigandine";20};{"hatchlings_bronze_coat";20};{"hatchlings_steel_coat";20};{"hatchlings_gorgon_coat";20};{"hatchlings_ophidian_plate";20};{"hatchlings_crimson_plate";20};{"hatchlings_draconic_plate";20};{"hatchlings_inferno_plate";20};{"food_for_hatchling";20};{"serpentine_spike";20};{"drake_horn";20};{"assault_alicorn";20};{"draconic_slicer";20};{"ophidian_lancer";20};{"diamond_drill";20};{"mithril_panzer_coat";20};{"brigandine_panzer_coat";20};{"draconic_panzer_coat";20};{"blood_panzer_coat";20};{"ophidian_panzer_coat";20};{"inferno_panzer_coat";20};{"food_for_strider";20};{"beast_soul_shot";20};{"beast_spirit_shot";20};{"blessed_beast_spirit_shot";20};{"pet_food_baby_spice";20};{"little_harness";20};{"enchanted_wolf_fang";20};{"enchanted_coyote_fang";20};{"enchanted_saltydog_fang";20};{"enchanted_cerberus_fang";20};{"orichalcum_fang";20};{"enchanted_fenril_fang";20};{"great_wolf_scale_armor";20};{"great_wolf_bronze_armor";20};{"great_wolf_plate_armor";20};{"great_wolf_mithril_armor";20};{"great_wolf_oriharukon_armor";20};{"great_wolf_orichalcum_armor";20};{"great_wolf_food";20};{"beast_soulshot_compressed_pack";20};{"beast_spiritshot_compressed_pack";20};{"blessed_beast_spiritshot_compressed_pack";20};{"improved_baby_pet_food";20}};

handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,420) == 0 && talker.level >= 35 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Little Wing");
			}
			if( myself::HaveMemo(talker,420) == 0 && talker.level < 35 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Little Wing");
			}
			if( myself::HaveMemo(talker,420) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Little Wing (Continue)");
			}
			if( talker.level >= 26 && myself::HaveMemo(talker,43) == 0 && myself::GetOneTimeQuestFlag(talker,43) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Help My Sister!");
			}
			if( talker.level < 26 && myself::HaveMemo(talker,43) == 0 && myself::GetOneTimeQuestFlag(talker,43) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Help My Sister!");
			}
			if( myself::HaveMemo(talker,43) == 0 && myself::GetOneTimeQuestFlag(talker,43) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Help My Sister! (End)");
			}
			if( myself::HaveMemo(talker,43) == 1 && myself::GetOneTimeQuestFlag(talker,43) == 0 && myself::GetMemoState(talker,43) == ( ( 1 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Help My Sister! (Continue)");
			}
			if( myself::HaveMemo(talker,43) == 1 && myself::GetMemoState(talker,43) <= ( ( 2 * 10 ) + 2 ) && myself::GetMemoState(talker,43) >= ( ( 2 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Help My Sister! (Continue)");
			}
			if( myself::HaveMemo(talker,43) == 1 && myself::GetMemoState(talker,43) == ( ( 3 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 8;
				myself::AddChoice(8,"Help My Sister! (Continue)");
			}
			if( myself::HaveMemo(talker,43) == 1 && myself::GetMemoState(talker,43) == ( ( 4 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 9;
				myself::AddChoice(9,"Help My Sister! (Continue)");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,420) == 0 && talker.level >= 35 ) )
					{
						myself::SetCurrentQuestID(420);
						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,"pet_manager_cooper_q0420_01.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",420);
							myself::ShowFHTML(talker,fhtml0);
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,420) == 0 && talker.level < 35 ) )
					{
						myself::SetCurrentQuestID(420);
						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,"pet_manager_cooper_q0420_03.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || myself::HaveMemo(talker,420) == 1 )
					{
						myself::SetCurrentQuestID(420);
						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,"pet_manager_cooper_q0420_04.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( talker.level >= 26 && myself::HaveMemo(talker,43) == 0 && myself::GetOneTimeQuestFlag(talker,43) == 0 ) )
					{
						myself::SetCurrentQuestID(43);
						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( ( ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 1 ) || 0 == 0 ) && ( ( 0 == 1 && myself::GetOneTimeQuestFlag(talker,0) == 1 ) || 0 == 0 ) ) && ( ( 0 == 1 && talker.subjob_id != 0 ) || 0 == 0 ) )
							{
								myself::FHTML_SetFileName(fhtml0,"pet_manager_cooper_q0043_0101.htm");
								myself::FHTML_SetInt(fhtml0,"quest_id",43);
								myself::ShowFHTML(talker,fhtml0);
							}
							else
							{
								myself::ShowPage(talker,"pet_manager_cooper_q0043_0102.htm");
							}
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( talker.level < 26 && myself::HaveMemo(talker,43) == 0 && myself::GetOneTimeQuestFlag(talker,43) == 0 ) )
					{
						myself::SetCurrentQuestID(43);
						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,"pet_manager_cooper_q0043_0103.htm");
					}
					break;
				}
				case 5:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,43) == 0 && myself::GetOneTimeQuestFlag(talker,43) == 1 ) )
					{
						myself::SetCurrentQuestID(43);
						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,"finishedquest.htm");
					}
					break;
				}
				case 6:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,43) == 1 && myself::GetOneTimeQuestFlag(talker,43) == 0 && myself::GetMemoState(talker,43) == ( ( 1 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(43);
						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( ( ( ( 1 == 1 && myself::OwnItemCount(talker,220) >= 1 ) || 1 == 0 ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) )
						{
							myself::SetHTMLCookie(talker,43,1);
							myself::ShowPage(talker,"pet_manager_cooper_q0043_0105.htm");
						}
						else
						{
							myself::ShowPage(talker,"pet_manager_cooper_q0043_0106.htm");
						}
					}
					break;
				}
				case 7:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,43) == 1 && myself::GetMemoState(talker,43) <= ( ( 2 * 10 ) + 2 ) && myself::GetMemoState(talker,43) >= ( ( 2 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(43);
						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::GetMemoState(talker,43) == ( ( 2 * 10 ) + 2 ) && ( ( 1 == 1 && myself::OwnItemCount(talker,7550) >= 30 ) || 1 == 0 ) ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) )
						{
							myself::SetHTMLCookie(talker,43,2);
							myself::ShowPage(talker,"pet_manager_cooper_q0043_0203.htm");
						}
						else
						{
							myself::ShowPage(talker,"pet_manager_cooper_q0043_0204.htm");
						}
					}
					break;
				}
				case 8:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,43) == 1 && myself::GetMemoState(talker,43) == ( ( 3 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(43);
						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,"pet_manager_cooper_q0043_0303.htm");
					}
					break;
				}
				case 9:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,43) == 1 && myself::GetMemoState(talker,43) == ( ( 4 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(43);
						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,43,4);
						myself::ShowPage(talker,"pet_manager_cooper_q0043_0401.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker)
	{
		if( quest_id == 420 )
		{
			myself::SetCurrentQuestID(420);
			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::AddLog(1,talker,420);
				myself::SetJournal(talker,420,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowPage(talker,"pet_manager_cooper_q0420_02.htm");
				myself::SetMemoState(talker,420,1);
			}
			return;
		}
		if( quest_id == 43 )
		{
			myself::SetCurrentQuestID(43);
			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,43);
				myself::SetMemoState(talker,43,( ( 1 * 10 ) + 1 ));
				myself::AddLog(1,talker,43);
				myself::SetFlagJournal(talker,43,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowPage(talker,"pet_manager_cooper_q0043_0104.htm");
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,i1,quest_id,reply,talker)
	{
		if( ask == 420 )
		{
			myself::SetCurrentQuestID(420);
			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 == 420 )
		{
		}
		if( ask == 43 )
		{
			myself::SetCurrentQuestID(43);
			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 == 43 )
		{
			i0 = myself::GetHTMLCookie(talker,43,( 2 - 1 ));
			if( i0 != -1 )
			{
				if( reply == 1 && myself::HaveMemo(talker,43) == 1 )
				{
					if( ( ( ( 1 == 1 && myself::OwnItemCount(talker,220) >= 1 ) || 1 == 0 ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) )
					{
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
						{
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,220,1);
							myself::DeleteItem1(talker,0,0);
							myself::DeleteItem1(talker,0,0);
							myself::ShowPage(talker,"pet_manager_cooper_q0043_0201.htm");
							myself::SetMemoState(talker,43,( ( 2 * 10 ) + 1 ));
							myself::SetFlagJournal(talker,43,2);
						}
					}
					else
					{
						myself::ShowPage(talker,"pet_manager_cooper_q0043_0202.htm");
					}
				}
			}
		}
		if( ask == 43 )
		{
			myself::SetCurrentQuestID(43);
			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 == 43 )
		{
			i0 = myself::GetHTMLCookie(talker,43,( 3 - 1 ));
			if( i0 != -1 )
			{
				if( reply == 1 && myself::HaveMemo(talker,43) == 1 )
				{
					if( ( ( ( 1 == 1 && myself::OwnItemCount(talker,7550) >= 30 ) || 1 == 0 ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) )
					{
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
						{
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,7550,30);
							myself::DeleteItem1(talker,0,0);
							myself::DeleteItem1(talker,0,0);
							myself::GiveItem1(talker,7551,1);
							myself::ShowPage(talker,"pet_manager_cooper_q0043_0301.htm");
							myself::SetMemoState(talker,43,( ( 3 * 10 ) + 1 ));
							myself::SetFlagJournal(talker,43,4);
						}
					}
					else
					{
						myself::ShowPage(talker,"pet_manager_cooper_q0043_0302.htm");
					}
				}
			}
		}
		if( ask == 43 )
		{
			myself::SetCurrentQuestID(43);
			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 == 43 && myself::GetOneTimeQuestFlag(talker,43) == 0 )
		{
			i0 = myself::GetHTMLCookie(talker,43,( 5 - 1 ));
			if( i0 != -1 )
			{
				if( reply == 3 && myself::HaveMemo(talker,43) == 1 && myself::GetOneTimeQuestFlag(talker,43) == 0 )
				{
					if( ( ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) )
					{
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
						{
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,0,myself::OwnItemCount(talker,0));
							myself::DeleteItem1(talker,0,myself::OwnItemCount(talker,0));
							myself::DeleteItem1(talker,0,myself::OwnItemCount(talker,0));
							myself::GiveItem1(talker,7584,1);
						}
						myself::AddLog(2,talker,43);
						myself::RemoveMemo(talker,43);
						myself::SetOneTimeQuestFlag(talker,43,1);
						myself::SoundEffect(talker,"ItemSound.quest_finish");
						myself::ShowPage(talker,"pet_manager_cooper_q0043_0501.htm");
					}
					else
					{
						myself::ShowPage(talker,"pet_manager_cooper_q0043_0502.htm");
					}
				}
			}
		}
		super;
	}

}
