ZURSULUS L2

Influx of Machines

ID
647
Название
Influx of Machines
start_npcs_json
[32069]
npc_ids_json
[32069]
constants_json
{"GUTENHAGEN":32069,"DESTROYED_GOLEM_SHARD":8100}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00647_InfluxOfMachines/Q00647_InfluxOfMachines.java

NPC квеста

IDНазваниеСтарт квестаУровень
32069GutenhagenДа70

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

htmltext = (player.getLevel() < 46) ? "32069-03.htm" : "32069-01.htm";

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

giveItems(player, getRandom(4963, 4972), 1);
giveItems(partyMember, DESTROYED_GOLEM_SHARD, 1);

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

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

[32069-01.htm] Collector Gutenhagen: When I first came here, these barracks were full of Dwarves... Now they're deserted! That is, of course, except for Yumi and me! Yumi's on some sort of research mission, and I can't just leave her alone! You look like a strong-enough fellow... Are you looking for work? "What kind of work?" [32069-02.htm] Collector Gutenhagen: The Golems in this area have become more than a mere noisance... Yumi and I don't stand a chance against them alone! Your job is to destroy all the Golems in the Horrifying Golem Army, including the Ginzu Golems and the Cannon Golems in the Strip Mine. Bring me 500 Golem Shards and you'll be well-rewarded! Good luck! [32069-03.htm] Collector Gutenhagen: When I first came here, these barracks were full of Dwarves... Now they're deserted! That is, of course, except for Yumi and me! Yumi's on some sort of research mission, and I can't just leave her alone! You don't look like a strong-enough fellow... Come back later if you looking for work. (This quest may only be undertaken by a character of level 46 and above.) [32069-04.htm] Collector Gutenhagen: Have you brought back 500 Golem Shards? No?... Your job is to destroy all the Golems in the Horrifying Golem Army, including the Ginzu Golems and the Cannon Golems in the Strip Mine. Bring me 500 Golem Shards and you'll be well-rewarded! Hurry! [32069-05.htm] Collector Gutenhagen: You've brought back 500 Golem Shards! I had no idea you could get the job done so quickly! I suppose I should've hired someone like you long ago... Now, give me the Shards... "Here are the Shards." [32069-06.htm] Collector Gutenhagen: Good job! Collecting 500 Golem Shards is never an easy task! Please accept this reward... What's that? It's not enough?! You must not have any idea what this paper is worth!
Исходник условий и наград (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.Q00647_InfluxOfMachines;

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 Q00647_InfluxOfMachines extends Quest
{
	// NPC
	private static final int GUTENHAGEN = 32069;
	
	// Item
	private static final int DESTROYED_GOLEM_SHARD = 8100;
	
	public Q00647_InfluxOfMachines()
	{
		super(647, "Influx of Machines");
		registerQuestItems(DESTROYED_GOLEM_SHARD);
		addStartNpc(GUTENHAGEN);
		addTalkId(GUTENHAGEN);
		for (int i = 22052; i < 22079; i++)
		{
			addKillId(i);
		}
	}
	
	@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("32069-02.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("32069-06.htm"))
		{
			takeItems(player, DESTROYED_GOLEM_SHARD, -1);
			giveItems(player, getRandom(4963, 4972), 1);
			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() < 46) ? "32069-03.htm" : "32069-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				if (cond == 1)
				{
					htmltext = "32069-04.htm";
				}
				else if (cond == 2)
				{
					htmltext = "32069-05.htm";
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState qs = getRandomPartyMemberState(player, 1, 3, npc);
		if (qs == null)
		{
			return;
		}
		
		final Player partyMember = qs.getPlayer();
		final QuestState st = getQuestState(partyMember, false);
		if (st == null)
		{
			return;
		}
		
		if (getRandom(10) < 3)
		{
			giveItems(partyMember, DESTROYED_GOLEM_SHARD, 1);
			if (getQuestItemsCount(partyMember, DESTROYED_GOLEM_SHARD) < 500)
			{
				playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				st.setCond(2, true);
			}
		}
	}
}