ZURSULUS L2

Attack Sailren!

ID
641
Название
Attack Sailren!
start_npcs_json
[32109]
npc_ids_json
[32109]
constants_json
{"STATUE":32109,"GAZKH_FRAGMENT":8782,"GAZKH":8784}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00641_AttackSailren/Q00641_AttackSailren.java

NPC квеста

IDНазваниеСтарт квестаУровень
32109Shilen's Stone StatueДа70

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

if (player.getLevel() < 77)

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

giveItems(player, GAZKH, 1);
giveItems(partyMember, GAZKH_FRAGMENT, 1);

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

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

[32109-1.htm] Shilen's Stone Statue: You are the one with the Elrokian warrior's spirit! Did you discover the whereabouts of Gazkh's fragments? Tell the statue about decrypting the password that Asamah talked about. [32109-2.htm] Shilen's Stone Statue: Infidel! To even touch sacred Shilen's statue, much less seek to awaken Shilen's avatar! For this insult, you deserve eternal punishment! But I see that you are an ignorant fool, so I will forgive your error. Now begone! [32109-3.htm] Shilen's Stone Statue: I am Shilen's avatar. Shilen commanded me to watch over this island and protect it from evil beings. The duty is growing increasingly difficult. But I have prayed to Shilen and she has decreed that she would send a warrior who can defeat the threat we face. Are you the one? No... You are too weak to be the warrior mother Shilen spoke of. (This quest may only be undertaken by a character of level 77 and above.) [32109-4.htm] Shilen's Stone Statue: Ah? So, the dinosaurs themselves contain some fragments of Gazkh? I suppose that it is possible...if the axe was broken and the fragments were scattered by the force Shilen used to seal Sailren. The predator dinosaurs here have skin harder than iron -- I doubt they would ever feel the fragments embedded in their hides. In fact, the very power of Gazkh has probably greatly extended their lifespans. You who contain an ancient Elrokian spirit, you are the only one who can hunt those dinosaurs and bring back the Gazkh fragments. Choose now. Will you attempt to recover the fragments? Say yes. [32109-5.htm] Shilen's Stone Statue: Very well. Yes, you are truly the one sent by mother Shilen... Listen carefully as I tell you about the dinosaurs that may contain Gazkh fragments. You will encounter predatory dinosaurs such as Velociraptor and Pterosaur. They are not as strong as Sailren, but vicious nevertheless. These are the most likely to contain the fragments. Go and hunt them -- find the fragments! Remember, you must return with at least 30 fragments. If you bring me 30 fragments or more, I will reforge them into an intact axe head. Ah, could our deliverance finally be at hand? May Shilen help you strike true! [32109-6.htm] Shilen's Stone Statue: The number of items is incorrect. Listen carefully! You will encounter predatory dinosaurs such as Velociraptor and Pterosaur. They are not as strong as Sailren, but vicious nevertheless. These are the most likely to contain the fragments. Go and hunt them -- find the fragments! Remember, you must return with at least 30 fragments. If you bring me 30 fragments or more, I will reforge them into an intact axe head. Ah, could our deliverance finally be at hand? May Shilen help you strike true! [32109-7.htm] Shilen's Stone Statue: You have brought all the Gazkh fragments! Shilen be praised! The power of the seal stones to guard that dangerous Sailren will be increased now that an Elrokian warrior again wields Gazkh. You are indeed the chosen of Shilen! The task is now yours. Are you ready to face the monsters within? "I'm ready." [32109-8.htm] Shilen's Stone Statue: Very well. By the power of Shilen, Gazkh has been restored. It possesses the powers that can defeat Sailren. You are now the true master of Gazkh. Shilen has decreed that the one who can wield Gazkh can defeat Sailren. Go now and defeat that evil dinosaur! Save this island and its people. Let me aid you one final time by giving you some additional guidance.
Исходник условий и наград (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.Q00641_AttackSailren;

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;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;

import quests.Q00126_TheNameOfEvil2.Q00126_TheNameOfEvil2;

public class Q00641_AttackSailren extends Quest
{
	// NPC
	private static final int STATUE = 32109;
	
	// Quest Item
	private static final int GAZKH_FRAGMENT = 8782;
	private static final int GAZKH = 8784;
	
	public Q00641_AttackSailren()
	{
		super(641, "Attack Sailren!");
		registerQuestItems(GAZKH_FRAGMENT);
		addStartNpc(STATUE);
		addTalkId(STATUE);
		addKillId(22196, 22197, 22198, 22199, 22218, 22223);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		final QuestState st = player.getQuestState(getName());
		if (st == null)
		{
			return null;
		}
		
		String htmltext = event;
		
		if (event.equals("32109-5.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("32109-8.htm"))
		{
			if (getQuestItemsCount(player, GAZKH_FRAGMENT) >= 30)
			{
				npc.broadcastPacket(new MagicSkillUse(npc, player, 5089, 1, 3000, 0));
				takeItems(player, GAZKH_FRAGMENT, -1);
				giveItems(player, GAZKH, 1);
				st.exitQuest(true, true);
			}
			else
			{
				htmltext = "32109-6.htm";
				st.setCond(1);
			}
		}
		
		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.getLevel() < 77)
				{
					htmltext = "32109-3.htm";
				}
				else
				{
					final QuestState st2 = player.getQuestState(Q00126_TheNameOfEvil2.class.getSimpleName());
					htmltext = ((st2 != null) && st2.isCompleted()) ? "32109-1.htm" : "32109-2.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				if (cond == 1)
				{
					htmltext = "32109-5.htm";
				}
				else if (cond == 2)
				{
					htmltext = "32109-7.htm";
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState qs = getRandomPartyMemberState(player, 1, 3, npc);
		if (qs == null)
		{
			return;
		}
		
		final Player partyMember = qs.getPlayer();
		final QuestState st = getQuestState(partyMember, false);
		if (st == null)
		{
			return;
		}
		
		if (getRandom(100) < 5)
		{
			giveItems(partyMember, GAZKH_FRAGMENT, 1);
			if (getQuestItemsCount(partyMember, GAZKH_FRAGMENT) < 30)
			{
				playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				st.setCond(2, true);
			}
		}
	}
}