ZURSULUS L2

Hunting for Wild Beasts

ID
341
Название
Hunting for Wild Beasts
start_npcs_json
[30078]
npc_ids_json
[]
constants_json
{"BEAR_SKIN":4259}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00341_HuntingForWildBeasts/Q00341_HuntingForWildBeasts.java

NPC квеста

Записей нет.

Условия уровней: выражения из Java

htmltext = (player.getLevel() < 20) ? "30078-00.htm" : "30078-01.htm";

Выдача предметов, адены и опыта: выражения из Java

giveAdena(player, 3710, true);
giveItems(player, BEAR_SKIN, 1);

Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.

Тексты квеста

[30078-00.htm] Grocer Pano: I am beside myself! Would you mind if I tell you my problem? Recently the salmon population in river to the west of this village has exploded. This is not even the spawning season and yet all the fish are returning at once. I feared that this may be an omen of bad things to come, but the businessman in me saw a great opportunity. In spite of my reservations I started selling fishing gear and opened a resort. Sounds great, right? Well, the problem is... You know, I don't really feel comfortable talking about my problems with you. Why don't you come back when you've had more experience. I will have something to ask of you then. (This quest may only be undertaken by a character of level 20 and above.) [30078-01.htm] Grocer Pano: I am beside myself! Would you mind if I tell you my problem? Recently the salmon population in the river to the west of this village has exploded. This is not even the spawning season and yet all the fish are returning at once. I feared that this may be an omen of bad things to come, but the businessman in me saw a great opportunity. In spite of my reservations I started selling fishing gear and opened a resort. Sounds great, right? Well, the problem is... "What's your problem?" [30078-01a.htm] Grocer Pano: Well, you see, when the river became clotted with salmon, inland bears started coming down to the river to gorge themselves. It was inevitable that they would clash violently with the fishermen there. Consequently my fishing resort was forced out of business, and I'm stuck with this huge stock of fishing gear! Would you be interested in earning some money? Please hunt down and kill the bears. I will pay you well! "I will hunt the bears." [30078-02.htm] Grocer Pano: Excellent! I bet you'll give those filthy bears what they have coming. Kill the Dion grizzly! Most of the bears by the river have already been killed, so you'll need to search nearby... Try the Dion Hills... In Gludio you will also find red bears, grizzly bears and brown bears. I hate those filthy beasts! If I could I would obliterate every single stinking bear on earth! Bring me at least 20 bear pelts. You'll be well-rewarded. [30078-03.htm] Grocer Pano: Have you killed the bears? You haven't killed enough of them. You must collect 20 bear pelts and bring them back to me. Otherwise, you shall not be paid. You must hunt the red bears, grizzly bears, brown bears and the Dion grizzly. Kill them all! [30078-04.htm] Grocer Pano: Good job! You shall be rewarded handsomely. The efforts of noble hunters like you will one day make the re-opening of my resort possible. Please stop by when we get it up and running. I know you will enjoy fishing there!
Исходник условий и наград (Java)
/*
 * Copyright (c) 2013 L2jMobius
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
 * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
package quests.Q00341_HuntingForWildBeasts;

import java.util.HashMap;
import java.util.Map;

import org.l2jmobius.gameserver.entity.actor.Npc;
import org.l2jmobius.gameserver.entity.actor.Player;
import org.l2jmobius.gameserver.mechanics.script.Quest;
import org.l2jmobius.gameserver.mechanics.script.QuestSound;
import org.l2jmobius.gameserver.mechanics.script.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;

public class Q00341_HuntingForWildBeasts extends Quest
{
	// Item
	private static final int BEAR_SKIN = 4259;
	
	// Drop chances
	private static final Map<Integer, Integer> CHANCES = new HashMap<>();
	static
	{
		CHANCES.put(20021, 500000); // Red Bear
		CHANCES.put(20203, 900000); // Dion Grizzly
		CHANCES.put(20310, 500000); // Brown Bear
		CHANCES.put(20335, 700000); // Grizzly Bear
	}
	
	public Q00341_HuntingForWildBeasts()
	{
		super(341, "Hunting for Wild Beasts");
		registerQuestItems(BEAR_SKIN);
		addStartNpc(30078); // Pano
		addTalkId(30078);
		addKillId(20021, 20203, 20310, 20335);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		String htmltext = event;
		final QuestState st = getQuestState(player, false);
		if (st == null)
		{
			return htmltext;
		}
		
		if (event.equals("30078-02.htm"))
		{
			st.startQuest();
		}
		
		return htmltext;
	}
	
	@Override
	public String onTalk(Npc npc, Player player)
	{
		String htmltext = getNoQuestMsg(player);
		final QuestState st = getQuestState(player, true);
		
		switch (st.getState())
		{
			case State.CREATED:
			{
				htmltext = (player.getLevel() < 20) ? "30078-00.htm" : "30078-01.htm";
				break;
			}
			case State.STARTED:
			{
				if (getQuestItemsCount(player, BEAR_SKIN) < 20)
				{
					htmltext = "30078-03.htm";
				}
				else
				{
					htmltext = "30078-04.htm";
					takeItems(player, BEAR_SKIN, -1);
					giveAdena(player, 3710, true);
					st.exitQuest(true, true);
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getQuestState(player, false);
		if ((st == null) || !st.isStarted())
		{
			return;
		}
		
		if ((getQuestItemsCount(player, BEAR_SKIN) < 20) && (getRandom(1000000) < CHANCES.get(npc.getId())))
		{
			giveItems(player, BEAR_SKIN, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}