ZURSULUS L2

Brigands Sweep

ID
292
Название
Brigands Sweep
start_npcs_json
[30532]
npc_ids_json
[20322,20323,20324,20327,20528,30532,30533]
constants_json
{"SPIRON":30532,"BALANKI":30533,"GOBLIN_BRIGAND":20322,"GOBLIN_BRIGAND_LEADER":20323,"GOBLIN_BRIGAND_LIEUTENANT":20324,"GOBLIN_SNOOPER":20327,"GOBLIN_LORD":20528,"GOBLIN_NECKLACE":1483,"GOBLIN_PENDANT":1484,"GOBLIN_LORD_PENDANT":1485,"SUSPICIOUS_MEMO":1486,"SUSPICIOUS_CONTRACT":1487}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00292_BrigandsSweep/Q00292_BrigandsSweep.java

NPC квеста

IDНазваниеСтарт квестаУровень
20322Goblin BrigandНет8
20323Goblin Brigand LeaderНет14
20324Goblin Brigand LieutenantНет10
20327Goblin SnooperНет5
20528Goblin LordНет13
30532SpironДа70
30533BalankiНет70

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

else if (player.getLevel() < 5)

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

giveAdena(player, reward, true);
giveAdena(player, 1500, true);
giveItems(player, GOBLIN_NECKLACE, 1);
giveItems(player, GOBLIN_PENDANT, 1);
giveItems(player, GOBLIN_LORD_PENDANT, 1);
giveItems(player, SUSPICIOUS_MEMO, 1);
giveItems(player, SUSPICIOUS_CONTRACT, 1);

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

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

