ZURSULUS L2

The Clan's Prestige

ID
509
Название
The Clan's Prestige
start_npcs_json
[31331]
npc_ids_json
[25290,25293,25322,25514,25523,31331]
constants_json
{"VALDIS":31331,"DAIMON_THE_WHITE_EYED":25290,"HESTIA_GUARDIAN_DEITY":25293,"PLAGUE_GOLEM":25523,"DEMONS_AGENT_FALSTON":25322,"QUEEN_SHYEED":25514,"DAIMONS_EYES":8489,"HESTIAS_FAIRY_STONE":8490,"NUCLEUS_OF_LESSER_GOLEM":8491,"FALSTON_FANG":8492,"SHAIDS_TALON":8493}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00509_AClansFame/Q00509_AClansFame.java

NPC квеста

IDНазваниеСтарт квестаУровень
25290Daimon the White-EyedНет78
25293Hesti Guardian Deity of the Hot SpringsНет78
25322Demon's Agent FalstonНет66
25514Queen ShyeedНет80
25523Plague GolemНет73
31331ValdisДа70

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

else if (clan.getLevel() < 6)

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

giveItems(clanLeader, item, 1);

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

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

[31331-0.htm] Grand Magister Valdis: Take your pick! Daimon the White-Eyed Hestia, Guardian Deity of the Hot Springs Plague Golem Demon's Agent Falston Queen Shyeed [31331-0a.htm] Grand Magister Valdis: Hearing this, you may think that the place has the bustling atmosphere of a metropolitan area. But due to its proximity to the border with Elmore, it always tends to maintain a somewhat tense atmosphere. The two types of atmosphere were always co-mingling and created a unique balance for years. But an increasing number of powerful monsters started to be a major menace to this balance. Of course we, the honorable citizens of Rune can not get our hands bloody nor pose a risk to our personal belongings by sending the city guards into the task of making these daemons to retreat. However, if we find some private army brave enough to join forces with us, there's one thing we can surely grant as a payment given our position and influence, and Reputation it is. I can see you're not the kind of people with the vein of a leader, so we have nothing to talk about. (This quest may only be undertaken by a leader of a clan level 6 and above.) [31331-0b.htm] Grand Magister Valdis: Hearing this, you may think that the place has the bustling atmosphere of a metropolitan area. But due to its proximity to the border with Elmore, it always tends to maintain a somewhat tense atmosphere. The two types of atmosphere were always co-mingling and created a unique balance for years. But an increasing number of powerful monsters started to be a major menace to this balance. Of course we, the honorable citizens of Rune can not get our hands bloody nor pose a risk to our personal belongings by sending the city guards into the task of making these daemons to retreat. However, if we find some private army brave enough to join forces with us, there's one thing we can surely grant as a payment given our position and influence, and Reputation it is. I've been told you lead a personal army, but i'm afraid your fellows may lack the strength required for we to engage in a business. (This quest may only be undertaken by a leader of a clan level 6 and above.) [31331-0c.htm] Grand Magister Valdis: Hearing this, you may think that the place has the bustling atmosphere of a metropolitan area. But due to its proximity to the border with Elmore, it always tends to maintain a somewhat tense atmosphere. The two types of atmosphere were always co-mingling and created a unique balance for years. But an increasing number of powerful monsters known as Raid Bosses started to terrorize town's people and are a major menace to this balance. Of course we, the honorable citizens of Rune can not get our hands bloody nor pose a risk to our personal belongings by sending the city guards into the task of making these daemons to retreat. However, if we find some private army brave enough to join forces with us, there's one thing we can surely grant as a payment given our position and influence, and Reputation it is. I've been told you lead a personal army. Of course we know a leader like you won't have to risk his life on the task, so if you can grant your subordinates will accomplish our requests i can give you further details, what you say? Yes, my clan will help you [31331-1.htm] Grand Magister Valdis: Very good! Destroy Daimon, the white-Eyed and bring me Daimon's Eyes. Remember, you don't need to do the killing yourself! Just stand back and let your Clan to do the work for you! [31331-1a.htm] Grand Magister Valdis: Too bad! Destroy Daimon, the white-Eyed and bring me Daimon's Eyes. Remember, you don't need to do the killing yourself! Just stand back and let your Clan to do the work for you! "I want to try another Raid Boss." "I want to quit this mission." [31331-1b.htm] Grand Magister Valdis: Excellent! I'll spread the word of your mighty Clan's defeat of the Daimon, the white-Eyed. "I want to kill some more Raid Bosses!" "I want to quit this mission." [31331-2.htm] Grand Magister Valdis: Very good! Destroy Hestia, Guardian Deity of the Hot Springs and bring me Hestia's Fairy Stone. Remember, you don't need to do the killing yourself! Just stand back and let your Clan to do the work for you! [31331-2a.htm] Grand Magister Valdis: Too bad! Destroy Hestia, Guardian Deity of the Hot Springs and bring me Hestia's Fairy Stone. Remember, you don't need to do the killing yourself! Just stand back and let your Clan to do the work for you! "I want to try another Raid Boss." "I want to quit this mission." [31331-2b.htm] Grand Magister Valdis: Excellent! I'll spread the word of your mighty Clan's defeat of the Hestia, Guardian Deity of the Hot Springs. "I want to kill some more Raid Bosses!" "I want to quit this mission." [31331-3.htm] Grand Magister Valdis: Very good! Destroy Plague Golem and bring me Nucleus of Lesser Golem. Remember, you don't need to do the killing yourself! Just stand back and let your Clan to do the work for you! [31331-3a.htm] Grand Magister Valdis: Too bad! Destroy Plague Golem and bring me Nucleus of Lesser Golem. Remember, you don't need to do the killing yourself! Just stand back and let your Clan to do the work for you! "I want to try another Raid Boss." "I want to quit this mission." [31331-3b.htm] Grand Magister Valdis: Excellent! I'll spread the word of your mighty Clan's defeat of the Plague Golem. "I want to kill some more Raid Bosses!" "I want to quit this mission." [31331-4.htm] Grand Magister Valdis: Very good! Destroy Demon's Agent Falston and bring me Falston's Fang. Remember, you don't need to do the killing yourself! Just stand back and let your Clan to do the work for you! [31331-4a.htm] Grand Magister Valdis: Too bad! Destroy Demon's Agent Falston and bring me Falston's Fang. Remember, you don't need to do the killing yourself! Just stand back and let your Clan to do the work for you! "I want to try another Raid Boss." "I want to quit this mission." [31331-4b.htm] Grand Magister Valdis: Excellent! I'll spread the word of your mighty Clan's defeat of the Demon's Agent Falston. "I want to kill some more Raid Bosses!" "I want to quit this mission." [31331-5.htm] Grand Magister Valdis: Very good! Destroy Queen Shyeed and bring me Shaid's Talon. Remember, you don't need to do the killing yourself! Just stand back and let your Clan to do the work for you! [31331-5a.htm] Grand Magister Valdis: Too bad! Destroy Queen Shyeed and bring me Shaid's Talon. Remember, you don't need to do the killing yourself! Just stand back and let your Clan to do the work for you! "I want to try another Raid Boss." "I want to quit this mission." [31331-5b.htm] Grand Magister Valdis: Excellent! I'll spread the word of your mighty Clan's defeat of the Queen Shyeed. "I want to kill some more Raid Bosses!" "I want to quit this mission." [31331-6.htm] Grand Magister Valdis: I believe that leaders are expected to supply two things most of all. One is a compelling vision or sense of purpose for the group. And you bear a special responsibility to articulate that vision, and in a very compelling fashion. And the second thing is to provide clear decisions. Doing that requires data collection and consultation, but ultimately leaders must set a direction. Anyway you're welcome whenever you change your mind and decide we'd need to discuss the reputation of your clan again. Farewell, and may we meet again in happier times.
Исходник условий и наград (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.Q00509_AClansFame;

import org.l2jmobius.commons.util.StringUtil;
import org.l2jmobius.gameserver.config.PlayerConfig;
import org.l2jmobius.gameserver.entity.actor.Npc;
import org.l2jmobius.gameserver.entity.actor.Player;
import org.l2jmobius.gameserver.entity.clan.Clan;
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.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.PledgeShowInfoUpdate;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;

public class Q00509_AClansFame extends Quest
{
	// NPCs
	private static final int VALDIS = 31331;
	
	// Raid Bosses
	private static final int DAIMON_THE_WHITE_EYED = 25290;
	private static final int HESTIA_GUARDIAN_DEITY = 25293;
	private static final int PLAGUE_GOLEM = 25523;
	private static final int DEMONS_AGENT_FALSTON = 25322;
	private static final int QUEEN_SHYEED = 25514;
	
	// Items
	private static final int DAIMONS_EYES = 8489;
	private static final int HESTIAS_FAIRY_STONE = 8490;
	private static final int NUCLEUS_OF_LESSER_GOLEM = 8491;
	private static final int FALSTON_FANG = 8492;
	private static final int SHAIDS_TALON = 8493;
	
	// Reward list (itemId, minClanPoints, maxClanPoints)
	private static final int[][] REWARD_LIST =
	{
		// @formatter:off
		{DAIMON_THE_WHITE_EYED, DAIMONS_EYES, 180, 215},
		{HESTIA_GUARDIAN_DEITY, HESTIAS_FAIRY_STONE, 430, 465},
		{PLAGUE_GOLEM, NUCLEUS_OF_LESSER_GOLEM, 380, 415},
		{DEMONS_AGENT_FALSTON, FALSTON_FANG, 220, 255},
		{QUEEN_SHYEED, SHAIDS_TALON, 130, 165}
	};
	
	// Radar
	private static final int[][] radar =
	{
		{186320, -43904, -3175},
		{134672, -115600, -1216},
		{170000, -59900, -3848},
		{93296, -75104, -1824},
		{79635, -55612, -5980}
		// @formatter:on
	};
	
	public Q00509_AClansFame()
	{
		super(509, "The Clan's Prestige");
		registerQuestItems(DAIMONS_EYES, HESTIAS_FAIRY_STONE, NUCLEUS_OF_LESSER_GOLEM, FALSTON_FANG, SHAIDS_TALON);
		addStartNpc(VALDIS);
		addTalkId(VALDIS);
		addKillId(DAIMON_THE_WHITE_EYED, HESTIA_GUARDIAN_DEITY, PLAGUE_GOLEM, DEMONS_AGENT_FALSTON, QUEEN_SHYEED);
	}
	
	@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 (StringUtil.isNumeric(event))
		{
			final int evt = Integer.parseInt(event);
			st.set("raid", event);
			htmltext = "31331-" + event + ".htm";
			
			final int x = radar[evt - 1][0];
			final int y = radar[evt - 1][1];
			final int z = radar[evt - 1][2];
			if ((x + y + z) > 0)
			{
				addRadar(player, x, y, z);
			}
			
			st.startQuest();
		}
		else if (event.equals("31331-6.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);
		
		final Clan clan = player.getClan();
		
		switch (st.getState())
		{
			case State.CREATED:
			{
				if (!player.isClanLeader())
				{
					st.exitQuest(true);
					htmltext = "31331-0a.htm";
				}
				else if (clan.getLevel() < 6)
				{
					st.exitQuest(true);
					htmltext = "31331-0b.htm";
				}
				else
				{
					htmltext = "31331-0c.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int raid = st.getInt("raid");
				if (st.isCond(1))
				{
					final int item = REWARD_LIST[raid - 1][1];
					final int count = getQuestItemsCount(player, item);
					final int reward = getRandom(REWARD_LIST[raid - 1][2], REWARD_LIST[raid - 1][3]);
					if (count == 0)
					{
						htmltext = "31331-" + raid + "a.htm";
					}
					else if (count == 1)
					{
						htmltext = "31331-" + raid + "b.htm";
						takeItems(player, item, 1);
						clan.addReputationScore(reward);
						player.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_SUCCESSFULLY_COMPLETED_A_CLAN_QUEST_S1_POINTS_HAVE_BEEN_ADDED_TO_YOUR_CLAN_S_REPUTATION_SCORE).addInt(reward));
						clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		// Retrieve the QuestState of the clan leader.
		final QuestState st = getClanLeaderQuestState(player, npc);
		if ((st == null) || !st.isStarted())
		{
			return;
		}
		
		// Reward only if quest is setup on good index.
		final int raid = st.getInt("raid");
		if (REWARD_LIST[raid - 1][0] == npc.getId())
		{
			final int item = REWARD_LIST[raid - 1][1];
			final Player clanLeader = st.getPlayer();
			
			// Check if the clan leader is within 1500 range of the raid boss.
			if ((clanLeader != null) && (npc.calculateDistance3D(clanLeader) < PlayerConfig.ALT_PARTY_RANGE) && !hasQuestItems(clanLeader, item))
			{
				giveItems(clanLeader, item, 1);
				playSound(clanLeader, QuestSound.ITEMSOUND_QUEST_MIDDLE);
			}
		}
	}
}