ZURSULUS L2

A Clan's Reputation

ID
508
Название
A Clan's Reputation
start_npcs_json
[30868]
npc_ids_json
[25051,25140,25245,25252,25255,25524,30868]
constants_json
{"SIR_ERIC_RODEMAI":30868,"FLAMESTONE_GIANT":25524,"PALIBATI_QUEEN_THEMIS":25252,"HEKATON_PRIME":25140,"GARGOYLE_LORD_TIPHON":25255,"LAST_LESSER_GIANT_GLAKI":25245,"RAHHA":25051,"NUCLEUS_OF_FLAMESTONE_GIANT":8494,"THEMIS_SCALE":8277,"NUCLEUS_OF_HEKATON_PRIME":8279,"TIPHON_SHARD":8280,"GLAKIS_NUCLEUS":8281,"RAHHAS_FANG":8282}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00508_AClansReputation/Q00508_AClansReputation.java

NPC квеста

IDНазваниеСтарт квестаУровень
25051RahhaНет65
25140Hekaton PrimeНет65
25245Last Lesser Giant GlakiНет78
25252Palibati Queen ThemisНет70
25255Gargoyle Lord TiphonНет65
25524Flamestone GiantНет76
30868Sir Eric RodemaiДа70

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

else if (clan.getLevel() < 5)

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

giveItems(clanLeader, item, 1);

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

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

