ZURSULUS L2

Tarantula's Spider Silk

ID
296
Название
Tarantula's Spider Silk
start_npcs_json
[30519]
npc_ids_json
[30519,30548]
constants_json
{"MION":30519,"DEFENDER_NATHAN":30548,"TARANTULA_SPIDER_SILK":1493,"TARANTULA_SPINNERETTE":1494,"RING_OF_RACCOON":1508,"RING_OF_FIREFLY":1509}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00296_TarantulasSpiderSilk/Q00296_TarantulasSpiderSilk.java

NPC квеста

IDНазваниеСтарт квестаУровень
30519MionДа70
30548NathanНет80

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

htmltext = (player.getLevel() < 15) ? "30519-01.htm" : "30519-02.htm";

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

giveItems(player, TARANTULA_SPIDER_SILK, count * (15 + getRandom(10)));
giveAdena(player, reward, true);
giveItems(player, TARANTULA_SPINNERETTE, 1);
giveItems(player, TARANTULA_SPIDER_SILK, 1);

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

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

[30519-01.htm] Trader Mion: I'm in trouble! I'm in big trouble! Van Holter of Elmore came to me, Mion, and ordered twenty dresses. Formal outfits for the mission to Aden, I heard. Oh dear. What should I do? Not enough time ... not enough materials! The honor of the Silver Scale Guild depends on my two hands now! Oh no ... I have to make the best Formal Wear! I'm in trouble! Big trouble! I don't know what to do now? I don't know! I really don't! Tarantula Spider Silk is lighter and has better colors than the highest-quality silk! Where can I find enough Tarantula Spider Silk for twenty dresses? That's too much! Who will believe me if I say I couldn't make Spider Silk dresses made of Tarantula Spider Silk because I couldn't find enough Spider Silk -- I'm frustrated! I'm frustrated! Tears form in my eyes and the world collapses upon me! Yikes! I really don't know what to do now ...! I do not have much time to make twenty by next week. Eeek! I, Mion, am responsible for this, if I do not finish on time! My fingers are starting to ache, thinking of all those clothes to make ... I will need a pile of laces and ribbons! Who is going to get the Spider Silk for me? Oh no! I need more materials!!! What should I do? Oh no ... my life is tragic ... now really ...I don't know what to do!!! (This quest may only be undertaken by a character of level 15 and above, with either the Ring of Raccoon or the Ring of Firefly.) [30519-02.htm] Trader Mion: I'm in trouble! I'm in big trouble! Van Holter of Elmore came to me, Mion, and ordered twenty dresses ... Formal outfits for the mission to Aden, I heard. Oh dear. What should I do? Not enough time ... not enough materials! The honor of the Silver Scale Guild depends on my two hands now! Oh no ... I have to make the best Formal Wear! I'm in trouble! Big trouble! I don't know what to do now? I don't know! I really don't! Tarantula Spider Silk is lighter and has better colors than the highest-quality silk! Where can I find enough Tarantula Spider Silk for twenty dresses? That's too much! Who will believe me if I say I couldn't make Spider Silk dresses made of Tarantula Spider Silk because I couldn't find enough Spider Silk -- I'm frustrated! I'm frustrated! Tears form in my eyes and the world collapses upon me! Yikes! I really don't know what to do now ...! Say you will help [30519-03.htm] Trader Mion: Ohh! Goddess Maphr sent me a savior! Good Lord! What took you so long! You don't have much time! Now I shall tell you about collecting the Spider Silk. Generally, people think that tarantulas do not make webs, but that is false. They dig holes for their nests and make webs to line them! Hunt tarantulas and bring all the Spider Silk to me! There are two kinds of tarantulas: hunter tarantula and plunder tarantula. If you fulfill this quest, I will reward you! By the way, if you happen to find a tarantula Spinneret take it to Defender Nathan. He will spin the silk out of it. He is a very skilled and sensitive Dwarf. [30519-03a.htm] Trader Mion: O Ho Ho! Do you think I'm stupid? Do you think I'd ask just anyone to collect Tarantula Spider Silk, which is easy to damage, just because I'm too busy!! Oh no ... I'm very upset! You are not even an apprentice of the Guild! You are bothering me, so go away! If you want to become an apprentice of the Guild, you should go to Elder Arin or Elder Keef at the House of Elders instead! Do you get it now? (This quest may only be undertaken by a character with the Ring of Raccoon or the Ring of Firefly.) [30519-04.htm] Trader Mion: Aghhh! What are you doing here? Hey ... I don't have time ... Just spin the silk out of them. If I don't have twenty dresses by next week, I will be kicked out of the Silver Scale Guild! I am telling you once more. You may receive Spider Silks only by hunting hunter tarantulas or plunder tarantulas. Just find them quickly and I will pay you back for sure. Also, you may only spin silks by giving Defender Nathan the tarantula Spinnerets! You don't have much time! You should be busy hunting spiders now ... you shouldn't waste your time like this! Please hurry, hurry ... I'm about to cry ...I don't know what to do now! Say you will quit Say you will continue [30519-05.htm] Trader Mion: Oh my ...I'm deeply touched! I've never been this touched before! You brought the Spider Silk! Thank you very, very much! This is the reward, as promised. Please take it ... I still need more Spider Silk, so please collect more! But making twenty dresses will take forever ... What should I do? Maybe I should run away to another village? Oh no! I don't know what to do!!! Say you will quit Say you will continue [30519-06.htm] Trader Mion: No way! I'm in a hurry and you want to quit? Do you want me to die? I have to make dresses by the day after tomorrow ...! Mion will hate you and curse you! Aghhhh! [30519-07.htm] Trader Mion: Please hurry ... hurry! Tarantula Spider Silk! A lot! Hurry, hurry! Spinnerets are to go to Defender Nathan! Do you understand? Aghhh! Hurry, hurry! I'm about to die! Drink some honey tea and cheer up, Mion! [30548-01.htm] Defender Nathan: I heard about you from Mion. You're helping her collect the Spider Silks, right? I once learned the craft of spinning from the Golden Wheel Guild. But I gave up being a craftsman, and became a defender instead ... Actually, I once got my fortune told at the Maphr Temple. They said I wouldn't live long if I became a craftsman ... Tsk ... Anyway, my skills don't compare to a master's, but the village girls once swooned at my spinning skills! So, if you have any tarantula Spinnerets, bring them to me. I'll spin an unbelievable amount of Spider Silk for you! Ask him to spin the Spider Silk [30548-02.htm] Defender Nathan: Huh! I can't believe Mion gave this job to such a fool. Hello? Anybody home?! I said Spinnerets, dummy! I need Spinnerets to spin the Spider Silk! Get it? [30548-03.htm] Defender Nathan: Spinnerets are the organs within the tarantulas' bodies that store the Spider Silk. Usually one can spin about fifteen skeins of Spider Silk from one Spinneret, but I can easily spin much more than that! If I'm lucky, I can spin over twenty skeins! Ha Ha Ha! Here! All done! Hurry up and take these to Mion!
Исходник условий и наград (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.Q00296_TarantulasSpiderSilk;

import org.l2jmobius.gameserver.config.GeneralConfig;
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 Q00296_TarantulasSpiderSilk extends Quest
{
	// NPCs
	private static final int MION = 30519;
	private static final int DEFENDER_NATHAN = 30548;
	
	// Quest Items
	private static final int TARANTULA_SPIDER_SILK = 1493;
	private static final int TARANTULA_SPINNERETTE = 1494;
	
	// Items
	private static final int RING_OF_RACCOON = 1508;
	private static final int RING_OF_FIREFLY = 1509;
	
	public Q00296_TarantulasSpiderSilk()
	{
		super(296, "Tarantula's Spider Silk");
		registerQuestItems(TARANTULA_SPIDER_SILK, TARANTULA_SPINNERETTE);
		addStartNpc(MION);
		addTalkId(MION, DEFENDER_NATHAN);
		addKillId(20394, 20403, 20508); // Crimson Tarantula, Hunter Tarantula, Plunder arantula
	}
	
	@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 "30519-03.htm":
			{
				if (hasAtLeastOneQuestItem(player, RING_OF_RACCOON, RING_OF_FIREFLY))
				{
					st.startQuest();
				}
				else
				{
					htmltext = "30519-03a.htm";
				}
				break;
			}
			case "30519-06.htm":
			{
				takeItems(player, TARANTULA_SPIDER_SILK, -1);
				takeItems(player, TARANTULA_SPINNERETTE, -1);
				st.exitQuest(true, true);
				break;
			}
			case "30548-02.htm":
			{
				final int count = getQuestItemsCount(player, TARANTULA_SPINNERETTE);
				if (count > 0)
				{
					htmltext = "30548-03.htm";
					takeItems(player, TARANTULA_SPINNERETTE, -1);
					giveItems(player, TARANTULA_SPIDER_SILK, count * (15 + getRandom(10)));
				}
				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() < 15) ? "30519-01.htm" : "30519-02.htm";
				break;
			}
			case State.STARTED:
			{
				switch (npc.getId())
				{
					case MION:
					{
						final int count = getQuestItemsCount(player, TARANTULA_SPIDER_SILK);
						if (count == 0)
						{
							htmltext = "30519-04.htm";
						}
						else
						{
							htmltext = "30519-05.htm";
							takeItems(player, TARANTULA_SPIDER_SILK, -1);
							
							int reward = count * 20;
							if (!GeneralConfig.ALT_VILLAGES_REPEATABLE_QUEST_REWARD && (count >= 10))
							{
								reward += 2000;
							}
							
							giveAdena(player, reward, true);
						}
						break;
					}
					case DEFENDER_NATHAN:
					{
						htmltext = "30548-01.htm";
						break;
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getQuestState(player, false);
		if ((st == null) || !st.isStarted())
		{
			return;
		}
		
		final int rnd = getRandom(100);
		if (rnd > 95)
		{
			giveItems(player, TARANTULA_SPINNERETTE, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
		else if (rnd > 45)
		{
			giveItems(player, TARANTULA_SPIDER_SILK, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}