ZURSULUS L2

Miner's Favor

ID
5
Название
Miner's Favor
start_npcs_json
[30554]
npc_ids_json
[30517,30518,30520,30526,30554]
constants_json
{"BOLTER":30554,"SHARI":30517,"GARITA":30518,"REED":30520,"BRUNON":30526,"BOLTERS_LIST":1547,"MINING_BOOTS":1548,"MINERS_PICK":1549,"BOOMBOOM_POWDER":1550,"REDSTONE_BEER":1551,"BOLTERS_SMELLY_SOCKS":1552,"NECKLACE":906}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00005_MinersFavor/Q00005_MinersFavor.java

NPC квеста

IDНазваниеСтарт квестаУровень
30517ShariНет70
30518GaritaНет70
30520ReedНет70
30526BrunonНет70
30554BolterДа70

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

htmltext = (player.getLevel() < 2) ? "30554-01.htm" : "30554-02.htm";

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

giveItems(player, BOLTERS_LIST, 1);
giveItems(player, BOLTERS_SMELLY_SOCKS, 1);
giveItems(player, MINERS_PICK, 1);
giveItems(player, NECKLACE, 1);
giveItems(player, BOOMBOOM_POWDER, 1);
giveItems(player, MINING_BOOTS, 1);
giveItems(player, REDSTONE_BEER, 1);

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

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

