ZURSULUS L2

A Looter and a Railroad Man

ID
649
Название
A Looter and a Railroad Man
start_npcs_json
[32052]
npc_ids_json
[32052]
constants_json
{"OBI":32052,"THIEF_GUILD_MARK":8099}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00649_ALooterAndARailroadMan/Q00649_ALooterAndARailroadMan.java

NPC квеста

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

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

htmltext = (player.getLevel() < 30) ? "32052-0a.htm" : "32052-0.htm";

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

giveAdena(player, 21698, true);
giveItems(player, THIEF_GUILD_MARK, 1);

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

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

[32052-0.htm] Railroad Worker Obi: This area has gone to hell lately! The security was never that great, but once there were merchants and warehouses, security guards and adventurers... But that was a long time ago... Now they're all gone! All that's left is this old, worn-out railroad station and the Bandits who rob anyone foolish enough to come here! How would you like a job? "Tell me more about the Bandits." [32052-0a.htm] Railroad Worker Obi: This area has gone to hell lately! The security was never that great, but once there were merchants and warehouses, security guards and adventurers... But that was a long time ago... Now they're all gone! All that's left is this old, worn-out railroad station and the Bandits who rob anyone foolish enough to come here! I would offer you a job, but I'm afraid you're not up for it yet. (This quest may only be undertaken by a character of level 30 and above.) [32052-1.htm] Railroad Worker Obi: The Bandits around these parts are known as Rayito's Bandits. They're not very strong but they're tenacious like bugs at a picnic. They survive by hunting the wild beasts around here. They use the beasts' teeth to decorate themselves! Nasty! Bring me proof that you killed 200 Bandits and I will give you reward. [32052-2.htm] Railroad Worker Obi: Do you have 200 proofs from the Bandits? "Here they are." [32052-2a.htm] Railroad Worker Obi: Hey! What are you doing? You promised to help! Bring justice to those Bandit Sweepers, Bandit Hounds, Bandit Watchman, Bandit Undertakers, Bandit Assassins, Bandit Warriors, Bandit Inspectors and Bandit Captains, and don't forget to bring back proof. [32052-3.htm] Railroad Worker Obi: You brought 200 Bandit proofs. That's great! We can rest easily for a while now. Please accept this token of our gratitude. It's not much, but please accept it. [32052-3a.htm] Railroad Worker Obi: These aren't 200 items! Go back and kill more, don't come here till you have 200 of them.
Исходник условий и наград (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.Q00649_ALooterAndARailroadMan;

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 Q00649_ALooterAndARailroadMan extends Quest
{
	// NPC
	private static final int OBI = 32052;
	
	// Item
	private static final int THIEF_GUILD_MARK = 8099;
	
	public Q00649_ALooterAndARailroadMan()
	{
		super(649, "A Looter and a Railroad Man");
		registerQuestItems(THIEF_GUILD_MARK);
		addStartNpc(OBI);
		addTalkId(OBI);
		addKillId(22017, 22018, 22019, 22021, 22022, 22023, 22024, 22026);
	}
	
	@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("32052-1.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("32052-3.htm"))
		{
			if (getQuestItemsCount(player, THIEF_GUILD_MARK) < 200)
			{
				htmltext = "32052-3a.htm";
			}
			else
			{
				takeItems(player, THIEF_GUILD_MARK, -1);
				giveAdena(player, 21698, true);
				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() < 30) ? "32052-0a.htm" : "32052-0.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				if (cond == 1)
				{
					htmltext = "32052-2a.htm";
				}
				else if (cond == 2)
				{
					htmltext = "32052-2.htm";
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getQuestState(player, false);
		if ((st == null) || !st.isCond(1))
		{
			return;
		}
		
		if (getRandom(10) < 8)
		{
			giveItems(player, THIEF_GUILD_MARK, 1);
			if (getQuestItemsCount(player, THIEF_GUILD_MARK) < 200)
			{
				playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				st.setCond(2, true);
			}
		}
	}
}