ZURSULUS L2

Whereabouts of the Archaeologist

ID
14
Название
Whereabouts of the Archaeologist
start_npcs_json
[31263]
npc_ids_json
[31263,31538]
constants_json
{"LIESEL":31263,"GHOST_OF_ADVENTURER":31538,"LETTER":7253}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00014_WhereaboutsOfTheArchaeologist/Q00014_WhereaboutsOfTheArchaeologist.java

NPC квеста

IDНазваниеСтарт квестаУровень
31263LieselДа70
31538Ghost of AdventurerНет70

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

htmltext = (player.getLevel() < 74) ? "31263-1.htm" : "31263-0.htm";

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

giveItems(player, LETTER, 1);
giveAdena(player, 113228, true);

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

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

[31263-0.htm] Trader Liesel: My friend left home to study archaeology a couple of years ago. His mother was just overcome by disease. Could you deliver her last letter to him? Yes [31263-1.htm] Trader Liesel: My friend left to study archaeology at the Imperial Tomb a few years ago. I have a letter for him, but I think you aren't capable enough to handle this delivery yet. (This quest may only be undertaken by a character of level 74 and above.) [31263-2.htm] Trader Liesel: He may be hard to find, but his last letter mentioned the Imperial Tomb. Maybe you can find him there! [31538-0.htm] Ghost of Adventurer: Huh? You were asked to give me this letter? Who writes a letter to a dead person? Hmm...Let me see... Oh, it's from my mother! It's been so long since I've seen her! How is she? Your mother is dead. [31538-1.htm] Ghost of Adventurer: Oh, yes, I see. Well, I could never let her see me like this, anyway! Thank you for bringing the letter to me. Please accept this token of my appreciation.
Исходник условий и наград (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.Q00014_WhereaboutsOfTheArchaeologist;

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.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;

public class Q00014_WhereaboutsOfTheArchaeologist extends Quest
{
	// NPCs
	private static final int LIESEL = 31263;
	private static final int GHOST_OF_ADVENTURER = 31538;
	
	// Items
	private static final int LETTER = 7253;
	
	public Q00014_WhereaboutsOfTheArchaeologist()
	{
		super(14, "Whereabouts of the Archaeologist");
		registerQuestItems(LETTER);
		addStartNpc(LIESEL);
		addTalkId(LIESEL, GHOST_OF_ADVENTURER);
	}
	
	@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("31263-2.htm"))
		{
			st.startQuest();
			giveItems(player, LETTER, 1);
		}
		else if (event.equals("31538-1.htm"))
		{
			takeItems(player, LETTER, 1);
			giveAdena(player, 113228, true);
			st.exitQuest(false, 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() < 74) ? "31263-1.htm" : "31263-0.htm";
				break;
			}
			case State.STARTED:
			{
				switch (npc.getId())
				{
					case LIESEL:
					{
						htmltext = "31263-2.htm";
						break;
					}
					case GHOST_OF_ADVENTURER:
					{
						htmltext = "31538-0.htm";
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
}