ZURSULUS L2

Dark Winged Spies

ID
275
Название
Dark Winged Spies
start_npcs_json
[30567]
npc_ids_json
[20316,27043]
constants_json
{"DARKWING_BAT":20316,"VARANGKA_TRACKER":27043,"DARKWING_BAT_FANG":1478,"VARANGKA_PARASITE":1479}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00275_DarkWingedSpies/Q00275_DarkWingedSpies.java

NPC квеста

IDНазваниеСтарт квестаУровень
20316Darkwing BatНет11
27043Varangka's TrackerНет11

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

else if (player.getLevel() < 11)

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

giveAdena(player, 4200, true);
giveItems(player, DARKWING_BAT_FANG, 1);
giveItems(player, VARANGKA_PARASITE, 1);
giveItems(player, DARKWING_BAT_FANG, 5);

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

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

[30567-00.htm] Neruga Chief Tantus: I am Chief Tantus of the great Neruga Tribe! The tasks I give are difficult ones that can only be carried out by the strongest fighters. They are all much too strenuous to entrust to a weak stranger like you! (This quest may only be undertaken by an Orcish character.) [30567-01.htm] Neruga Chief Tantus: The identity of the one stirring up goblins and werewolves, and controlling rakeclaw imps has been unmasked. He is called Varangka, a disgraced mage banished from the Kingdom a few years ago. He decided to seek revenge upon us to wipe away his shame and humiliation by conspiring with the evil spirits and gaining the power of the darkness. Somewhere on the Immortal Plateau, he is plotting to destroy the Kingdom of the Orcs. Many expeditions have been dispatched to kill him, but every time Varangka already knew of the attack and had escaped. We found out that he has servants that act as his eyes and ears. The darkwing bat is controlled by Varangka, who uses it to look at our movements. Seer Tanapi is developing a protective shield that will keep darkwing bats from approaching. I will ask you later to collect objects that are required to complete the magic, so be prepared. (This quest may only be undertaken by a character of level 11 and above.) [30567-02.htm] Neruga Chief Tantus: The identity of the one who instigated goblins and werewolves, and controlled rakeclaw imps from behind the scenes has been unmasked. He is called Varangka, a disgraced mage banished from the Kingdom a few years ago. He decided to seek revenge upon us to wipe away his shame and humiliation by conspiring with the evil spirits and gaining the power of the darkness. Somewhere on the Immortal Plateau, he is plotting to destroy the Kingdom of the Orcs. Many expeditions have been dispatched to kill him, but every time, Varangka already knew of the attack and had escaped. Now we know that he had servants in the air that acted as his eyes and ears. The darkwing bats are being controlled by Varangka, who uses them to monitor our movements. The seers say they need the fangs of the bats to complete the protection system that will keep the darkwing bats from approaching. Say you will collect the fangs [30567-03.htm] Neruga Chief Tantus: Kill the darkwing bats and bring their fangs. Fangs should not be broken or scratched! Bring only the intact ones; a total of seventy fangs are required. As long as the darkwing bats act as the eyes and ears of Varangka, he can see every move we make. We should make him go blind by sending an expedition to defeat him. You must be careful when hunting darkwing bats. Varangka's trackers may attack you. Make sure you are always on your guard. Good luck! [30567-04.htm] Neruga Chief Tantus: You must collect seventy fangs of the darkwing bats. That's the only way to complete the protection shield that will keep the bats from approaching. As long as the darkwing bats become the eyes and ears of Varangka, he can see every move that we make. We cannot defeat him until we blind him. You must be careful when hunting darkwing bats. Trackers sent by Varangka may attack you. Make sure you are always on your guard. Good luck! [30567-05.htm] Neruga Chief Tantus: Well done! With this, we can cast a shield around the king's hall and surrounding buildings for the time being, to prevent the secret agents of Varangka from peeking in. Before we can dispatch an expedition team to deal with Varangka, they must first receive the protection of the shield. We need more bat fangs in the future. For now, receive this money, help yourself to our excellent food and drink, and have a good rest. Come back when you are ready to fight once more for our race.
Исходник условий и наград (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.Q00275_DarkWingedSpies;

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 Q00275_DarkWingedSpies extends Quest
{
	// Monsters
	private static final int DARKWING_BAT = 20316;
	private static final int VARANGKA_TRACKER = 27043;
	
	// Items
	private static final int DARKWING_BAT_FANG = 1478;
	private static final int VARANGKA_PARASITE = 1479;
	
	public Q00275_DarkWingedSpies()
	{
		super(275, "Dark Winged Spies");
		registerQuestItems(DARKWING_BAT_FANG, VARANGKA_PARASITE);
		addStartNpc(30567); // Tantus
		addTalkId(30567);
		addKillId(DARKWING_BAT, VARANGKA_TRACKER);
	}
	
	@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("30567-03.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:
			{
				if (player.getRace() != Race.ORC)
				{
					htmltext = "30567-00.htm";
				}
				else if (player.getLevel() < 11)
				{
					htmltext = "30567-01.htm";
				}
				else
				{
					htmltext = "30567-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				if (st.isCond(1))
				{
					htmltext = "30567-04.htm";
				}
				else
				{
					htmltext = "30567-05.htm";
					takeItems(player, DARKWING_BAT_FANG, -1);
					takeItems(player, VARANGKA_PARASITE, -1);
					giveAdena(player, 4200, true);
					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;
		}
		
		switch (npc.getId())
		{
			case DARKWING_BAT:
			{
				giveItems(player, DARKWING_BAT_FANG, 1);
				if (getQuestItemsCount(player, DARKWING_BAT_FANG) < 70)
				{
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				else
				{
					st.setCond(2, true);
				}
				
				if ((getRandom(100) < 10) && (getQuestItemsCount(player, DARKWING_BAT_FANG) > 10) && (getQuestItemsCount(player, DARKWING_BAT_FANG) < 66))
				{
					// Spawn of Varangka Tracker on the npc position.
					addSpawn(VARANGKA_TRACKER, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
					giveItems(player, VARANGKA_PARASITE, 1);
				}
				break;
			}
			case VARANGKA_TRACKER:
			{
				if (hasQuestItems(player, VARANGKA_PARASITE))
				{
					takeItems(player, VARANGKA_PARASITE, -1);
					if (getQuestItemsCount(player, DARKWING_BAT_FANG) < 70)
					{
						giveItems(player, DARKWING_BAT_FANG, 5);
						if (getQuestItemsCount(player, DARKWING_BAT_FANG) < 70)
						{
							playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
						}
						else
						{
							st.setCond(2, true);
						}
					}
				}
				break;
			}
		}
	}
}