ZURSULUS L2

Keen Claws

ID
264
Название
Keen Claws
start_npcs_json
[30136]
npc_ids_json
[]
constants_json
{"WOLF_CLAW":1367,"LEATHER_SANDALS":36,"WOODEN_HELMET":43,"STOCKINGS":462,"HEALING_POTION":1061,"SHORT_GLOVES":48,"CLOTH_SHOES":35}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00264_KeenClaws/Q00264_KeenClaws.java

NPC квеста

Записей нет.

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

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

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

giveItems(player, WOODEN_HELMET, 1);
giveAdena(player, 1000, true);
giveItems(player, LEATHER_SANDALS, 1);
giveItems(player, STOCKINGS, 1);
giveAdena(player, 50, true);
giveItems(player, HEALING_POTION, 1);
giveItems(player, SHORT_GLOVES, 1);
giveItems(player, CLOTH_SHOES, 1);
giveItems(player, WOLF_CLAW, (getRandomBoolean() ? 1 : 2) * ((npc.getId() == 20003) ? 2 : 1));

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

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

[30136-01.htm] Trader Payne: The arrows sold in this store are specially crafted by my hands. As you know, the shaft is made from ash and the tips are made from steel or adamantium. But sometimes I get orders for custom-made arrows. For example, the Assassin Kiel Nighthawk has ordered a claw-shaped arrowhead made of Wolf Claws. He is away at the siege battle in Giran right now, but I am sure he will order arrowheads again when he returns. I'd like you to help me gather the Wolf Claws when that time comes. (This quest may only be undertaken by a character of level 3 and above.) [30136-02.htm] Trader Payne: The arrows sold in this store are specially crafted by my hands. As you know, the shaft is made from ash and the tips are made from steel or adamantium. But sometimes I get orders for custom-made arrows. Just a few days ago, Assassin Kiel Nighthawk placed an order for claw-shaped arrows made from Wolf Claws. Hooked arrows made from claws are difficult to pull out once they are lodged in the body, and create great internal wounds. Kiel said that he had to leave for a castle siege soon and to complete the arrows within a week. However, time is too short and I must ask your assistance. Could you help me gather the Wolf Claws? Say you will help [30136-03.htm] Trader Payne: Thank you. Your task is fairly simple. Collect fifty Wolf Claws and bring them to me. You can acquire the claws by hunting the ashen wolves or goblins outside of the village. The lowest goblins have crude talismans made by stringing Wolf Claws. As a reward for helping me, I will give you one of the defense items from my store. I swear on the eye of Shilen which observes everything, that I will faithfully fulfill the terms of our Contract. Wonderful! I thank you in advance. There is not much time, so please hurry. [30136-04.htm] Trader Payne: According to the Contract we have entered into, you must gather fifty Wolf Claws and bring them to me. You can acquire the claws by hunting the ashen wolves or goblins outside of the village. The lowest goblins have crude talismans made by stringing Wolf Claws. Now hurry! There is not much time left. [30136-05.htm] Trader Payne: Thank you. I see you have brought me fifty Wolf Claws. Now I can start on the special arrows that Kiel has ordered. I hope I can finish them in time, before he leaves for Pabel. According to our Contract, I will give you this. It may not be flashy, but it is light and very strong, and will surely be useful one day. Now, shall we go our separate ways? May the shelter of the abyss envelope you until we meet 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.Q00264_KeenClaws;

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 Q00264_KeenClaws extends Quest
{
	// Item
	private static final int WOLF_CLAW = 1367;
	
	// Rewards
	private static final int LEATHER_SANDALS = 36;
	private static final int WOODEN_HELMET = 43;
	private static final int STOCKINGS = 462;
	private static final int HEALING_POTION = 1061;
	private static final int SHORT_GLOVES = 48;
	private static final int CLOTH_SHOES = 35;
	
	public Q00264_KeenClaws()
	{
		super(264, "Keen Claws");
		registerQuestItems(WOLF_CLAW);
		addStartNpc(30136); // Payne
		addTalkId(30136);
		addKillId(20003, 20456); // Goblin, Wolf
	}
	
	@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("30136-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:
			{
				htmltext = (player.getLevel() < 3) ? "30136-01.htm" : "30136-02.htm";
				break;
			}
			case State.STARTED:
			{
				final int count = getQuestItemsCount(player, WOLF_CLAW);
				if (count < 50)
				{
					htmltext = "30136-04.htm";
				}
				else
				{
					htmltext = "30136-05.htm";
					takeItems(player, WOLF_CLAW, -1);
					
					final int n = getRandom(17);
					if (n == 0)
					{
						giveItems(player, WOODEN_HELMET, 1);
						playSound(player, QuestSound.ITEMSOUND_QUEST_JACKPOT);
					}
					else if (n < 2)
					{
						giveAdena(player, 1000, true);
					}
					else if (n < 5)
					{
						giveItems(player, LEATHER_SANDALS, 1);
					}
					else if (n < 8)
					{
						giveItems(player, STOCKINGS, 1);
						giveAdena(player, 50, true);
					}
					else if (n < 11)
					{
						giveItems(player, HEALING_POTION, 1);
					}
					else if (n < 14)
					{
						giveItems(player, SHORT_GLOVES, 1);
					}
					else
					{
						giveItems(player, CLOTH_SHOES, 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;
		}
		
		giveItems(player, WOLF_CLAW, (getRandomBoolean() ? 1 : 2) * ((npc.getId() == 20003) ? 2 : 1));
		if (getQuestItemsCount(player, WOLF_CLAW) >= 50)
		{
			st.setCond(2, true);
		}
		else
		{
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}