ZURSULUS L2

Clean up the Swamp of Screams

ID
629
Название
Clean up the Swamp of Screams
start_npcs_json
[31553]
npc_ids_json
[31553]
constants_json
{"PIERCE":31553,"TALON_OF_STAKATO":7250,"GOLDEN_RAM_COIN":7251}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00629_CleanUpTheSwampOfScreams/Q00629_CleanUpTheSwampOfScreams.java

NPC квеста

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

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

if (player.getLevel() >= 66)
htmltext = (player.getLevel() < 66) ? "31553-0a.htm" : "31553-0.htm";

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

giveItems(player, GOLDEN_RAM_COIN, 20);
giveItems(partyMember, TALON_OF_STAKATO, 1);

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

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

[31553-0.htm] Mercenary Captain Pierce: Do you know why this is called the Swamp of Screams? Because of the haunting screams of those caught off guard! It's our rule to finish any job we take, no matter how difficult. Are you ready to help empty the swamp of the stakatos? Quest [31553-0a.htm] Mercenary Captain Pierce: Do you know why this is called the Swamp of Screams? Because of the haunting screams of those caught off guard. It's our rule to finish any job we start, no matter how difficult. You're not up to it yet. (This quest may only be undertaken by a character of level 66 and above.) [31553-1.htm] Mercenary Captain Pierce: You'll find two types of stakatos in the Swamp of Screams, Splinter Stakatos around the edges and Needle Stakatos at the center. There are many poisonous pools that they hang around, so beware. When you kill one, pull out its claws. Collect 100 on each outing, they serve as proof of your deeds. Your life is most important, so don't get in over your head. [31553-1a.htm] Mercenary Captain Pierce: Do you want to get demoted for delinquency? Get out there and slay some stakatos! [31553-2.htm] Mercenary Captain Pierce: Thank god you came back alright. So, how's the situation? "I've brought 100 claws of Stakatos." [31553-3.htm] Mercenary Captain Pierce: Great fighting. Take a rest for the moment. Ah, take this with you. This is a reward for bringing 100 stakato claws. It is paid to mercenaries as an allowance. Take it to the Mercenary Supplier and exchange it with various things. If you need anything, go see Abercrombie anytime! "I'll go back to the battleground again." "I have more claws of Stakatos." "I want to quit." [31553-3a.htm] Mercenary Captain Pierce: Don't rest until you've brought back 100 stakato claws. [31553-4.htm] Mercenary Captain Pierce: It is impossible for us to clear the whole swamp. We don't have the strength to strike a fatal blow, we'd have to tackle the incubator and kill the queen. Our resources are too few, but we must continue until given the withdrawal order. [31553-5.htm] Mercenary Captain Pierce: Quitting, huh? The Golden Ram will always welcome skilled soldiers like you! You must have your own reasons, and I thank you for helping us. Come back whenever you want a good fight! [31553-6.htm] Mercenary Captain Pierce: I'm Pierce, captain of the Golden Ram Mercenary Force. Would you care to join us? If so, speak with mercenary Kahman..
Исходник условий и наград (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.Q00629_CleanUpTheSwampOfScreams;

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

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 Q00629_CleanUpTheSwampOfScreams extends Quest
{
	// NPC
	private static final int PIERCE = 31553;
	
	// Items
	private static final int TALON_OF_STAKATO = 7250;
	private static final int GOLDEN_RAM_COIN = 7251;
	
	// Drop chances
	private static final Map<Integer, Integer> CHANCES = new HashMap<>();
	static
	{
		CHANCES.put(21508, 500000);
		CHANCES.put(21509, 431000);
		CHANCES.put(21510, 521000);
		CHANCES.put(21511, 576000);
		CHANCES.put(21512, 746000);
		CHANCES.put(21513, 530000);
		CHANCES.put(21514, 538000);
		CHANCES.put(21515, 545000);
		CHANCES.put(21516, 553000);
		CHANCES.put(21517, 560000);
	}
	
	public Q00629_CleanUpTheSwampOfScreams()
	{
		super(629, "Clean up the Swamp of Screams");
		registerQuestItems(TALON_OF_STAKATO, GOLDEN_RAM_COIN);
		addStartNpc(PIERCE);
		addTalkId(PIERCE);
		addKillId(CHANCES.keySet());
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		String htmltext = event;
		final QuestState st = getQuestState(player, false);
		if (st == null)
		{
			return htmltext;
		}
		
		switch (event)
		{
			case "31553-1.htm":
			{
				if (player.getLevel() >= 66)
				{
					st.startQuest();
				}
				else
				{
					htmltext = "31553-0a.htm";
					st.exitQuest(true);
				}
				break;
			}
			case "31553-3.htm":
			{
				if (getQuestItemsCount(player, TALON_OF_STAKATO) >= 100)
				{
					takeItems(player, TALON_OF_STAKATO, 100);
					giveItems(player, GOLDEN_RAM_COIN, 20);
				}
				else
				{
					htmltext = "31553-3a.htm";
				}
				break;
			}
			case "31553-5.htm":
			{
				st.exitQuest(true, true);
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public String onTalk(Npc npc, Player player)
	{
		if (!hasAtLeastOneQuestItem(player, 7246, 7247))
		{
			return "31553-6.htm";
		}
		
		String htmltext = getNoQuestMsg(player);
		final QuestState st = getQuestState(player, true);
		switch (st.getState())
		{
			case State.CREATED:
			{
				htmltext = (player.getLevel() < 66) ? "31553-0a.htm" : "31553-0.htm";
				break;
			}
			case State.STARTED:
			{
				htmltext = (getQuestItemsCount(player, TALON_OF_STAKATO) >= 100) ? "31553-2.htm" : "31553-1a.htm";
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getRandomPartyMemberState(player, -1, 3, npc);
		if ((st == null) || !st.isStarted())
		{
			return;
		}
		
		if (getRandom(1000000) < CHANCES.get(npc.getId()))
		{
			final Player partyMember = st.getPlayer();
			giveItems(partyMember, TALON_OF_STAKATO, 1);
			if (getQuestItemsCount(partyMember, TALON_OF_STAKATO) < 100)
			{
				playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				st.setCond(2, true);
			}
		}
	}
}