ZURSULUS L2

Hunt the Orcs

ID
260
Название
Hunt the Orcs
start_npcs_json
[30221]
npc_ids_json
[20468,20469,20470,20471,20472,20473,30221]
constants_json
{"RAYEN":30221,"KABOO_ORC":20468,"KABOO_ORC_ARCHER":20469,"KABOO_ORC_GRUNT":20470,"KABOO_ORC_FIGHTER":20471,"KABOO_ORC_FIGHTER_LEADER":20472,"KABOO_ORC_FIGHTER_LIEUTENANT":20473,"ORC_AMULET":1114,"ORC_NECKLACE":1115,"SPIRITSHOT_FOR_BEGINNERS":5790,"SOULSHOT_FOR_BEGINNERS":5789}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00260_OrcHunting/Q00260_OrcHunting.java

NPC квеста

IDНазваниеСтарт квестаУровень
20468Kaboo OrcНет6
20469Kaboo Orc ArcherНет8
20470Kaboo Orc GruntНет7
20471Kaboo Orc FighterНет10
20472Kaboo Orc Fighter LeaderНет12
20473Kaboo Orc Fighter LieutenantНет11
30221RayenДа80

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

else if (player.getLevel() < 6)

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

giveAdena(player, reward, true);
giveItems(player, SPIRITSHOT_FOR_BEGINNERS, 3000);
giveItems(player, SOULSHOT_FOR_BEGINNERS, 6000);
giveItems(player, ORC_AMULET, 1);
giveItems(player, ORC_NECKLACE, 1);

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

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

