ZURSULUS L2

Grave Robber Annihilation

ID
644
Название
Grave Robber Annihilation
start_npcs_json
[32017]
npc_ids_json
[32017]
constants_json
{"KARUDA":32017,"ORC_GRAVE_GOODS":8088}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00644_GraveRobberAnnihilation/Q00644_GraveRobberAnnihilation.java

NPC квеста

IDНазваниеСтарт квестаУровень
32017KarudaДа70

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

htmltext = (player.getLevel() < 20) ? "32017-06.htm" : "32017-01.htm";

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

rewardItems(player, reward[0], reward[1]);
giveItems(partyMember, ORC_GRAVE_GOODS, 1);

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

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

[32017-01.htm] Karuda: Greetings, and welcome! We are the followers of Pa'agrio, as we are fated to be. Are you free to help us? This is the graveyard of a lost tribe, but grave robbers seek to plunder the burial grounds within. And thus, the spirits of the dead have become restless. We have decided to drive the grave robbers from this place, but we're short of capable hands and need your help. Can you help us? "How can I help you?" [32017-02.htm] Karuda: My investigation confirms that the grave robbers plundered almost 120 graves. If you defeat them and bring back the stolen Orcish burial goods, I will give you a reward. I have heard that the grave robbers' hideout is based in the south. Best of luck to you. [32017-03.htm] Karuda: Yes, I certify that these are all of the stolen items. I shall reward you for your hard work as best I can. I don't have much to give you, but I can give you your choice of: Varnish Animal Skin Animal Bone Charcoal Coal Iron Ore [32017-04.htm] Karuda: Here, and may Pa'agrio bless and protect you! Perhaps we will meet again, if it is His will. [32017-05.htm] Karuda: Defeat the grave robbers and take back 120 stolen grave items. [32017-06.htm] Karuda: Greetings, and welcome... but what has brought you to a such dangerous place? (This quest may only be undertaken by a character of level 20 and above.) [32017-07.htm] Karuda: Have you recovered all of the stolen burial goods? Swift work! I think you must have had the blessings of Pa'agrio! Please return the burial goods to me. I will see to their proper disposition. Hand over the burial goods.
Исходник условий и наград (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.Q00644_GraveRobberAnnihilation;

import org.l2jmobius.commons.util.StringUtil;
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.QuestSound;
import org.l2jmobius.gameserver.mechanics.script.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;

public class Q00644_GraveRobberAnnihilation extends Quest
{
	// NPC
	private static final int KARUDA = 32017;
	
	// Item
	private static final int ORC_GRAVE_GOODS = 8088;
	
	// Rewards
	private static final int[][] REWARDS =
	{
		// @formatter:off
		{1865, 30},
		{1867, 40},
		{1872, 40},
		{1871, 30},
		{1870, 30},
		{1869, 30}
		// @formatter:on
	};
	
	public Q00644_GraveRobberAnnihilation()
	{
		super(644, "Grave Robber Annihilation");
		registerQuestItems(ORC_GRAVE_GOODS);
		addStartNpc(KARUDA);
		addTalkId(KARUDA);
		addKillId(22003, 22004, 22005, 22006, 22008);
	}
	
	@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("32017-02.htm"))
		{
			st.startQuest();
		}
		else if (StringUtil.isNumeric(event))
		{
			htmltext = "32017-04.htm";
			takeItems(player, ORC_GRAVE_GOODS, -1);
			
			final int[] reward = REWARDS[Integer.parseInt(event)];
			rewardItems(player, reward[0], reward[1]);
			
			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:
			{
				htmltext = (player.getLevel() < 20) ? "32017-06.htm" : "32017-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				if (cond == 1)
				{
					htmltext = "32017-05.htm";
				}
				else if (cond == 2)
				{
					htmltext = "32017-07.htm";
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState qs = getRandomPartyMemberState(player, 1, 3, npc);
		if (qs == null)
		{
			return;
		}
		
		final Player partyMember = qs.getPlayer();
		final QuestState st = getQuestState(partyMember, false);
		if (st == null)
		{
			return;
		}
		
		if (getRandomBoolean())
		{
			giveItems(partyMember, ORC_GRAVE_GOODS, 1);
			if (getQuestItemsCount(partyMember, ORC_GRAVE_GOODS) < 120)
			{
				playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				st.setCond(2, true);
			}
		}
	}
}