ZURSULUS L2

The Finest Ingredients - Part 1

ID
624
Название
The Finest Ingredients - Part 1
start_npcs_json
[31521]
npc_ids_json
[21314,21317,21319,21321]
constants_json
{"NEPENTHES":21319,"ATROX":21321,"ATROXSPAWN":21317,"BANDERSNATCH":21314,"TRUNK_OF_NEPENTHES":7202,"FOOT_OF_BANDERSNATCHLING":7203,"SECRET_SPICE":7204,"ICE_CRYSTAL":7080,"SOY_SAUCE_JAR":7205}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00624_TheFinestIngredientsPart1/Q00624_TheFinestIngredientsPart1.java

NPC квеста

IDНазваниеСтарт квестаУровень
21314Hot Springs BandersnatchlingНет73
21317Hot Springs AtroxspawnНет74
21319Hot Springs NepenthesНет75
21321Hot Springs AtroxНет76

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

htmltext = (player.getLevel() < 73) ? "31521-03.htm" : "31521-01.htm";

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

giveItems(player, ICE_CRYSTAL, 1);
giveItems(player, SOY_SAUCE_JAR, 1);
giveItems(partyMember, TRUNK_OF_NEPENTHES, 1);
giveItems(partyMember, SECRET_SPICE, 1);
giveItems(partyMember, FOOT_OF_BANDERSNATCHLING, 1);

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

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