[30517-01.htm] Trader Shari: Bolter sent you, eh? Lessee here...oh, he ordered some Boomboom Powder a few days ago. Last time he used too much while trying to blast a new mine entrance and singed his beard! Hopefully he'll be more careful with this batch. Here you go: 1 sack of Boomboom Powder. Please don't drop it! [30517-02.htm] Trader Shari: I gave you a sack of Boomboom Powder, right? Hurry and take it to Miner Bolter. And be sure not to get it near any open flame, or getting Bolter's reward will be the least of your worries! [30518-01.htm] Trader Garita: The item that the Gray Pillar Guild ordered? Ah, here you go: a pair of strong leather Mining Boots. Let me just make a notation in my account book...there! Now take them to Miner Bolter with my thanks. [30518-02.htm] Trader Garita: I see that you're still here in the village. Isn't Miner Bolter waiting for his new Mining Boots? I think you'd best take them to him right away! [30520-01.htm] Warehouse Chief Reed: The item Bolter entrusted to me...? Ah! You mean the Dion-brewed Redstone Beer he gave me last week! Where is it...here! It goes down very smooth, I can tell you that. Just the thing to wash away the dust of the road. Just thinking about it makes me thirsty... Well, well...uh, I really must return to my account book. You'd best deliver it to Bolter before something...happens...to that cool, tasty beer... [30520-02.htm] Warehouse Chief Reed: Look here, I'm trying to organize my account book! Bolter's beer? I already gave you the Redstone Beer! If you drank it already, it's not my fault! [30526-01.htm] Blacksmith Brunon: Who are you you and what do you want? I am too busy to waste time with young idlers... Bolter's order, you say? And who is Bolter? Start talking sense or get out of my shop! Take out Bolter's Smelly Socks. [30526-02.htm] Blacksmith Brunon: Ugh! That smell! Do you have a week-dead ferret in there? Ohh... Wait! Bolter! I remember him now. He placed an order last week, didn't he? Well, well! Here is the Miner's Pick he wanted. Take it -- and get that vile-smelling thing away from me! [30526-03.htm] Blacksmith Brunon: You again! What is it this time? I already gave you the Miner's Pick that Bolter ordered. Take it to him at the Strip Mine and leave me in peace! [30554-01.htm] Miner Bolter: I'm a member of the Gray Pillar Guild, which controls this Strip Mine. Those hard-working Dwarves over there are all my guild brothers. Frankly, we prefer it out here, living among the rock and rubble of the mine instead of some stuffy cottage back in the village. The only drawback is that we still have to send someone into the village every few days to get supplies. It was Fundal's turn to go, but he broke his leg in a mining accident this morning. Do you know anyone trustworthy enough to go in his place? (This quest may only be undertaken by a character of level 2 and above.) [30554-02.htm] Miner Bolter: I'm a member of the Gray Pillar Guild, which controls this Strip Mine. Those hard-working Dwarves over there are all my guild brothers. Frankly, we prefer it out here, living among the rock and rubble of the mine instead of some stuffy cottage back in the village. The only drawback is that we still have to send someone into the village every few days to get supplies. It was Fundal's turn to go, but he broke his leg in a mining accident this morning. Will you go in his place? Say yes. [30554-03.htm] Miner Bolter: Here's a list of the supplies we need. Let's see... Ah! First, stop by the Weapons and Armor Shop and get a sack of Boom-boom Powder from Trader Shari. Then go to the General Store and get a pair of Mining Boots from Trader Garita. After that, go to the Warehouse and get us a case of Redstone Beer from Warehouse Chief Reed. Finally, pick up a Miner's Pick from Blacksmith Brunon. Brunon has become very absent-minded, so take these -- just in case you need to shock him back to reality! [30554-04.htm] Miner Bolter: Hey, you! Where's the rest of the supplies I ordered? Did you lose the list I gave you? Say yes. [30554-05.htm] Miner Bolter: Argh! May your beard become as sparse as a Gremlin's whiskers, you empty-headed wastrel! You are as forgetful as Brunon... First, stop by the Weapons and Armor Shop and get a sack of Boom-boom Powder from Trader Shari. Then go to the General Store and get a pair of Mining Boots from Trader Garita. After that, go to the Warehouse and get us a case of Redstone Beer from Warehouse Chief Reed. Finally, pick up a Miner's Pick from Blacksmith Brunon. [30554-06.htm] Miner Bolter: You've done well, my young friend. Thanks to you, we now have all the comforts of home! Take this as a token of our gratitude. It's nothing fancy, but you might find it useful one day. In the meantime, what do you say to sharing a cold Redstone Beer with me?
Исходник условий и наград (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.Q00005_MinersFavor;

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 Q00005_MinersFavor extends Quest
{
	// NPCs
	private static final int BOLTER = 30554;
	private static final int SHARI = 30517;
	private static final int GARITA = 30518;
	private static final int REED = 30520;
	private static final int BRUNON = 30526;
	
	// Items
	private static final int BOLTERS_LIST = 1547;
	private static final int MINING_BOOTS = 1548;
	private static final int MINERS_PICK = 1549;
	private static final int BOOMBOOM_POWDER = 1550;
	private static final int REDSTONE_BEER = 1551;
	private static final int BOLTERS_SMELLY_SOCKS = 1552;
	
	// Reward
	private static final int NECKLACE = 906;
	
	public Q00005_MinersFavor()
	{
		super(5, "Miner's Favor");
		registerQuestItems(BOLTERS_LIST, MINING_BOOTS, MINERS_PICK, BOOMBOOM_POWDER, REDSTONE_BEER, BOLTERS_SMELLY_SOCKS);
		addStartNpc(BOLTER);
		addTalkId(BOLTER, SHARI, GARITA, REED, BRUNON);
	}
	
	@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("30554-03.htm"))
		{
			st.startQuest();
			giveItems(player, BOLTERS_LIST, 1);
			giveItems(player, BOLTERS_SMELLY_SOCKS, 1);
		}
		else if (event.equals("30526-02.htm"))
		{
			takeItems(player, BOLTERS_SMELLY_SOCKS, 1);
			giveItems(player, MINERS_PICK, 1);
			if (hasQuestItems(player, MINING_BOOTS, BOOMBOOM_POWDER, REDSTONE_BEER))
			{
				st.setCond(2, true);
			}
			else
			{
				playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
		}
		
		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() < 2) ? "30554-01.htm" : "30554-02.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case BOLTER:
					{
						if (cond == 1)
						{
							htmltext = "30554-04.htm";
						}
						else if (cond == 2)
						{
							htmltext = "30554-06.htm";
							takeItems(player, BOLTERS_LIST, 1);
							takeItems(player, BOOMBOOM_POWDER, 1);
							takeItems(player, MINERS_PICK, 1);
							takeItems(player, MINING_BOOTS, 1);
							takeItems(player, REDSTONE_BEER, 1);
							giveItems(player, NECKLACE, 1);
							st.exitQuest(false, true);
						}
						break;
					}
					case SHARI:
					{
						if ((cond == 1) && !hasQuestItems(player, BOOMBOOM_POWDER))
						{
							htmltext = "30517-01.htm";
							giveItems(player, BOOMBOOM_POWDER, 1);
							if (hasQuestItems(player, MINING_BOOTS, MINERS_PICK, REDSTONE_BEER))
							{
								st.setCond(2, true);
							}
							else
							{
								playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
							}
						}
						else
						{
							htmltext = "30517-02.htm";
						}
						break;
					}
					case GARITA:
					{
						if ((cond == 1) && !hasQuestItems(player, MINING_BOOTS))
						{
							htmltext = "30518-01.htm";
							giveItems(player, MINING_BOOTS, 1);
							if (hasQuestItems(player, MINERS_PICK, BOOMBOOM_POWDER, REDSTONE_BEER))
							{
								st.setCond(2, true);
							}
							else
							{
								playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
							}
						}
						else
						{
							htmltext = "30518-02.htm";
						}
						break;
					}
					case REED:
					{
						if ((cond == 1) && !hasQuestItems(player, REDSTONE_BEER))
						{
							htmltext = "30520-01.htm";
							giveItems(player, REDSTONE_BEER, 1);
							if (hasQuestItems(player, MINING_BOOTS, MINERS_PICK, BOOMBOOM_POWDER))
							{
								st.setCond(2, true);
							}
							else
							{
								playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
							}
						}
						else
						{
							htmltext = "30520-02.htm";
						}
						break;
					}
					case BRUNON:
					{
						if ((cond == 1) && !hasQuestItems(player, MINERS_PICK))
						{
							htmltext = "30526-01.htm";
						}
						else
						{
							htmltext = "30526-03.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
}