ZURSULUS L2

Offspring of Nightmares

ID
169
Название
Offspring of Nightmares
start_npcs_json
[30145]
npc_ids_json
[]
constants_json
{"CRACKED_SKULL":1030,"PERFECT_SKULL":1031,"BONE_GAITERS":31}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00169_OffspringOfNightmares/Q00169_OffspringOfNightmares.java

NPC квеста

Записей нет.

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

else if (player.getLevel() < 15)

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

giveItems(player, BONE_GAITERS, 1);
giveAdena(player, reward, true);
giveItems(killer, PERFECT_SKULL, 1);
giveItems(killer, CRACKED_SKULL, 1);

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

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

[30145-00.htm] Magister Vlasty: I am currently conducting research on the undead, and need someone to fetch some materials for me. But I'm not sure how much a foreign race like yourself would understand about the ingredients used in black magic ... Yes, I think it would be best to ask someone from our race. (This quest may only be undertaken by a Dark Elven character.) [30145-02.htm] Magister Vlasty: My latest interest is the spirits called dark horrors. I am currently studying these strange undead creatures. But I have yet to have a model of an actual dark horror, and my studies have not progressed significantly. At some point, I might have to ask you to get me some dark horror bones. (This quest may only be undertaken by a Dark Elven character of level 15 and above.) [30145-03.htm] Magister Vlasty: I am currently studying dark horrors. These dark horrors are different in many ways from normal undead creatures. I think that perhaps dark horrors are monsters created by Shilen from the nightmares of the ancient ones, and are the personification of the most basic horrors ever known. The scythe that a dark horror holds represents death, and the sharp fangs like those found on evil creatures may have been objects of fear for the ancient ones ... I plan to conduct more actual tests, to prove my scientific theory. For this, I'm going to need a model. How about it, do you think you can get me a skull of a dark horror? You seem more than capable of handling this request with no difficulties ...? Say you will do the favor [30145-04.htm] Magister Vlasty: To find these dark horrors, you should go to the swamp area southwest of the village. But it may be hard to find a perfect, whole skull. In most cases, when a dark horror dies, the power of the black magic that supports its life is scattered, and the bones are shattered. So, it may be difficult to find a Perfect Skull. But even broken skulls are helpful to my research, and if you bring me broken skulls along with a Perfect Skull, I will reward you handsomely for your efforts, do not worry. However, I cannot base my studies on Cracked Skulls alone, and so I will not reward you until you bring me a Perfect Skull. If you are ready, you should be on your way now. [30145-05.htm] Magister Vlasty: Haven't you been able to obtain the skulls yet? Well, there's no need to rush. I repeat, to find the dark horrors, go to the swamp area that is southwest of the village. Slay the dark horrors and bring the skulls back to me. It doesn't matter if they are cracked. But you must bring me at least one Perfect Skull. If not, I cannot give you any reward. [30145-06.htm] Magister Vlasty: Hmm ... This is without a doubt the skull of a dark horror. But I cannot perform my spell with Cracked Skulls alone. Bring me an uncracked, whole skull. Then I will pay you for the Perfect Skull, along with any Cracked Skulls you may bring me. [30145-07.htm] Magister Vlasty: Ho, this is the whole, Perfect Skull of a dark horror ... Somehow, it looks similar to Elven skulls ... Hmmm ... interesting ...? Wait ...! It can't be ... Here, take the payment I have promised you. Now go away. Never speak of this again. You must promise me. Do you understand? Ask what is wrong [30145-08.htm] Magister Vlasty: You are still young and probably do not know, but actually, fifty years ago a group of Dark Elves rose up in opposition to Tetrarch Thifiell. But one day, they all just disappeared. After a long investigation, it was concluded that they had been slain by the Elves of light at that time ... But a few of my brothers, including myself, questioned the results of that investigation ... Do not ask any more! You might also be put into danger. I plan to not get myself involved deeply in this matter either. Here, take your reward and forget about this incident.
Исходник условий и наград (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.Q00169_OffspringOfNightmares;

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 Q00169_OffspringOfNightmares extends Quest
{
	// Items
	private static final int CRACKED_SKULL = 1030;
	private static final int PERFECT_SKULL = 1031;
	private static final int BONE_GAITERS = 31;
	
	public Q00169_OffspringOfNightmares()
	{
		super(169, "Offspring of Nightmares");
		registerQuestItems(CRACKED_SKULL, PERFECT_SKULL);
		addStartNpc(30145); // Vlasty
		addTalkId(30145);
		addKillId(20105, 20025);
	}
	
	@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("30145-04.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30145-08.htm"))
		{
			final int reward = 17000 + (getQuestItemsCount(player, CRACKED_SKULL) * 20);
			takeItems(player, PERFECT_SKULL, -1);
			takeItems(player, CRACKED_SKULL, -1);
			giveItems(player, BONE_GAITERS, 1);
			giveAdena(player, reward, true);
			st.exitQuest(false, true);
		}
		
		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 = "30145-00.htm";
				}
				else if (player.getLevel() < 15)
				{
					htmltext = "30145-02.htm";
				}
				else
				{
					htmltext = "30145-03.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				if (cond == 1)
				{
					if (hasQuestItems(player, CRACKED_SKULL))
					{
						htmltext = "30145-06.htm";
					}
					else
					{
						htmltext = "30145-05.htm";
					}
				}
				else if (cond == 2)
				{
					htmltext = "30145-07.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.isStarted())
		{
			if ((getRandom(10) > 7) && !hasQuestItems(killer, PERFECT_SKULL))
			{
				giveItems(killer, PERFECT_SKULL, 1);
				qs.setCond(2, true);
			}
			else if (getRandom(10) > 4)
			{
				giveItems(killer, CRACKED_SKULL, 1);
				playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
		}
	}
}