ZURSULUS L2

Plunder Their Supplies

ID
360
Название
Plunder Their Supplies
start_npcs_json
[30873]
npc_ids_json
[]
constants_json
{"SUPPLY_ITEM":5872,"SUSPICIOUS_DOCUMENT":5871,"RECIPE_OF_SUPPLY":5870}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00360_PlunderTheirSupplies/Q00360_PlunderTheirSupplies.java

NPC квеста

Записей нет.

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

htmltext = (player.getLevel() < 52) ? "30873-0a.htm" : "30873-0.htm";

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

giveAdena(player, reward, true);
giveItems(killer, SUPPLY_ITEM, 1);
giveItems(killer, SUSPICIOUS_DOCUMENT, 1);
giveItems(killer, RECIPE_OF_SUPPLY, 1);

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

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

[30873-0.htm] Guard Coleman: Have you witnessed the current condition of the Cemetery? The final resting place of kings, aristocrats and heroes has fallen into ruin and been overtaken by hideous monsters. Our neglect tempts our ancestors' wrath. At Captain Kurtiz's direction, we have begun to try to drive out the monsters, but we have not been very effective so far. "Is there any other way to solve this problem?" [30873-0a.htm] Guard Coleman: Have you been to the Cemetery? It's a dangerous place, where many monsters roam. The neglect of the kingdom has allowed it to fall into ruins. If we incur our ancestors' wrath, we'll have no one to blame but ourselves. You must use extreme care when you go there. I seriously doubt that you will survive. (This quest may only be undertaken by a character of level 52 and above.) [30873-1.htm] Guard Coleman: Captain Kurtiz says that in order to wipe them out completely, the Taik Orc seeker and the Taik Orc supply leader must be stopped from giving supplies to the monsters. But alas, our guards are having a hard time dealing with their forces. The captain has ordered me to find someone who can kill them for us. You seem capable of doing it. Are you willing to help us? We will pay you a generous reward. "I will do my best." [30873-2.htm] Guard Coleman: I wish you luck. You will be compensated based on the amount of supplies you bring back from the orcs. If you happen to find an important document, please bring it to me as well. In our current predicament, any amount of enemy intelligence would be very helpful. [30873-3.htm] Guard Coleman: Why are you still here? You must subjugate Taik Orc seekers and Taik Orc supply leaders. You can't go back on your word! You don't intend to do that, do you? "I'll help you, but I expect to be paid very well." "I want to quit". [30873-4.htm] Guard Coleman: Thank you! I'm sure you will continue to have great results. Bring me any supplies and documents you take from the Taik Orcs and I will give you a generous reward... Hurry! [30873-5.htm] Guard Coleman: Are you finished already? You must be exhausted! Thank you! Here is your reward. This should be more than enough compensation for your work... Do you wish to continue helping me with this mission? "I'll help you, but I must be paid well." "Sorry, I can't help you anymore." [30873-6.htm] Guard Coleman: Ah, yes... I understand... We all have our own path to follow... I shouldn't try to stop you. May a divine blessing shine upon your path from this day forward... But with your abilities, you probably don't even need a blessing. Someday I'm sure your name will be known throughout the kingdom of Aden.
Исходник условий и наград (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.Q00360_PlunderTheirSupplies;

import java.util.HashMap;
import java.util.Map;

import org.l2jmobius.gameserver.config.PlayerConfig;
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;
import org.l2jmobius.gameserver.util.LocationUtil;

public class Q00360_PlunderTheirSupplies extends Quest
{
	// Items
	private static final int SUPPLY_ITEM = 5872;
	private static final int SUSPICIOUS_DOCUMENT = 5871;
	private static final int RECIPE_OF_SUPPLY = 5870;
	
	// Drops
	private static final Map<Integer, Integer> MONSTER_DROP_CHANCES = new HashMap<>();
	static
	{
		MONSTER_DROP_CHANCES.put(20666, 50); // Taik Orc Seeker
		MONSTER_DROP_CHANCES.put(20669, 75); // Taik Orc Supply Leader
	}
	
	public Q00360_PlunderTheirSupplies()
	{
		super(360, "Plunder Their Supplies");
		registerQuestItems(RECIPE_OF_SUPPLY, SUPPLY_ITEM, SUSPICIOUS_DOCUMENT);
		addStartNpc(30873); // Coleman
		addTalkId(30873);
		addKillId(MONSTER_DROP_CHANCES.keySet());
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		final String htmltext = event;
		final QuestState st = player.getQuestState(getName());
		if (st == null)
		{
			return htmltext;
		}
		
		if (event.equals("30873-2.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30873-6.htm"))
		{
			takeItems(player, SUPPLY_ITEM, -1);
			takeItems(player, SUSPICIOUS_DOCUMENT, -1);
			takeItems(player, RECIPE_OF_SUPPLY, -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() < 52) ? "30873-0a.htm" : "30873-0.htm";
				break;
			}
			case State.STARTED:
			{
				final int supplyItems = getQuestItemsCount(player, SUPPLY_ITEM);
				if (supplyItems == 0)
				{
					htmltext = "30873-3.htm";
				}
				else
				{
					final int reward = 6000 + (supplyItems * 100) + (getQuestItemsCount(player, RECIPE_OF_SUPPLY) * 6000);
					htmltext = "30873-5.htm";
					takeItems(player, SUPPLY_ITEM, -1);
					takeItems(player, RECIPE_OF_SUPPLY, -1);
					giveAdena(player, reward, true);
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player killer, boolean isPet)
	{
		final QuestState qs = getQuestState(killer, false);
		if ((qs == null) || !LocationUtil.checkIfInRange(PlayerConfig.ALT_PARTY_RANGE, npc, killer, false))
		{
			return;
		}
		
		if (getRandom(100) < MONSTER_DROP_CHANCES.get(npc.getId()))
		{
			giveItems(killer, SUPPLY_ITEM, 1);
			playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
		
		if (getRandom(100) < 10)
		{
			if (getQuestItemsCount(killer, SUSPICIOUS_DOCUMENT) < 4)
			{
				giveItems(killer, SUSPICIOUS_DOCUMENT, 1);
			}
			else
			{
				giveItems(killer, RECIPE_OF_SUPPLY, 1);
				takeItems(killer, SUSPICIOUS_DOCUMENT, -1);
			}
			
			playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}