ZURSULUS L2

Deliver Goods

ID
153
Название
Deliver Goods
start_npcs_json
[30041]
npc_ids_json
[30002,30003,30041,30054]
constants_json
{"JACKSON":30002,"SILVIA":30003,"ARNOLD":30041,"RANT":30054,"DELIVERY_LIST":1012,"HEAVY_WOOD_BOX":1013,"CLOTH_BUNDLE":1014,"CLAY_POT":1015,"JACKSON_RECEIPT":1016,"SILVIA_RECEIPT":1017,"RANT_RECEIPT":1018,"SOULSHOT_NO_GRADE":1835,"RING_OF_KNOWLEDGE":875}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00153_DeliverGoods/Q00153_DeliverGoods.java

NPC квеста

IDНазваниеСтарт квестаУровень
30002JacksonНет70
30003SilviaНет70
30041ArnoldДа80
30054RantНет70

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

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

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

giveItems(player, DELIVERY_LIST, 1);
giveItems(player, CLAY_POT, 1);
giveItems(player, CLOTH_BUNDLE, 1);
giveItems(player, HEAVY_WOOD_BOX, 1);
giveItems(player, RING_OF_KNOWLEDGE, 1);
giveItems(player, RING_OF_KNOWLEDGE, 1);
addExpAndSp(player, 600, 0);
giveItems(player, JACKSON_RECEIPT, 1);
giveItems(player, SILVIA_RECEIPT, 1);
giveItems(player, SOULSHOT_NO_GRADE, 3);
giveItems(player, RANT_RECEIPT, 1);

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

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