[30868-0.htm] Sir Eric Rodemai: Which Raid Boss do you wish to take on? Palibati Queen Themis Hekaton Prime Gargoyle Lord Tiphon Last Lesser Giant Glaki Rahha Flamestone Giant [30868-0a.htm] Sir Eric Rodemai: 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 Aden 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 5 and above.) [30868-0b.htm] Sir Eric Rodemai: 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 Aden 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 5 and above.) [30868-0c.htm] Sir Eric Rodemai: 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 Aden 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 [30868-1.htm] Sir Eric Rodemai: Very good! Slaughter Palibati Queen Themis and bring me her scale! As I told you before, you don't have to kill her yourself! There's no rule that says the Clan Leader has to get his hands bloody! Just stand in a safe place and watch your Clan kill Palibati Queen Themis and then bring her scale to me. [30868-1a.htm] Sir Eric Rodemai: Too bad! I need you to slaughter Palibati Queen Themis and bring me her scale! As I told you before, you don't have to kill her yourself! There's no rule that says the Clan Leader has to get his hands bloody! Just stand in a safe place and watch your Clan kill Palibati Queen Themis and then bring her scale to me. "I want to try another Raid Boss." Quit [30868-1b.htm] Sir Eric Rodemai: Well done! I'll spread the news that your brave Clan hat defeated Palibati Queen Themis. "I want to continue killing Raid Bosses." Quit [30868-2.htm] Sir Eric Rodemai: Very good! Slaughter Hekaton Prime and bring me his Nucleus! As I told you before, you don't have to kill him yourself! There's no rule that says the Clan Leader has to get his hands bloody! Just stand in a safe place and watch your Clan kill Hekaton Prime and then bring his Nucleus to me. [30868-2a.htm] Sir Eric Rodemai: Too bad! I need you to slaughter Hekaton Prime and bring me his Nucleus! As I told you before, you don't have to kill him yourself! There's no rule that says the Clan Leader has to get his hands bloody! Just stand in a safe place and watch your Clan kill Hekaton Prime and then bring his Nucleus to me. "I want to try another Raid Boss." Quit [30868-2b.htm] Sir Eric Rodemai: Well done! I'll spread the news that your brave Clan hat defeated Hekaton Prime. "I want to continue killing Raid Bosses." Quit [30868-3.htm] Sir Eric Rodemai: Very good! Slaughter Gargoyle Lord Tiphon and bring me his Shard! As I told you before, you don't have to kill him yourself! There's no rule that says the Clan Leader has to get his hands bloody! Just stand in a safe place and watch your Clan kill Gargoyle Lord Tiphon and then bring his Shard to me. [30868-3a.htm] Sir Eric Rodemai: Too bad! I need you to slaughter Gargoyle Lord Tiphon and bring me his Shard! As I told you before, you don't have to kill him yourself! There's no rule that says the Clan Leader has to get his hands bloody! Just stand in a safe place and watch your Clan kill Gargoyle Lord Tiphon and then bring his Shard to me. "I want to try another Raid Boss." Quit [30868-3b.htm] Sir Eric Rodemai: Well done! I'll spread the news that your brave Clan hat defeated Gargoyle Lord Tiphon. "I want to continue killing Raid Bosses." Quit [30868-4.htm] Sir Eric Rodemai: Very good! Slaughter Last Lesser Giant Glaki and bring me his Nucleus! As I told you before, you don't have to kill him yourself! There's no rule that says the Clan Leader has to get his hands bloody! Just stand in a safe place and watch your Clan kill Last Lesser Giant Glaki and then bring his Nucleus to me. [30868-4a.htm] Sir Eric Rodemai: Too bad! I need you to slaughter Last Lesser Giant Glaki and bring me his Nucleus! As I told you before, you don't have to kill him yourself! There's no rule that says the Clan Leader has to get his hands bloody! Just stand in a safe place and watch your Clan kill Last Lesser Giant Glaki and then bring his Nucleus to me. "I want to try another Raid Boss." Quit [30868-4b.htm] Sir Eric Rodemai: Well done! I'll spread the news that your brave Clan hat defeated Last Lesser Giant Glaki. "I want to continue killing Raid Bosses." Quit [30868-5.htm] Sir Eric Rodemai: Very good! Slaughter Rahha and bring me her fang! As I told you before, you don't have to kill her yourself! There's no rule that says the Clan Leader has to get his hands bloody! Just stand in a safe place and watch your Clan kill Rahha and then bring her fang to me. [30868-5a.htm] Sir Eric Rodemai: Too bad! I need you to slaughter Rahha and bring me her fang! As I told you before, you don't have to kill her yourself! There's no rule that says the Clan Leader has to get his hands bloody! Just stand in a safe place and watch your Clan kill Rahha and then bring her fang to me. "I want to try another Raid Boss." Quit [30868-5b.htm] Sir Eric Rodemai: Well done! I'll spread the news that your brave Clan hat defeated Rahha. "I want to continue killing Raid Bosses." Quit [30868-6.htm] Sir Eric Rodemai: Very good! Slaughter Flamestone Giant and bring me his Nucleus! As I told you before, you don't have to kill him yourself! There's no rule that says the Clan Leader has to get his hands bloody! Just stand in a safe place and watch your Clan kill Flamestone Giant and then bring his Nucleus to me. [30868-6a.htm] Sir Eric Rodemai: Too bad! I need you to slaughter Flamestone Giant and bring me his Nucleus! As I told you before, you don't have to kill him yourself! There's no rule that says the Clan Leader has to get his hands bloody! Just stand in a safe place and watch your Clan kill Flamestone Giant and then bring his Nucleus to me. "I want to try another Raid Boss." Quit [30868-6b.htm] Sir Eric Rodemai: Well done! I'll spread the news that your brave Clan hat defeated Flamestone Giant. "I want to continue killing Raid Bosses." Quit [30868-7.htm] Sir Eric Rodemai: 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.Q00508_AClansReputation;

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 Q00508_AClansReputation extends Quest
{
	// NPC
	private static final int SIR_ERIC_RODEMAI = 30868;
	
	// Raidbosses
	private static final int FLAMESTONE_GIANT = 25524;
	private static final int PALIBATI_QUEEN_THEMIS = 25252;
	private static final int HEKATON_PRIME = 25140;
	private static final int GARGOYLE_LORD_TIPHON = 25255;
	private static final int LAST_LESSER_GIANT_GLAKI = 25245;
	private static final int RAHHA = 25051;
	
	// Items
	private static final int NUCLEUS_OF_FLAMESTONE_GIANT = 8494;
	private static final int THEMIS_SCALE = 8277;
	private static final int NUCLEUS_OF_HEKATON_PRIME = 8279;
	private static final int TIPHON_SHARD = 8280;
	private static final int GLAKIS_NUCLEUS = 8281;
	private static final int RAHHAS_FANG = 8282;
	
	// Reward list (itemId, minClanPoints, maxClanPoints)
	private static final int[][] REWARD_LIST =
	{
		// @formatter:off
		{PALIBATI_QUEEN_THEMIS, THEMIS_SCALE, 65, 100},
		{HEKATON_PRIME, NUCLEUS_OF_HEKATON_PRIME, 40, 75},
		{GARGOYLE_LORD_TIPHON, TIPHON_SHARD, 30, 65},
		{LAST_LESSER_GIANT_GLAKI, GLAKIS_NUCLEUS, 105, 140},
		{RAHHA, RAHHAS_FANG, 40, 75},
		{FLAMESTONE_GIANT, NUCLEUS_OF_FLAMESTONE_GIANT, 60, 95}
	};
	
	// Radar
	private static final int[][] radar =
	{
		{192346, 21528, -3648},
		{191979, 54902, -7658},
		{170038, -26236, -3824},
		{171762, 55028, -5992},
		{117232, -9476, -3320},
		{144218, -5816, -4722}
		// @formatter:on
	};
	
	public Q00508_AClansReputation()
	{
		super(508, "A Clan's Reputation");
		registerQuestItems(THEMIS_SCALE, NUCLEUS_OF_HEKATON_PRIME, TIPHON_SHARD, GLAKIS_NUCLEUS, RAHHAS_FANG, NUCLEUS_OF_FLAMESTONE_GIANT);
		addStartNpc(SIR_ERIC_RODEMAI);
		addTalkId(SIR_ERIC_RODEMAI);
		addKillId(FLAMESTONE_GIANT, PALIBATI_QUEEN_THEMIS, HEKATON_PRIME, GARGOYLE_LORD_TIPHON, LAST_LESSER_GIANT_GLAKI, RAHHA);
	}
	
	@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 = "30868-" + 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("30868-7.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 = "30868-0a.htm";
				}
				else if (clan.getLevel() < 5)
				{
					st.exitQuest(true);
					htmltext = "30868-0b.htm";
				}
				else
				{
					htmltext = "30868-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 = "30868-" + raid + "a.htm";
					}
					else if (count == 1)
					{
						htmltext = "30868-" + 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;
		}
		
		// Check if the clan leader is within 1500 range of the raid boss.
		final Player clanLeader = st.getPlayer();
		if (npc.calculateDistance3D(clanLeader) < PlayerConfig.ALT_PARTY_RANGE)
		{
			// Reward only if quest is set up on the correct index.
			final int raid = st.getInt("raid");
			if (REWARD_LIST[raid - 1][0] == npc.getId())
			{
				final int item = REWARD_LIST[raid - 1][1];
				if (!hasQuestItems(clanLeader, item))
				{
					giveItems(clanLeader, item, 1);
					playSound(clanLeader, QuestSound.ITEMSOUND_QUEST_MIDDLE);
				}
			}
		}
	}
}