ZURSULUS L2

The Ocean of Distant Stars

ID
117
Название
The Ocean of Distant Stars
start_npcs_json
[32053]
npc_ids_json
[22023,22024,32052,32053,32054,32055,32076]
constants_json
{"ABEY":32053,"GHOST":32054,"ANCIENT_GHOST":32055,"OBI":32052,"BOX":32076,"BANDIT_WARRIOR":22023,"BANDIT_INSPECTOR":22024,"GREY_STAR":8495,"ENGRAVED_HAMMER":8488}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00117_TheOceanOfDistantStars/Q00117_TheOceanOfDistantStars.java

NPC квеста

IDНазваниеСтарт квестаУровень
22023Bandit WarriorНет36
22024Bandit InspectorНет37
32052ObiНет70
32053AbeyДа70
32054Ghost of a Railroad EngineerНет70
32055Ghost of an Ancient Railroad EngineerНет70
32076BoxНет70

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

htmltext = (player.getLevel() < 39) ? "32053-00.htm" : "32053-01.htm";

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

giveItems(player, ENGRAVED_HAMMER, 1);
addExpAndSp(player, 63591, 0);

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

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

[32052-01.htm] Railroad Worker Obi: I've been watching you for a while now, and you talk to yourself a lot! Is that normal where you come from, talking to yourself? "You see, there was this ghost..." [32052-02.htm] Railroad Worker Obi: What? A ghost? Huh...? I have no idea! Why don't you ask Abey when she wakes up later? [32052-03.htm] Railroad Worker Obi: Hmmmm...? A hammer? Let me see... What? This is really old! I haven't seen this kind of hammer in a long time! So, this pillar, I'm sure you know, stands for our Gray Pillar Guild. And the star that is connected to this column, you see the two lines between them? These lines symbolize the railroad. Basically, it means, the railroad that reaches the stars and the Sky Wagon that runs on it. They actually had plans for one back then! "Tell me about the Sky Wagon." [32052-04.htm] Railroad Worker Obi: You want to know about the Sky Wagon, eh? There used to be a book about it around here somewhere... Oh, yeah, the bandit stole it! It's a thin book with a grey cover... The Bandit Warrior or Inspector could tell you more about that book. [32052-05.htm] Railroad Worker Obi: Oh, you brought the book! Yes, I remember now! The Sky Wagon was planed by the giants of the Age of Titans! After they were extinct, the Dwarves proceeded with the plan as if it were their own! But once the Dwarf King was dead and the Elders started governing the Dwarves, the plan was shelved because of other Guilds' pressure. Those were sad days indeed! So much potential income gone to waste... This hammer comes from that time! So... The ghost told you to bring me this hammer? "Yes." [32052-06.htm] Railroad Worker Obi: Humm...! Then... That must be the ghost of someone who actually worked on the Sky Train project! Our train station was built to transport the raw materials for the construction of the Sky Train... The project suffered from cost overruns and had to be shut down. Now only abandoned ruins remain. One could say these hammers symbolize the dreams of those ancient Dwarves. I don't belive in ghosts but I'll bet this hammer meant a lot to him! I'll tell Abey what we've learned... Take the hammer and give it to the ghost next time you see him. [32053-00.htm] Railroad Worker Abey: Return when you are more experienced. (This quest may only be undertaken by a character of level 39 and above.) [32053-01.htm] Railroad Worker Abey: Hey stranger, would you do me a favor? I keep hearing strange noises around here every night! Obi says he doesn't know anything about it. Could you find out what's going on around here? "I'll do it." [32053-02.htm] Railroad Worker Abey: Oh, thank you! I haven't slept in weeks! I'm afraid those noises might mean something very bad! I'm sure you'll make it possible for me to finally get a good night's sleep! Good luck! [32053-03.htm] Railroad Worker Abey: Well, you must have done a good job! I slept like a log last night! What was making that noise? "Well, you see, there was this Dwarven ghost, and a strange hammer..." [32053-04.htm] Railroad Worker Abey: A ghost? Eeek! Oh, excuse me! I'm so sorry! I'm just deathly afraid of ghosts! But... The hammer! If we find that hammer, the ghost will go away, right? ... I think it's in a box in the back. We keep a lot of old odds-and-ends in there. [32053-05.htm] Railroad Worker Abey: Is this the hammer? Wow! Look how rusty it is! It seems familiar to me somehow. The Black Anvil doesn't use hammers this large, but our Grey Pillar Guild does! These engravings are also of the Grey Pillar... But what are those strange stars? Oh! I've got it! I think Obi might know! Obi has been working here for a long time. Why don't you go ask him about it? "I'll do it." [32053-06.htm] Railroad Worker Abey: Please go and ask Obi about that hammer! [32054-01.htm] Ghost of the Railroad Engineer: What brought you to me, you of the living? Talk about the hammer and the ghost. [32054-02.htm] Ghost of the Railroad Engineer: As you can see, there are many ghosts here who once were Dwarves. We worked to a common purpose: the dream of bulding an air trolley. We wanted to visit the Sea of Stars and the Palace of the Gods... But the Giants left, and we died one by one here. We refused Shilen's call in favor of our own ambition, but in the end, we failed. Ask why. [32054-03.htm] Ghost of the Railroad Engineer: It is as you see... We are all dead and cannot hold a hammer. When we realized we could no longer work, we started to go insane, and this is the result. The ghost you spoke with was a good man once, and strong, so he may outlast many of us. Still, it's just a matter of time, as it was with me. May I ask a favor of you? This is just between us... [32055-01.htm] Ghost of the Ancient Railroad Engineer: You can hear me? Truly? At last! It has been so long since anyone has been able to see or hear me. That gal over there - I've been calling to her for ages, and she doesn't even know I exist! I need your help. Please, please listen to what I ask. Ask what the problem is [32055-02.htm] Ghost of the Ancient Railroad Engineer: ...Hm? Ah, sorry, I forgot what I was saying. Don't be alarmed, I am a ghost. Oh, you can tell? Yes, I guess you could, come to think of it. The translucency and the echoing voice are, pardon the expression, dead giveaways. Well, I'm stuck in this place because I lost my tools... a terrible error for an engineer to make. I think I might have left it somewhere in this railroad station. I recall a hammer with engravings on the handle. Do you think you can find it for me? I think that any railroad worker would probably know where it is. [32055-03.htm] Ghost of the Ancient Railroad Engineer: Yes, that's it! That's the hammer! I have missed it so... I brought that hammer with me when I first set foot on this land. Would you please hand it to me? "Give him the hammer." [32055-04.htm] (The hammer falls right through his hand onto the ground. It breaks with a thud.) Ghost of the Ancient Railroad Engineer: Oh, wow! I can't hold it! I can't hold it! I thought I could hold at least this hammer if nothing else! My own good hammer, and I have no hand to hold it... Well, there is nothing I can do about it. My last hope is dashed. All I can do is wait here for Shilen's call... One last favor, living one: could you please go to the Trolley Ruins and meet my friend for me? I am too weak to go see him now. [32055-05.htm] Ghost of the Ancient Railroad Engineer: Please go to the Trolley Ruins and meet my friend for me. I am too weak to go see him now. [32076-01.htm] Box: The box contains odds-and-ends and a large hammer. Pick up the hammer [32076-02.htm] Box: As you pick up the hammer, you hear the sound of breaking glass coming from the box. The hammer is quite large, with a pillar and stars engraved upon the handle. Take it to Railroad Worker Abey. [32076-03.htm] Box: Except old-fashioned things and odds-and-ends, there is nothing else interesting in that box.
Исходник условий и наград (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.Q00117_TheOceanOfDistantStars;

import org.l2jmobius.gameserver.config.PlayerConfig;
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;
import org.l2jmobius.gameserver.util.LocationUtil;

public class Q00117_TheOceanOfDistantStars extends Quest
{
	// NPCs
	private static final int ABEY = 32053;
	private static final int GHOST = 32054;
	private static final int ANCIENT_GHOST = 32055;
	private static final int OBI = 32052;
	private static final int BOX = 32076;
	
	// Monsters
	private static final int BANDIT_WARRIOR = 22023;
	private static final int BANDIT_INSPECTOR = 22024;
	
	// Items
	private static final int GREY_STAR = 8495;
	private static final int ENGRAVED_HAMMER = 8488;
	
	public Q00117_TheOceanOfDistantStars()
	{
		super(117, "The Ocean of Distant Stars");
		registerQuestItems(GREY_STAR, ENGRAVED_HAMMER);
		addStartNpc(ABEY);
		addTalkId(ABEY, ANCIENT_GHOST, GHOST, OBI, BOX);
		addKillId(BANDIT_WARRIOR, BANDIT_INSPECTOR);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		String htmltext = event;
		final QuestState st = getQuestState(player, false);
		if (st == null)
		{
			return htmltext;
		}
		
		switch (event)
		{
			case "32053-02.htm":
			{
				st.startQuest();
				break;
			}
			case "32055-02.htm":
			{
				st.setCond(2, true);
				break;
			}
			case "32052-02.htm":
			{
				st.setCond(3, true);
				break;
			}
			case "32053-04.htm":
			{
				st.setCond(4, true);
				break;
			}
			case "32076-02.htm":
			{
				st.setCond(5, true);
				giveItems(player, ENGRAVED_HAMMER, 1);
				break;
			}
			case "32053-06.htm":
			{
				st.setCond(6, true);
				break;
			}
			case "32052-04.htm":
			{
				st.setCond(7, true);
				break;
			}
			case "32052-06.htm":
			{
				st.setCond(9, true);
				takeItems(player, GREY_STAR, 1);
				break;
			}
			case "32055-04.htm":
			{
				st.setCond(10, true);
				takeItems(player, ENGRAVED_HAMMER, 1);
				break;
			}
			case "32054-03.htm":
			{
				addExpAndSp(player, 63591, 0);
				st.exitQuest(false, true);
				break;
			}
		}
		
		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() < 39) ? "32053-00.htm" : "32053-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case ANCIENT_GHOST:
					{
						if (cond == 1)
						{
							htmltext = "32055-01.htm";
						}
						else if ((cond > 1) && (cond < 9))
						{
							htmltext = "32055-02.htm";
						}
						else if (cond == 9)
						{
							htmltext = "32055-03.htm";
						}
						else if (cond > 9)
						{
							htmltext = "32055-05.htm";
						}
						break;
					}
					case OBI:
					{
						if (cond == 2)
						{
							htmltext = "32052-01.htm";
						}
						else if ((cond > 2) && (cond < 6))
						{
							htmltext = "32052-02.htm";
						}
						else if (cond == 6)
						{
							htmltext = "32052-03.htm";
						}
						else if (cond == 7)
						{
							htmltext = "32052-04.htm";
						}
						else if (cond == 8)
						{
							htmltext = "32052-05.htm";
						}
						else if (cond > 8)
						{
							htmltext = "32052-06.htm";
						}
						break;
					}
					case ABEY:
					{
						if ((cond == 1) || (cond == 2))
						{
							htmltext = "32053-02.htm";
						}
						else if (cond == 3)
						{
							htmltext = "32053-03.htm";
						}
						else if (cond == 4)
						{
							htmltext = "32053-04.htm";
						}
						else if (cond == 5)
						{
							htmltext = "32053-05.htm";
						}
						else if (cond > 5)
						{
							htmltext = "32053-06.htm";
						}
						break;
					}
					case BOX:
					{
						if (cond == 4)
						{
							htmltext = "32076-01.htm";
						}
						else if (cond > 4)
						{
							htmltext = "32076-03.htm";
						}
						break;
					}
					case GHOST:
					{
						if (cond == 10)
						{
							htmltext = "32054-01.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 = getRandomPartyMemberState(killer, 7, 3, npc);
		if ((qs == null) || !LocationUtil.checkIfInRange(PlayerConfig.ALT_PARTY_RANGE, npc, killer, true))
		{
			return;
		}
		
		if (giveItemRandomly(killer, npc, GREY_STAR, 1, 1, 0.2, true))
		{
			qs.setCond(8);
		}
	}
}