ZURSULUS L2

Skirmish with the Orcs

ID
105
Название
Skirmish with the Orcs
start_npcs_json
[30218]
npc_ids_json
[27059,27060,27061,27062,27064,27065,27067,27068]
constants_json
{"KABOO_CHIEF_UOPH":27059,"KABOO_CHIEF_KRACHA":27060,"KABOO_CHIEF_BATOH":27061,"KABOO_CHIEF_TANUKIA":27062,"KABOO_CHIEF_TUREL":27064,"KABOO_CHIEF_ROKO":27065,"KABOO_CHIEF_KAMUT":27067,"KABOO_CHIEF_MURTIKA":27068,"KENDELL_ORDER_1":1836,"KENDELL_ORDER_2":1837,"KENDELL_ORDER_3":1838,"KENDELL_ORDER_4":1839,"KENDELL_ORDER_5":1840,"KENDELL_ORDER_6":1841,"KENDELL_ORDER_7":1842,"KENDELL_ORDER_8":1843,"KABOO_CHIEF_TORC_1":1844,"KABOO_CHIEF_TORC_2":1845,"SPIRITSHOT_FOR_BEGINNERS":5790,"SOULSHOT_FOR_BEGINNERS":5789,"RED_SUNSET_STAFF":754,"RED_SUNSET_SWORD":981,"LESSER_HEALING_POT":1060,"ECHO_BATTLE":4412,"ECHO_LOVE":4413,"ECHO_SOLITUDE":4414,"ECHO_FEAST":4415,"ECHO_CELEBRATION":4416}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00105_SkirmishWithOrcs/Q00105_SkirmishWithOrcs.java

NPC квеста

IDНазваниеСтарт квестаУровень
27059UophНет11
27060KrachaНет11
27061BatohНет11
27062TanukiaНет8
27064TurelНет11
27065RokoНет8
27067KamutНет11
27068MurtikaНет8

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

else if (player.getLevel() < 10)

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

giveItems(player, getRandom(1836, 1839), 1); // Kendell's orders 1 to 4.
giveItems(player, getRandom(1840, 1843), 1); // Kendell's orders 5 to 8.
giveItems(player, RED_SUNSET_STAFF, 1);
giveItems(player, RED_SUNSET_SWORD, 1);
giveItems(player, SPIRITSHOT_FOR_BEGINNERS, 3000);
giveItems(player, SOULSHOT_FOR_BEGINNERS, 7000);
rewardItems(player, LESSER_HEALING_POT, 100);
giveItems(player, ECHO_BATTLE, 10);
giveItems(player, ECHO_LOVE, 10);
giveItems(player, ECHO_SOLITUDE, 10);
giveItems(player, ECHO_FEAST, 10);
giveItems(player, ECHO_CELEBRATION, 10);
giveItems(player, KABOO_CHIEF_TORC_1, 1);
giveItems(player, KABOO_CHIEF_TORC_2, 1);
giveItems(player, KABOO_CHIEF_TORC_2, 1);

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

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

