ZURSULUS L2

Chest caught with a bait of wind

ID
27
Название
Chest caught with a bait of wind
start_npcs_json
[31570]
npc_ids_json
[31434,31570]
constants_json
{"LANOSCO":31570,"SHALING":31434,"LARGE_BLUE_TREASURE_CHEST":6500,"STRANGE_BLUEPRINT":7625,"BLACK_PEARL_RING":880}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00027_ChestCaughtWithABaitOfWind/Q00027_ChestCaughtWithABaitOfWind.java

NPC квеста

IDНазваниеСтарт квестаУровень
31434ShalingНет70
31570LanoscoДа70

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

if (player.getLevel() < 27)

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

giveItems(player, STRANGE_BLUEPRINT, 1);
giveItems(player, BLACK_PEARL_RING, 1);

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

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

[31434-01.htm] Blueprint Seller Shaling: Hello! what can I do for you? Do you need the blueprint for an extraordinary golem? Sorry, but I have only ordinary ones left now. Recently, I completed a really great golem bluprint, but I accidently dropped it off of the bridge and lost it! What a terrible loss! "I found it!" [31434-02.htm] Blueprint Seller Shaling: This is amazing! How did you find it? You must be a great adventurer! Thank you so much! Please accept this token of my appreciation! [31434-03.htm] Blueprint Seller Shaling: You said you'd found the blueprint, but you have neither the blueprint nor the box! Are you teasing me? [31570-01.htm] Fishermen's Guild Member Lanosco: Hello again! You got the bait of wind from me before. Did it work? Honestly, it's not intended to catch fish at all! But you look rather pleased with yourself! Did you catch anything? Besides fish, I mean! "What do you mean?" [31570-02.htm] Fishermen's Guild Member Lanosco: Well, it's obvious you're not here to buy fishing gear! Have you ever been fishing? Try it once, you'll be hooked! Heh heh! I'm the man to see when you need bait! (This quest may only be undertaken by a character of level 27 and above.) [31570-03.htm] Fishermen's Guild Member Lanosco: Well, it's obvious you're not here to buy fishing gear! Have you ever been fishing? Try it once, you'll be hooked! Heh heh! I'm the man to see when you need bait! (This quest may only be undertaken by a character who has completed Lanosco's Special Bait quest.) [31570-04.htm] Fishermen's Guild Member Lanosco: A while back someone was here asking about a large blue treasure box. The bait I gave you earlier was designed to find it! Don't look so hurt! It only works if the person using it doesn't know about it. If you haven't found it yet, please continue to look for it. Only you can use that bait now. This should be easy for you! I can't tell you who the large blue treasure box belongs to now, but I will if you find it! It was lost near the shore. Look for it there. Your fishing skill must be level 9 and you must bring the box to me unopened. Someone else may have found it by now, so make sure to ask around about it in the market. [31570-05.htm] Fishermen's Guild Member Lanosco: You're back! Did you finish your assignment already? Maybe I should've made it harder for you! Let me check it out... Is that the large blue treasure box? "Here it is." [31570-06.htm] Fishermen's Guild Member Lanosco: You're back! Did you finish your assignment already? No? Well then, by all means, go and find the large blue treasure box. It won't be easy to find, but I'm really counting on you! [31570-07.htm] Fishermen's Guild Member Lanosco: I think this is the large blue treasure box that my client lost. It seems to contain a blueprint of golem. The only blacksmith in this whole area capable of making such a thing is Shaling in this village. She told me recently that she had dropped a box containing a blueprint in the river while she was traveling. This must be it! Please take this blueprint of golem to Shaling in the Blacksmith Shop. [31570-08.htm] Fishermen's Guild Member Lanosco: Didn't you say you had found the large blue treasure box? I must authenticate its contents! If you opened it, it's useless! You'll need to bring another, unopened one. [31570-09.htm] Fishermen's Guild Member Lanosco: Why haven't you taken the chest to Miss Shaling yet? Take it to the Blacksmith Shop. She told me recently that she had dropped a box containing a blueprint in the river while she was traveling. So deliver it quickly!
Исходник условий и наград (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.Q00027_ChestCaughtWithABaitOfWind;

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 quests.Q00050_LanoscosSpecialBait.Q00050_LanoscosSpecialBait;

public class Q00027_ChestCaughtWithABaitOfWind extends Quest
{
	// NPCs
	private static final int LANOSCO = 31570;
	private static final int SHALING = 31434;
	
	// Items
	private static final int LARGE_BLUE_TREASURE_CHEST = 6500;
	private static final int STRANGE_BLUEPRINT = 7625;
	private static final int BLACK_PEARL_RING = 880;
	
	public Q00027_ChestCaughtWithABaitOfWind()
	{
		super(27, "Chest caught with a bait of wind");
		
		registerQuestItems(STRANGE_BLUEPRINT);
		
		addStartNpc(LANOSCO);
		addTalkId(LANOSCO, SHALING);
	}
	
	@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 "31570-04.htm":
			{
				st.startQuest();
				break;
			}
			case "31570-07.htm":
			{
				if (hasQuestItems(player, LARGE_BLUE_TREASURE_CHEST))
				{
					st.setCond(2);
					takeItems(player, LARGE_BLUE_TREASURE_CHEST, 1);
					giveItems(player, STRANGE_BLUEPRINT, 1);
				}
				else
				{
					htmltext = "31570-08.htm";
				}
				break;
			}
			case "31434-02.htm":
			{
				if (hasQuestItems(player, STRANGE_BLUEPRINT))
				{
					htmltext = "31434-02.htm";
					takeItems(player, STRANGE_BLUEPRINT, 1);
					giveItems(player, BLACK_PEARL_RING, 1);
					st.exitQuest(false, true);
				}
				else
				{
					htmltext = "31434-03.htm";
				}
				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:
			{
				if (player.getLevel() < 27)
				{
					htmltext = "31570-02.htm";
				}
				else
				{
					final QuestState st2 = player.getQuestState(Q00050_LanoscosSpecialBait.class.getSimpleName());
					if ((st2 != null) && st2.isCompleted())
					{
						htmltext = "31570-01.htm";
					}
					else
					{
						htmltext = "31570-03.htm";
					}
				}
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case LANOSCO:
					{
						if (cond == 1)
						{
							htmltext = (!hasQuestItems(player, LARGE_BLUE_TREASURE_CHEST)) ? "31570-06.htm" : "31570-05.htm";
						}
						else if (cond == 2)
						{
							htmltext = "31570-09.htm";
						}
						break;
					}
					case SHALING:
					{
						if (cond == 2)
						{
							htmltext = "31434-01.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
}