[30532-00.htm] Elder Spiron: Young stranger of a foreign race, you wish to help me? I appreciate the thought, but ... I cannot entrust guild business to an outsider. (This quest may only be undertaken by a Dwarven character.) [30532-01.htm] Elder Spiron: Business is bad these days because of the goblin brigands. The goblins have become so bold that they attack freight wagons now! Just last week, a wagon belonging to our guild was attacked by the goblin brigands. I am thinking of addressing this brigand issue next month at the Guild Association Elder Council ... But I can't wait that long ... I need to do something about this ... (This quest may only be undertaken by a character of level 5 and above.) [30532-02.htm] Elder Spiron: Business is bad these days because of the goblin brigands. The goblins have become so bold that they attack freight wagons now! The our guild has been taking great losses lately, because only our wagons are being attacked. I am thinking of addressing this brigand issue next month at the Guild Association Elder Council ... But I can't wait that long ... So, I need to ask you a favor ... Would you like to work for me? If you work for our glorious Golden Wheel Guild, your friends and colleagues will respect you even more. Oh, and of course I will reward you based on your work. Nothing is free for Dwarves. What do you think? Will you give it a try? Say you want to be a talented Dwarf [30532-03.htm] Elder Spiron: Very well! Now let me give you the details Your job is to wipe out the insolent goblins that have been attacking our Guild freight wagons. Of course, I could hire guard escorts, but under these circumstances I cannot trust anyone except for my guild members. In the interest of good business, I need proof of your qualifications. All goblins wear necklaces that represent their rank, so collect them and bring them to me. I will reward you based on the number and type of necklaces that you bring. That means, if you bring necklaces that belong to high-ranking goblins, I will reward you even more, understood? Now! Leave at once! Time is money! [30532-04.htm] Elder Spiron: Why have you returned empty handed? Don't tell me that you've forgotten what your job is. Given the urgency of the situation, let me tell you one more time! Your job is to punish the insolent goblins that are interrupting our guild's trade. Defeat the goblins and bring their necklaces as proof. I will reward you based on the number and type of necklaces that you bring. Now! Leave at once! Time is money! Say you will quit Say you will continue [30532-05.htm] Elder Spiron: Welcome back! So you have taken care of the insolent goblins that interfered with our business! Now I'll finally get a good night's sleep! Of course, we need to work very hard to cover last month's loss ... Whew ... Anyway, you have done well! As promised, I will reward you based on the number and type of necklaces you have brought after killing the goblins. Thanks to your efforts, the insolent brigands have been taught a lesson, but I am still worried ... A freight wagon is departing for Shootguart tonight ... Would you do me another favor? Say you will quit Say you will continue [30532-06.htm] Elder Spiron: You want to quit? Why? It's not because you think the reward isn't enough, is it? People may say that I'm stingy, but upon my word I always treat those who work for our guild very well. You should think again, young friend! You can broaden your experience, while making money. Don't miss this opportunity! [30532-07.htm] Elder Spiron: Please carry on then! It is thanks to earnest youngsters like you that the business of our Dwarven Guilds flourishes! [30532-08.htm] Elder Spiron: Well done! As promised, I will reward you based on the number and types of necklaces you have brought after killing the goblins. What are these memos ...? This paper is used by Dwarven Guilds when writing official documents ... Also, the handwriting is Dwarvish ... This means those insolent goblins were in secret communication with one of us Dwarves ...! How can this be ...! This must be a plot by one of the other guilds to destroy our business! Look here, my friend. Please find rest of these memos! That's the only way to reveal the truth behind this secret plot! I'll give you more than enough reward, never you worry about that! Say you will quit Say you will continue [30532-09.htm] Elder Spiron: Well done! As promised, I will reward you based on the number and type of necklaces you have brought after killing the goblins. Have you found the rest of the suspicious memos? Please help me out once more, my friend! You know that you are the only one I can trust. I must find the rest of the memos and find out who is trying to destroy our Guild! Say you will quit Say you will continue [30532-10.htm] Elder Spiron: Well done! As promised, I will reward you based on the number and type of necklaces you have brought after killing the goblins. Their spirits must be significantly deflated! What is this, a contract ...? This is the suspicious memos all combined! Let me see ... Hmm ... Yes ... As I thought ...The goblins were hired by the Silver Scale Guild. I can't believe Balanki would hatch such a bold plot ... Well, I must do something! Going straight to the Guild Elder Council is not much fun ... I think meeting Balanki and coming to a mutual agreement is better! I finally have his weak point ... He must pay a high price for his actions! Thanks to you, I have obtained valuable information. Since I am a fair Dwarf, I will reward you additionally for your unexpected achievement. Many thanks for your troubles! Say you will quit Say you will continue [30533-01.htm] Elder Balanki: I heard you work for the Golden Wheel Guild ... Is this true? Oh ... I see. Young friend, let me give you a piece of advice. Spiron is only taking advantage of you. That mean old man is only interested in generating profits for his guild! Even if you should get hurt or run into trouble while carrying out guild business, don't expect Spiron to help you. He'll only argue that that wasn't in the contract. [30533-02.htm] Elder Balanki: Aren't you Spiron's messenger? What business do you have with me? Hmm? What is this contract? Oh no. Those goblins ...! I told them to tear this contract to pieces and throw it away ... This puts me in quite a difficult situation ... However ... Why did you bring this contract to me? Oh ... Now I understand ... If I give you the proper price, you will forget about this contract, right? You are as cunning as that old man ... Ok. Is this enough? Not enough? Now, this should be enough. You are a greedy one ... Give me the contract now! I will throw this into the brazier in the forge tonight ...!
Исходник условий и наград (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.Q00292_BrigandsSweep;

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;

public class Q00292_BrigandsSweep extends Quest
{
	// NPCs
	private static final int SPIRON = 30532;
	private static final int BALANKI = 30533;
	
	// Monsters
	private static final int GOBLIN_BRIGAND = 20322;
	private static final int GOBLIN_BRIGAND_LEADER = 20323;
	private static final int GOBLIN_BRIGAND_LIEUTENANT = 20324;
	private static final int GOBLIN_SNOOPER = 20327;
	private static final int GOBLIN_LORD = 20528;
	
	// Items
	private static final int GOBLIN_NECKLACE = 1483;
	private static final int GOBLIN_PENDANT = 1484;
	private static final int GOBLIN_LORD_PENDANT = 1485;
	private static final int SUSPICIOUS_MEMO = 1486;
	private static final int SUSPICIOUS_CONTRACT = 1487;
	
	public Q00292_BrigandsSweep()
	{
		super(292, "Brigands Sweep");
		registerQuestItems(GOBLIN_NECKLACE, GOBLIN_PENDANT, GOBLIN_LORD_PENDANT, SUSPICIOUS_MEMO, SUSPICIOUS_CONTRACT);
		addStartNpc(SPIRON);
		addTalkId(SPIRON, BALANKI);
		addKillId(GOBLIN_BRIGAND, GOBLIN_BRIGAND_LEADER, GOBLIN_BRIGAND_LIEUTENANT, GOBLIN_SNOOPER, GOBLIN_LORD);
	}
	
	@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("30532-03.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30532-06.htm"))
		{
			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:
			{
				if (player.getRace() != Race.DWARF)
				{
					htmltext = "30532-00.htm";
				}
				else if (player.getLevel() < 5)
				{
					htmltext = "30532-01.htm";
				}
				else
				{
					htmltext = "30532-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				switch (npc.getId())
				{
					case SPIRON:
					{
						final int goblinNecklaces = getQuestItemsCount(player, GOBLIN_NECKLACE);
						final int goblinPendants = getQuestItemsCount(player, GOBLIN_PENDANT);
						final int goblinLordPendants = getQuestItemsCount(player, GOBLIN_LORD_PENDANT);
						final int suspiciousMemos = getQuestItemsCount(player, SUSPICIOUS_MEMO);
						final int countAll = goblinNecklaces + goblinPendants + goblinLordPendants;
						final boolean hasContract = hasQuestItems(player, SUSPICIOUS_CONTRACT);
						if (countAll == 0)
						{
							htmltext = "30532-04.htm";
						}
						else
						{
							if (hasContract)
							{
								htmltext = "30532-10.htm";
							}
							else if (suspiciousMemos > 0)
							{
								if (suspiciousMemos > 1)
								{
									htmltext = "30532-09.htm";
								}
								else
								{
									htmltext = "30532-08.htm";
								}
							}
							else
							{
								htmltext = "30532-05.htm";
							}
							
							takeItems(player, GOBLIN_NECKLACE, -1);
							takeItems(player, GOBLIN_PENDANT, -1);
							takeItems(player, GOBLIN_LORD_PENDANT, -1);
							if (hasContract)
							{
								st.setCond(1);
								takeItems(player, SUSPICIOUS_CONTRACT, -1);
							}
							
							int reward = (12 * goblinNecklaces) + (36 * goblinPendants) + (33 * goblinLordPendants) + ((hasContract) ? 1120 : 0);
							if (!GeneralConfig.ALT_VILLAGES_REPEATABLE_QUEST_REWARD && (countAll >= 10))
							{
								reward += 1000;
							}
							
							giveAdena(player, reward, true);
						}
						break;
					}
					case BALANKI:
					{
						if (!hasQuestItems(player, SUSPICIOUS_CONTRACT))
						{
							htmltext = "30533-01.htm";
						}
						else
						{
							htmltext = "30533-02.htm";
							st.setCond(1);
							takeItems(player, SUSPICIOUS_CONTRACT, -1);
							giveAdena(player, 1500, true);
						}
						break;
					}
				}
				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;
		}
		
		final int chance = getRandom(10);
		if (chance > 5)
		{
			switch (npc.getId())
			{
				case GOBLIN_BRIGAND:
				case GOBLIN_SNOOPER:
				case GOBLIN_BRIGAND_LIEUTENANT:
				{
					giveItems(player, GOBLIN_NECKLACE, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					break;
				}
				case GOBLIN_BRIGAND_LEADER:
				{
					giveItems(player, GOBLIN_PENDANT, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					break;
				}
				case GOBLIN_LORD:
				{
					giveItems(player, GOBLIN_LORD_PENDANT, 1);
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					break;
				}
			}
		}
		else if ((chance > 4) && st.isCond(1))
		{
			giveItems(player, SUSPICIOUS_MEMO, 1);
			if (getQuestItemsCount(player, SUSPICIOUS_MEMO) < 3)
			{
				playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				takeItems(player, SUSPICIOUS_MEMO, -1);
				giveItems(player, SUSPICIOUS_CONTRACT, 1);
				st.setCond(2, true);
			}
		}
	}
}