ZURSULUS L2

Go Get the Calculator

ID
347
Название
Go Get the Calculator
start_npcs_json
[30526]
npc_ids_json
[30526,30527,30532,30533]
constants_json
{"BRUNON":30526,"SILVERA":30527,"SPIRON":30532,"BALANKI":30533,"GEMSTONE_BEAST_CRYSTAL":4286,"CALCULATOR_QUEST":4285,"CALCULATOR_REAL":4393}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00347_GoGetTheCalculator/Q00347_GoGetTheCalculator.java

NPC квеста

IDНазваниеСтарт квестаУровень
30526BrunonДа70
30527SilveraНет70
30532SpironНет70
30533BalankiНет70

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

htmltext = (player.getLevel() < 12) ? "30526-00.htm" : "30526-01.htm";

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

giveItems(player, CALCULATOR_REAL, 1);
giveAdena(player, 1000, true);
giveItems(player, CALCULATOR_QUEST, 1);
giveItems(player, GEMSTONE_BEAST_CRYSTAL, 1);

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

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

[30526-00.htm] Blacksmith Brunon: When you have developed more skills I would like to talk to you about a project I've been working on. (This quest may only be undertaken by a character of level 12 and above.) [30526-01.htm] Blacksmith Brunon: What goes through your mind when you gaze upon the silvery moon? Have you ever dreamed of visiting that cold and desolate place? Just think of the strange and wonderful minerals there! Imagine the discoveries you could make! Many have tried to reach the moon but so far all have failed. There was the catapult, a miserable failure. Someone got the idea to have a golem hurl a vehicle there, also a tragedy. Many noble Dwarves have given their lives in this endeavor. So you wish to attempt this feat? To go where no Dwarf has gone before? Good! I have a plan, my 18th actually, that I am sure will get you safely there and back. We have thought of everything that could go possibly go wrong! Bwa ha ha ha! "I don't want to go to the moon." [30526-02.htm] Blacksmith Brunon: Oh, well, I will have to look elsewhere for a volunteer for the moon mission. I do have another task you might be interested in. Any project this large requires a lot of support on the ground. I realize this is rather sudden, but would you mind taking a test to see if you qualify for the position I am considering you for? What is the product of the following equation: (123 + 45.6)78.9? 3720.84 13302.54 "I don't know." [30526-03.htm] Blacksmith Brunon: Ha! Too much for you, eh? Don't worry, you passed the test... Why do you look so surprised? Your willingness to admit that your calculation skills are weak tells me that you and I share a common bond. I have tried and tried to reach to moon, and every time, total failure! Whoa! Who can say a genius like myself can fail! There was no failure! How can you hope to accomplish anything if you are constantly living in fear of failure? How dare you call me a failure! "Brunon, you're the one who said it." [30526-03a.htm] Blacksmith Brunon: I bet you plan to publish a new, world-shattering theory... Turn the mathematical world on its head... Am I right?... I am having serious doubts about working with you. [30526-03b.htm] Blacksmith Brunon: Ah, you are smarter than you look! Was that too easy? Come to think of it, mathematical skills aren't at all important for the position I was thinking about. You don't seem to understand my way of thinking very well, and I hesitate to trust you with the expensive equipment. If we are to work together we must know each other's minds completely. [30526-04.htm] Blacksmith Brunon: Oh, yes, so I did! I believe the reason my previous missions to the moon have not been successful has been due to calculation errors. Any miscalculation in atmospheric resistance, engine burn, or any thousands of other factors inevitably leads to disaster. I need to get the latest model Calculator which has just been introduced in the village. I must get my hands on it! I am certain that this new technology will make my "18th Plan to Conquer the Moon" an unqualified success! Would you please get this Calculator for me? "I will bring you the Calculator." [30526-05.htm] Blacksmith Brunon: Thank you! Please go and get it immediately. I have heard that the new model Calculator was brought in by one of the Trader Guilds. That would be good place to start, wouldn't it? [30526-06.htm] Blacksmith Brunon: Ah, you're back! Did you bring the new model Calculator? Not yet? Why not? As I said, you should check with the Trader Guilds. I am sure they brought it into the village. If you keep looking you will find it. Surely you know by now that the guilds you should check with are the Silver Scale Guild and the Golden Wheel Guild... Get going! [30526-07.htm] Blacksmith Brunon: Ah, the new model Calculator! Good job! You shall be rewarded for this! Give me a moment while I check it out! Is this how it works? . . Aaargh! Do you actually think that this is a new model? Well, sorry to tell you this, but this Calculator can only handle simple equations. It's of no use to me at all. I suppose, however, you still should be paid for your efforts. How does 1,000 adena sound? Or, if you prefer, you can have the Calculator. It's your choice! Take the Calculator. Take the 1000 adena. [30526-08.htm] Blacksmith Brunon: Good choice! I hope you get some use out of it. By the way, if you change your mind, come back to see me! I am still looking for a volunteer for my 18th mission to the moon! [30526-09.htm] Blacksmith Brunon: Ah, yes. It is refreshing to see someone who knows the value of money. By the way, if you're ever interested in going to the moon, come back to see me! [30527-00.htm] Blacksmith Silvera: Is that so? Well, keep searching. I know you will find it! [30527-01.htm] Blacksmith Silvera: Ha! The Calculator? Why are you bothering me for it? Certainly you can find another Dwarf to get one from! Okay. You win. Actually, I'm tired of carrying it around. I hoped to exchange it for something more useful or pretty, but in this village, nobody has anything I find interesting... Sigh! Bring me something pretty and I'll give you the Calculator! I want some new crystals, and I know just where you can find some! Not far from here the Gemstone Beasts hoard their crystals. They shine so brightly it shouldn't be hard to find them. Oh, I can't wait! Bring me 10 crystals from the Gemstone Beasts and I'll give you the Calculator. [30527-02.htm] Blacksmith Silvera: Have you brought me the 10 crystals from Gemstone Beasts? If you want the Calculator you must bring me the crystals immediately! The beasts can be found in the Abandoned Mine. Please hurry! [30527-03.htm] Blacksmith Silvera: Oh, they are more beautiful than I imagined! You have made me very happy! Here is your calculator. [30527-04.htm] Blacksmith Silvera: I already gave you the Calculator! Don't you remember? [30532-01.htm] Golden Wheel's Spiron: What use would you have for such advanced technology? Oh, I get it! Its for Brunon! Mark my words, that fool is in over his head! You should be very careful in your dealings with him... Well, my friend, we don't have the Calculator you seek, but I do know where it can be found... I will tell you where it is if you will honestly answer this question: Which is the best Dwarven trade guild? Golden Wheel Silver Scale I don't know. You do know the name of our guild, don't you? Not that I mean for you to lie to say that we are the best, but... [30532-02.htm] Golden Wheel's Spiron: Ah, yes, your honest admiration for our clan will not go unrewarded... Now, Brunon is the one who seeks the Calculator, correct? To him I would say this: "The enemy is within your own house." Said another way: "It is closer than you think." I suppose that makes more sense! That should be enough information for you and Brunon. If you still can't find it, ask someone else... [30532-03.htm] Golden Wheel's Spiron: Are you serious? The Silver Scale? Ha! What makes you think those buffoons are better than the mightly Golden Wheel? Who told you that? Its bull! [30532-04.htm] Golden Wheel's Spiron: What do mean you don't know! Any idiot should be able to answer this question without thinking! Among the top six dwarven guilds, only two are trade guilds. I, Spiron, am elder of the mighty Golden Wheel Guild and Balanki is the elder of the Silver Scale Guild. Now say it! Who is the best? [30532-05.htm] Golden Wheel's Spiron: Ah yes, the Calculator... Tell Brunon this: "The enemy is within your own house." Or, "It is closer than you think." If you don't understand this, I give up. Go and ask someone else... [30533-01.htm] Silver Scale's Balanki: A new type of Calculator, eh? Well, unfortunately, our guild does not make these, but I could tell you who does... Of course, as you know, nothing comes for free. However, this shouldn't be much, just a small token of good faith... I'll give you the information for only 100 adena. It's not like I need the money... As you know, I am an elder, and such sums are nothing to me. All I require is a demonstration of your gratitude. Give him 100 adena. [30533-02.htm] Silver Scale's Balanki: Oh, how kind of you... But I really didn't need the money... . . Oh wait... I almost forgot. You wanted some information, didn't you? Well, the new model Calculator is in the possession of a female dwarf in this village. That's all I can tell you... Good luck! [30533-03.htm] Silver Scale's Balanki: Wow, you're poor! You should go earn some money and come back! [30533-04.htm] Silver Scale's Balanki: The new model Calculator is in the possession of a female dwarf in this village. That's all I know. Could you please give me some more money? No, I don't have more information but I do need more money, and a lot more than 100 adena!
Исходник условий и наград (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.Q00347_GoGetTheCalculator;

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 Q00347_GoGetTheCalculator extends Quest
{
	// NPCs
	private static final int BRUNON = 30526;
	private static final int SILVERA = 30527;
	private static final int SPIRON = 30532;
	private static final int BALANKI = 30533;
	
	// Items
	private static final int GEMSTONE_BEAST_CRYSTAL = 4286;
	private static final int CALCULATOR_QUEST = 4285;
	private static final int CALCULATOR_REAL = 4393;
	
	public Q00347_GoGetTheCalculator()
	{
		super(347, "Go Get the Calculator");
		registerQuestItems(GEMSTONE_BEAST_CRYSTAL, CALCULATOR_QUEST);
		addStartNpc(BRUNON);
		addTalkId(BRUNON, SILVERA, SPIRON, BALANKI);
		addKillId(20540);
	}
	
	@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 "30526-05.htm":
			{
				st.startQuest();
				break;
			}
			case "30533-03.htm":
			{
				if (getQuestItemsCount(player, 57) >= 100)
				{
					htmltext = "30533-02.htm";
					takeItems(player, 57, 100);
					
					if (st.isCond(3))
					{
						st.setCond(4, true);
					}
					else
					{
						st.setCond(2, true);
					}
				}
				break;
			}
			case "30532-02.htm":
			{
				if (st.isCond(2))
				{
					st.setCond(4, true);
				}
				else
				{
					st.setCond(3, true);
				}
				break;
			}
			case "30526-08.htm":
			{
				takeItems(player, CALCULATOR_QUEST, -1);
				giveItems(player, CALCULATOR_REAL, 1);
				st.exitQuest(true, true);
				break;
			}
			case "30526-09.htm":
			{
				takeItems(player, CALCULATOR_QUEST, -1);
				giveAdena(player, 1000, true);
				st.exitQuest(true, true);
				break;
			}
		}
		
		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() < 12) ? "30526-00.htm" : "30526-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case BRUNON:
					{
						htmltext = (!hasQuestItems(player, CALCULATOR_QUEST)) ? "30526-06.htm" : "30526-07.htm";
						break;
					}
					case SPIRON:
					{
						htmltext = (cond < 4) ? "30532-01.htm" : "30532-05.htm";
						break;
					}
					case BALANKI:
					{
						htmltext = (cond < 4) ? "30533-01.htm" : "30533-04.htm";
						break;
					}
					case SILVERA:
					{
						if (cond < 4)
						{
							htmltext = "30527-00.htm";
						}
						else if (cond == 4)
						{
							htmltext = "30527-01.htm";
							st.setCond(5, true);
						}
						else if (cond == 5)
						{
							if (getQuestItemsCount(player, GEMSTONE_BEAST_CRYSTAL) < 10)
							{
								htmltext = "30527-02.htm";
							}
							else
							{
								htmltext = "30527-03.htm";
								st.setCond(6, true);
								takeItems(player, GEMSTONE_BEAST_CRYSTAL, -1);
								giveItems(player, CALCULATOR_QUEST, 1);
							}
						}
						else if (cond == 6)
						{
							htmltext = "30527-04.htm";
						}
						break;
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getQuestState(player, false);
		if ((st == null) || !st.isCond(5))
		{
			return;
		}
		
		if (getRandomBoolean() && (getQuestItemsCount(player, GEMSTONE_BEAST_CRYSTAL) < 10))
		{
			giveItems(player, GEMSTONE_BEAST_CRYSTAL, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}