ZURSULUS L2

Scent of Death

ID
319
Название
Scent of Death
start_npcs_json
[30138]
npc_ids_json
[]
constants_json
{"ZOMBIE_SKIN":1045}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00319_ScentOfDeath/Q00319_ScentOfDeath.java

NPC квеста

Записей нет.

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

htmltext = (player.getLevel() < 11) ? "30138-02.htm" : "30138-03.htm";

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

giveAdena(player, 3350, true);
rewardItems(player, 1060, 1);
giveItems(player, ZOMBIE_SKIN, 1);

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

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

[30138-02.htm] Trader Minaless: I grow many Medicinal Herbs as a side job. Of course, my efforts don't compare at all to Tetrarch Vellior's herb garden, but I am raising a few priceless herbs like nightshade and Belladonna. However, as precious as they are, they must be given a special fertilizer. To make the fertilizer of the nightshade, one must collect all sorts of different materials, and it takes a lot of time and effort. It would be nice if you could help me later on. ... (This quest may only be undertaken by a character of level 11 and above.) [30138-03.htm] Trader Minaless: Do you know about the flower called nightshade? It is a very beautiful plant with a sweet scent that only blossoms at night. The juice is very poisonous, but if it is processed properly it can be used in making reagents that have many uses. Recently, I have begun raising nightshade in my herb garden. However, I am still learning the craft, so everything is very crude compared to Tetrarch Vellior's herb garden. To make nightshade fertilizer I must collect all sorts of odd ingredients, and it requires a lot of time and effort. I need someone to collect ingredients for me. Could you help me? Say you will help [30138-04.htm] Trader Minaless: Nightshade must be fertilized by zombie dust. It is a component made by drying the skin of corpses and pounding them into dust. This is said to be more effective when it is made by older corpses. I sought the advice of Tetrarch Vellior, who said that he collects the skin of the undead to make zombie dust. If you go to the Marshlands, southwest of the village, the marsh zombies that were massacred by our race a long time ago haunt the grounds. Please collect their skin. I will pay you for 5 Zombie's Skins. [30138-05.htm] Trader Minaless: I must have at least five zombie skins to make zombie dust. If you go to the Marshlands southwest of the village, there are many marsh zombies that aimlessly wander around. [30138-06.htm] Trader Minaless: Thank you! This is enough to make fertilizer for a month. I will compensate you as I promised! I will also give you a reagent made from the juice of nightshade I harvested just recently. My skills are yet poor, so the effect is weak, but I think you will still find it quite useful.
Исходник условий и наград (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.Q00319_ScentOfDeath;

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 Q00319_ScentOfDeath extends Quest
{
	// Item
	private static final int ZOMBIE_SKIN = 1045;
	
	public Q00319_ScentOfDeath()
	{
		super(319, "Scent of Death");
		registerQuestItems(ZOMBIE_SKIN);
		addStartNpc(30138); // Minaless
		addTalkId(30138);
		addKillId(20015, 20020);
	}
	
	@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("30138-04.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() < 11) ? "30138-02.htm" : "30138-03.htm";
				break;
			}
			case State.STARTED:
			{
				if (st.isCond(1))
				{
					htmltext = "30138-05.htm";
				}
				else
				{
					htmltext = "30138-06.htm";
					takeItems(player, ZOMBIE_SKIN, -1);
					giveAdena(player, 3350, true);
					rewardItems(player, 1060, 1);
					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.isCond(1))
		{
			return;
		}
		
		if (getRandom(10) < 2)
		{
			giveItems(player, ZOMBIE_SKIN, 1);
			if (getQuestItemsCount(player, ZOMBIE_SKIN) < 5)
			{
				playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				st.setCond(2, true);
			}
		}
	}
}