ZURSULUS L2

Specialty Liquor Delivery

ID
622
Название
Specialty Liquor Delivery
start_npcs_json
[31521]
npc_ids_json
[31267,31521,31543,31544,31545,31546,31547]
constants_json
{"JEREMY":31521,"PULIN":31543,"NAFF":31544,"CROCUS":31545,"KUBER":31546,"BEOLIN":31547,"LIETTA":31267,"SPECIAL_DRINK":7197,"FEE_OF_SPECIAL_DRINK":7198,"ADENA":57,"HASTE_POTION":1062}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00622_SpecialtyLiquorDelivery/Q00622_SpecialtyLiquorDelivery.java

NPC квеста

IDНазваниеСтарт квестаУровень
31267LiettaНет70
31521JeremyДа70
31543PulinНет70
31544NaffНет70
31545CrocusНет70
31546KuberНет70
31547BeolinНет70

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

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

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

giveItems(player, SPECIAL_DRINK, 5);
giveItems(player, FEE_OF_SPECIAL_DRINK, 1);
giveItems(player, FEE_OF_SPECIAL_DRINK, 1);
giveItems(player, FEE_OF_SPECIAL_DRINK, 1);
giveItems(player, FEE_OF_SPECIAL_DRINK, 1);
giveItems(player, FEE_OF_SPECIAL_DRINK, 1);
giveItems(player, getRandomEntry(RECIPES), 1);
rewardItems(player, ADENA, 18800);
rewardItems(player, HASTE_POTION, 1);

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

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

