ZURSULUS L2

Bring Out the Flavor of Ingredients!

ID
380
Название
Bring Out the Flavor of Ingredients!
start_npcs_json
[30069]
npc_ids_json
[20205,20206,20225]
constants_json
{"DIRE_WOLF":20205,"KADIF_WEREWOLF":20206,"GIANT_MIST_LEECH":20225,"RITRON_FRUIT":5895,"MOON_FACE_FLOWER":5896,"LEECH_FLUIDS":5897,"ANTIDOTE":1831,"RITRON_JELLY":5960,"JELLY_RECIPE":5959}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00380_BringOutTheFlavorOfIngredients/Q00380_BringOutTheFlavorOfIngredients.java

NPC квеста

IDНазваниеСтарт квестаУровень
20205Dire WolfНет24
20206Kadif WerewolfНет25
20225Giant Mist LeechНет25

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

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

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

giveItems(player, JELLY_RECIPE, 1);
giveItems(player, RITRON_JELLY, 1);
giveItems(player, RITRON_FRUIT, 1);
giveItems(player, MOON_FACE_FLOWER, 1);
giveItems(player, LEECH_FLUIDS, 1);

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

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

[30069-00.htm] Magister Rollant: Are you interested in the culinary arts? There are many excellent food ingredients here at Dion Castle. The local people have a passion for cooking and hold a culinary competition every month. Many people think of this place as a chef's paradise, but I'm not completely satisfied. Although the correct cooking process is vital to the creation of fine foods, there is something missing... If you know anyone capable of gathering truly exotic ingredients, send them to me! (This quest may only be undertaken by a character of level 24 and above.) [30069-01.htm] Magister Rollant: Are you interested in the culinary arts? There are many excellent food ingredients here at Dion Castle. The local people have a passion for cooking and hold a culinary competition every month. Many people think of this place as a chef's paradise, but I'm not completely satisfied. Although the correct cooking process is vital to the creation of fine foods, there is something missing.... The other chefs don't seem to notice this, or else they simply don't want to put in the time and effort to obtain new ingredients. "Are you different from other chefs?" [30069-02.htm] Magister Rollant: The most important skill a chef possesses is the ability to evaluate fine ingredients. A thorough knowledge of ingredients and the ability to find them are essential. Only then does preparation come into play. Remember, an apple requires no preparation whatsoever. Cooking shouldn't always mean smearing something with butter and flour and calling it a pie. But I must admit, there are some hazards in using raw ingredients... "What kind of hazards?" [30069-03.htm] Magister Rollant: Raw foods can have a very strong flavor. Some foods, if not prepared properly, can even cause illness. By far, the greatest use of ingredients is dessert. Would you care to sample some? "Would I ever!" [30069-04.htm] Magister Rollant: Excellent! We must gather the ingredients! Actually, that will be the hardest part. They aren't easy to find... The fruit of the ritron trees quite often fails to sprout, and ripens underground. Dire wolves have an excellent sense of smell and often dig up the ritron fruits. I will need 4 ritron fruits. I will also need a Moon Face Flower which is carried by Kadif werewolves and some fluids of giant mist leeches. Ah, I will also need two leaves of Antidote as well, since Leech Fluids are very poisonous. So let's see, I need 4 ritron fruits, 20 moon flowers, 10 bottles of giant mist leech fluids and two leaves of Antidote... You can purchase Antidote at any store. Bring me these ingredients and you'll taste the best dessert in the world! "Where can I find these ingredients?" [30069-05.htm] Magister Rollant: Dire wolves can be found in the northern Dion Hills, or in the south across the river west of Dion Castle and also on the Plains of Dion. Since Kadif werewolves can only be found on the Plains of Dion, you'll have to cross the river anyway. Giant mist leeches can be found in the Cruma Marshlands. Antidotes can be bought at any store. [30069-06.htm] Magister Rollant: You haven't brought all the ingredients. Please bring me ritron fruits from Dire wolves, moon flowers from Kadif werewolves, giant mist leech fluids and Antidote. Bring them to me and I'll make you the best dessert ever made... Elven Magister Mirien, known as the magician of flavor, has never tasted it! "Where do I find the ingredients?" [30069-07.htm] Magister Rollant: Good! You've brought all the ingredients. I'll get started with my cooking. Ritron fruit cannot be consumed raw. To soften it, you must use this leech fluid. First we must beat the leech fluid together and neutralize it with Antidote. Then, grind the moon flower... This will take a while... Would you like to come back later? [30069-08.htm] Magister Rollant: Now I must distill the Leech Fluid and mix it with gelatin. Hmm, I forgot, I need to make gelatin, too. Please light the fire. Now I will crush one Ritron Fruit and add it to the ground Moon Flower... Please come back later. [30069-09.htm] Magister Rollant: Timing is essential! I will add the sterilized Leech Fluids to the Ritron Fruit just before it melts, so it will develop the maximum smoothness while retaining the pulp that uniquely tickles the throat... I must concentrate. Please don't interrupt me! Come back later! [30069-10.htm] Magister Rollant: Quiet! This is a very crucial moment! Come back later. Why are you in such a hurry? [30069-11.htm] Magister Rollant: It's done! Now it must marinate in the sauce. When it's hardened you can eat it. I call it "Rollant's Special Ritron Jelly". Can you taste the hint of Moon Flower? I added the ritron fruit to the ritron sauce to really intensify the flavor. It melts in your mouth but still has a lovely texture, doesn't it? Eat up! "It's the best tasting dessert I've ever had!" [30069-12.htm] Magister Rollant: I'm glad you enjoyed it. In case you ever want to have it again, take this recipe. I hope other chefs learn that such ingredients exist and start creating dishes made from them. Please share it with as many people as possible. [30069-13.htm] Magister Rollant: It's done! Now, it must marinate in the ritron sauce. When it's hardened you can eat it. I call it "Rollant's Special Ritron Jelly". Can you taste the hint of Moon Flower? I added the Ritron Fruit to the Ritron sauce which really intensifies the flavor. It melts in your mouth but still has a lovely texture, doesn't it? Regretfully, this ritron fruit had been gnawed by wolves. I'm sure the taste won't be affected, but much of the joy of a dessert is its appearance... Oh, well, you have to make do with what you have. Thank you for your work.
Исходник условий и наград (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.Q00380_BringOutTheFlavorOfIngredients;

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 Q00380_BringOutTheFlavorOfIngredients extends Quest
{
	// Monsters
	private static final int DIRE_WOLF = 20205;
	private static final int KADIF_WEREWOLF = 20206;
	private static final int GIANT_MIST_LEECH = 20225;
	
	// Items
	private static final int RITRON_FRUIT = 5895;
	private static final int MOON_FACE_FLOWER = 5896;
	private static final int LEECH_FLUIDS = 5897;
	private static final int ANTIDOTE = 1831;
	
	// Rewards
	private static final int RITRON_JELLY = 5960;
	private static final int JELLY_RECIPE = 5959;
	
	public Q00380_BringOutTheFlavorOfIngredients()
	{
		super(380, "Bring Out the Flavor of Ingredients!");
		registerQuestItems(RITRON_FRUIT, MOON_FACE_FLOWER, LEECH_FLUIDS);
		addStartNpc(30069); // Rollant
		addTalkId(30069);
		addKillId(DIRE_WOLF, KADIF_WEREWOLF, GIANT_MIST_LEECH);
	}
	
	@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("30069-04.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30069-12.htm"))
		{
			giveItems(player, JELLY_RECIPE, 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() < 24) ? "30069-00.htm" : "30069-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				if (cond == 1)
				{
					htmltext = "30069-06.htm";
				}
				else if (cond == 2)
				{
					if (getQuestItemsCount(player, ANTIDOTE) >= 2)
					{
						htmltext = "30069-07.htm";
						st.setCond(3, true);
						takeItems(player, RITRON_FRUIT, -1);
						takeItems(player, MOON_FACE_FLOWER, -1);
						takeItems(player, LEECH_FLUIDS, -1);
						takeItems(player, ANTIDOTE, 2);
					}
					else
					{
						htmltext = "30069-06.htm";
					}
				}
				else if (cond == 3)
				{
					htmltext = "30069-08.htm";
					st.setCond(4, true);
				}
				else if (cond == 4)
				{
					htmltext = "30069-09.htm";
					st.setCond(5, true);
				}
				else if (cond == 5)
				{
					htmltext = "30069-10.htm";
					st.setCond(6, true);
				}
				else if (cond == 6)
				{
					giveItems(player, RITRON_JELLY, 1);
					if (getRandom(100) < 55)
					{
						htmltext = "30069-11.htm";
					}
					else
					{
						htmltext = "30069-13.htm";
						st.exitQuest(true, true);
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getQuestState(player, false);
		if ((st == null) || !st.isCond(1))
		{
			return;
		}
		
		switch (npc.getId())
		{
			case DIRE_WOLF:
			{
				if ((getRandom(10) < 1) && (getQuestItemsCount(player, RITRON_FRUIT) < 4))
				{
					giveItems(player, RITRON_FRUIT, 1);
					if (getQuestItemsCount(player, RITRON_FRUIT) < 4)
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
					else
					{
						if ((getQuestItemsCount(player, MOON_FACE_FLOWER) == 20) && (getQuestItemsCount(player, LEECH_FLUIDS) == 10))
						{
							st.setCond(2, true);
						}
						else
						{
							playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
						}
					}
				}
				break;
			}
			case KADIF_WEREWOLF:
			{
				if ((getRandom(10) < 5) && (getQuestItemsCount(player, MOON_FACE_FLOWER) < 20))
				{
					giveItems(player, MOON_FACE_FLOWER, 1);
					if (getQuestItemsCount(player, MOON_FACE_FLOWER) < 20)
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
					else
					{
						if ((getQuestItemsCount(player, RITRON_FRUIT) == 4) && (getQuestItemsCount(player, LEECH_FLUIDS) == 10))
						{
							st.setCond(2, true);
						}
						else
						{
							playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
						}
					}
				}
				break;
			}
			case GIANT_MIST_LEECH:
			{
				if ((getRandom(10) < 5) && (getQuestItemsCount(player, LEECH_FLUIDS) < 10))
				{
					giveItems(player, LEECH_FLUIDS, 1);
					if (getQuestItemsCount(player, LEECH_FLUIDS) < 10)
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
					else
					{
						if ((getQuestItemsCount(player, RITRON_FRUIT) == 4) && (getQuestItemsCount(player, MOON_FACE_FLOWER) == 20))
						{
							st.setCond(2, true);
						}
						else
						{
							playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
						}
					}
				}
				break;
			}
		}
	}
}