ZURSULUS L2

Pleas of Pixies

ID
266
Название
Pleas of Pixies
start_npcs_json
[31852]
npc_ids_json
[]
constants_json
{"PREDATOR_FANG":1334,"GLASS_SHARD":1336,"EMERALD":1337,"BLUE_ONYX":1338,"ONYX":1339}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00266_PleasOfPixies/Q00266_PleasOfPixies.java

NPC квеста

Записей нет.

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

else if (player.getLevel() < 3)

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

rewardItems(player, EMERALD, 1);
rewardItems(player, BLUE_ONYX, 1);
rewardItems(player, ONYX, 1);
rewardItems(player, GLASS_SHARD, 1);
giveItems(player, PREDATOR_FANG, getRandom(2, 3));
giveItems(player, PREDATOR_FANG, 1);
giveItems(player, PREDATOR_FANG, getRandom(3) == 0 ? 1 : 2);
giveItems(player, PREDATOR_FANG, 2);

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

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

[31852-00.htm] Pixie Murika: You are not a child of the forest! I don't wish to receive assistance from one who doesn't understand the order of the forest! (This quest may only be undertaken by an Elven character.) [31852-01.htm] Pixie Murika: A few days ago, the king of the birds came to my race and asked for help. Keltirs steal water birds' eggs hidden in the grass, while the wolves devour baby pheasants, and he asked us to slay the greedy animals for him. It is true that the keltir and the wolf only act on their inbred natural instincts, but we must stop them from preying on the birds for a time, if we are to restore the balance of the forest! Right now our queen is thinking of ways to protect the birds of the forest. Surely with her insight and wisdom, she will find an excellent solution! (This quest may only be undertaken by a character of level 3 and above.) [31852-02.htm] Pixie Murika: A few days ago, the king of the birds came to my race and asked for help. The red keltirs are stealing eggs from the nests of aquatic birds, hidden in the grass, and eating them. Also, the gray wolves are eating the young pheasants. So, they asked us to kill those greedy animals. It is true that the keltir and the wolf only act on their inbred natural instinct, but we must stop them from preying on the birds so heavily if we are to recover the balance of the forest! Our wise queen has found the perfect solution for protecting the birds. We can protect bird nests and homes by placing talismans that emit a power keltirs and wolves fear. This will prevent them from approaching the birds. But we are having difficulties collecting the necessary materials to create this talisman. Do you think you could help us? Say you will help. [31852-03.htm] Pixie Murika: To create the amulets, we need the fangs of the keltir or the wolf. We need many of them, as we plan to place these talismans in many locations. Gather 100 fangs and bring them to me. In return, I will then give you this sparkling stone that I recently found in the grass! I am not sure what it is, but I am sure it is something very valuable! [31852-04.htm] Pixie Murika: Have you forgotten already your promise to hunt red keltirs and gray wolves and bring me 100 of their fangs? Keep your promise and I will give you this sparkling stone that I found a few days ago in the forest. I'm sure it is a very valuable stone! [31852-05.htm] Pixie Murika: You have brought me 100 fangs as promised! Thank you! Now our queen can make the talismans to protect the birds of the forest. I hope that the day will soon come when songbirds will sing from every tree branch. Please don't leave yet! We pixies always repay any help we receive. There! Take this. I found it in the woods a few days ago. Your kind seems to like this kind of sparkling stone, right? This is a very precious stone, isn't it? Am I wrong?
Исходник условий и наград (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.Q00266_PleasOfPixies;

import org.l2jmobius.gameserver.entity.actor.Npc;
import org.l2jmobius.gameserver.entity.actor.Player;
import org.l2jmobius.gameserver.entity.actor.enums.creature.Race;
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 Q00266_PleasOfPixies extends Quest
{
	// Items
	private static final int PREDATOR_FANG = 1334;
	
	// Rewards
	private static final int GLASS_SHARD = 1336;
	private static final int EMERALD = 1337;
	private static final int BLUE_ONYX = 1338;
	private static final int ONYX = 1339;
	
	public Q00266_PleasOfPixies()
	{
		super(266, "Pleas of Pixies");
		registerQuestItems(PREDATOR_FANG);
		addStartNpc(31852); // Murika
		addTalkId(31852);
		addKillId(20525, 20530, 20534, 20537);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		final String htmltext = event;
		final QuestState st = getQuestState(player, false);
		if (st == null)
		{
			return htmltext;
		}
		
		if (event.equals("31852-03.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:
			{
				if (player.getRace() != Race.ELF)
				{
					htmltext = "31852-00.htm";
				}
				else if (player.getLevel() < 3)
				{
					htmltext = "31852-01.htm";
				}
				else
				{
					htmltext = "31852-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				if (getQuestItemsCount(player, PREDATOR_FANG) < 100)
				{
					htmltext = "31852-04.htm";
				}
				else
				{
					htmltext = "31852-05.htm";
					takeItems(player, PREDATOR_FANG, -1);
					
					final int n = getRandom(100);
					if (n < 10)
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_JACKPOT);
						rewardItems(player, EMERALD, 1);
					}
					else if (n < 30)
					{
						rewardItems(player, BLUE_ONYX, 1);
					}
					else if (n < 60)
					{
						rewardItems(player, ONYX, 1);
					}
					else
					{
						rewardItems(player, GLASS_SHARD, 1);
					}
					
					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;
		}
		
		switch (npc.getId())
		{
			case 20525:
			{
				giveItems(player, PREDATOR_FANG, getRandom(2, 3));
				if (getQuestItemsCount(player, PREDATOR_FANG) < 100)
				{
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				else
				{
					st.setCond(2, true);
				}
				break;
			}
			case 20530:
			{
				if (getRandom(10) < 8)
				{
					giveItems(player, PREDATOR_FANG, 1);
					if (getQuestItemsCount(player, PREDATOR_FANG) < 100)
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
					else
					{
						st.setCond(2, true);
					}
				}
				break;
			}
			case 20534:
			{
				if (getRandom(10) < 6)
				{
					giveItems(player, PREDATOR_FANG, getRandom(3) == 0 ? 1 : 2);
					if (getQuestItemsCount(player, PREDATOR_FANG) < 100)
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
					else
					{
						st.setCond(2, true);
					}
				}
				break;
			}
			case 20537:
			{
				giveItems(player, PREDATOR_FANG, 2);
				if (getQuestItemsCount(player, PREDATOR_FANG) < 100)
				{
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
				else
				{
					st.setCond(2, true);
				}
				break;
			}
		}
	}
}