ZURSULUS L2

Shards of Golem

ID
152
Название
Shards of Golem
start_npcs_json
[30035]
npc_ids_json
[20016,30035,30283]
constants_json
{"HARRIS":30035,"ALTRAN":30283,"STONE_GOLEM":20016,"HARRIS_RECEIPT_1":1008,"HARRIS_RECEIPT_2":1009,"GOLEM_SHARD":1010,"TOOL_BOX":1011,"WOODEN_BREASTPLATE":23}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00152_ShardsOfGolem/Q00152_ShardsOfGolem.java

NPC квеста

IDНазваниеСтарт квестаУровень
20016Stone GolemНет13
30035HarrysДа70
30283AltranНет70

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

htmltext = (player.getLevel() < 10) ? "30035-01a.htm" : "30035-01.htm";

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

giveItems(player, HARRIS_RECEIPT_1, 1);
giveItems(player, HARRIS_RECEIPT_2, 1);
giveItems(player, WOODEN_BREASTPLATE, 1);
addExpAndSp(player, 5000, 0);
giveItems(player, TOOL_BOX, 1);
giveItems(killer, GOLEM_SHARD, 1);

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

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

[30035-01.htm] Magister Harrys: Recently, the severe storms damaged the roof of the temple in several places. We are in the middle of repairing the roof right now, but it is harder than we thought. Plus, all our tools are old and dull, making this an even slower task. The high priest has personally asked us to hurry with the repairs, and I am worried that progress is too slow. A few days ago I went to the village Blacksmith and asked Altran to create new tools for us. I cannot leave the temple right now, as I have to prepare for the services, but could you go to the village and bring the tools back to me? Say you will do the favor [30035-01a.htm] Magister Harrys: Recently the severe storms damaged the roof of the temple in several places. We will be starting repairs soon, and I hope you can help us at that time. (This quest may only be undertaken by a character of level 10 and above.) [30035-02.htm] Magister Harrys: Thank you. Take this receipt. Go to the village Blacksmith and show Altran this receipt, and come back here with the tools. We are planning to do repairs this afternoon, so I hope I can receive them before then. [30035-03.htm] Magister Harrys: Go and fetch the tools that I have ordered from Blacksmith Altran. I'd like to receive them before this afternoon, as we plan on making repairs then. Please hurry. [30035-04.htm] Magister Harrys: So these are the tools that have been forged by Blacksmith Altran. I'm sure they are of the highest quality. Thank you for bringing them here. I heard that you obtained the materials to make the tools for Blacksmith Altran? I will give you a reward for your help. Please do not decline, and accept my gift. May the blessings of Einhasad be with you. [30283-01.htm] Blacksmith Altran: So, Sorcerer Harrys sent you. He asked me to make strong tools that would not rust. Even if I could make saws and nails from Damascus metal, hammers must be made from a lighter, harder material. I'm thinking of taking this opportunity to make a new tool that I've only been thinking of. To make that, I need a slightly exotic material. Could you help me in finding it? Say you will help [30283-02.htm] Blacksmith Altran: This time, when I'm making the hammer, I plan to use stone instead of metals like Steel or Damascus. Stone hammers, you ask? No, we haven't gone back to primitive times. The stone I am talking about is not the everyday rock you can find anywhere, but the shards that fall from a golem's body. Rock golems live in the woods in the northern region of the island, where people seldom stray. They say that golems are magic creatures that were created by Elves that lived on this island long ago. I don't know about magic, but the shards of the golems can be used as a strong, lightweight material. Gather five of these shards and bring them to me. [30283-03.htm] Blacksmith Altran: When you have gathered five golem shards, bring them to me. Then I can make the hammer needed for Sorcerer Harrys' repair work. According to the guards, they say that there are many stone golems on the northern shores of the island. [30283-04.htm] Blacksmith Altran: So this is the golem shard ... Similar to diamond, but more dense and thus very hard. It will take some time to polish and carve this shard, so would you wait a moment? All I have to do is polish this golem shard a bit with a mithril hammer and fix it firmly to this wooden handle that I've already made. Wonderful! Finished! It may look a bit coarse, but no other tool can compare to this. Try it! Quite heavy, eh? Here, this is a toolbox that contains the tools that Sorcerer Harrys has asked for. It includes the hammer that I just made from the golem shard, as well as nails, a saw, and various other equipment. Go and deliver them to him. [30283-05.htm] Blacksmith Altran: What are you doing, lazing around like that? Go to the temple immediately and deliver the toolbox that I have given you to Sorcerer Harrys.
Исходник условий и наград (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.Q00152_ShardsOfGolem;

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 Q00152_ShardsOfGolem extends Quest
{
	// NPCs
	private static final int HARRIS = 30035;
	private static final int ALTRAN = 30283;
	
	// Monster
	private static final int STONE_GOLEM = 20016;
	
	// Items
	private static final int HARRIS_RECEIPT_1 = 1008;
	private static final int HARRIS_RECEIPT_2 = 1009;
	private static final int GOLEM_SHARD = 1010;
	private static final int TOOL_BOX = 1011;
	
	// Reward
	private static final int WOODEN_BREASTPLATE = 23;
	
	public Q00152_ShardsOfGolem()
	{
		super(152, "Shards of Golem");
		registerQuestItems(HARRIS_RECEIPT_1, HARRIS_RECEIPT_2, GOLEM_SHARD, TOOL_BOX);
		addStartNpc(HARRIS);
		addTalkId(HARRIS, ALTRAN);
		addKillId(STONE_GOLEM);
	}
	
	@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("30035-02.htm"))
		{
			st.startQuest();
			giveItems(player, HARRIS_RECEIPT_1, 1);
		}
		else if (event.equals("30283-02.htm"))
		{
			st.setCond(2, true);
			takeItems(player, HARRIS_RECEIPT_1, 1);
			giveItems(player, HARRIS_RECEIPT_2, 1);
		}
		
		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() < 10) ? "30035-01a.htm" : "30035-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case HARRIS:
					{
						if (cond < 4)
						{
							htmltext = "30035-03.htm";
						}
						else if (cond == 4)
						{
							htmltext = "30035-04.htm";
							takeItems(player, HARRIS_RECEIPT_2, 1);
							takeItems(player, TOOL_BOX, 1);
							giveItems(player, WOODEN_BREASTPLATE, 1);
							addExpAndSp(player, 5000, 0);
							st.exitQuest(false, true);
						}
						break;
					}
					case ALTRAN:
					{
						if (cond == 1)
						{
							htmltext = "30283-01.htm";
						}
						else if (cond == 2)
						{
							htmltext = "30283-03.htm";
						}
						else if (cond == 3)
						{
							htmltext = "30283-04.htm";
							st.setCond(4, true);
							takeItems(player, GOLEM_SHARD, -1);
							giveItems(player, TOOL_BOX, 1);
						}
						else if (cond == 4)
						{
							htmltext = "30283-05.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player killer, boolean isSummon)
	{
		final QuestState qs = getQuestState(killer, false);
		if ((qs != null) && qs.isCond(2) && (getRandom(100) < 30) && (getQuestItemsCount(killer, GOLEM_SHARD) < 5))
		{
			giveItems(killer, GOLEM_SHARD, 1);
			if (getQuestItemsCount(killer, GOLEM_SHARD) >= 5)
			{
				qs.setCond(3, true);
			}
			else
			{
				playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
		}
	}
}