ZURSULUS L2

Shilen's Hunt

ID
165
Название
Shilen's Hunt
start_npcs_json
[30348]
npc_ids_json
[]
constants_json
{"DARK_BEZOAR":1160,"LESSER_HEALING_POTION":1060}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00165_ShilensHunt/Q00165_ShilensHunt.java

NPC квеста

Записей нет.

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

else if (player.getLevel() < 3)

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

rewardItems(player, LESSER_HEALING_POTION, 5);
addExpAndSp(player, 1000, 0);
giveItems(killer, DARK_BEZOAR, 1);

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

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

[30348-00.htm] Sentry Nelsya: In a few weeks, the mass of darkness dedicated to Shilen and Gran Kain will be held. Shilen's Hunt will be held for ten days before the mass. Unfortunately, those of other races, like yourself, cannot participate in the hunt. But you may come and watch if you'd like. (This quest may only be undertaken by a Dark Elven character.) [30348-01.htm] Sentry Nelsya: In a few weeks, the mass of darkness dedicated to Shilen and Gran Kain will be held. Shilen's Hunt will be held for ten days before the mass. The purpose of the ceremony is to hunt wild animals in the name of the goddess and offer them at the temple. Of course, the act of offering a sacrifice is only symbolic -- in the past, the hunt's purpose was also to acquire supplies for the winter during our long period of hiding in the darkness. During the hunt, all the youth in the village, armed with swords and bows, go out into the woods to hunt. The fervor is impressive -- the Humans who witnessed it called it a "wild hunt". I think you should definitely participate when the hunt begins. (This quest may only be undertaken by a character of level 3 and above.) [30348-02.htm] Sentry Nelsya: In a few days the mass of darkness dedicated to Shilen and Gran Kain will be held. Shilen's Hunt will be held for ten days before the mass. The purpose of this ceremony is to hunt wild animals in the name of the goddess and offer them as a sacrifice at the sanctuary. Of course, the act of offering a sacrifice is only symbolic -- in the past, the hunt's purpose was also to acquire supplies for the winter during our long period of hiding in the darkness. The hunt has already begun! The youth of the village are in the woods and on the hunt, armed with swords and bows. The fervor is impressive -- the Humans who witnessed it called it the "wild hunt." I think you should also hurry and participate in the hunt to honor the mother of the abyss! Say you will participate [30348-03.htm] Sentry Nelsya: Among the brown keltirs and gray wolves in the forest, there are rare animals that bear a bezoar on their bellies, as a sign of being chosen by Shilen. This bezoar is black and sparkles like a jewel. Known as the Dark Bezoar, this stone is not only beautiful, but possesses strong magical powers. The hunter who brings back thirteen Dark Bezoars is given the honorary title of "Great Hunter," and also presented with the reward that the abyssal celebrants have put up. Everyone is given the chance to compete for the prize. Of course, that includes you, too. In the name of Shilen, who takes in all that is living, may your hunt bring good results. [30348-04.htm] Sentry Nelsya: Have you found all thirteen Dark Bezoars? It won't be easy. Even if it is the hunt season, only one out of five animals will have the Bezoar. Now! Go out into the forest again and hunt brown keltirs and gray wolves. Shilen's Hunt continues even as we speak. Glory to the mother of the abyss! [30348-05.htm] Sentry Nelsya: You've done it! Thirteen Dark Bezoars! Surely Shilen will grant our race prosperity this year. Now take this prize. It is only right that you, the victor of the hunt, should be given this reward. May the blessing of Shilen, who takes in all living things, be with you ...
Исходник условий и наград (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.Q00165_ShilensHunt;

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.entity.actor.enums.creature.Race;
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 Q00165_ShilensHunt extends Quest
{
	// NPCs
	private static final Map<Integer, Integer> MONSTERS = new HashMap<>();
	static
	{
		MONSTERS.put(20456, 3); // Ashen Wolf
		MONSTERS.put(20529, 1); // Young Brown Keltir
		MONSTERS.put(20532, 1); // Brown Keltir
		MONSTERS.put(20536, 2); // Elder Brown Keltir
	}
	
	// Items
	private static final int DARK_BEZOAR = 1160;
	private static final int LESSER_HEALING_POTION = 1060;
	
	public Q00165_ShilensHunt()
	{
		super(165, "Shilen's Hunt");
		registerQuestItems(DARK_BEZOAR);
		addStartNpc(30348); // Nelsya
		addTalkId(30348);
		addKillId(MONSTERS.keySet());
	}
	
	@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("30348-03.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:
			{
				if (player.getRace() != Race.DARK_ELF)
				{
					htmltext = "30348-00.htm";
				}
				else if (player.getLevel() < 3)
				{
					htmltext = "30348-01.htm";
				}
				else
				{
					htmltext = "30348-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				if (getQuestItemsCount(player, DARK_BEZOAR) >= 13)
				{
					htmltext = "30348-05.htm";
					takeItems(player, DARK_BEZOAR, -1);
					rewardItems(player, LESSER_HEALING_POTION, 5);
					addExpAndSp(player, 1000, 0);
					st.exitQuest(false, true);
				}
				else
				{
					htmltext = "30348-04.htm";
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player killer, boolean isSummon)
	{
		final QuestState qs = getQuestState(killer, false);
		if ((qs != null) && qs.isCond(1) && (getRandom(3) < MONSTERS.get(npc.getId())))
		{
			giveItems(killer, DARK_BEZOAR, 1);
			if (getQuestItemsCount(killer, DARK_BEZOAR) < 13)
			{
				playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				qs.setCond(2, true);
			}
		}
	}
}