ZURSULUS L2

Destroy Plague Carriers

ID
316
Название
Destroy Plague Carriers
start_npcs_json
[30155]
npc_ids_json
[20040,20047,27020]
constants_json
{"SUKAR_WERERAT":20040,"SUKAR_WERERAT_LEADER":20047,"VAROOL_FOULCLAW":27020,"WERERAT_FANG":1042,"VAROOL_FOULCLAW_FANG":1043}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00316_DestroyPlagueCarriers/Q00316_DestroyPlagueCarriers.java

NPC квеста

IDНазваниеСтарт квестаУровень
20040Sukar WereratНет18
20047Sukar Wererat LeaderНет19
27020Varool FoulclawНет20

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

else if (player.getLevel() < 18)

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

giveAdena(player, reward, true);
giveItems(player, WERERAT_FANG, 1);
giveItems(player, VAROOL_FOULCLAW_FANG, 1);

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

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

[30155-00.htm] Master Ellenia: Have you ever seen the race called the ratmen? We Elves call that lowly race "plague bringers." Originally no disease existed anywhere in the Elven Forest. But when the dirty ratmen entered our forest, they spread disease and plague, and we learned for the first time what it means to become ill and weak. Their nest has recently been uncovered, and a group will be sent soon to eradicate them. We will surely drive the plague bringers out of our forest. But this is business between Elves and ratmen. I don't think the one of a foreign race, like yourself, should be involved. (This quest may only be undertaken by an Elven character.) [30155-02.htm] Master Ellenia: Have you ever seen the race called the ratmen? We Elves call that lowly race "plague bringers." Originally no disease existed anywhere in the Elven Forest. But when the dirty ratmen entered our forest, they spread disease and plague, and we learned for the first time what it means to become ill and weak. Moreover, the ratmen were paid to fight for the Dark Elves as mercenary soldiers during our war with the dark ones. Countless Elven brothers lost their lives to that disgusting race. Never can we forget or forgive the sins that they committed against us. Heed my words ... there will come a day when those plague bringers will be destroyed. When that time comes, please take up your sword and join in the sacred task of dealing with the ratmen. (This quest may only be undertaken by a character of level 18 and above.) [30155-03.htm] Master Ellenia: Have you ever seen the race called the ratmen? We Elves call that lowly race "plague bringers." Originally no disease existed anywhere in the Elven Forest. But when the dirty ratmen entered our forest, they spread disease and plague, and we learned for the first time what it means to become ill and weak. Moreover, the ratmen were paid to fight for the Dark Elves as mercenary soldiers during our war with the dark ones. Countless Elven brothers lost their lives to that disgusting race. Never can we forget or forgive the sins that they committed against us. Now the time has come to destroy the plague bringers! Won't you participate in the sacred task of punishing the ratmen? Say you will participate [30155-04.htm] Master Ellenia: Then I shall draw up our Contract. What you must do is to kill the ratmen and bring back their fangs as proof. I will compensate you for as many as you bring back. Furthermore, if you kill their leader Varool Foulclaw and bring back one of his fangs as proof, I will give you a great reward. We should not leave any of them alive, those dirty villains that have polluted the Elven Forest with disease and collaborated with the dark race! In Eva's name, may they all receive the stillness of the grave! According to the sentinels, the ratmen nest is in the abandoned Elven Underground Fortress. If you do not know the way to the Elven Underground Fortress, ask Sentinel Starden. May the divine protection of Eva be with you. [30155-05.htm] Master Ellenia: The eradication of the plague bringers has begun! Please hurry to the abandoned Underground Elven Fortress. Do you remember the Contract you signed with me? Destroy the dirty ratmen and bring back their fangs as proof, and I will reward you for each item of proof you bring me. I will give you an exceptionally large reward if you kill their leader, Varool Foulclaw, and bring me one of his fangs. Say you are going to go destroy them Say you will end the Contract [30155-07.htm] Master Ellenia: I congratulate you upon your safe return, Fighter of the forest. Have you given the enemy of our race a harsh punishment they will not soon forget? According to the terms of our Contract, I will reward you according to the number of fangs you have brought. I hope you will continue to fight for the brothers of the forest. Say you will end the Contract Say you will continue [30155-08.htm] Master Ellenia: I understand. You too, need rest. Rest under the shade of the Mother Tree and recover the strength of both your body and soul. Well then, may Eva's blessings be with you. [30155-09.htm] Master Ellenia: The fight must continue. We should not leave any of them alive, those dirty villains that have polluted the Elven Forest with disease and collaborated with the dark race. In Eva's name, may they all receive the stillness of the grave!
Исходник условий и наград (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.Q00316_DestroyPlagueCarriers;

import org.l2jmobius.gameserver.config.GeneralConfig;
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 Q00316_DestroyPlagueCarriers extends Quest
{
	// Monsters
	private static final int SUKAR_WERERAT = 20040;
	private static final int SUKAR_WERERAT_LEADER = 20047;
	private static final int VAROOL_FOULCLAW = 27020;
	
	// Items
	private static final int WERERAT_FANG = 1042;
	private static final int VAROOL_FOULCLAW_FANG = 1043;
	
	public Q00316_DestroyPlagueCarriers()
	{
		super(316, "Destroy Plague Carriers");
		registerQuestItems(WERERAT_FANG, VAROOL_FOULCLAW_FANG);
		addStartNpc(30155); // Ellenia
		addTalkId(30155);
		addKillId(SUKAR_WERERAT, SUKAR_WERERAT_LEADER, VAROOL_FOULCLAW);
	}
	
	@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("30155-04.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30155-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:
			{
				if (player.getRace() != Race.ELF)
				{
					htmltext = "30155-00.htm";
				}
				else if (player.getLevel() < 18)
				{
					htmltext = "30155-02.htm";
				}
				else
				{
					htmltext = "30155-03.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int ratFangs = getQuestItemsCount(player, WERERAT_FANG);
				final int varoolFangs = getQuestItemsCount(player, VAROOL_FOULCLAW_FANG);
				if ((ratFangs + varoolFangs) == 0)
				{
					htmltext = "30155-05.htm";
				}
				else
				{
					htmltext = "30155-07.htm";
					takeItems(player, WERERAT_FANG, -1);
					takeItems(player, VAROOL_FOULCLAW_FANG, -1);
					
					int reward = (ratFangs * 30) + (varoolFangs * 10000);
					if (!GeneralConfig.ALT_VILLAGES_REPEATABLE_QUEST_REWARD && (ratFangs >= 10))
					{
						reward += 5000;
					}
					
					giveAdena(player, reward, 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;
		}
		
		switch (npc.getId())
		{
			case SUKAR_WERERAT:
			case SUKAR_WERERAT_LEADER:
			{
				if (getRandom(10) < 4)
				{
					giveItems(player, WERERAT_FANG, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				break;
			}
			case VAROOL_FOULCLAW:
			{
				if (!hasQuestItems(player, VAROOL_FOULCLAW_FANG) && (getRandom(10) < 2))
				{
					giveItems(player, VAROOL_FOULCLAW_FANG, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				break;
			}
		}
	}
}