ZURSULUS L2

Seed of Evil

ID
158
Название
Seed of Evil
start_npcs_json
[30031]
npc_ids_json
[]
constants_json
{"CLAY_TABLET":1025,"ENCHANT_ARMOR_D":956}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00158_SeedOfEvil/Q00158_SeedOfEvil.java

NPC квеста

Записей нет.

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

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

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

giveItems(player, ENCHANT_ARMOR_D, 1);
giveItems(killer, CLAY_TABLET, 1);

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

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

[30031-02.htm] High Priest Biotin: Actually, I have been plagued by an unexplainable fear lately. I think it is the reoccurring nightmare that I have been having recently. I have had superior intuition since I was young, and have often received divine signs in my dreams. I think that my nightmares are a warning from the gods. I do not know its exact identity yet, but I feel that an evil power is spreading its hands over the island. I only hope that this uneasy fear is a figment of my imagination ... I am not sure yet ... But perhaps even you may have to fight this evil. (This quest may only be undertaken by a character of level 21 and above.) [30031-03.htm] High Priest Biotin: I have had great intuition since my youth and have received warnings about disasters or dangers in my sleep. Eventually that has caused me to walk the path of faith. After becoming a priest, I have received the message of the gods more clearly in my dreams. Lately those occurrences have been rare, but all of a sudden, I have begun to consecutively dream very unsettling nightmares. The dream was unclear at first, but finally became clear last night. I finally realized that the dream was a warning against the foreboding evil that approaches our Talking Island. Oh, it is frightening indeed. A great evil power is targeting Talking Island. But as of now, I do not know the identity of that great evil ... all I know is that a devil presumed to be a worshipper of this evil is plotting something in the basements of the Elven Ruins. That is why all I know at the moment is that the evil worshipper must be found and eliminated. We must get rid of the seed of evil or it may draw a great evil into our island. I would like you to perform that task. Say you will accept the job [30031-04.htm] High Priest Biotin: Brave warrior, to seek out and eradicate the seed of evil, you must travel to the abandoned Elven Ruins. For directions to the abandoned Elven Ruins, ask Guard Kenyos who stands at the northern entrance of the village. In my dreams the seed of evil that will lead a great evil into the world is lying dormant in the deepest depths of the cellars, gathering power. The seed of evil took the form of a devil with large, grotesque red wings, reminiscent of a bat. They came in a group, but one of them radiated an evil force greater than the rest. I am sure that he is the leader of this group. I pray to Einhasad that our small power of good may be sufficient to defeat the darkness. [30031-05.htm] High Priest Biotin: You have not yet been able to eradicate that seed of evil, I see. Bear this in mind. It is in the deepest depths of the Elven Ruins, and takes the form of a great red devil with the wings of a bat. I bid you take caution. [30031-06.htm] High Priest Biotin: Thank you. You have completed a dangerous task. What ...? He called upon the name of Beleth at his death ...? Beleth was an evil Sorcerer, also called a devil. Long ago, his powers were sealed by the Mystics of the Ivory Tower. However, they say that no one knows whether he is still dead or alive. That a devil worshipping Beleth should appear on this island ... This is no common thing at all ... I have the feeling that this incident is the beginning of a greater plague that will come upon us in the future ... This Clay Tablet? Have you obtained it from that devil? Clay tablets were used by Mystics in the Elmoreden Age. I don't know how this is related to Beleth ... I guess I will have to ask Gallint of Einhovant's School of Wizardry, who knows how to read the ancient language, to translate this for me ... Oh. I have been so occupied with my thoughts, I nearly forgot. Please take this. This is a small gift for having performed such a difficult task. Please do not decline, just accept my gift.
Исходник условий и наград (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.Q00158_SeedOfEvil;

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;
import org.l2jmobius.gameserver.network.enums.ChatType;

public class Q00158_SeedOfEvil extends Quest
{
	// Item
	private static final int CLAY_TABLET = 1025;
	
	// Reward
	private static final int ENCHANT_ARMOR_D = 956;
	
	public Q00158_SeedOfEvil()
	{
		super(158, "Seed of Evil");
		registerQuestItems(CLAY_TABLET);
		addStartNpc(30031); // Biotin
		addTalkId(30031);
		addKillId(27016); // Nerkas
	}
	
	@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("30031-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() < 21) ? "30031-02.htm" : "30031-03.htm";
				break;
			}
			case State.STARTED:
			{
				if (!hasQuestItems(player, CLAY_TABLET))
				{
					htmltext = "30031-05.htm";
				}
				else
				{
					htmltext = "30031-06.htm";
					takeItems(player, CLAY_TABLET, 1);
					giveItems(player, ENCHANT_ARMOR_D, 1);
					st.exitQuest(false, true);
				}
				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) && !hasQuestItems(killer, CLAY_TABLET))
		{
			giveItems(killer, CLAY_TABLET, 1);
			qs.setCond(2, true);
		}
		
		npc.broadcastSay(ChatType.NPC_GENERAL, "The power of Lord Beleth rules the whole world...!");
	}
}