[30218-00.htm] Sentinel Kendell: Traveller of a foreign race, the Elves are currently engaged in war with the kaboo orc tribe. If you plan on travelling outside the village, take care not to become involved in the battle or you shall be hurt. (This quest may only be undertaken by an Elven character.) [30218-01.htm] Sentinel Kendell: Looking at young Elves today, I think that they are like fragile flowers growing under the shade of the Mother Tree. Granted, they learn the use of the bow or arrow from many fine masters, or magic to command the elementals from wise sorcerors, but that is purely academic, and I worry that they may not be able to perform well in actual battle. Thus, I have always advocated that young Elves need to actively go into the battlefield and receive actual training. I'm sure you also want to see the results of your training, and also receive acknowledgement of your skills? Soon the orc tribes from the Misty Mountains and our Elven Fighters will be having a skirmish. When the time comes, I will give you the chance to participate in battle. (This quest may only be undertaken by a character of level 10 and above.) [30218-02.htm] Sentinel Kendell: Recently the orcs of Fog Mountain have become bold, and have attacked our beautiful woods in large groups. Orcs have invaded our forests before, but never in such large numbers. We Elven fighters plan to take this opportunity to strike back at those orcs that invade our homes, so that they will never again try to take over the Elven Forest. Will you face the orcs as a member of the guardians? Say that you will fight the orcs [30218-03.htm] Sentinel Kendell: My young friend, I advise you to take this opportunity to prove your bravery. Now I will tell you exactly what role you must play from this moment on. Listen to the explanation about the role [30218-04.htm] Sentinel Kendell: As you know, the Elven fighting method is to form many squadrons and weaken the opponent's strength slowly through repeated attacks and retreats, rather than rely on a full scale clash between large armies. Bear this in mind. A retreat is not a shameful thing. If we retreat without overextending the fight, the opportunity for victory will always seek us out. Your task is to throw the opponents into turmoil by slaying their leaders. This decree lists which Orc leaders you must slay and where their locations are. The information has been written based on the reports of scouts, and is surely valid. Slay the targets and bring back proof of their deaths. Well, go on now. May the blessings of Eva be with you. [30218-05.htm] Sentinel Kendell: Young friend, why have you not left yet? We must spare no time in defeating the kaboo orcs that invade our beautiful woods! The orders I have given you list which orc leaders you must slay and where their locations are. Slay the targets and bring back proof of their deaths. As your opponent is an orc leader, take extra caution. Well, go on now. May the blessings of Eva be with you. [30218-06.htm] Sentinel Kendell: Well done indeed, my young friend. I have received reports that the kaboo orcs, having lost their leader, have scattered. Now it is only a matter of time before we can completely drive the scattered orcs out of our woods. May the souls of our brothers slain by the orcs be comforted through this ... But the battle is not over yet. I have received reports that the orc army is amassing near Lake Iris, south of the village. Your second task is to defeat one of the leaders of that army. This order contains details about the target you must face. Bear this in mind. An animal becomes violent if cornered. Be extra careful. [30218-07.htm] Sentinel Kendell: Young friend, have you not left the village yet? The target you must slay is written on the orders I gave you. Slay him and bring back proof of his death. And take heed. An animal becomes violent if cornered. Be extra careful. [30218-08.htm] Sentinel Kendell: By the looks of that amulet, I see that you have delivered Bhato Bloodspear to the eternal rest of the deep lake. I'm sure Shilen has taken his bloody soul. My comrade, you have fought well for the brothers of the woods. There is nothing more you need to do now. I have received word that the orc army has retreated back to the Misty Mountains. I'm sure their severe defeat this time will be a lesson to them, and they will not attempt to take over our woods again. There are still orcs lurking in the woods, but they are mere stragglers that have strayed from their army. To commemorate your achievement in this battle, I will present you with this. This is a weapon used by our Red Sunset Brothers who fought alongside Smallberry during the battle with the Elves. That clan has been disbanded now, but the swords and staffs they used are presented even now to talented youth that fight for the glory of our race. My young brother, until the day we meet again, may the brilliance of mithril shine on the woods, lakes, and in your soul.
Исходник условий и наград (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.Q00105_SkirmishWithOrcs;

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.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;
import org.l2jmobius.gameserver.mechanics.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;

public class Q00105_SkirmishWithOrcs extends Quest
{
	// Monster
	private static final int KABOO_CHIEF_UOPH = 27059;
	private static final int KABOO_CHIEF_KRACHA = 27060;
	private static final int KABOO_CHIEF_BATOH = 27061;
	private static final int KABOO_CHIEF_TANUKIA = 27062;
	private static final int KABOO_CHIEF_TUREL = 27064;
	private static final int KABOO_CHIEF_ROKO = 27065;
	private static final int KABOO_CHIEF_KAMUT = 27067;
	private static final int KABOO_CHIEF_MURTIKA = 27068;
	
	// Item
	private static final int KENDELL_ORDER_1 = 1836;
	private static final int KENDELL_ORDER_2 = 1837;
	private static final int KENDELL_ORDER_3 = 1838;
	private static final int KENDELL_ORDER_4 = 1839;
	private static final int KENDELL_ORDER_5 = 1840;
	private static final int KENDELL_ORDER_6 = 1841;
	private static final int KENDELL_ORDER_7 = 1842;
	private static final int KENDELL_ORDER_8 = 1843;
	private static final int KABOO_CHIEF_TORC_1 = 1844;
	private static final int KABOO_CHIEF_TORC_2 = 1845;
	
	// Rewards
	private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
	private static final int SOULSHOT_FOR_BEGINNERS = 5789;
	private static final int RED_SUNSET_STAFF = 754;
	private static final int RED_SUNSET_SWORD = 981;
	private static final int LESSER_HEALING_POT = 1060;
	private static final int ECHO_BATTLE = 4412;
	private static final int ECHO_LOVE = 4413;
	private static final int ECHO_SOLITUDE = 4414;
	private static final int ECHO_FEAST = 4415;
	private static final int ECHO_CELEBRATION = 4416;
	
	public Q00105_SkirmishWithOrcs()
	{
		super(105, "Skirmish with the Orcs");
		registerQuestItems(KENDELL_ORDER_1, KENDELL_ORDER_2, KENDELL_ORDER_3, KENDELL_ORDER_4, KENDELL_ORDER_5, KENDELL_ORDER_6, KENDELL_ORDER_7, KENDELL_ORDER_8, KABOO_CHIEF_TORC_1, KABOO_CHIEF_TORC_2);
		addStartNpc(30218); // Kendell
		addTalkId(30218);
		addKillId(KABOO_CHIEF_UOPH, KABOO_CHIEF_KRACHA, KABOO_CHIEF_BATOH, KABOO_CHIEF_TANUKIA, KABOO_CHIEF_TUREL, KABOO_CHIEF_ROKO, KABOO_CHIEF_KAMUT, KABOO_CHIEF_MURTIKA);
	}
	
	@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("30218-03.htm"))
		{
			st.startQuest();
			giveItems(player, getRandom(1836, 1839), 1); // Kendell's orders 1 to 4.
		}
		
		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 = "30218-00.htm";
				}
				else if (player.getLevel() < 10)
				{
					htmltext = "30218-01.htm";
				}
				else
				{
					htmltext = "30218-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				if (cond == 1)
				{
					htmltext = "30218-05.htm";
				}
				else if (cond == 2)
				{
					htmltext = "30218-06.htm";
					st.setCond(3, true);
					takeItems(player, KABOO_CHIEF_TORC_1, 1);
					takeItems(player, KENDELL_ORDER_1, 1);
					takeItems(player, KENDELL_ORDER_2, 1);
					takeItems(player, KENDELL_ORDER_3, 1);
					takeItems(player, KENDELL_ORDER_4, 1);
					giveItems(player, getRandom(1840, 1843), 1); // Kendell's orders 5 to 8.
				}
				else if (cond == 3)
				{
					htmltext = "30218-07.htm";
				}
				else if (cond == 4)
				{
					htmltext = "30218-08.htm";
					takeItems(player, KABOO_CHIEF_TORC_2, 1);
					takeItems(player, KENDELL_ORDER_5, 1);
					takeItems(player, KENDELL_ORDER_6, 1);
					takeItems(player, KENDELL_ORDER_7, 1);
					takeItems(player, KENDELL_ORDER_8, 1);
					
					if (player.isMageClass())
					{
						giveItems(player, RED_SUNSET_STAFF, 1);
					}
					else
					{
						giveItems(player, RED_SUNSET_SWORD, 1);
					}
					
					// Give newbie reward if player is eligible
					if (player.isNewbie())
					{
						int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEWBIE_SHOTS_RECEIVED, 0);
						if (newPlayerRewardsReceived < 2)
						{
							st.showQuestionMark(26);
							if (player.isMageClass())
							{
								st.playTutorialVoice("tutorial_voice_027");
								giveItems(player, SPIRITSHOT_FOR_BEGINNERS, 3000);
								player.getVariables().set(PlayerVariables.NEWBIE_SHOTS_RECEIVED, ++newPlayerRewardsReceived);
							}
							else
							{
								st.playTutorialVoice("tutorial_voice_026");
								giveItems(player, SOULSHOT_FOR_BEGINNERS, 7000);
								player.getVariables().set(PlayerVariables.NEWBIE_SHOTS_RECEIVED, ++newPlayerRewardsReceived);
							}
						}
					}
					
					rewardItems(player, LESSER_HEALING_POT, 100);
					giveItems(player, ECHO_BATTLE, 10);
					giveItems(player, ECHO_LOVE, 10);
					giveItems(player, ECHO_SOLITUDE, 10);
					giveItems(player, ECHO_FEAST, 10);
					giveItems(player, ECHO_CELEBRATION, 10);
					player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
					st.exitQuest(false, true);
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				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 KABOO_CHIEF_UOPH:
			case KABOO_CHIEF_KRACHA:
			case KABOO_CHIEF_BATOH:
			case KABOO_CHIEF_TANUKIA:
			{
				if (st.isCond(1) && hasQuestItems(player, npc.getId() - 25223)) // npcId - 25223 = itemId to verify.
				{
					st.setCond(2, true);
					giveItems(player, KABOO_CHIEF_TORC_1, 1);
				}
				break;
			}
			case KABOO_CHIEF_TUREL:
			case KABOO_CHIEF_ROKO:
			{
				if (st.isCond(3) && hasQuestItems(player, npc.getId() - 25224)) // npcId - 25224 = itemId to verify.
				{
					st.setCond(4, true);
					giveItems(player, KABOO_CHIEF_TORC_2, 1);
				}
				break;
			}
			case KABOO_CHIEF_KAMUT:
			case KABOO_CHIEF_MURTIKA:
			{
				if (st.isCond(3) && hasQuestItems(player, npc.getId() - 25225)) // npcId - 25225 = itemId to verify.
				{
					st.setCond(4, true);
					giveItems(player, KABOO_CHIEF_TORC_2, 1);
				}
				break;
			}
		}
	}
}