ZURSULUS L2

Bard's Mandolin

ID
362
Название
Bard's Mandolin
start_npcs_json
[30957]
npc_ids_json
[30837,30956,30957,30958]
constants_json
{"SWAN":30957,"NANARIN":30956,"GALION":30958,"WOODROW":30837,"SWAN_FLUTE":4316,"SWAN_LETTER":4317}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00362_BardsMandolin/Q00362_BardsMandolin.java

NPC квеста

IDНазваниеСтарт квестаУровень
30837WoodrowНет70
30956NanarinНет70
30957SwanДа70
30958GalionНет70

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

htmltext = (player.getLevel() < 15) ? "30957-2.htm" : "30957-1.htm";

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

giveAdena(player, 10000, true);
giveItems(player, 4410, 1);
giveItems(player, SWAN_LETTER, 1);
giveItems(player, SWAN_FLUTE, 1);

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

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

[30837-1.htm] Trader Woodrow: Ah, you mean the flute that Swan ordered? It must have arrived at Giran Harbor by now... If you're in a hurry, you can go directly to the harbor and pick it up. I'll give you the item number so you can pick it up from Galion at the harbor. [30837-2.htm] Trader Woodrow: Didn't you say that you desperately need the flute? It will take a long time for it to be shipped here. Why don't you go directly to Giran Harbor and pick it up? Give the item number I gave you to Galion at the harbor. [30837-3.htm] Trader Woodrow: So, we meet again! Please give my regards to Mr. Swan. [30956-1.htm] Musician Nanarin: What, another package from Bard Swan? Oh, my, this is especially beautiful! Hey, you aren't waiting around for a reply, are you? I appreciate all the flutes, but the Bard really isn't my type! Please tell him that my knight in shining armor is someone else! [30956-2.htm] Musician Nanarin: What am I to do about Bard Swan? I don't want to hurt his feelings but I am not attracted to him at all! [30957-1.htm] Bard Swan: I am uncomfortable talking about my feelings, but she is so beautiful and pure... She is the perfect woman! No... she is a goddess! If only I could tell her of my feelings... Her flute playing is sublime! She is renowned, even among the musicians of her own race, for her incredible talent. A while back I sent her a gift, a flute made of horn, but I haven't gotten any word back from her... Please help me! I feel like I'm losing my mind! "I will help you." [30957-2.htm] Bard Swan: I am uncomfortable talking about my feelings, but she is so beautiful and pure... She is the perfect woman! No... she is a goddess! You are not worthy to even speak her name! (This quest may only be undertaken by a character of level 15 and above.) [30957-3.htm] Bard Swan: Oh, thank you so much! Actually, I have already ordered a flute for her from Trader Woodrow of Aden Castle Town, a specialist in exotic musical instruments. Please check with him to see if the flute has arrived. Mention my name and he will tell you the status of my order. Afterwards I will give you a musical score that is necessary to make an Echo Crystal. [30957-4.htm] Bard Swan: My goddess... Oh, my dear goddess... I pray the flute makes her happy... What are you still doing here? Go and see Trader Woodrow of Aden Castle Town and find out whether the flute I ordered has arrived. [30957-5.htm] Bard Swan: Oh, thank you! The flute is beautiful! Surely this will please my beloved Nanarin. Would you perhaps be willing to take the flute to her, along with my letter? Please say that you will do this one last thing for me. [30957-5a.htm] Bard Swan: My heart is racing like a crazy. I can't wait to know the answer of my beloved Nanarin! [30957-6.htm] Bard Swan: Did you deliver the flute and letter to Nanarin? What did she say? Please tell me! "I think she likes you." "She liked the flute but she doesn't like you." [30957-7.htm] Bard Swan: Oh, I knew it would work! Now, if I can only convince her of my devotion to her... I am greatly indebted to you! Unfortunately, I have spent most of my money on the flute... I've managed to scrape together a bit of money for you. Take it, along with this musical score I composed myself. [30957-8.htm] Bard Swan: Oh, I wish I was dead! Perhaps it was the wrong gift. I must have not been trying hard enough. I shall never give up! Somehow I will win the heart of my beloved! Take this as a token of my gratitude for all your help. [30958-1.htm] Galion: A flute? Wait a moment, let me check... Ah, yes, here it is! A flute made of horn, imported from Avella. It's quite expensive but has an exquisite tone! [30958-2.htm] Galion: How is my old friend Trader Woodrow? I feel I know him well although we have only spoken by letter...
Исходник условий и наград (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.Q00362_BardsMandolin;

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 Q00362_BardsMandolin extends Quest
{
	// NPCs
	private static final int SWAN = 30957;
	private static final int NANARIN = 30956;
	private static final int GALION = 30958;
	private static final int WOODROW = 30837;
	
	// Items
	private static final int SWAN_FLUTE = 4316;
	private static final int SWAN_LETTER = 4317;
	
	public Q00362_BardsMandolin()
	{
		super(362, "Bard's Mandolin");
		registerQuestItems(SWAN_FLUTE, SWAN_LETTER);
		addStartNpc(SWAN);
		addTalkId(SWAN, NANARIN, GALION, WOODROW);
	}
	
	@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("30957-3.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30957-7.htm") || event.equals("30957-8.htm"))
		{
			giveAdena(player, 10000, true);
			giveItems(player, 4410, 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() < 15) ? "30957-2.htm" : "30957-1.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case SWAN:
					{
						if ((cond == 1) || (cond == 2))
						{
							htmltext = "30957-4.htm";
						}
						else if (cond == 3)
						{
							htmltext = "30957-5.htm";
							st.setCond(4, true);
							giveItems(player, SWAN_LETTER, 1);
						}
						else if (cond == 4)
						{
							htmltext = "30957-5a.htm";
						}
						else if (cond == 5)
						{
							htmltext = "30957-6.htm";
						}
						break;
					}
					case WOODROW:
					{
						if (cond == 1)
						{
							htmltext = "30837-1.htm";
							st.setCond(2, true);
						}
						else if (cond == 2)
						{
							htmltext = "30837-2.htm";
						}
						else if (cond > 2)
						{
							htmltext = "30837-3.htm";
						}
						break;
					}
					case GALION:
					{
						if (cond == 2)
						{
							htmltext = "30958-1.htm";
							st.setCond(3);
							playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
							giveItems(player, SWAN_FLUTE, 1);
						}
						else if (cond > 2)
						{
							htmltext = "30958-2.htm";
						}
						break;
					}
					case NANARIN:
					{
						if (cond == 4)
						{
							htmltext = "30956-1.htm";
							st.setCond(5, true);
							takeItems(player, SWAN_FLUTE, 1);
							takeItems(player, SWAN_LETTER, 1);
						}
						else if (cond == 5)
						{
							htmltext = "30956-2.htm";
						}
						break;
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
}