ZURSULUS L2

Magnificent Feast

ID
378
Название
Magnificent Feast
start_npcs_json
[30594]
npc_ids_json
[30594]
constants_json
{"RANSPO":30594,"WINE_15":5956,"WINE_30":5957,"WINE_60":5958,"MUSICAL_SCORE":4421,"SALAD_RECIPE":1455,"SAUCE_RECIPE":1456,"STEAK_RECIPE":1457,"RITRON_DESSERT":5959}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00378_GrandFeast/Q00378_GrandFeast.java

NPC квеста

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

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

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

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

giveItems(player, REWARDS.get(score)[0], REWARDS.get(score)[1]);
giveAdena(player, adena, true);

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

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

[30594-0.htm] Warehouse Chief Ranspo: I've been a warehouse keeper in this very location for almost 40 years! I can honestly say that I built this place with my own hands! I sacrificed my youth and devoted all of my passion to it! I received notice some time ago from the elder council of the guild union in Schuttgart. An inspector from the Iron Gate Guild will visit here soon. He is coming to observe my warehouse because the productivity in Dion has been so high this year. If everything goes well, I might very well be promoted to the position of elder! When the inspector is here, I must honor him with a great feast... But I don't know where to start! I'm so excited! I must have some help from an adventurer like yourself, but... now that I get a closer look at you, I can tell that you're still lacking experience! Why don't you come back and see me later? (This quest may only be undertaken by a character of level 20 and above.) [30594-1.htm] Warehouse Chief Ranspo: I've been a warehouse keeper in this very location for almost 40 years! I can honestly say that I built this place with my own hands. I sacrificed my youth and devoted all of my passion to it! I received notice some time ago from the elder council of the guild union in Schuttgart. An inspector from the Iron Gate Guild will visit here soon. He is coming to observe my warehouse because the productivity in Dion has been so high this year. If everything goes well, I might be very well be promoted to the position of elder! When the inspector is here, I must honor him with a great feast... But I don't know where to start! I'm so excited! I must have some help from an adventurer like yourself. Of course, you'll be well rewarded. What do you think? Will you help me? "I'll help you." [30594-10.htm] Warehouse Chief Ranspo: Oh my! Yes, This is exactly what I wanted! Just looking at the ingredients makes my mouth water! So, now I just have to follow the recipe, right? I'm going to do everything I can to make this feast a success! Thank you for your hard work. Thanks to you, now I can prepare a truly magnificent banquet! My promotion is guaranteed. Please accept this reward! [30594-2.htm] Warehouse Chief Ranspo: Wonderful! The inspector is widely known to be a lover of fine food and drink. It is said that he joined a wine taster's guild as a hobby and ended up earning the title of Sommelier, the highest grade! Anyway, at the feast, I must offer him first some elegant appetizers and top-quality wine. I know that the wine in this area is very well-regarded. Would you find a bottle and bring it to me? The older the better! Go visit Guard Harlan who works in the village. [30594-3.htm] Warehouse Chief Ranspo: Did you bring me the wine? "I brought you a 15-year-old bottle of wine." "I brought you a 30-year-old bottle of wine." "I brought you a 60-year-old bottle of wine." "Uh... where can I obtain the wine?" [30594-4.htm] Warehouse Chief Ranspo: Are you playing with me? Go get the wine! "Uh... where can I find the wine?" [30594-4a.htm] Warehouse Chief Ranspo: Hmm... 15-year-old wine... I think you could've done better than that... Anyway, since I don't have much time left, I'll take it. Next I'll need... A grand feast must be accompanied by entertainment! I heard that there is a skillful dwarf composer in this village. What was his name? Barmonkey... Barbado... something like that... Anyhow, please find this man and ask him to compose some festive music suitable for this occasion. I'll hire a musician myself. Just bring me a musical score. [30594-4b.htm] Warehouse Chief Ranspo: Hmm.. 30-year-old wine... Not bad... But I think you could've done better... But I'll take it. Let's see, what else was there...? Ah, yes! A grand feast must be accompanied by entertainment! I've heard that there is a skillful dwarf composer in this village. What was his name? Barmonkey... Barbado... something like that... Anyhow, please find him and ask him to compose some festive music suitable for this occasion. I'll hire a musician myself. Just bring me a musical score. [30594-4c.htm] Warehouse Chief Ranspo: Oh, my! A 60-year-old wine! Such a rarity! Thank you so much! I'm glad I trusted you with this task. Now, let me see, what else was there...? Ah, yes! A grand feast must be accompanied by entertainment! I've heard that there is a skillful dwarf composer in this village. What was his name? Barmonkey... Barbado... something like that... Anyhow, please find him and ask him to compose some festive music suitable for this occasion. I'll hire a musician myself. Just bring me a musical score. [30594-4d.htm] Warehouse Chief Ranspo: What a blockhead you are! What's the matter with you? I'll explain it once more, so open your ears and listen! I must have top-quality wine! The older the better! Go and see Guard Harlan in the village. [30594-5.htm] Warehouse Chief Ranspo: Have you brought me the musical score? What have you been doing? Hurry to see that dwarf Barbado, or whatever his name is, and bring back the score! Make sure it's cheerful music, suitable for a banquet! [30594-5a.htm] Warehouse Chief Ranspo: Is this the music Booboo, no, Barbado composed? Ha! I can't read music... but, I've heard that he's a good musician. I'm sure it's wonderful... I've hired an accordionist... Now, what else was there? Ah, yes! That's right...! "What else do you need?" [30594-6.htm] Warehouse Chief Ranspo: Appetizer, wine, cheerful music... all that's lacking is the main course... the heart and soul of the feast! We must prepare the courses! I know that the inspector would like to try some of Dion's regional foods. I have provided the young chef's apprentice with space and money to develop dishes... For some reason, it's taking him forever! Jonas is only interested in winning a prize in the culinary competition. He's not interested in treating the inspector with great dishes at all! He's saying that before he can complete the final dish, he won't tell his secret recipe to anyone! Would you talk to him and try to get his secret recipe? [30594-7.htm] Warehouse Chief Ranspo: Have you gotten the secret recipe from Jonas? I've invested so much time and money in that kid... If the recipe is mediocre.. I'll kick him out immediately! "I brought you Jonas's Salad Recipe." "I brought you Jonas's Sauce Recipe." "I brought you Jonas's Steak Recipe." "Uh... who is Jonas?" [30594-8.htm] Warehouse Chief Ranspo: The inspector will be here in two days! We're running out of time! In fact, we've no time at all! Hurry back with a secret recipe from Jonas! "Uh... who is Jonas?" [30594-8a.htm] Warehouse Chief Ranspo: His recipe for what? Salad?! You can't really expect me to serve rabbit food to the inspector! Well, actually, it is a specialty of Dion... I suppose I could give it a try... Well... my preparations for the feast are almost complete... I have just one last favor to ask you... Can you guess what it is? Yes, the dessert! What meal is complete without a delicious dessert? Go and see Magister Rollant at the temple, I've heard he has a secret recipe for a dessert made with local ingredients... [30594-8b.htm] Warehouse Chief Ranspo: What am I supposed to do with a sauce? I suppose I could make steak... I could prepare it Dwarf-style, and use the sauce that Jonas developed. That should be enough to satisfy the inspector. My preparations for the feast are almost complete... I have one last favor to ask you... Can you guess what it is? Yes, the dessert! What meal is complete without a delicious dessert? Go and see Magister Rollant at the temple, I've heard that he has a secret recipe for a dessert made with local ingredients... [30594-8c.htm] Warehouse Chief Ranspo: Monster Eye Steak? Oh my, that is unique! I like it! I'm sure the inspector will be very impressed! My preparations for the feast are almost complete... I have one last favor to ask... Can you guess what it is? Yes, the dessert! What meal is complete without a delicious dessert? Go and see Magister Rollant at the temple, I've heard that he has a secret recipe for a dessert made with local ingredients... [30594-8d.htm] Warehouse Chief Ranspo: Oh my! Where is Shilen when you need her? She should have taken you long ago! What were you doing when I explained this to you before? Are you deaf? OK, I'll tell you once more. Pay attention! The guy next to me is Jonas! He has a lot of secret recipes. Talk to him, obtain one of his secret recipes and bring it to me! [30594-9.htm] Warehouse Chief Ranspo: The inspector will be here the day after tomorrow! Even though you brought me the recipe, I'm not sure we can prepare the dish in time! Quickly! Go to the temple and get the recipe for dessert from Magister Rollant!
Исходник условий и наград (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.Q00378_GrandFeast;

import java.util.HashMap;
import java.util.Map;

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 Q00378_GrandFeast extends Quest
{
	// NPC
	private static final int RANSPO = 30594;
	
	// Items
	private static final int WINE_15 = 5956;
	private static final int WINE_30 = 5957;
	private static final int WINE_60 = 5958;
	private static final int MUSICAL_SCORE = 4421;
	private static final int SALAD_RECIPE = 1455;
	private static final int SAUCE_RECIPE = 1456;
	private static final int STEAK_RECIPE = 1457;
	private static final int RITRON_DESSERT = 5959;
	
	// Rewards
	private static final Map<String, int[]> REWARDS = new HashMap<>();
	static
	{
		// @formatter:off
		REWARDS.put("9", new int[]{847, 1, 5700});
		REWARDS.put("10", new int[]{846, 2, 0});
		REWARDS.put("12", new int[]{909, 1, 25400});
		REWARDS.put("17", new int[]{846, 2, 1200});
		REWARDS.put("18", new int[]{879, 1, 6900});
		REWARDS.put("20", new int[]{890, 2, 8500});
		REWARDS.put("33", new int[]{879, 1, 8100});
		REWARDS.put("34", new int[]{910, 1, 0});
		REWARDS.put("36", new int[]{848, 1, 2200});
		// @formatter:on
	}
	
	public Q00378_GrandFeast()
	{
		super(378, "Magnificent Feast");
		addStartNpc(RANSPO);
		addTalkId(RANSPO);
	}
	
	@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 "30594-2.htm":
			{
				st.startQuest();
				break;
			}
			case "30594-4a.htm":
			{
				if (hasQuestItems(player, WINE_15))
				{
					st.setCond(2, true);
					st.set("score", "1");
					takeItems(player, WINE_15, 1);
				}
				else
				{
					htmltext = "30594-4.htm";
				}
				break;
			}
			case "30594-4b.htm":
			{
				if (hasQuestItems(player, WINE_30))
				{
					st.setCond(2, true);
					st.set("score", "2");
					takeItems(player, WINE_30, 1);
				}
				else
				{
					htmltext = "30594-4.htm";
				}
				break;
			}
			case "30594-4c.htm":
			{
				if (hasQuestItems(player, WINE_60))
				{
					st.setCond(2, true);
					st.set("score", "4");
					takeItems(player, WINE_60, 1);
				}
				else
				{
					htmltext = "30594-4.htm";
				}
				break;
			}
			case "30594-6.htm":
			{
				if (hasQuestItems(player, MUSICAL_SCORE))
				{
					st.setCond(3, true);
					takeItems(player, MUSICAL_SCORE, 1);
				}
				else
				{
					htmltext = "30594-5.htm";
				}
				break;
			}
			case "30594-8a.htm":
			{
				if (hasQuestItems(player, SALAD_RECIPE))
				{
					st.setCond(4, true);
					final int score = st.getInt("score");
					st.set("score", String.valueOf(score + 8));
					takeItems(player, SALAD_RECIPE, 1);
				}
				else
				{
					htmltext = "30594-8.htm";
				}
				break;
			}
			case "30594-8b.htm":
			{
				if (hasQuestItems(player, SAUCE_RECIPE))
				{
					st.setCond(4, true);
					final int score = st.getInt("score");
					st.set("score", String.valueOf(score + 16));
					takeItems(player, SAUCE_RECIPE, 1);
				}
				else
				{
					htmltext = "30594-8.htm";
				}
				break;
			}
			case "30594-8c.htm":
			{
				if (hasQuestItems(player, STEAK_RECIPE))
				{
					st.setCond(4, true);
					final int score = st.getInt("score");
					st.set("score", String.valueOf(score + 32));
					takeItems(player, STEAK_RECIPE, 1);
				}
				else
				{
					htmltext = "30594-8.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:
			{
				htmltext = (player.getLevel() < 20) ? "30594-0.htm" : "30594-1.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				if (cond == 1)
				{
					htmltext = "30594-3.htm";
				}
				else if (cond == 2)
				{
					htmltext = (!hasQuestItems(player, MUSICAL_SCORE)) ? "30594-5.htm" : "30594-5a.htm";
				}
				else if (cond == 3)
				{
					htmltext = "30594-7.htm";
				}
				else if (cond == 4)
				{
					final String score = st.get("score");
					if (REWARDS.containsKey(score) && hasQuestItems(player, RITRON_DESSERT))
					{
						htmltext = "30594-10.htm";
						
						takeItems(player, RITRON_DESSERT, 1);
						giveItems(player, REWARDS.get(score)[0], REWARDS.get(score)[1]);
						
						final int adena = REWARDS.get(score)[2];
						if (adena > 0)
						{
							giveAdena(player, adena, true);
						}
						
						st.exitQuest(true, true);
					}
					else
					{
						htmltext = "30594-9.htm";
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
}