ZURSULUS L2

Invaders of the Holy Land

ID
273
Название
Invaders of the Holy Land
start_npcs_json
[30566]
npc_ids_json
[]
constants_json
{"BLACK_SOULSTONE":1475,"RED_SOULSTONE":1476,"SOULSHOT_FOR_BEGINNERS":5789}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00273_InvadersOfTheHolyLand/Q00273_InvadersOfTheHolyLand.java

NPC квеста

Записей нет.

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

else if (player.getLevel() < 6)

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

giveAdena(player, reward, true);
giveItems(player, SOULSHOT_FOR_BEGINNERS, 6000);
giveItems(player, BLACK_SOULSTONE, 1);
giveItems(player, RED_SOULSTONE, 1);

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

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

[30566-00.htm] Atuba Chief Varkees: Did you think that I, Atuba Chief Varkees, would seek the help of the weak races like yours! Get out of my sight! (This quest may only be undertaken by an Orcish character.) [30566-01.htm] Atuba Chief Varkees: The almighty Flame Lord has ordered me, Varkees, to defeat the disgusting Rakeclaw Imps. Young Orc, have you experience in fighting against Rakeclaw Imps? They are creatures created from the power of black magic. These blasphemous creatures are defiling our Holy Land even as we speak! I do not think that these petty creatures are brave enough to face us Orcs. There must be someone behind them! I will find out the secret powers controlling them, no matter what! (This quest may only be undertaken by a character of level 6 and above.) [30566-02.htm] Atuba Chief Varkees: The almighty Flame Lord has ordered me, Varkees, to defeat these foreigners called the Rakeclaw Imps! Young Orc, have you experience in fighting against the Rakeclaw Imps? They are magical creatures created from the power of dark magic. These blasphemous creatures are defiling our Holy Land even as we speak! I, Varkees, do not think that these petty creatures are brave enough to face Orcs on their own. According to the seers, a jewel called the soulstone is embedded in the hearts of Rakeclaw Imps. This soulstone attaches itself to its host and steals the host's spirit, allowing dark magicians to bend the creatures to their will! The seers have revealed this truth to me, Varkees. That if we gather enough soulstones, we will be able to turn their own powers against them and find out who is controlling the imps. I, the Atuba Chief Varkees, command you! Defeat the foreigners who have invaded our Holy Land, and bring the soulstones embedded in their hearts! Say you will take his orders [30566-03.htm] Atuba Chief Varkees: Tejakar Pa'agrio! Well then, young Orc, go at once and defeat the Rakeclaw Imps, collect their soulstones, and bring them back to me! I, the Atuba Chief Varkees, will reward you based on the number of soulstones you bring! But, listen well! Although the soulstones are originally red, they turn black when they assimilate with the host. Imps are weak-minded, so most of the soulstones in the hearts of the imps will have turned black. But some of the strong-minded ones might still have Red Soulstones. Should you bring me a Red Soulstone, I will give you an even greater reward! [30566-04.htm] Atuba Chief Varkees: Young Orc, why do you not keep your promise to me, Varkees?! Go at once from the village to punish the Rakeclaw Imps who have invaded our land, and bring me the soulstones that are imbedded in their hearts! Say you will quit Say you will continue [30566-05.htm] Atuba Chief Varkees: Tejakar Pa'agrio! You've done well, young Orc. Though the Red Soulstone has not yet been found, the black soulstones you have brought will be of great aid in revealing the powers controlling the imps! As promised I, Atuba Chief Varkees, will reward you for each of the soulstones you have brought. Young Orc who has fought for our pride, this is a fair compensation for your hard work and sacrifice. Say you will quit Say you will continue [30566-06.htm] Atuba Chief Varkees: Tejakar Pa'agrio! Is this not the Red Soulstone! You've done well, young Orc. A job well done, indeed! With this, the seers will be able to use their sorcery and find out the powers that are controlling the imps! I, the Atuba Chief Varkees, hereby reward you. As I promised, I will compensate you for each of the soulstones you have brought me. Young Orc who has fought for our honor, this is the reward for your hard work and sacrifice. So do not refuse! Say you will quit Say you will continue [30566-07.htm] Atuba Chief Varkees: Quit?! Our revenge against the invaders of our Holy Land has only just begun. At a time like this, why do you desire to withdraw your weapons and walk away from the battle? Don't tell me you are frightened? Young Orc, have you forgotten the faith of our race! Orcs never retreat from the battlefield! [30566-08.htm] Atuba Chief Varkees: I, Varkees, will find out the powers controlling the imps by performing a countertracking spell with the seers. While I am doing this, young Orc, continue to fight for the honor of our race! Tejakar Pa'agrio!
Исходник условий и наград (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.Q00273_InvadersOfTheHolyLand;

import org.l2jmobius.gameserver.config.GeneralConfig;
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;
import org.l2jmobius.gameserver.mechanics.variables.PlayerVariables;

public class Q00273_InvadersOfTheHolyLand extends Quest
{
	// Items
	private static final int BLACK_SOULSTONE = 1475;
	private static final int RED_SOULSTONE = 1476;
	
	// Reward
	private static final int SOULSHOT_FOR_BEGINNERS = 5789;
	
	public Q00273_InvadersOfTheHolyLand()
	{
		super(273, "Invaders of the Holy Land");
		registerQuestItems(BLACK_SOULSTONE, RED_SOULSTONE);
		addStartNpc(30566); // Varkees
		addTalkId(30566);
		addKillId(20311, 20312, 20313);
	}
	
	@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("30566-03.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30566-07.htm"))
		{
			st.exitQuest(true, true);
		}
		
		return htmltext;
	}
	
	@Override
	public String onTalk(Npc npc, Player player)
	{
		final QuestState st = getQuestState(player, true);
		String htmltext = getNoQuestMsg(player);
		
		switch (st.getState())
		{
			case State.CREATED:
			{
				if (player.getRace() != Race.ORC)
				{
					htmltext = "30566-00.htm";
				}
				else if (player.getLevel() < 6)
				{
					htmltext = "30566-01.htm";
				}
				else
				{
					htmltext = "30566-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int red = getQuestItemsCount(player, RED_SOULSTONE);
				final int black = getQuestItemsCount(player, BLACK_SOULSTONE);
				if ((red + black) == 0)
				{
					htmltext = "30566-04.htm";
				}
				else
				{
					if (red == 0)
					{
						htmltext = "30566-05.htm";
					}
					else
					{
						htmltext = "30566-06.htm";
					}
					
					int reward = (black * 3) + (red * 10);
					if (!GeneralConfig.ALT_VILLAGES_REPEATABLE_QUEST_REWARD)
					{
						reward += ((black >= 10) ? ((red >= 1) ? 1800 : 1500) : 0);
					}
					
					takeItems(player, BLACK_SOULSTONE, -1);
					takeItems(player, RED_SOULSTONE, -1);
					giveAdena(player, reward, true);
					
					// Give newbie reward if player is eligible.
					if (player.isNewbie() && (st.getInt("Reward") == 0))
					{
						int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEWBIE_SHOTS_RECEIVED, 0);
						if (newPlayerRewardsReceived < 1)
						{
							giveItems(player, SOULSHOT_FOR_BEGINNERS, 6000);
							st.playTutorialVoice("tutorial_voice_026");
							st.set("Reward", "1");
							player.getVariables().set(PlayerVariables.NEWBIE_SHOTS_RECEIVED, ++newPlayerRewardsReceived);
						}
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getQuestState(player, false);
		if ((st == null) || !st.isStarted())
		{
			return;
		}
		
		final int npcId = npc.getId();
		int probability = 77;
		if (npcId == 20311)
		{
			probability = 90;
		}
		else if (npcId == 20312)
		{
			probability = 87;
		}
		
		if (getRandom(100) <= probability)
		{
			giveItems(player, BLACK_SOULSTONE, 1);
		}
		else
		{
			giveItems(player, RED_SOULSTONE, 1);
		}
		
		playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
	}
}