[31521-01.htm] Chef Jeremy: Oh no! I've got a serious problem! That newcomer Donath plans to participate in the culinary contest, and from what I've heard, he's my only real competition! What can I do to beat him? I've got it! But the ingredients won't be easy to find... Hey, you! Yeah, you! I hate to ask you this, but do you want a job? I'm the greatest chef in this region, and I'm preparing to make the most fabulous dish of all time! Help me gather the ingredients and I'll give you an Ice Crystal! "I'll help you." [31521-02.htm] Chef Jeremy: I plan to prepare smoked yeti meat for the competition, but I won't use just any ordinary yeti meat! I must have the meat of the king of the yetis! Also known as the Icicle Emperor, he's very rarely seen. First, I must make a special dish to lure him out. Bring me the secret recipe spices extracted from hot springs nipensiz stems, soles of Hot Springs Bandersnatches, Hot Springs Atrox and Hot Springs Atrox spawn. I'll need fifty of each! Why so many? Ha! This is the king of the yetis we're talking about here! He's a big eater and won't come out for an ordinary portion! I'll start preparing now. Bring me the ingredients as soon as possible! [31521-03.htm] Chef Jeremy: I need someone to find some ingredients for me. I don't intend to feed the monsters! (This quest may only be undertaken by a character of level 73 and above.) [31521-04.htm] Chef Jeremy: Unbelievable! You brought them back so quickly! I had a good feeling about you! This should be plenty for now. Now, let me have those ingredients. "Here you go." [31521-05.htm] Chef Jeremy: Keep this soy sauce with you, and come back when you have the rest of the ingredients. Hold on a second... Ah yes, here are some Ice Crystals. They'll keep the sauce fresh, and you can use them for something else later on... [31521-06.htm] Chef Jeremy: What the...?! Blast! Do you want to see a chef go crazy? While you're wasting time, Donath is probably creating a dish that will steal away my position as top chef! Leave now, gather the ingredients and bring them to me at once! There's no time to waste! [31521-07.htm] Chef Jeremy: Are you kidding me? You had the ingredients and now they're gone? I need to sit down!
Исходник условий и наград (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.Q00624_TheFinestIngredientsPart1;

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 Q00624_TheFinestIngredientsPart1 extends Quest
{
	// Monsters
	private static final int NEPENTHES = 21319;
	private static final int ATROX = 21321;
	private static final int ATROXSPAWN = 21317;
	private static final int BANDERSNATCH = 21314;
	
	// Items
	private static final int TRUNK_OF_NEPENTHES = 7202;
	private static final int FOOT_OF_BANDERSNATCHLING = 7203;
	private static final int SECRET_SPICE = 7204;
	
	// Rewards
	private static final int ICE_CRYSTAL = 7080;
	private static final int SOY_SAUCE_JAR = 7205;
	
	public Q00624_TheFinestIngredientsPart1()
	{
		super(624, "The Finest Ingredients - Part 1");
		registerQuestItems(TRUNK_OF_NEPENTHES, FOOT_OF_BANDERSNATCHLING, SECRET_SPICE);
		addStartNpc(31521); // Jeremy
		addTalkId(31521);
		addKillId(NEPENTHES, ATROX, ATROXSPAWN, BANDERSNATCH);
	}
	
	@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("31521-02.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("31521-05.htm"))
		{
			if ((getQuestItemsCount(player, TRUNK_OF_NEPENTHES) >= 50) && (getQuestItemsCount(player, FOOT_OF_BANDERSNATCHLING) >= 50) && (getQuestItemsCount(player, SECRET_SPICE) >= 50))
			{
				takeItems(player, TRUNK_OF_NEPENTHES, -1);
				takeItems(player, FOOT_OF_BANDERSNATCHLING, -1);
				takeItems(player, SECRET_SPICE, -1);
				giveItems(player, ICE_CRYSTAL, 1);
				giveItems(player, SOY_SAUCE_JAR, 1);
				st.exitQuest(true, true);
			}
			else
			{
				st.setCond(1);
				htmltext = "31521-07.htm";
			}
		}
		
		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() < 73) ? "31521-03.htm" : "31521-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				if (cond == 1)
				{
					htmltext = "31521-06.htm";
				}
				else if (cond == 2)
				{
					if ((getQuestItemsCount(player, TRUNK_OF_NEPENTHES) >= 50) && (getQuestItemsCount(player, FOOT_OF_BANDERSNATCHLING) >= 50) && (getQuestItemsCount(player, SECRET_SPICE) >= 50))
					{
						htmltext = "31521-04.htm";
					}
					else
					{
						htmltext = "31521-07.htm";
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState qs = getRandomPartyMemberState(player, 1, 3, npc);
		if (qs == null)
		{
			return;
		}
		
		final Player partyMember = qs.getPlayer();
		final QuestState st = getQuestState(partyMember, false);
		if (st == null)
		{
			return;
		}
		
		switch (npc.getId())
		{
			case NEPENTHES:
			{
				if (getQuestItemsCount(partyMember, TRUNK_OF_NEPENTHES) < 50)
				{
					giveItems(partyMember, TRUNK_OF_NEPENTHES, 1);
					if ((getQuestItemsCount(partyMember, TRUNK_OF_NEPENTHES) >= 50) && (getQuestItemsCount(player, FOOT_OF_BANDERSNATCHLING) >= 50) && (getQuestItemsCount(player, SECRET_SPICE) >= 50))
					{
						st.setCond(2, true);
					}
					else
					{
						playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
				}
				break;
			}
			case ATROX:
			case ATROXSPAWN:
			{
				if (getQuestItemsCount(partyMember, SECRET_SPICE) < 50)
				{
					giveItems(partyMember, SECRET_SPICE, 1);
					if ((getQuestItemsCount(partyMember, SECRET_SPICE) >= 50) && (getQuestItemsCount(player, TRUNK_OF_NEPENTHES) >= 50) && (getQuestItemsCount(player, FOOT_OF_BANDERSNATCHLING) >= 50))
					{
						st.setCond(2, true);
					}
					else
					{
						playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
				}
				break;
			}
			case BANDERSNATCH:
			{
				if (getQuestItemsCount(partyMember, FOOT_OF_BANDERSNATCHLING) < 50)
				{
					giveItems(partyMember, FOOT_OF_BANDERSNATCHLING, 1);
					if ((getQuestItemsCount(partyMember, FOOT_OF_BANDERSNATCHLING) >= 50) && (getQuestItemsCount(player, TRUNK_OF_NEPENTHES) >= 50) && (getQuestItemsCount(player, SECRET_SPICE) >= 50))
					{
						st.setCond(2, true);
					}
					else
					{
						playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
				}
				break;
			}
		}
	}
}