ZURSULUS L2

Chains of Slavery

ID
265
Название
Chains of Slavery
start_npcs_json
[30357]
npc_ids_json
[]
constants_json
{"SHACKLE":1368,"SPIRITSHOT_FOR_BEGINNERS":5790,"SOULSHOT_FOR_BEGINNERS":5789}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00265_BondsOfSlavery/Q00265_BondsOfSlavery.java

NPC квеста

Записей нет.

Условия уровней: выражения из 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, SHACKLE, 1);

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

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

[30357-00.htm] Sentry Kristin: Traveler of another race, we of the dark believe that the act of requesting the assistance of another is a sign of weakness. No matter how difficult the situation may be, I will never ask any favors of you. (This quest may only be undertaken by a Dark Elven character.) [30357-01.htm] Sentry Kristin: Have you ever seen imps in the forest? Those hideous creatures were once slaves that served our race. However, they undid the spells of restraint through some unknown method and escaped aboveground. When I look at that lowly race that used to serve us parading around aboveground, I feel so... I cannot contain my hurt pride. However, recently Tetrarch Vellior said he is preparing a spell that will make the imps submissive again. Soon, those rude imps will once again call us their masters! (This quest may only be undertaken by a character of level 6 and above.) [30357-02.htm] Sentry Kristin: Have you seen imps in the forest? Those hideous creatures were once slaves that served our race. However, when we were at war with the Elves of Light, they undid the spells of restraint through some unknown method and escaped aboveground. When I look at the lowly race that used to serve us parading around aboveground, I feel so ... I cannot contain my hurt pride. However, recently Tetrarch Velior said he is preparing a spell that will make the imps submissive again. But he mentioned that he needs the shackles from around their necks in order to complete the spell. Would you go into the woods to slay those rude imps and collect their shackles? Say you will hunt the imps [30357-03.htm] Sentry Kristin: Good. Go into the forest and strike down any imp you meet, collect the shackles around their necks, and bring them to me. I will compensate you for every shackle you bring me. In the name of the goddess, may your hunt meet great success! Soon those arrogant imps will once again call us their masters! [30357-04.htm] Sentry Kristin: You have come back empty-handed. Are you tired of the hunt already? As I have said before, only those who return with the shackles from the imp's necks will receive the reward. Say you will quit Say you will continue [30357-05.htm] Sentry Kristin: Have you come back after teaching a lesson to that lowly race that has forgotten its place? The shackles you have returned with will be useful for Tetrarch Vellior's spell research. As promised, I will reward you for each shackle you have brought me. If you are not tired of the hunt yet, could you continue a little more? I don't know whether the spell research is going well ... But the Tetrarch says that he needs more shackles. Say you will quit Say you will continue [30357-06.htm] Sentry Kristin: Good. We sentries will take care of hunting the rest of the imps. Ah! About those imps ... Keep this information to yourself ... I overheard the Elders talking and ... they say that the imps are resisting the submission spell. I hear the elders are preparing an even stronger spell ... Perhaps the rumor is true that there is a magic user among the imps. [30357-07.htm] Sentry Kristin: Please carry on, then. In the name of the goddess, I pray that your hunt may yield great plenty. Soon, those arrogant imps will once again call us their masters!
Исходник условий и наград (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.Q00265_BondsOfSlavery;

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 Q00265_BondsOfSlavery extends Quest
{
	// Item
	private static final int SHACKLE = 1368;
	
	// Newbie Items
	private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
	private static final int SOULSHOT_FOR_BEGINNERS = 5789;
	
	public Q00265_BondsOfSlavery()
	{
		super(265, "Chains of Slavery");
		registerQuestItems(SHACKLE);
		addStartNpc(30357); // Kristin
		addTalkId(30357);
		addKillId(20004, 20005);
	}
	
	@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("30357-03.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30357-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.DARK_ELF)
				{
					htmltext = "30357-00.htm";
				}
				else if (player.getLevel() < 6)
				{
					htmltext = "30357-01.htm";
				}
				else
				{
					htmltext = "30357-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int shackles = getQuestItemsCount(player, SHACKLE);
				if (shackles == 0)
				{
					htmltext = "30357-04.htm";
				}
				else
				{
					htmltext = "30357-05.htm";
					
					int reward = 12 * shackles;
					if (!GeneralConfig.ALT_VILLAGES_REPEATABLE_QUEST_REWARD && (shackles >= 10))
					{
						reward += 500;
					}
					
					takeItems(player, SHACKLE, -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;
		}
		
		if (Rnd.get(10) < (npc.getId() == 20004 ? 5 : 6))
		{
			giveItems(player, SHACKLE, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}