ZURSULUS L2

Curiosity of a Dwarf

ID
329
Название
Curiosity of a Dwarf
start_npcs_json
[30437]
npc_ids_json
[]
constants_json
{"GOLEM_HEARTSTONE":1346,"BROKEN_HEARTSTONE":1365}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00329_CuriosityOfADwarf/Q00329_CuriosityOfADwarf.java

NPC квеста

Записей нет.

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

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

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

giveAdena(player, (broken * 50) + (golem * 1000) + (((golem + broken) > 10) ? 1183 : 0), true);
giveItems(player, GOLEM_HEARTSTONE, 1);
giveItems(player, BROKEN_HEARTSTONE, 1);

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

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

[30437-01.htm] Trader Rolento: As Elves are infatuated with poetry and songs and Orcs rave over war, we Dwarves love to make things with our very own hands. Ever since I was young, I immensely enjoyed fooling around with toys with springs or pocket watches. My dream is to make a golem with my own hands some day. However, I am not talking about the animate, monster golems that you can see frequently. The golems made by the dwarves are automatic dolls that move according to minute mechanical devices. It is totally different from stone golems or granite golems, which are magically blessed with life. However, I always wondered what the energy source of a magically created golem would be. No matter how carefully I looked at it, I could not find the part that generated power ... . There are many golems in the wastelands here. They say it is because the devil Beleth and the magicians of the Ivory Tower used them as weapons of war in this land. If that is true, then that means that more than a thousand years have passed since the golems were abandoned in this land. Don't you find it surprising that they are still moving? What do you think? Aren't you getting curious, too? If you have time later, let's research it together. (This quest may only be undertaken by a character of level 33 and above.) [30437-02.htm] Trader Rolento: As Elves are infatuated with poetry and songs and Orcs rave over war, we Dwarves love to make things with our very own hands. Ever since I was young, I immensely enjoyed fooling around with toys with springs or pocket watches. My dream is to make a golem with my own hands someday. However, I am not talking about the animate, monster golems that you can see frequently. The golems made by the dwarves are automatic dolls that move according to minute mechanical devices. It is totally different from stone golems or granite golems, which were magically blessed with life. However, I always wondered what the energy source of a magically created golem would be. No matter how carefully I looked at it, I could not find the part that generated power ... There are many golems in the Wastelands here. They say it is because the devil Beleth and the magicians of the Ivory Tower used them as weapons of war in this land. If that is true, then that means that more than a thousand years have passed since the golems were abandoned in this land. What do you think? Aren't you getting curious, too? If you grant my request, it will be a great help to my studies ... will you help me? Say you will help [30437-03.htm] Trader Rolento: Good! We understand each other well. Actually, I recently had a chance to see a destroyed granite golem, and within the remains I saw a piece of stone of a different hue. I asked Sarien, who has profound knowledge of magic, and he said the stone was a heartstone. I found out that all the golems made by the magicians had a heartstone in the center of their bodies. What was it that he said? Something about putting a symbolic heart that resembles the living body into a still stone figure, and then gathering the magic forces before beginning the spells ... . Of course I didn't understand a word of what he was talking about, but anyway, it seems almost certain that the heartstone is the power source of the golem. So, I would like you to go into the Wastelands and get me the heartstone of a golem. There are many granite golems in the Wastelands. There are also granite golems that are nicknamed punchers, because they Brandish their fists about fiercely. Most heartstones shatter or crack when the golem is killed, but very rarely you can obtain whole, perfect heartstones. I would like you to bring me all the heartstones you can find -- whether they be broken or whole. I will compensate you for as many as you bring back. Of course, I will be more generous for perfect heartstones. [30437-04.htm] Trader Rolento: Oh dear, your hands are still empty. As I already told you, I need the heartstones of granite golems and punchers. Please go to the Wastelands and find heartstones for me. Say you will quit Say you will continue [30437-05.htm] Trader Rolento: Oh, you have found some! I will reveal whether or not the power to move rocks like living humans for hundreds of years lies within this small stone. I must begin my research immediately -- starting tonight. Although it is difficult because I do not have any proper tools or measuring devices, because this is not a workshop, I can measure the size with a ruler and the weight with a scale, and pound it with my hammer to fathom its solidity and density. Hmm ... so this goes like this ... and ... Oh dear, I've been wrapped up too much in my own thoughts, forgive me! As we promised, I will reward you by the number of heartstones you have brought. But I wish to have some more heartstones to send to my guild brothers in Giran. What do you say? Could I ask you another favor? Say you will quit Say you will continue [30437-06.htm] Trader Rolento: I'm sorry that you are quitting, it is too bad. I'll have to ask someone else. Thanks anyway. May the divine blessing of Maphr, our God of the Earth, be with you! [30437-07.htm] Trader Rolento: I want to thank you. Thank you so much for helping me satisfy my curiosity. If my studies produce results, then we Dwarves may be able to develop a new power tool that moves mechanical devices. It is all thanks to you. That granted, please help me a little more.
Исходник условий и наград (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.Q00329_CuriosityOfADwarf;

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 Q00329_CuriosityOfADwarf extends Quest
{
	// Items
	private static final int GOLEM_HEARTSTONE = 1346;
	private static final int BROKEN_HEARTSTONE = 1365;
	
	public Q00329_CuriosityOfADwarf()
	{
		super(329, "Curiosity of a Dwarf");
		addStartNpc(30437); // Rolento
		addTalkId(30437);
		addKillId(20083, 20085); // Granite golem, Puncher
	}
	
	@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("30437-03.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30437-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:
			{
				htmltext = (player.getLevel() < 33) ? "30437-01.htm" : "30437-02.htm";
				break;
			}
			case State.STARTED:
			{
				final int golem = getQuestItemsCount(player, GOLEM_HEARTSTONE);
				final int broken = getQuestItemsCount(player, BROKEN_HEARTSTONE);
				if ((golem + broken) == 0)
				{
					htmltext = "30437-04.htm";
				}
				else
				{
					htmltext = "30437-05.htm";
					takeItems(player, GOLEM_HEARTSTONE, -1);
					takeItems(player, BROKEN_HEARTSTONE, -1);
					giveAdena(player, (broken * 50) + (golem * 1000) + (((golem + broken) > 10) ? 1183 : 0), true);
				}
				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(100);
		if (chance < 2)
		{
			giveItems(player, GOLEM_HEARTSTONE, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
		else if (chance < ((npc.getId() == 20083) ? 44 : 50))
		{
			giveItems(player, BROKEN_HEARTSTONE, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}