[30221-00.htm] Sentinel Rayen: Stranger with an unfamiliar gaze, please be careful if you should venture outside the village. The woods are full of danger, as there is a war going on between our race of the woods and the kaboo orcs of the Fog Mountains. But do not worry, the Elven warriors will soon drive the orcs out of our woods. (This quest may only be undertaken by an Elven character.) [30221-01.htm] Sentinel Rayen: The orcs of Fog Mountains are becoming bolder and bolder lately. Before, they wouldn't dare set foot into the Elven Forest, and now they dare to come into the village. Pretty soon, we plan to recruit brave brothers to help us defeat these fearless invaders. I hope you will take part in this when the time comes. (This quest may only be undertaken by a character of level 6 and above.) [30221-02.htm] Sentinel Rayen: The kaboo orcs of the Fog Mountains are becoming bolder and bolder lately. Before, they wouldn't dare set foot into the Elven Forest, and now they dare to come into the village. On top of that, more and more orc hordes are invading the forest. I don't know how the orcs can come near the village, with the guardians keeping watch at the boundary of the woods. They must be avoiding the eyes of the guardians using some clever method. The elders have ordered us to recruit brothers who will help us to defeat the kaboo orcs. Shouldn't we punish this fearless race that dares to invade our homes? Would you like to participate? Say you will participate [30221-03.htm] Sentinel Rayen: Now go into the Elven Forest and fight the kaboo orcs. But you must keep this in mind. A hierarchy exists within the orcs, and because fighter or leader levels are stronger than lesser orcs, you may be in trouble if you do not take care. The lesser orcs carry feather amulets, while the high level orcs wear necklaces made from bones. Gather these items as proof and bring them to me. May the goddess guide your blade and arrows! Teach those orcs a stern lesson that they should never even think of setting foot into the Elven Forest! [30221-04.htm] Sentinel Rayen: Why have you come back so soon? Even as we speak, our beautiful woods are being invaded by the Orcs. They are a race that does not know about beauty or purity. We cannot let them violate our home, can we? But even if you say that your mind and body are tired, I will not fault or scold you. Sheath your blade at once and take shelter under the shade of the Mother Tree. Say you will go and fight. Say you will quit. [30221-05.htm] Sentinel Rayen: You have fought well for the brothers of the forest. I will give you a reward for each piece of proof you have brought from slaying kaboo orcs in the battlefield. I am giving this in the name of our Hierarch Asterios, so please do not refuse our gift. Now! Shall you go back to the battlefield and fight once more? Or do you wish to stop? Even if you say that you are exhausted in mind and body, I will not fault or scold you. Say you will continue Say you will quit [30221-06.htm] Sentinel Rayen: The brothers of the forest will forever remember your bravery. Sheathe your sword now and seek rest under the shade of the Mother Tree. May the tranquility of the still lakes be with you. [30221-07.htm] Sentinel Rayen: I hope you will continue to fight for the brothers of the forest. Teach those kaboo orcs a lesson they will never forget, so that they know how deadly Elven punishment can be, and never dare to set foot in our woods again.
Исходник условий и наград (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.Q00260_OrcHunting;

import org.l2jmobius.commons.util.Rnd;
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;
import org.l2jmobius.gameserver.mechanics.variables.PlayerVariables;

public class Q00260_OrcHunting extends Quest
{
	// NPC
	private static final int RAYEN = 30221;
	
	// Monsters
	private static final int KABOO_ORC = 20468;
	private static final int KABOO_ORC_ARCHER = 20469;
	private static final int KABOO_ORC_GRUNT = 20470;
	private static final int KABOO_ORC_FIGHTER = 20471;
	private static final int KABOO_ORC_FIGHTER_LEADER = 20472;
	private static final int KABOO_ORC_FIGHTER_LIEUTENANT = 20473;
	
	// Items
	private static final int ORC_AMULET = 1114;
	private static final int ORC_NECKLACE = 1115;
	
	// Newbie Items
	private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
	private static final int SOULSHOT_FOR_BEGINNERS = 5789;
	
	public Q00260_OrcHunting()
	{
		super(260, "Hunt the Orcs");
		registerQuestItems(ORC_AMULET, ORC_NECKLACE);
		addStartNpc(RAYEN);
		addTalkId(RAYEN);
		addKillId(KABOO_ORC, KABOO_ORC_ARCHER, KABOO_ORC_GRUNT, KABOO_ORC_FIGHTER, KABOO_ORC_FIGHTER_LEADER, KABOO_ORC_FIGHTER_LIEUTENANT);
	}
	
	@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("30221-03.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30221-06.htm"))
		{
			st.exitQuest(true, true);
		}
		
		return htmltext;
	}
	
	@Override
	public String onTalk(Npc npc, Player player)
	{
		final QuestState st = getQuestState(player, true);
		String htmltext = getNoQuestMsg(player);
		
		switch (st.getState())
		{
			case State.CREATED:
			{
				if (player.getRace() != Race.ELF)
				{
					htmltext = "30221-00.htm";
				}
				else if (player.getLevel() < 6)
				{
					htmltext = "30221-01.htm";
				}
				else
				{
					htmltext = "30221-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 = "30221-04.htm";
				}
				else
				{
					htmltext = "30221-05.htm";
					
					int reward = (amulet * 12) + (necklace * 30);
					if (!GeneralConfig.ALT_VILLAGES_REPEATABLE_QUEST_REWARD && ((amulet + necklace) >= 10))
					{
						reward += 1000;
					}
					
					takeItems(player, ORC_AMULET, -1);
					takeItems(player, ORC_NECKLACE, -1);
					giveAdena(player, reward, true);
					
					// Give newbie reward if player is eligible.
					if (player.isNewbie() && (st.getInt("Reward") == 0))
					{
						int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEWBIE_SHOTS_RECEIVED, 0);
						if (newPlayerRewardsReceived < 1)
						{
							st.showQuestionMark(26);
							st.set("Reward", "1");
							
							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, 6000);
								player.getVariables().set(PlayerVariables.NEWBIE_SHOTS_RECEIVED, ++newPlayerRewardsReceived);
							}
						}
					}
				}
				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_ORC:
			case KABOO_ORC_GRUNT:
			case KABOO_ORC_ARCHER:
			{
				if (Rnd.get(10) < 5)
				{
					giveItems(player, ORC_AMULET, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				break;
			}
			case KABOO_ORC_FIGHTER:
			case KABOO_ORC_FIGHTER_LEADER:
			case KABOO_ORC_FIGHTER_LIEUTENANT:
			{
				if (Rnd.get(10) < 5)
				{
					giveItems(player, ORC_NECKLACE, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				break;
			}
		}
	}
}