ZURSULUS L2

Sweetest Venom

ID
324
Название
Sweetest Venom
start_npcs_json
[30351]
npc_ids_json
[]
constants_json
{"VENOM_SAC":1077}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00324_SweetestVenom/Q00324_SweetestVenom.java

NPC квеста

Записей нет.

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

htmltext = (player.getLevel() < 18) ? "30351-02.htm" : "30351-03.htm";

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

giveAdena(player, 5810, true);
giveItems(player, VENOM_SAC, 1);

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

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

[30351-02.htm] Astaron: Have you ever tried Dreviant Wine? It's the sweetest, but most dangerous wine that those of my race enjoy drinking. The wine is made from the distilled poison of spiders, you see. Only a few people in the entire continent, including myself, know how to make this wine. I had the opportunity to learn this skill before Patriarch Mitraell was entrapped by that seal. Rumor has it that the Drevanul whispered into the Patriarch's ear how to make this precious wine. Perhaps it is because the secret has been passed down from the Drevanuls, but when our brothers who practice the dark arts drink this wine, their understanding of magic is heightened momentarily. Since I am not well versed in magic, I do not know if this is true or not. In a few weeks Mr. Vollodos will be importing an order of grapes cultivated from the land of Gludio, and I plan to purchase them and try making a few bottles of dreviant wine for myself. The most difficult ingredient to find is the spider's poison. I may have to ask your help for that... (This quest may only be undertaken by a character of level 18 and above.) [30351-03.htm] Astaron: Have you ever tried Dreviant Wine? It's the sweetest, but most dangerous wine that those of my race enjoy drinking. The wine is made from the distilled poison of spiders, you see. Only a few people in the entire continent, including myself, know how to make this wine. I had the opportunity to learn this skill before Patriarch Mitraell was entrapped by that seal. Rumor has it that the Drevanul whispered into the Patriarch's ear how to make this precious wine. Perhaps it is because the secret has been passed down from the Drevanuls, but when our brothers who practice the dark arts drink this wine, their understanding of magic is heightened momentarily. Since I am not well versed in magic, I do not know if this is true or not. A few days ago Trader Vollodos received a shipment of grapes cultivated in the Human land of Gludio, and I am thinking of purchasing them to make a few bottles of Dreviant Wine. The most difficult ingredient to find is the spider's poison, and I would like you to take care of that for me. Can you help me? Say you will help [30351-04.htm] Astaron: While travelling southwest from the village, you will encounter the Altar of Passage of the Dark Elves. There are many poison spiders living in the nearby woods. Hunt the spiders and bring me their Poison Sacs. If you bring me ten Poison Sacs, I will reward you generously. [30351-05.htm] Astaron: You agreed to collect ten Poison Sacs for me, right? Have you found them all yet? Well, there's no need to rush. They say there are many poison spiders near the Altar of Passage of the Dark Elves. [30351-06.htm] Astaron: So you have brought me all ten Poison Sacs. Thank you. This should be enough to make three or four bottles of the finest Dreviant Wine. When the wine ages in a few years, I will let you sample it, so don't forget and come see me again. Now, here is the compensation I promised 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.Q00324_SweetestVenom;

import java.util.HashMap;
import java.util.Map;

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 Q00324_SweetestVenom extends Quest
{
	// Item
	private static final int VENOM_SAC = 1077;
	
	// Drop chances
	private static final Map<Integer, Integer> CHANCES = new HashMap<>();
	static
	{
		CHANCES.put(20034, 220000);
		CHANCES.put(20038, 230000);
		CHANCES.put(20043, 250000);
	}
	
	public Q00324_SweetestVenom()
	{
		super(324, "Sweetest Venom");
		registerQuestItems(VENOM_SAC);
		addStartNpc(30351); // Astaron
		addTalkId(30351);
		addKillId(20034, 20038, 20043);
	}
	
	@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("30351-04.htm"))
		{
			st.startQuest();
		}
		
		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() < 18) ? "30351-02.htm" : "30351-03.htm";
				break;
			}
			case State.STARTED:
			{
				if (st.isCond(1))
				{
					htmltext = "30351-05.htm";
				}
				else
				{
					htmltext = "30351-06.htm";
					takeItems(player, VENOM_SAC, -1);
					giveAdena(player, 5810, true);
					st.exitQuest(true, true);
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getQuestState(player, false);
		if ((st == null) || !st.isCond(1))
		{
			return;
		}
		
		if (getRandom(1000000) < CHANCES.get(npc.getId()))
		{
			giveItems(player, VENOM_SAC, 1);
			if (getQuestItemsCount(player, VENOM_SAC) < 10)
			{
				playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				st.setCond(2, true);
			}
		}
	}
}