ZURSULUS L2

Necromancer's Request

ID
632
Название
Necromancer's Request
start_npcs_json
[31522]
npc_ids_json
[]
constants_json
{"VAMPIRE_HEART":7542,"ZOMBIE_BRAIN":7543}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00632_NecromancersRequest/Q00632_NecromancersRequest.java

NPC квеста

Записей нет.

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

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

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

giveAdena(player, 120000, true);
giveItems(partyMember, ZOMBIE_BRAIN, 1);
giveItems(partyMember, VAMPIRE_HEART, 1);

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

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

[31522-01.htm] Mysterious Wizard: I'm looking for someone whose power is equal to the Lord of the Forest of the Dead! I have many servants, even if their heads are rotten. (This quest may only be undertaken by a character of level 64 and above.) [31522-02.htm] Mysterious Wizard: This land is fertile ground for the materials I need in my dark arts. The problem is, my servants all have rotten heads! I need someone to give me a hand cultivating the forest. Quest [31522-03.htm] Mysterious Wizard: The most important of the materials I need are undead hearts with their Human memory intact. Especially the grey heart of undead vampires. They're just as good as red cloth from Aden. I need 200 of them. Also, I'll trade you something for undead brains. You can hunt them at night. What do you think? [31522-04.htm] Mysterious Wizard: You don't have 200 vampire hearts yet. I'll trade you something for the dead's brains though. Trade the dead's brains. Continue hunting. Stop hunting. [31522-05.htm] Mysterious Wizard: Good, you brought 200 vampire hearts. I'll buy them with adena, but the undead brains aren't worth much. I'll trade you something else for them. "I'll sell you the vampire hearts." "I'll trade the brains." "I want to quit hunting." [31522-06.htm] Mysterious Wizard: Come on, that's not enough! Can you imagine how many hearts I need to dye a yard of cloth red with blood? Excellent material, equivalent to the red cloth of Aden, but infused with magical power. Please bring me more hearts. I'll trade you for the dead's brains anytime. Trade the dead's brains. Say you'll go and bring more vampire hearts. Say you want to quit. [31522-07.htm] Mysterious Wizard: One more favor. Collect 200 vampire hearts. Also, I'll trade you something for any undead brains you can scoop up. [31522-08.htm] Mysterious Wizard: That'll do. I have enough hearts now. [31522-09.htm] Mysterious Wizard: Are you sure you have 200 vampire hearts? Maybe you dropped some.
Исходник условий и наград (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.Q00632_NecromancersRequest;

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 Q00632_NecromancersRequest extends Quest
{
	// Monsters
	private static final int[] VAMPIRES =
	{
		21568,
		21573,
		21582,
		21585,
		21586,
		21587,
		21588,
		21589,
		21590,
		21591,
		21592,
		21593,
		21594,
		21595
	};
	private static final int[] UNDEADS =
	{
		21547,
		21548,
		21549,
		21551,
		21552,
		21555,
		21556,
		21562,
		21571,
		21576,
		21577,
		21579
	};
	
	// Items
	private static final int VAMPIRE_HEART = 7542;
	private static final int ZOMBIE_BRAIN = 7543;
	
	public Q00632_NecromancersRequest()
	{
		super(632, "Necromancer's Request");
		registerQuestItems(VAMPIRE_HEART, ZOMBIE_BRAIN);
		addStartNpc(31522); // Mysterious Wizard
		addTalkId(31522);
		addKillId(VAMPIRES);
		addKillId(UNDEADS);
	}
	
	@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("31522-03.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("31522-06.htm"))
		{
			if (getQuestItemsCount(player, VAMPIRE_HEART) >= 200)
			{
				st.setCond(1, true);
				takeItems(player, VAMPIRE_HEART, -1);
				giveAdena(player, 120000, true);
			}
			else
			{
				htmltext = "31522-09.htm";
			}
		}
		else if (event.equals("31522-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() < 63) ? "31522-01.htm" : "31522-02.htm";
				break;
			}
			case State.STARTED:
			{
				htmltext = (getQuestItemsCount(player, VAMPIRE_HEART) >= 200) ? "31522-05.htm" : "31522-04.htm";
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getRandomPartyMemberState(player, -1, 3, npc);
		if ((st == null) || !st.isStarted())
		{
			return;
		}
		
		final Player partyMember = st.getPlayer();
		for (int undead : UNDEADS)
		{
			if ((undead == npc.getId()) && (getRandom(100) < 33))
			{
				giveItems(partyMember, ZOMBIE_BRAIN, 1);
				playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				return;
			}
		}
		
		if (st.isCond(1) && getRandomBoolean())
		{
			giveItems(partyMember, VAMPIRE_HEART, 1);
			if (getQuestItemsCount(partyMember, VAMPIRE_HEART) < 200)
			{
				playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				st.setCond(2, true);
			}
		}
	}
}