[30002-01.htm] Trader Jackson: Ah, the goods that I ordered from the mainland! Thank you. I heard that the trade ship was shipwrecked because of the storm... for a time, I thought that I would never receive my goods... I'm glad that it turned out otherwise! Wonderful! Here is the receipt. Carry on! [30002-02.htm] Trader Jackson: Take the receipt I have given you and go to Guard Arnold. He is so old-fashioned, he will probably worry continuously until he has the receipt in his hand. Thanks a lot, then! [30003-01.htm] Trader Silvia: Oh, the cloth I ordered has arrived. Thank you. So kind of you to personally deliver it to the store... Now I can make a new robe for Cristel to wear on her outings. Wait a moment... take this receipt. And here, take this as a reward for personally delivering the goods to me. Have a fine day! [30003-02.htm] Trader Silvia: Go and show the receipt I gave you to Guard Arnold. And please tell him thank you, I have received the goods in good condition. [30041-00.htm] Guard Arnold: These days, no trade ships bearing the flag of Gracia sail into the dock. That's because all trade with Gracia has been halted since the war. It was quite a sight to see the great trade ships slowly sail into the harbor with their horns sounding, but I guess we won't be seeing any of that anymore. Instead, there has been an increase in trade ships coming in from Giran. However, the recent storms have caused numerous Giran trade ships to be shipwrecked on the island's western shores. Fortunately, none of the crews were lost, but even we guards had to be called out to collect the sunken trade goods. Now we have to organize the goods that were on the shipwrecked ships. As soon as we organize them, we will have to deliver the goods to their respective owners. I hope you can help us when the time comes. (This quest may only be undertaken by a character of level 2 and above.) [30041-01.htm] Guard Arnold: Following the war with Gracia, our king issued a trade embargo, and trade with Gracia was stopped altogether. That's why Gracian trade ships cannot be seen nowadays. On those days that the grand, magnificent Gracian trade ships slowly sailed into the harbor, the village people would all come out to the docks and greet the ship with enthusiastic waves ... Lately there have been many trade ships coming in from Giran. But compared to Gracia, it seems that they are inexperienced when it comes to navigation. The recent storms have caused numerous trade ships to be shipwrecked on the southern shores of the island. Fortunately, none of the crew were killed, but even we guards had to be called out to collect the sunken trade goods. We're just about finished organizing the goods that were on the shipwrecked ships, but the task of delivering the goods to their respective owners still remains. We're still short on help. Do you think you can help us out? Say you will help [30041-02.htm] Sentry Arnold: Here is the list of all the townspeople you must deliver items to. It's that simple! I'll figure your wages based on how well you do. That Heavy Wooden Box goes to Merchant Jackson at the Weapons Shop, the Fabric goes to Merchant Silvia at the General Store, and that Clay Pot goes to Warehouse Keeper Lant. Deliver those items and bring back the receipts. Thank you! [30041-03.htm] Sentry Arnold: You still haven't made the deliveries? Please do so immediately and bring me back the receipts! The Heavy Wooden Box goes to Merchant Jackson at the Weapons Shop, the Fabrics go to Merchant Silvia at the General Store, and the Clay Pot goes to Warehouse Keeper Lant. [30041-04.htm] Guard Arnold: Have you finished all your deliveries? Thank you. As promised, here is your pay. If you ever get the chance, let's have a drink sometime. It's not a bad experience to sit on the shore and tip back a drink, while watching the night sea. [30054-01.htm] Warehouse Keeper Rant: Ha ha! It's the jar I ordered from Giran. I was worried it would be broken during shipping. I'm so relieved! Ah, you need a receipt, don't you? Here it is. Let me just sign it and confirm delivery. There you go -- have a nice day! [30054-02.htm] Warehouse Keeper Rant: Please tell Mr. Arnold that I received it. And don't forget to show him the receipt I gave you!
Исходник условий и наград (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.Q00153_DeliverGoods;

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 Q00153_DeliverGoods extends Quest
{
	// NPCs
	private static final int JACKSON = 30002;
	private static final int SILVIA = 30003;
	private static final int ARNOLD = 30041;
	private static final int RANT = 30054;
	
	// Items
	private static final int DELIVERY_LIST = 1012;
	private static final int HEAVY_WOOD_BOX = 1013;
	private static final int CLOTH_BUNDLE = 1014;
	private static final int CLAY_POT = 1015;
	private static final int JACKSON_RECEIPT = 1016;
	private static final int SILVIA_RECEIPT = 1017;
	private static final int RANT_RECEIPT = 1018;
	
	// Rewards
	private static final int SOULSHOT_NO_GRADE = 1835;
	private static final int RING_OF_KNOWLEDGE = 875;
	
	public Q00153_DeliverGoods()
	{
		super(153, "Deliver Goods");
		registerQuestItems(DELIVERY_LIST, HEAVY_WOOD_BOX, CLOTH_BUNDLE, CLAY_POT, JACKSON_RECEIPT, SILVIA_RECEIPT, RANT_RECEIPT);
		addStartNpc(ARNOLD);
		addTalkId(JACKSON, SILVIA, ARNOLD, RANT);
	}
	
	@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("30041-02.htm"))
		{
			st.startQuest();
			giveItems(player, DELIVERY_LIST, 1);
			giveItems(player, CLAY_POT, 1);
			giveItems(player, CLOTH_BUNDLE, 1);
			giveItems(player, HEAVY_WOOD_BOX, 1);
		}
		
		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() < 2) ? "30041-00.htm" : "30041-01.htm";
				break;
			}
			case State.STARTED:
			{
				switch (npc.getId())
				{
					case ARNOLD:
					{
						if (st.isCond(1))
						{
							htmltext = "30041-03.htm";
						}
						else if (st.isCond(2))
						{
							htmltext = "30041-04.htm";
							takeItems(player, DELIVERY_LIST, 1);
							takeItems(player, JACKSON_RECEIPT, 1);
							takeItems(player, SILVIA_RECEIPT, 1);
							takeItems(player, RANT_RECEIPT, 1);
							giveItems(player, RING_OF_KNOWLEDGE, 1);
							giveItems(player, RING_OF_KNOWLEDGE, 1);
							addExpAndSp(player, 600, 0);
							st.exitQuest(false, true);
						}
						break;
					}
					case JACKSON:
					{
						if (hasQuestItems(player, HEAVY_WOOD_BOX))
						{
							htmltext = "30002-01.htm";
							takeItems(player, HEAVY_WOOD_BOX, 1);
							giveItems(player, JACKSON_RECEIPT, 1);
							if (hasQuestItems(player, SILVIA_RECEIPT, RANT_RECEIPT))
							{
								st.setCond(2, true);
							}
							else
							{
								playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
							}
						}
						else
						{
							htmltext = "30002-02.htm";
						}
						break;
					}
					case SILVIA:
					{
						if (hasQuestItems(player, CLOTH_BUNDLE))
						{
							htmltext = "30003-01.htm";
							takeItems(player, CLOTH_BUNDLE, 1);
							giveItems(player, SILVIA_RECEIPT, 1);
							giveItems(player, SOULSHOT_NO_GRADE, 3);
							if (hasQuestItems(player, JACKSON_RECEIPT, RANT_RECEIPT))
							{
								st.setCond(2, true);
							}
							else
							{
								playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
							}
						}
						else
						{
							htmltext = "30003-02.htm";
						}
						break;
					}
					case RANT:
					{
						if (hasQuestItems(player, CLAY_POT))
						{
							htmltext = "30054-01.htm";
							takeItems(player, CLAY_POT, 1);
							giveItems(player, RANT_RECEIPT, 1);
							if (hasQuestItems(player, JACKSON_RECEIPT, SILVIA_RECEIPT))
							{
								st.setCond(2, true);
							}
							else
							{
								playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
							}
						}
						else
						{
							htmltext = "30054-02.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
}