ZURSULUS L2

Revenge of the Redbonnet

ID
291
Название
Revenge of the Redbonnet
start_npcs_json
[30553]
npc_ids_json
[]
constants_json
{"BLACK_WOLF_PELT":1482,"SCROLL_OF_ESCAPE":736,"GRANDMA_PEARL":1502,"GRANDMA_MIRROR":1503,"GRANDMA_NECKLACE":1504,"GRANDMA_HAIRPIN":1505}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00291_RevengeOfTheRedbonnet/Q00291_RevengeOfTheRedbonnet.java

NPC квеста

Записей нет.

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

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

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

rewardItems(player, GRANDMA_PEARL, 1);
rewardItems(player, GRANDMA_MIRROR, 1);
rewardItems(player, GRANDMA_NECKLACE, 1);
rewardItems(player, SCROLL_OF_ESCAPE, 1);
rewardItems(player, GRANDMA_HAIRPIN, 1);
giveItems(player, BLACK_WOLF_PELT, 1);

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

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

[30553-01.htm] Maryse Redbonnet: When I was 10, I decided to kill all the wolves in the world, because they killed my loving family. I didn't want this to happen to others, you see. That's why I became a wolf hunter... I still vividly remember my first kill... It was a wolf cub that was only a few days old... I killed it without mercy. After that, I killed every wolf that I saw! I killed hundreds, no, thousands of wolves! People saw me carrying a bundle of Wolf Pelts and called me the Redbonnet the horrible. I must kill wolves! I have to kill them all! (This quest may only be undertaken by a character of level 4 and above.) [30553-02.htm] Maryse Redbonnet: When I was 10, I decided to kill all the wolves in the world, because they killed my loving family. I didn't want this to happen to others, you see. That's why I became a wolf hunter... I still vividly remember my first kill... It was a wolf cub that was only a few days old. I killed it without mercy. After that, I killed every wolf that I saw! I killed hundreds, I mean, thousands of wolves! People saw me carrying a bundle of Wolf Pelts and called me the Redbonnet the horrible. But now I am too old to hunt wolves. So, someone should kill the wolves in my stead! I want to smell their blood... The bloody stench of the enemies who killed my family! Please... It is my wish... Please kill the wolves! Kill them all! Say you will grant the wish [30553-03.htm] Maryse Redbonnet: If you kill wolves for me, I will give you an article left by my grandmother as a reward! Kill the black wolves stalking everywhere outside the village right now! And strip their pelts and bring them to me! One or two is not enough! Of course not ... No way! I need many! Forty Wolf Pelts ...! Yes, bring back 40! Heh, heh, heh ... [30553-04.htm] Maryse Redbonnet: ... Forty Wolf Pelts! Is that too difficult a task? How come you didn't keep your promise? Somewhere right now, a young girl is being eaten by a wolf! I can see that! Run out of the village now and kill all the black wolves! I want to smell the blood of wolves! The bloody stench of my enemies! All the wolves in the world must be killed! [30553-05.htm] Maryse Redbonnet: Heh, heh, heh ... Yes, this is it ... Forty dead wolves ... Look, grandma! I killed this many wolves today as well! Aren't you happy, grandma? Aren't you? Aren't you? The horrible redbonnet is still strong! I told you! My grandma is very happy, too! My grandma wants me to give this to you. Here! Take it! It's for making my grandma happy ... All right! Take it now!
Исходник условий и наград (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.Q00291_RevengeOfTheRedbonnet;

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 Q00291_RevengeOfTheRedbonnet extends Quest
{
	// Quest items
	private static final int BLACK_WOLF_PELT = 1482;
	
	// Rewards
	private static final int SCROLL_OF_ESCAPE = 736;
	private static final int GRANDMA_PEARL = 1502;
	private static final int GRANDMA_MIRROR = 1503;
	private static final int GRANDMA_NECKLACE = 1504;
	private static final int GRANDMA_HAIRPIN = 1505;
	
	public Q00291_RevengeOfTheRedbonnet()
	{
		super(291, "Revenge of the Redbonnet");
		registerQuestItems(BLACK_WOLF_PELT);
		addStartNpc(30553); // Maryse Redbonnet
		addTalkId(30553);
		addKillId(20317);
	}
	
	@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("30553-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() < 4) ? "30553-01.htm" : "30553-02.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				if (cond == 1)
				{
					htmltext = "30553-04.htm";
				}
				else if (cond == 2)
				{
					htmltext = "30553-05.htm";
					takeItems(player, BLACK_WOLF_PELT, -1);
					
					final int random = getRandom(100);
					if (random < 3)
					{
						rewardItems(player, GRANDMA_PEARL, 1);
					}
					else if (random < 21)
					{
						rewardItems(player, GRANDMA_MIRROR, 1);
					}
					else if (random < 46)
					{
						rewardItems(player, GRANDMA_NECKLACE, 1);
					}
					else
					{
						rewardItems(player, SCROLL_OF_ESCAPE, 1);
						rewardItems(player, GRANDMA_HAIRPIN, 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, BLACK_WOLF_PELT, 1);
		if (getQuestItemsCount(player, BLACK_WOLF_PELT) < 40)
		{
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
		else
		{
			st.setCond(2, true);
		}
	}
}