[31267-01.htm] Lietta: Are you here for something? Or perhaps to drop something off? "Jeremy sent me to get some adena." [31267-02.htm] Lietta: Oh, I see. Jeremy didn't pay you after you did work for him? That sounds like Jeremy! Hold on... Here you are. This should be enough. [31521-01.htm] Chef Jeremy: You look like you could use a few extra adena... Well I'm looking for a helper! You'll earn an honest wage around here, that's for sure! All you have to do is take these specialty liquors to my customers. Their names are already written down. Deliver them quickly, and who knows? I might teach you a secret cooking technique! Ha! "I'll deliver your liquor." [31521-02.htm] Chef Jeremy: Please take this specialty liquor to my customers at the hot springs resort. Our motto is "The Customer Always Comes First!" Don't ever forget it! [31521-03.htm] Chef Jeremy: Many dangerous and ferocious beasts lurk these parts. I'd really hate to have to bury another assistant! (This quest may only be undertaken by a character of level 68 and above.) [31521-04.htm] Chef Jeremy: What are you waiting for? Think my customers who are waiting for my delicious liquor to arrive! Get going! [31521-05.htm] Chef Jeremy: You've come back? Did you finish delivering all the liquor? "I completed the delivery." [31521-06.htm] Chef Jeremy: This liquor was made by my great-great grandmother for the soldiers at war. They say that the soldiers who drank it were swept up in ecstatic fervor, and were victorious in war! I don't know if that's true or not... Anyway, I realize that you must be rewarded, but I don't have any adena at this moment. Would you mind speaking with Warehouse Keeper Lietta in the Town of Goddard? She has quite a bit of my adena. Tell her I sent you and she'll take care of you. [31543-01.htm] Pulin: You're the liquor delivery man, right? Show me the booze! I came all the way from Horse Island for a drink! "Here's the liquor delivery." [31543-02.htm] Pulin: Actually, I'm not much of a drinker... I thought this might be different! Here's your money. [31543-03.htm] Pulin: I think the taste of this liquor is starting to grow on me! I'll probably be seeing you again! [31544-01.htm] Naff: The hot springs always reminds me of Jeremy's special liquor! Let me guess... You must be Jeremy's delivery man! "I've brought you some specially brewed liquor!" [31544-02.htm] Naff: What a marvelous taste! It's truly worthy of the gods! [31544-03.htm] Naff: How could I have gotten so drunk from one glass? Woohoo! I feel great! [31545-01.htm] Crocus: I need a drink! Do you have any liquor? "I have your liquor right here!" [31545-02.htm] Crocus: The fruity bouquet and sparkling sensation on my tongue is awesome! There's absolutely nothing like this in the whole world! Jeremy's liquor is unique to this region but very popular everywhere! I'm so glad I came here. [31545-03.htm] Crocus: What a wonderful diversion! I'll wager that even the gods are jealous! If only I could snack on some of Jeremy's eggs... [31546-01.htm] Kuber: That feels so good! I ordered a boiled egg to go with my drink! Once the liquor and the egg arrive, I'll be in heaven! "I'm here to deliver some liquor." [31546-02.htm] Kuber: Mmm... That's delicious! You look tired! Can I buy you a drink? [31546-03.htm] Kuber: Thank you so much! I look forward to getting more deliveries from you! [31547-01.htm] Beolin: Dammit! I need a drink! When will that liquor order get here? "I'm here to deliver some liquor." [31547-02.htm] Beolin: It's about time! Mmm... These hot springs just aren't the same without a nice glass of wine... Hee hee... I'll never get tired of drinking this stuff! Oh, thanks for the delivery! Here's the money for the wine. [31547-03.htm] Beolin: Mmm! Gulp~! Oh, yeah! That's the stuff! What are you staring at, stranger?
Исходник условий и наград (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.Q00622_SpecialtyLiquorDelivery;

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 Q00622_SpecialtyLiquorDelivery extends Quest
{
	// NPCs
	private static final int JEREMY = 31521;
	private static final int PULIN = 31543;
	private static final int NAFF = 31544;
	private static final int CROCUS = 31545;
	private static final int KUBER = 31546;
	private static final int BEOLIN = 31547;
	private static final int LIETTA = 31267;
	
	// Items
	private static final int SPECIAL_DRINK = 7197;
	private static final int FEE_OF_SPECIAL_DRINK = 7198;
	
	// Rewards
	private static final int ADENA = 57;
	private static final int HASTE_POTION = 1062;
	private static final int[] RECIPES =
	{
		6847,
		6849,
		6851
	};
	
	public Q00622_SpecialtyLiquorDelivery()
	{
		super(622, "Specialty Liquor Delivery");
		registerQuestItems(SPECIAL_DRINK, FEE_OF_SPECIAL_DRINK);
		addStartNpc(JEREMY);
		addTalkId(JEREMY, PULIN, NAFF, CROCUS, KUBER, BEOLIN, LIETTA);
	}
	
	@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 "31521-02.htm":
			{
				st.startQuest();
				giveItems(player, SPECIAL_DRINK, 5);
				break;
			}
			case "31547-02.htm":
			{
				st.setCond(2, true);
				takeItems(player, SPECIAL_DRINK, 1);
				giveItems(player, FEE_OF_SPECIAL_DRINK, 1);
				break;
			}
			case "31546-02.htm":
			{
				st.setCond(3, true);
				takeItems(player, SPECIAL_DRINK, 1);
				giveItems(player, FEE_OF_SPECIAL_DRINK, 1);
				break;
			}
			case "31545-02.htm":
			{
				st.setCond(4, true);
				takeItems(player, SPECIAL_DRINK, 1);
				giveItems(player, FEE_OF_SPECIAL_DRINK, 1);
				break;
			}
			case "31544-02.htm":
			{
				st.setCond(5, true);
				takeItems(player, SPECIAL_DRINK, 1);
				giveItems(player, FEE_OF_SPECIAL_DRINK, 1);
				break;
			}
			case "31543-02.htm":
			{
				st.setCond(6, true);
				takeItems(player, SPECIAL_DRINK, 1);
				giveItems(player, FEE_OF_SPECIAL_DRINK, 1);
				break;
			}
			case "31521-06.htm":
			{
				st.setCond(7, true);
				takeItems(player, FEE_OF_SPECIAL_DRINK, 5);
				break;
			}
			case "31267-02.htm":
			{
				if (getRandom(5) < 1)
				{
					giveItems(player, getRandomEntry(RECIPES), 1);
				}
				else
				{
					rewardItems(player, ADENA, 18800);
					rewardItems(player, HASTE_POTION, 1);
				}
				
				st.exitQuest(true, true);
				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() < 68) ? "31521-03.htm" : "31521-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case JEREMY:
					{
						if (cond < 6)
						{
							htmltext = "31521-04.htm";
						}
						else if (cond == 6)
						{
							htmltext = "31521-05.htm";
						}
						else if (cond == 7)
						{
							htmltext = "31521-06.htm";
						}
						break;
					}
					case BEOLIN:
					{
						if ((cond == 1) && (getQuestItemsCount(player, SPECIAL_DRINK) == 5))
						{
							htmltext = "31547-01.htm";
						}
						else if (cond > 1)
						{
							htmltext = "31547-03.htm";
						}
						break;
					}
					case KUBER:
					{
						if ((cond == 2) && (getQuestItemsCount(player, SPECIAL_DRINK) == 4))
						{
							htmltext = "31546-01.htm";
						}
						else if (cond > 2)
						{
							htmltext = "31546-03.htm";
						}
						break;
					}
					case CROCUS:
					{
						if ((cond == 3) && (getQuestItemsCount(player, SPECIAL_DRINK) == 3))
						{
							htmltext = "31545-01.htm";
						}
						else if (cond > 3)
						{
							htmltext = "31545-03.htm";
						}
						break;
					}
					case NAFF:
					{
						if ((cond == 4) && (getQuestItemsCount(player, SPECIAL_DRINK) == 2))
						{
							htmltext = "31544-01.htm";
						}
						else if (cond > 4)
						{
							htmltext = "31544-03.htm";
						}
						break;
					}
					case PULIN:
					{
						if ((cond == 5) && (getQuestItemsCount(player, SPECIAL_DRINK) == 1))
						{
							htmltext = "31543-01.htm";
						}
						else if (cond > 5)
						{
							htmltext = "31543-03.htm";
						}
						break;
					}
					case LIETTA:
					{
						if (cond == 7)
						{
							htmltext = "31267-01.htm";
						}
						break;
					}
				}
			}
		}
		
		return htmltext;
	}
}