ZURSULUS L2

Power of Darkness

ID
353
Название
Power of Darkness
start_npcs_json
[31044]
npc_ids_json
[]
constants_json
{"STONE":5862}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00353_PowerOfDarkness/Q00353_PowerOfDarkness.java

NPC квеста

Записей нет.

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

htmltext = (player.getLevel() < 55) ? "31044-01.htm" : "31044-02.htm";

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

giveAdena(player, 2500 + (230 * stones), true);
giveItems(killer, STONE, 1);

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

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

[31044-01.htm] Trader Galman: Hey! What are you doing? You shouldn't be here! This place is too dangerous for you. (This quest may only be undertaken by a character of level 55 and above.) [31044-02.htm] Trader Galman: Have you ever heard of the Stone of Contract? It is used to tap into the power of darkness... Why are you looking at me like that? Don't hold it against me just because I mentioned the power of darkness. Actually, it's all due to a woman. My one and only love... "Is she in trouble?" [31044-03.htm] Trader Galman: She recently fell sick with some mysterious illness. I took her to the priest, and we've tried numerous medicines, but all for naught. As a last resort I decided to call upon the powers of darkness. But for someone like me to use these powers, I must have a Stone of Contract. Will you bring one to me? "I will help you." [31044-04.htm] Trader Galman: Wonderful! You can get the stone from the Malruk Succubus and Malruk Succubus Turens that have been attacking those who pass by Dragon Valley. They belong to the race of darkness, and so they are not at all easy to deal with... Be very careful... I will reward you handsomely for your efforts. [31044-05.htm] Trader Galman: Are you still here? You haven't found the stone? I'll tell you again. The Stone of Contract is kept by Malruk succubi and Malruk succubus turens. Please, bring me a Stone of Contract... You're not going to quit on me, are you? "I want to quit." "I'll bring you a Stone of Contract." [31044-06.htm] Trader Galman: Ah, the stones of Contract! Let me have them! They look good enough for me. Thank you for doing this for me. Here is the reward I promised. Please take it... By the way, I still need more stones. Could you bring me more? I understand if you don't want to... "I will collect more stones for you." "I want to quit. It's far too dangerous." [31044-07.htm] Trader Galman: Thank you! I'll never forget this. I'm so happy to think that soon I will see her smiling face again... Are you still here? Bring me the Stones of Contract. You can get them from Malruk Succubus and Malruk Succubus Turens. [31044-08.htm] Trader Galman: If that's what you want, I won't try to stop you... Well, what are you still doing here?
Исходник условий и наград (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.Q00353_PowerOfDarkness;

import org.l2jmobius.commons.util.Rnd;
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.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;

public class Q00353_PowerOfDarkness extends Quest
{
	// Item
	private static final int STONE = 5862;
	
	public Q00353_PowerOfDarkness()
	{
		super(353, "Power of Darkness");
		registerQuestItems(STONE);
		addStartNpc(31044); // Galman
		addTalkId(31044);
		addKillId(20244, 20245, 20283, 20284);
	}
	
	@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("31044-04.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("31044-08.htm"))
		{
			st.exitQuest(true, 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:
			{
				htmltext = (player.getLevel() < 55) ? "31044-01.htm" : "31044-02.htm";
				break;
			}
			case State.STARTED:
			{
				final int stones = getQuestItemsCount(player, STONE);
				if (stones == 0)
				{
					htmltext = "31044-05.htm";
				}
				else
				{
					htmltext = "31044-06.htm";
					takeItems(player, STONE, -1);
					giveAdena(player, 2500 + (230 * stones), true);
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player killer, boolean isPet)
	{
		final QuestState st = getQuestState(killer, false);
		if (st == null)
		{
			return;
		}
		
		if (st.isCond(1) && (Rnd.get(100) < ((npc.getId() == 20244) || (npc.getId() == 20283) ? 48 : 50)))
		{
			giveItems(killer, STONE, 1);
		}
	}
}