ZURSULUS L2

Catch the Wind

ID
317
Название
Catch the Wind
start_npcs_json
[30361]
npc_ids_json
[]
constants_json
{"WIND_SHARD":1078}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00317_CatchTheWind/Q00317_CatchTheWind.java

NPC квеста

Записей нет.

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

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

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

giveAdena(player, reward, true);
giveItems(player, WIND_SHARD, 1);

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

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

[30361-02.htm] Rizraell: All spirits in the ancient forest used to be friends to us Elves. But recently, some spirits have become violent. It's as if they were trying to get revenge on the Elves for the destruction of the forest. I heard it was the angry wind spirit lirein that recently caused the strong wind to destroy the roofs of the village buildings and break windows. If the 'sylph' is the spirit of the cool breeze that blows between trees, then 'lirein' is a vengeful spirit of a wild storm. These spirits pluck trees from their roots and send animals flying high in the air. They are especially hostile to Elves. They come and go with severe winds, and we feel like they are trying to drive us from the forest. However, the Wind Shard, a fragment of Soul Ore that is within the body of a lirein, is a very precious resource. I make various magical products using Soul Ore, so I may ask you to collect some Wind Shards for me in the near future. (This quest may only be undertaken by a character of level 18 and above.) [30361-03.htm] Rizraell: All spirits in the ancient forest used to be friends to us Elves. But recently, some spirits have become violent. It's as if they were trying to get revenge on the Elves for the destruction of the forest. I heard it was the angry wind spirit lirein that recently caused the strong wind to destroy the roofs of the village buildings and break windows. If the 'sylph' is the spirit of the cool breeze that blows between trees, then 'lirein' is a vengeful spirit of a wild storm. These spirits pluck trees from their roots and send animals flying high in the air. They are especially hostile to Elves. They come and go with severe winds, and we feel like they are trying to drive us from the forest. However, the Wind Shard, a fragment of Soul Ore that is within the body of a lirein, is a very precious resource. I use elemental stones to make various magic products, but among them, the Wind Shard is a material inevitably needed when making the scroll of wind. The scroll of wind is just as its name implies -- wind that is trapped in parchment. If you spread the scroll wide open, the strong wind sealed within will blow in the direction of your choice for a few seconds. This can be very useful for various tasks. It is used to change the direction of the wind east, to prevent the poisonous fumes coming from the Sea of Spores from entering the Elven forest. The scroll of wind is also bought by many Human and Dwarven sea navigators. I heard it is used when there is no wind on the ocean and the ship cannot move. I am making several scrolls of wind due to the commission of Herbiel, but I am short of a few materials. Can you do me the favor of collecting Wind Shards? Say you will take the task. [30361-04.htm] Rizraell: Then let's make a Contract. If you find Wind Shards from lirein, the vengeful spirits of the wind, I will compensate you according to how many you bring. They say there are many lirein around the Neutral Zone on the boundaries of the Elven Forest and Gludio. If you don't know how to get there, ask Sentinel Rayen. [30361-05.htm] Rizraell: Do you remember our Contract? If you find Wind Shards from lireins, the vengeful spirits of the wind, I will compensate you according to how many you bring me. They say there are many lirein in the Neutral Zone. Ask Sentinel Rayen about how to get there. Say you will find them Say you will end the Contract [30361-07.htm] Rizraell: Thank you. This blue jewel that quivers at the tip of my fingers is indeed a Wind Shard. I will compensate you according to how many you brought. Thank you for your trouble. Would you like to end the Contract? Or would you like to continue collecting? Say you will end the Contract Say you will continue [30361-08.htm] Rizraell: Thank you. I am much indebted to you even during the short time our fates were bound by Contract. May Eva's blessing be with you. [30361-09.htm] Rizraell: The Wind Shard that you collect will protect our forest from the poisons blowing from the Sea of Spores and give hope to the sailors that are stranded in the ocean. Well then, please continue to perform your services.
Исходник условий и наград (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.Q00317_CatchTheWind;

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 Q00317_CatchTheWind extends Quest
{
	// Item
	private static final int WIND_SHARD = 1078;
	
	public Q00317_CatchTheWind()
	{
		super(317, "Catch the Wind");
		registerQuestItems(WIND_SHARD);
		addStartNpc(30361); // Rizraell
		addTalkId(30361);
		addKillId(20036, 20044);
	}
	
	@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("30361-04.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30361-08.htm"))
		{
			st.exitQuest(true, true);
		}
		
		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) ? "30361-02.htm" : "30361-03.htm";
				break;
			}
			case State.STARTED:
			{
				final int shards = getQuestItemsCount(player, WIND_SHARD);
				if (shards == 0)
				{
					htmltext = "30361-05.htm";
				}
				else
				{
					htmltext = "30361-07.htm";
					takeItems(player, WIND_SHARD, -1);
					
					int reward = 40 * shards;
					if (!GeneralConfig.ALT_VILLAGES_REPEATABLE_QUEST_REWARD && (shards >= 10))
					{
						reward += 2988;
					}
					
					giveAdena(player, reward, true);
				}
				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;
		}
		
		if (getRandomBoolean())
		{
			giveItems(player, WIND_SHARD, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}