ZURSULUS L2

In Search of Cloth

ID
34
Название
In Search of Cloth
start_npcs_json
[30088]
npc_ids_json
[20560,20561,30088,30165,30294]
constants_json
{"RADIA":30088,"RALFORD":30165,"VARAN":30294,"TRISALIM_SPIDER":20560,"TRISALIM_TARANTULA":20561,"SPINNERET":7528,"SUEDE":1866,"THREAD":1868,"SPIDERSILK":7161,"MYSTERIOUS_CLOTH":7076}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00034_InSearchOfCloth/Q00034_InSearchOfCloth.java

NPC квеста

IDНазваниеСтарт квестаУровень
20560Trisalim SpiderНет45
20561Trisalim TarantulaНет46
30088RadiaДа70
30165RalfordНет70
30294VaranНет70

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

if (player.getLevel() >= 60)

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

giveItems(player, SPIDERSILK, 1);
giveItems(player, MYSTERIOUS_CLOTH, 1);
giveItems(member, SPINNERET, 1);

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

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

[30088-0.htm] Trader Radia: Welcome, stranger! What can I do for you? Nice ring! Are you here to propose to me? Just kidding! Don't tell me you thought I was serious!? Oh, you're here for Leikar's order? Sorry, it hasn't come in yet. Maybe you should check with Varan in Gludio Castle Town. I've been expecting a shipment from him. "Ok." [30088-0a.htm] Trader Radia: Welcome! What can I do for you? I'm sorry, but if you're not expecting an order, you'll need to come back later. I'm too busy now. (This quest may only be undertaken by a character who advanced first in Make Formal Wear quest.) [30088-0b.htm] Trader Radia: Leikar's order isn't ready because the materials haven't arrived yet. You'll need to check back later. (This quest may only be undertaken by a character of level 60 and above.) [30088-1.htm] Trader Radia: I would've checked with Varan myself if I wasn't so busy. Go ask him why the materials aren't here yet. [30088-1a.htm] Trader Radia: What are you still doing here? If you want the order, you'll have to check with Varan and find out where the materials are! [30088-2.htm] Trader Radia: Welcome back! What did Varan have to say for himself? "He apologized." [30088-3.htm] Trader Radia: Well, it looks like I'll need to find a new supplier. Ralford is more reliable. He can get what I need. He's at the Ivory Tower in Oren. I'll let him know you're coming. [30088-3a.htm] Trader Radia: Please get the ingredients from Ralford at the Ivory Tower. [30088-4.htm] Trader Radia: Excellent! Can I have them? "Here you go." [30088-4a.htm] Trader Radia: You haven't heard from Ralford? I need spidersilk, 3000 Suedes and 5000 threads. Please hurry. [30088-5.htm] Trader Radia: Yes, your fabric is ready! Let me get it for you. Here it is! Isn't it nice? You can really make something nice with this. Have a safe journey! [30165-0.htm] Trader Ralford: Welcome! Radia told me you'd be coming. Are you here for the spidersilk, thread and suede? Sorry, we're all out! You can probably get some thread and suede from travelers, but as for the spidersilk, that's another matter! I can make some for you if you help me! "I'll help you." [30165-1.htm] Trader Ralford: In the Sea of Spores, there are spiders called Trisalim Spiders and Trisalim Tarantulas. Please bring me 10 Spinneret from them and I'll make spidersilk for you. [30165-1a.htm] Trader Ralford: This isn't enough! I need more. [30165-2.htm] Trader Ralford: Wonderful! Give me the Spinneret and I'll make spidersilk for you. "Here they are." [30165-3.htm] Trader Ralford: Thank you. Please wait here. Here's the spidersilk you asked for. Radia asked for more than just this, however. It shouldn't be too hard for you... She needs 3000 suedes and 5000 threads... [30165-3a.htm] Trader Ralford: Radia needs spidersilk, 3000 Suedes and 5000 threads. Please take it to her. [30294-0.htm] Trader Varan: Ah, you mean Radia's order? Well, I haven't gotten the materials yet. The goods she wants have been rather scarce of late, making them difficult to obtain. "When can I get it then?" [30294-1.htm] Trader Varan: Tell her I'm sorry I couldn't fill the order on time, and that I accept responsibility for the breach of Contract. [30294-1a.htm] Trader Varan: Please tell Radia that I won't make a mistake like this again.
Исходник условий и наград (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.Q00034_InSearchOfCloth;

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;

import quests.Q00037_MakeFormalWear.Q00037_MakeFormalWear;

public class Q00034_InSearchOfCloth extends Quest
{
	// NPCs
	private static final int RADIA = 30088;
	private static final int RALFORD = 30165;
	private static final int VARAN = 30294;
	
	// Monsters
	private static final int TRISALIM_SPIDER = 20560;
	private static final int TRISALIM_TARANTULA = 20561;
	
	// Items
	private static final int SPINNERET = 7528;
	private static final int SUEDE = 1866;
	private static final int THREAD = 1868;
	private static final int SPIDERSILK = 7161;
	
	// Rewards
	private static final int MYSTERIOUS_CLOTH = 7076;
	
	public Q00034_InSearchOfCloth()
	{
		super(34, "In Search of Cloth");
		registerQuestItems(SPINNERET, SPIDERSILK);
		addStartNpc(RADIA);
		addTalkId(RADIA, RALFORD, VARAN);
		addKillId(TRISALIM_SPIDER, TRISALIM_TARANTULA);
	}
	
	@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 "30088-1.htm":
			{
				st.startQuest();
				break;
			}
			case "30294-1.htm":
			{
				st.setCond(2, true);
				break;
			}
			case "30088-3.htm":
			{
				st.setCond(3, true);
				break;
			}
			case "30165-1.htm":
			{
				st.setCond(4, true);
				break;
			}
			case "30165-3.htm":
			{
				st.setCond(6, true);
				takeItems(player, SPINNERET, 10);
				giveItems(player, SPIDERSILK, 1);
				break;
			}
			case "30088-5.htm":
			{
				if ((getQuestItemsCount(player, SUEDE) >= 3000) && (getQuestItemsCount(player, THREAD) >= 5000) && hasQuestItems(player, SPIDERSILK))
				{
					takeItems(player, SPIDERSILK, 1);
					takeItems(player, SUEDE, 3000);
					takeItems(player, THREAD, 5000);
					giveItems(player, MYSTERIOUS_CLOTH, 1);
					st.exitQuest(false, true);
				}
				else
				{
					htmltext = "30088-4a.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:
			{
				if (player.getLevel() >= 60)
				{
					final QuestState fwear = player.getQuestState(Q00037_MakeFormalWear.class.getSimpleName());
					if ((fwear != null) && fwear.isCond(6))
					{
						htmltext = "30088-0.htm";
					}
					else
					{
						htmltext = "30088-0a.htm";
					}
				}
				else
				{
					htmltext = "30088-0b.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case RADIA:
					{
						if (cond == 1)
						{
							htmltext = "30088-1a.htm";
						}
						else if (cond == 2)
						{
							htmltext = "30088-2.htm";
						}
						else if (cond == 3)
						{
							htmltext = "30088-3a.htm";
						}
						else if (cond == 6)
						{
							if ((getQuestItemsCount(player, SUEDE) < 3000) || (getQuestItemsCount(player, THREAD) < 5000) || !hasQuestItems(player, SPIDERSILK))
							{
								htmltext = "30088-4a.htm";
							}
							else
							{
								htmltext = "30088-4.htm";
							}
						}
						break;
					}
					case VARAN:
					{
						if (cond == 1)
						{
							htmltext = "30294-0.htm";
						}
						else if (cond > 1)
						{
							htmltext = "30294-1a.htm";
						}
						break;
					}
					case RALFORD:
					{
						if (cond == 3)
						{
							htmltext = "30165-0.htm";
						}
						else if ((cond == 4) && (getQuestItemsCount(player, SPINNERET) < 10))
						{
							htmltext = "30165-1a.htm";
						}
						else if (cond == 5)
						{
							htmltext = "30165-2.htm";
						}
						else if (cond > 5)
						{
							htmltext = "30165-3a.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isSummon)
	{
		final Player member = getRandomPartyMember(player, 4);
		if ((member != null) && getRandomBoolean())
		{
			final QuestState qs = getQuestState(member, false);
			giveItems(member, SPINNERET, 1);
			if (getQuestItemsCount(member, SPINNERET) >= 10)
			{
				qs.setCond(5, true);
			}
			else
			{
				playSound(member, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
		}
	}
}