ZURSULUS L2

Orc Subjugation

ID
263
Название
Orc Subjugation
start_npcs_json
[30346]
npc_ids_json
[]
constants_json
{"ORC_AMULET":1116,"ORC_NECKLACE":1117}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00263_OrcSubjugation/Q00263_OrcSubjugation.java

NPC квеста

Записей нет.

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

else if (player.getLevel() < 8)

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

giveAdena(player, reward, true);
giveItems(player, (npc.getId() == 20385) ? ORC_AMULET : ORC_NECKLACE, 1);

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

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

[30346-00.htm] Sentry Kayleen: Foreign traveler, do not wander around this place. Please conduct your business in the village quickly and leave. Soon, our Dark Elven Race will go to war with the balor orcs of the Misty Mountains. When the fighting begins, the roads will become dangerous and you may be forced to stay here. So if you have somewhere else you need to get to, it would be better to hurry. (This quest may only be undertaken by a Dark Elven character.) [30346-01.htm] Sentry Kayleen: I don't know why, but the Balor Orcs, who had been hiding in the Misty Mountains, have started to invade our forest in groups. It is unpardonable that the Balor Orcs, who used to be our slaves, have forgotten their place and dare to challenge us! The Assassin scouts are following the movements of the Balor Orcs at this very moment. As soon as accurate information is received, Tetrarch Vellior will give the command to strike. When the time comes, you should also participate in the battle! We must launch a full-scale attack and drive the Balor Orcs out of our woods! (This quest may only be undertaken by a character of level 8 and above.) [30346-02.htm] Sentry Kayleen: I do not know why, but the balor orcs, who had been hiding in the Misty Mountains, have started to invade our forest in groups. It is unpardonable that the balor orcs, who used to be our slaves, have forgotten their place and dare to challenge us! According to the reports of the assassin scouts, the balor orcs are not simply coming to pillage, but are preparing for a large-scale migration. A sudden invasion of the balor orcs ... Perhaps those cunning Elves of Light are behind this! These woods are our home. We have defended ourselves every time the greedy Humans or the Elves of Light invaded us. We cannot allow an inferior race like the balor orcs to threaten our woods! All the Warriors of our race must come together to punish them in the name of Shilen. Would you like to participate? Say you will participate [30346-03.htm] Sentry Kayleen: Go to the woods and strike down any balor orcs you meet! Someone with your skills can easily take care of the Balor Orc archers, but the fighters and leaders are much stronger than regular balor orcs, so do not let your guard down! Tetrarch Vellior made a proclamation just a few days ago. The more balor orcs that are killed, the greater reward he will give. Slay the balor orcs and bring back something to serve as proof of your deed. The archers carry feather amulets, while the fighters and leaders wear a necklace crafted of bone pieces. If you collect these and bring them to me, I will give you a reward according to the number of items you present. Excellent! May you go forth in the name of Shilen and present fear as dark as the abyss and a death as cold as the deep lakes to those invaders who have violated our land! [30346-04.htm] Sentry Kayleen: Why are your hands so clean when they should be stained with the blood of the balor orcs? Go quickly into the woods and dispose of the balor orcs! Go forth in the name of Shilen and take fear as dark as the abyss and death as cold as the deep lakes to those invaders who have violated our land! You do not want to give up, do you? Do you not hear the balor orcs on the battlefield outside of the village mocking you? Would you turn and run from their taunts? Say you will go into the midst of battle Say you will quit [30346-05.htm] Sentry Kayleen: You have fought very well. In the name of Tetrarch Vellior, I will give you a reward for every balor orc that you strike down. Those who fight on behalf of the race of darkness will reap a rich reward for their bravery. But the battle is not over yet. The foreign invaders still lurk in our woods! Will you go back into the battlefield, or will you stop fighting now? Say you will continue Say you will quit [30346-06.htm] Sentry Kayleen: Then set down your sword and staff now, and go seek rest. May you find tranquility and safety in the darkness of the abyss. [30346-07.htm] Sentry Kayleen: Bring death upon the fighters and an unforgettable fear upon their widows, so that the balor orcs will never again dream of coming into our woods. May Shilen's will guide your sword and arrows straight to the hearts of your enemies! May Gran Kain increase the strength of your spells and spirits!
Исходник условий и наград (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.Q00263_OrcSubjugation;

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 Q00263_OrcSubjugation extends Quest
{
	// Items
	private static final int ORC_AMULET = 1116;
	private static final int ORC_NECKLACE = 1117;
	
	public Q00263_OrcSubjugation()
	{
		super(263, "Orc Subjugation");
		registerQuestItems(ORC_AMULET, ORC_NECKLACE);
		addStartNpc(30346); // Kayleen
		addTalkId(30346);
		addKillId(20385, 20386, 20387, 20388);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		final String htmltext = event;
		final QuestState st = getQuestState(player, false);
		if (st == null)
		{
			return htmltext;
		}
		
		if (event.equals("30346-03.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30346-06.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.DARK_ELF)
				{
					htmltext = "30346-00.htm";
				}
				else if (player.getLevel() < 8)
				{
					htmltext = "30346-01.htm";
				}
				else
				{
					htmltext = "30346-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int amulet = getQuestItemsCount(player, ORC_AMULET);
				final int necklace = getQuestItemsCount(player, ORC_NECKLACE);
				if ((amulet == 0) && (necklace == 0))
				{
					htmltext = "30346-04.htm";
				}
				else
				{
					htmltext = "30346-05.htm";
					takeItems(player, ORC_AMULET, -1);
					takeItems(player, ORC_NECKLACE, -1);
					int reward = (amulet * 20) + (necklace * 30);
					if (!GeneralConfig.ALT_VILLAGES_REPEATABLE_QUEST_REWARD && ((amulet + necklace) >= 10))
					{
						reward += 1000;
					}
					
					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.isCond(1))
		{
			return;
		}
		
		if (getRandomBoolean())
		{
			giveItems(player, (npc.getId() == 20385) ? ORC_AMULET : ORC_NECKLACE, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}