ZURSULUS L2

Skirmish with the Werewolves

ID
274
Название
Skirmish with the Werewolves
start_npcs_json
[30569]
npc_ids_json
[]
constants_json
{"NECKLACE_OF_VALOR":1507,"NECKLACE_OF_COURAGE":1506,"MARAKU_WEREWOLF_HEAD":1477,"MARAKU_WOLFMEN_TOTEM":1501}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00274_SkirmishWithTheWerewolves/Q00274_SkirmishWithTheWerewolves.java

NPC квеста

Записей нет.

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

else if (player.getLevel() < 9)

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

giveAdena(player, amount, true);
giveItems(player, MARAKU_WEREWOLF_HEAD, 1);
giveItems(player, MARAKU_WOLFMEN_TOTEM, 1);

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

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

[30569-00.htm] Prefect Brukurse: Your courage is admirable, small creature of another race! However, I have no task to give to a weak one like you! (This quest may only be undertaken by an Orcish character.) [30569-01.htm] Prefect Brukurse: This Immortal Plateau has been the holiest land of the Orcs since ancient times! The place where our progenitor -- made by the great Pa'agrio of the flame -- took his first steps, is none other than the Immortal Plateau. However, there is a group of fools that will not understand that this land belongs to us. These wolfmen call themselves maraku and challenge us for our land. The Flame Lord Kakai sent an envoy to the wolfmen and politely asked them to leave this land! But they replied to his civil request by returning the envoy's head! We will mercilessly punish those who repay our good will with blood! So, you should not go and prepare yourself for vengeance! (This quest may only be undertaken by a character of level 9 and above.) [30569-02.htm] Prefect Brukurse: This Immortal Plateau has been the holiest land of the Orcs since ancient times! The place where our progenitor -- made by the great Pa'agrio of flame -- took his first steps, is none other than the Immortal Plateau. However, there is a group of fools that will not understand that this land belongs to us. These wolfmen call themselves maraku and challenge us for our land. The Flame Lord Kakai sent an envoy to the wolfmen and politely asked them to leave this land! But they replied to his civil request by returning the envoy's head! How dare they repay our good will with blood! Blood for blood! As things have turned out this way, I of course cannot let a single werewolf live. The wolfmen brought this upon themselves! The lord has ordered us to punish these rash fools without pity. Young Orc! Will you not fight for the dignity of your race? Say that you will fight the werewolves [30569-03.htm] Prefect Brukurse: Tejakar Oroka! Young Orc, go to the wilderness right now and kill those maraku wolfmen without mercy! Collect forty of their severed heads and bring them back to me! The maraku tribe leaders are quite powerful so be careful when you deal with them! I will pierce the heads of that proud race with spears, and display them outside the village! They will realize the high price of arousing our anger! Here! Go off and fight! [30569-04.htm] Prefect Brukurse: Young Orc, have you come back already? The punishment of those maraku wolfmen who dare to challenge us has not ended yet! Don't even think about coming back here until you have forty werewolf heads! [30569-05.htm] Prefect Brukurse: Tejakar Oroka! Well done indeed, my young Orc! The severed heads of the werewolves that you brought back will all be skewered on spears and placed outside the village. We will show the world the consequences of challenging us! But the maraku wolfmen will not retreat so easily! This is not the end of the war against them. You should take a short rest and restore your energy! However, grease your weapon, tighten the laces on your armor so they do not become loose, and remain prepared to fight at any moment! [30569-06.htm] Prefect Brukurse: Tejakar Oroka! Well done indeed, my young Orc! The crude item in your hand is a totem worshipped by the wolfmen! That is a great war trophy to commemorate this battle. But if you are not interested in trophies, you can sell it to the merchants. I heard some brothers will pay a fortune to get those trophies, maybe to show off their valor! The severed heads of the werewolves that you have brought back will be skewered on spears and placed outside the village. We will show the world the consequences of daring to challenge our race! But the maraku wolfmen will not retreat so easily! This is not the end of the war against them. You should take a short rest and restore your energy! However, keep your weapons greased and tighten the laces on your armor to remain always prepared to fight! [30569-07.htm] Prefect Brukurse: This Immortal Plateau has been the holiest of lands for the Orcs since ancient times! The place where our progenitor -- made by the great Pa'agrio of flame -- took his first steps, is none other than the Immortal Plateau. However, there is a group of fools that refuses to understand that this land belongs to us. These wolfmen call themselves maraku and challenge us for our land. The Flame Lord Kakai sent an envoy to the wolfmen and asked them to leave this land! But they replied to his civil request by returning the envoy's head! We will mercilessly punish those who repay our good will with blood! I look at your eyes and I can tell that your blood is boiling with anger already! However, if you wish to fight for the dignity of your race, you must first be acknowledged as an Orc Fighter. Go on to Praetorian Rukain and test your courage! (This quest may only be undertaken by a character possessing the necklace of valor or the necklace of courage.)
Исходник условий и наград (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.Q00274_SkirmishWithTheWerewolves;

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 Q00274_SkirmishWithTheWerewolves extends Quest
{
	// Needed items
	private static final int NECKLACE_OF_VALOR = 1507;
	private static final int NECKLACE_OF_COURAGE = 1506;
	
	// Items
	private static final int MARAKU_WEREWOLF_HEAD = 1477;
	private static final int MARAKU_WOLFMEN_TOTEM = 1501;
	
	public Q00274_SkirmishWithTheWerewolves()
	{
		super(274, "Skirmish with the Werewolves");
		registerQuestItems(MARAKU_WEREWOLF_HEAD, MARAKU_WOLFMEN_TOTEM);
		addStartNpc(30569);
		addTalkId(30569);
		addKillId(20363, 20364);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		final QuestState st = player.getQuestState(getName());
		final String htmltext = event;
		if (st == null)
		{
			return htmltext;
		}
		
		if (event.equals("30569-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.ORC)
				{
					htmltext = "30569-00.htm";
				}
				else if (player.getLevel() < 9)
				{
					htmltext = "30569-01.htm";
				}
				else if (hasAtLeastOneQuestItem(player, NECKLACE_OF_COURAGE, NECKLACE_OF_VALOR))
				{
					htmltext = "30569-02.htm";
				}
				else
				{
					htmltext = "30569-07.htm";
				}
				break;
			}
			case State.STARTED:
			{
				if (st.isCond(1))
				{
					htmltext = "30569-04.htm";
				}
				else
				{
					htmltext = "30569-05.htm";
					
					final int amount = 3500 + (getQuestItemsCount(player, MARAKU_WOLFMEN_TOTEM) * 600);
					takeItems(player, MARAKU_WEREWOLF_HEAD, -1);
					takeItems(player, MARAKU_WOLFMEN_TOTEM, -1);
					giveAdena(player, amount, 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;
		}
		
		giveItems(player, MARAKU_WEREWOLF_HEAD, 1);
		if (getQuestItemsCount(player, MARAKU_WEREWOLF_HEAD) < 40)
		{
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
		else
		{
			st.setCond(2, true);
		}
		
		if (getRandom(100) < 6)
		{
			giveItems(player, MARAKU_WOLFMEN_TOTEM, 1);
		}
	}
}