More final and static cleanups.
This commit is contained in:
		@@ -266,7 +266,7 @@ public class Alarm extends AbstractNpcAI
 | 
			
		||||
	 * @param questId the quest ID
 | 
			
		||||
	 * @param memoState the memo state
 | 
			
		||||
	 */
 | 
			
		||||
	private static void setMemoState(PlayerInstance player, int questId, int memoState)
 | 
			
		||||
	private void setMemoState(PlayerInstance player, int questId, int memoState)
 | 
			
		||||
	{
 | 
			
		||||
		QuestState qs = null;
 | 
			
		||||
		switch (questId)
 | 
			
		||||
@@ -321,7 +321,7 @@ public class Alarm extends AbstractNpcAI
 | 
			
		||||
	 * @param slot the slot
 | 
			
		||||
	 * @param memoStateEx the memo state ex
 | 
			
		||||
	 */
 | 
			
		||||
	private static void setMemoStateEx(PlayerInstance player, int questId, int slot, int memoStateEx)
 | 
			
		||||
	private void setMemoStateEx(PlayerInstance player, int questId, int slot, int memoStateEx)
 | 
			
		||||
	{
 | 
			
		||||
		QuestState qs = null;
 | 
			
		||||
		switch (questId)
 | 
			
		||||
 
 | 
			
		||||
@@ -597,7 +597,7 @@ public class HallOfErosionAttack extends AbstractNpcAI
 | 
			
		||||
		return "";
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void finishInstance(InstanceWorld world)
 | 
			
		||||
	private void finishInstance(InstanceWorld world)
 | 
			
		||||
	{
 | 
			
		||||
		if (world instanceof HEAWorld)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -957,7 +957,7 @@ public class SeedOfDestruction extends AbstractNpcAI
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void removeBuffs(Creature ch)
 | 
			
		||||
	private void removeBuffs(Creature ch)
 | 
			
		||||
	{
 | 
			
		||||
		ch.stopAllEffectsExceptThoseThatLastThroughDeath();
 | 
			
		||||
		if (ch.hasSummon())
 | 
			
		||||
 
 | 
			
		||||
@@ -250,7 +250,7 @@ public class AnomicFoundry extends AbstractNpcAI
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	// Zoey76: TODO: This should be done with onFactionCall(..)
 | 
			
		||||
	private static void requestHelp(Npc requester, PlayerInstance agressor, int range, int helperId)
 | 
			
		||||
	private void requestHelp(Npc requester, PlayerInstance agressor, int range, int helperId)
 | 
			
		||||
	{
 | 
			
		||||
		for (Spawn spawn : SpawnTable.getInstance().getSpawns(helperId))
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -244,7 +244,7 @@ public class StakatoNest extends AbstractNpcAI
 | 
			
		||||
		return null;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void giveCocoon(PlayerInstance player, Npc npc)
 | 
			
		||||
	private void giveCocoon(PlayerInstance player, Npc npc)
 | 
			
		||||
	{
 | 
			
		||||
		player.addItem("StakatoCocoon", ((getRandom(100) > 80) ? LARGE_COCOON : SMALL_COCOON), 1, npc, true);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -262,7 +262,7 @@ public class TerritoryManagers extends AbstractNpcAI
 | 
			
		||||
	 * @param questId the quest Id of the quest that will be processed
 | 
			
		||||
	 * @param itemIds the item Ids should be deleted
 | 
			
		||||
	 */
 | 
			
		||||
	private static void processNoblesseQuest(PlayerInstance player, int questId, int[] itemIds)
 | 
			
		||||
	private void processNoblesseQuest(PlayerInstance player, int questId, int[] itemIds)
 | 
			
		||||
	{
 | 
			
		||||
		final Quest q = QuestManager.getInstance().getQuest(questId);
 | 
			
		||||
		if (q == null)
 | 
			
		||||
@@ -299,7 +299,7 @@ public class TerritoryManagers extends AbstractNpcAI
 | 
			
		||||
	 * @param event the event leading to this deletion
 | 
			
		||||
	 * @param npc the npc referencing this deletion
 | 
			
		||||
	 */
 | 
			
		||||
	private static void deleteIfExist(PlayerInstance player, int itemId, String event, Npc npc)
 | 
			
		||||
	private void deleteIfExist(PlayerInstance player, int itemId, String event, Npc npc)
 | 
			
		||||
	{
 | 
			
		||||
		final ItemInstance item = player.getInventory().getItemByItemId(itemId);
 | 
			
		||||
		if (item != null)
 | 
			
		||||
 
 | 
			
		||||
@@ -741,7 +741,7 @@ public class RainbowSpringsChateau extends ClanHallSiegeEngine
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void moveGourds()
 | 
			
		||||
	private void moveGourds()
 | 
			
		||||
	{
 | 
			
		||||
		final Spawn[] tempArray = _gourds;
 | 
			
		||||
		final int iterator = _acceptedClans.size();
 | 
			
		||||
@@ -756,20 +756,20 @@ public class RainbowSpringsChateau extends ClanHallSiegeEngine
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void reduceGourdHp(int index, PlayerInstance player)
 | 
			
		||||
	private void reduceGourdHp(int index, PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		final Spawn gourd = _gourds[index];
 | 
			
		||||
		gourd.getLastSpawn().reduceCurrentHp(1000, player, null);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void increaseGourdHp(int index)
 | 
			
		||||
	private void increaseGourdHp(int index)
 | 
			
		||||
	{
 | 
			
		||||
		final Spawn gourd = _gourds[index];
 | 
			
		||||
		final Npc gourdNpc = gourd.getLastSpawn();
 | 
			
		||||
		gourdNpc.setCurrentHp(gourdNpc.getCurrentHp() + 1000);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void castDebuffsOnEnemies(int myArena)
 | 
			
		||||
	private void castDebuffsOnEnemies(int myArena)
 | 
			
		||||
	{
 | 
			
		||||
		for (int id : ARENA_ZONES)
 | 
			
		||||
		{
 | 
			
		||||
@@ -792,7 +792,7 @@ public class RainbowSpringsChateau extends ClanHallSiegeEngine
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void shoutRandomText(Npc npc)
 | 
			
		||||
	private void shoutRandomText(Npc npc)
 | 
			
		||||
	{
 | 
			
		||||
		final int length = _textPassages.length;
 | 
			
		||||
		
 | 
			
		||||
@@ -841,7 +841,7 @@ public class RainbowSpringsChateau extends ClanHallSiegeEngine
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void updateAttacker(int clanId, long count, boolean remove)
 | 
			
		||||
	private void updateAttacker(int clanId, long count, boolean remove)
 | 
			
		||||
	{
 | 
			
		||||
		try (Connection con = DatabaseFactory.getConnection())
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -219,7 +219,7 @@ public class Elpies extends Event
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void dropItem(Npc mob, PlayerInstance player, int[][] droplist)
 | 
			
		||||
	private void dropItem(Npc mob, PlayerInstance player, int[][] droplist)
 | 
			
		||||
	{
 | 
			
		||||
		final int chance = getRandom(100);
 | 
			
		||||
		
 | 
			
		||||
 
 | 
			
		||||
@@ -235,7 +235,7 @@ public class Rabbits extends Event
 | 
			
		||||
		return super.onAttack(npc, attacker, damage, isSummon);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void dropItem(Npc npc, PlayerInstance player, int[][] droplist)
 | 
			
		||||
	private void dropItem(Npc npc, PlayerInstance player, int[][] droplist)
 | 
			
		||||
	{
 | 
			
		||||
		final int chance = getRandom(100);
 | 
			
		||||
		for (int[] drop : droplist)
 | 
			
		||||
@@ -248,7 +248,7 @@ public class Rabbits extends Event
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void recordSpawn(Set<Npc> npcs, int npcId, int x, int y, int z, int heading, boolean randomOffSet, long despawnDelay)
 | 
			
		||||
	private void recordSpawn(Set<Npc> npcs, int npcId, int x, int y, int z, int heading, boolean randomOffSet, long despawnDelay)
 | 
			
		||||
	{
 | 
			
		||||
		final Npc npc = addSpawn(npcId, x, y, z, heading, randomOffSet, despawnDelay);
 | 
			
		||||
		if (npc.getId() == CHEST)
 | 
			
		||||
 
 | 
			
		||||
@@ -351,7 +351,7 @@ public class AdminBuffs implements IAdminCommandHandler
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void removeBuff(PlayerInstance activeChar, int objId, int skillId)
 | 
			
		||||
	private void removeBuff(PlayerInstance activeChar, int objId, int skillId)
 | 
			
		||||
	{
 | 
			
		||||
		Creature target = null;
 | 
			
		||||
		try
 | 
			
		||||
@@ -378,7 +378,7 @@ public class AdminBuffs implements IAdminCommandHandler
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void removeAllBuffs(PlayerInstance activeChar, int objId)
 | 
			
		||||
	private void removeAllBuffs(PlayerInstance activeChar, int objId)
 | 
			
		||||
	{
 | 
			
		||||
		Creature target = null;
 | 
			
		||||
		try
 | 
			
		||||
 
 | 
			
		||||
@@ -113,7 +113,7 @@ public class AdminChangeAccessLevel implements IAdminCommandHandler
 | 
			
		||||
	 * @param player the online target
 | 
			
		||||
	 * @param lvl the access level
 | 
			
		||||
	 */
 | 
			
		||||
	private static void onlineChange(PlayerInstance activeChar, PlayerInstance player, int lvl)
 | 
			
		||||
	private void onlineChange(PlayerInstance activeChar, PlayerInstance player, int lvl)
 | 
			
		||||
	{
 | 
			
		||||
		if (lvl >= 0)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -173,7 +173,7 @@ public class AdminFence implements IAdminCommandHandler
 | 
			
		||||
		return ADMIN_COMMANDS;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void sendHtml(PlayerInstance activeChar, int page)
 | 
			
		||||
	private void sendHtml(PlayerInstance activeChar, int page)
 | 
			
		||||
	{
 | 
			
		||||
		final PageResult result = HtmlUtil.createPage(FenceData.getInstance().getFences().values(), page, 10, currentPage ->
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -152,7 +152,7 @@ public class AdminShowQuests implements IAdminCommandHandler
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void showFirstQuestMenu(PlayerInstance target, PlayerInstance actor)
 | 
			
		||||
	private void showFirstQuestMenu(PlayerInstance target, PlayerInstance actor)
 | 
			
		||||
	{
 | 
			
		||||
		final StringBuilder replyMSG = new StringBuilder("<html><body><table width=270><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Player: " + target.getName() + "</center></td><td width=45><button value=\"Back\" action=\"bypass -h admin_admin6\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table>");
 | 
			
		||||
		final NpcHtmlMessage adminReply = new NpcHtmlMessage();
 | 
			
		||||
@@ -170,7 +170,7 @@ public class AdminShowQuests implements IAdminCommandHandler
 | 
			
		||||
		actor.sendPacket(adminReply);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void showQuestMenu(PlayerInstance target, PlayerInstance actor, String[] val)
 | 
			
		||||
	private void showQuestMenu(PlayerInstance target, PlayerInstance actor, String[] val)
 | 
			
		||||
	{
 | 
			
		||||
		try (Connection con = DatabaseFactory.getConnection())
 | 
			
		||||
		{
 | 
			
		||||
@@ -316,7 +316,7 @@ public class AdminShowQuests implements IAdminCommandHandler
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void setQuestVar(PlayerInstance target, PlayerInstance actor, String[] val)
 | 
			
		||||
	private void setQuestVar(PlayerInstance target, PlayerInstance actor, String[] val)
 | 
			
		||||
	{
 | 
			
		||||
		QuestState qs = target.getQuestState(val[0]);
 | 
			
		||||
		final String[] outval = new String[3];
 | 
			
		||||
 
 | 
			
		||||
@@ -111,7 +111,7 @@ public class AdminZone implements IAdminCommandHandler
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void showHtml(PlayerInstance activeChar)
 | 
			
		||||
	private void showHtml(PlayerInstance activeChar)
 | 
			
		||||
	{
 | 
			
		||||
		final String htmContent = HtmCache.getInstance().getHtm(activeChar, "data/html/admin/zone.htm");
 | 
			
		||||
		final NpcHtmlMessage adminReply = new NpcHtmlMessage();
 | 
			
		||||
@@ -162,7 +162,7 @@ public class AdminZone implements IAdminCommandHandler
 | 
			
		||||
		activeChar.sendPacket(adminReply);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void getGeoRegionXY(PlayerInstance activeChar)
 | 
			
		||||
	private void getGeoRegionXY(PlayerInstance activeChar)
 | 
			
		||||
	{
 | 
			
		||||
		final int worldX = activeChar.getX();
 | 
			
		||||
		final int worldY = activeChar.getY();
 | 
			
		||||
 
 | 
			
		||||
@@ -122,7 +122,7 @@ public class ClanWarehouse implements IBypassHandler
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void showWithdrawWindow(PlayerInstance player, WarehouseListType itemtype, byte sortorder)
 | 
			
		||||
	private void showWithdrawWindow(PlayerInstance player, WarehouseListType itemtype, byte sortorder)
 | 
			
		||||
	{
 | 
			
		||||
		player.sendPacket(ActionFailed.STATIC_PACKET);
 | 
			
		||||
		
 | 
			
		||||
 
 | 
			
		||||
@@ -235,7 +235,7 @@ public class NpcViewMod implements IBypassHandler
 | 
			
		||||
		return sb.toString();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void sendNpcDropList(PlayerInstance player, Npc npc, DropType dropType, int page)
 | 
			
		||||
	private void sendNpcDropList(PlayerInstance player, Npc npc, DropType dropType, int page)
 | 
			
		||||
	{
 | 
			
		||||
		final List<DropHolder> dropList = npc.getTemplate().getDropList(dropType);
 | 
			
		||||
		if (dropList == null)
 | 
			
		||||
 
 | 
			
		||||
@@ -155,7 +155,7 @@ public class Observation implements IBypassHandler
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void doObserve(PlayerInstance player, Npc npc, Location pos, long cost)
 | 
			
		||||
	private void doObserve(PlayerInstance player, Npc npc, Location pos, long cost)
 | 
			
		||||
	{
 | 
			
		||||
		if (player.reduceAdena("Broadcast", cost, npc, true))
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -106,7 +106,7 @@ public class PrivateWarehouse implements IBypassHandler
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void showWithdrawWindow(PlayerInstance player, WarehouseListType itemtype, byte sortorder)
 | 
			
		||||
	private void showWithdrawWindow(PlayerInstance player, WarehouseListType itemtype, byte sortorder)
 | 
			
		||||
	{
 | 
			
		||||
		player.sendPacket(ActionFailed.STATIC_PACKET);
 | 
			
		||||
		player.setActiveWarehouse(player.getWarehouse());
 | 
			
		||||
 
 | 
			
		||||
@@ -94,7 +94,7 @@ public class SupportMagic implements IBypassHandler
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void makeSupportMagic(PlayerInstance player, Npc npc, boolean isSummon)
 | 
			
		||||
	private void makeSupportMagic(PlayerInstance player, Npc npc, boolean isSummon)
 | 
			
		||||
	{
 | 
			
		||||
		final int level = player.getLevel();
 | 
			
		||||
		if (isSummon && !player.hasServitor())
 | 
			
		||||
 
 | 
			
		||||
@@ -68,7 +68,7 @@ public class Wear implements IBypassHandler
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void showWearWindow(PlayerInstance player, int val)
 | 
			
		||||
	private void showWearWindow(PlayerInstance player, int val)
 | 
			
		||||
	{
 | 
			
		||||
		final BuyListHolder buyList = BuyListData.getInstance().getBuyList(val);
 | 
			
		||||
		if (buyList == null)
 | 
			
		||||
 
 | 
			
		||||
@@ -89,7 +89,7 @@ public class BanHandler implements IPunishmentHandler
 | 
			
		||||
	 * Applies all punishment effects from the player.
 | 
			
		||||
	 * @param player
 | 
			
		||||
	 */
 | 
			
		||||
	private static void applyToPlayer(PlayerInstance player)
 | 
			
		||||
	private void applyToPlayer(PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		Disconnection.of(player).defaultSequence(false);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -124,7 +124,7 @@ public class ChatBanHandler implements IPunishmentHandler
 | 
			
		||||
	 * @param task
 | 
			
		||||
	 * @param player
 | 
			
		||||
	 */
 | 
			
		||||
	private static void applyToPlayer(PunishmentTask task, PlayerInstance player)
 | 
			
		||||
	private void applyToPlayer(PunishmentTask task, PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		final long delay = (task.getExpirationTime() - System.currentTimeMillis()) / 1000;
 | 
			
		||||
		if (delay > 0)
 | 
			
		||||
@@ -142,7 +142,7 @@ public class ChatBanHandler implements IPunishmentHandler
 | 
			
		||||
	 * Removes any punishment effects from the player.
 | 
			
		||||
	 * @param player
 | 
			
		||||
	 */
 | 
			
		||||
	private static void removeFromPlayer(PlayerInstance player)
 | 
			
		||||
	private void removeFromPlayer(PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		player.sendMessage("Your Chat ban has been lifted");
 | 
			
		||||
		player.sendPacket(new EtcStatusUpdate(player));
 | 
			
		||||
 
 | 
			
		||||
@@ -154,7 +154,7 @@ public class JailHandler implements IPunishmentHandler
 | 
			
		||||
	 * @param task
 | 
			
		||||
	 * @param player
 | 
			
		||||
	 */
 | 
			
		||||
	private static void applyToPlayer(PunishmentTask task, PlayerInstance player)
 | 
			
		||||
	private void applyToPlayer(PunishmentTask task, PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		player.setInstanceId(0);
 | 
			
		||||
		
 | 
			
		||||
@@ -202,7 +202,7 @@ public class JailHandler implements IPunishmentHandler
 | 
			
		||||
	 * Removes any punishment effects from the player.
 | 
			
		||||
	 * @param player
 | 
			
		||||
	 */
 | 
			
		||||
	private static void removeFromPlayer(PlayerInstance player)
 | 
			
		||||
	private void removeFromPlayer(PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		ThreadPool.schedule(new TeleportTask(player, JailZone.getLocationOut()), 2000);
 | 
			
		||||
		
 | 
			
		||||
 
 | 
			
		||||
@@ -507,7 +507,7 @@ public class Kamaloka extends AbstractInstance
 | 
			
		||||
	 * Removing all buffs from player and pet except BUFFS_WHITELIST
 | 
			
		||||
	 * @param ch player
 | 
			
		||||
	 */
 | 
			
		||||
	private static void removeBuffs(Creature ch)
 | 
			
		||||
	private void removeBuffs(Creature ch)
 | 
			
		||||
	{
 | 
			
		||||
		final Function<BuffInfo, Boolean> removeBuffs = info ->
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -167,7 +167,7 @@ public class NornilsGarden extends AbstractInstance
 | 
			
		||||
	};
 | 
			
		||||
	// @formatter:on
 | 
			
		||||
	
 | 
			
		||||
	private static void dropHerb(Npc mob, PlayerInstance player, int[][] drop)
 | 
			
		||||
	private void dropHerb(Npc mob, PlayerInstance player, int[][] drop)
 | 
			
		||||
	{
 | 
			
		||||
		final int chance = getRandom(100);
 | 
			
		||||
		for (int[] element : drop)
 | 
			
		||||
@@ -179,7 +179,7 @@ public class NornilsGarden extends AbstractInstance
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void giveBuffs(Creature ch)
 | 
			
		||||
	private void giveBuffs(Creature ch)
 | 
			
		||||
	{
 | 
			
		||||
		if (skill1 != null)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -1106,23 +1106,23 @@ public abstract class AbstractSagaQuest extends Quest
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void addSpawn(QuestState st, Npc mob)
 | 
			
		||||
	private void addSpawn(QuestState st, Npc mob)
 | 
			
		||||
	{
 | 
			
		||||
		SPAWN_LIST.put(mob, st.getPlayer().getObjectId());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void autoChat(Npc npc, String text)
 | 
			
		||||
	private void autoChat(Npc npc, String text)
 | 
			
		||||
	{
 | 
			
		||||
		npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.GENERAL, npc.getId(), text));
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void cast(Npc npc, Creature target, int skillId, int level)
 | 
			
		||||
	private void cast(Npc npc, Creature target, int skillId, int level)
 | 
			
		||||
	{
 | 
			
		||||
		target.broadcastPacket(new MagicSkillUse(target, target, skillId, level, 6000, 1));
 | 
			
		||||
		target.broadcastPacket(new MagicSkillUse(npc, npc, skillId, level, 6000, 1));
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void DeleteSpawn(QuestState st, Npc npc)
 | 
			
		||||
	private void DeleteSpawn(QuestState st, Npc npc)
 | 
			
		||||
	{
 | 
			
		||||
		if (SPAWN_LIST.containsKey(npc))
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -154,7 +154,7 @@ public class Q00003_WillTheSealBeBroken extends Quest
 | 
			
		||||
		return htmltext;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void giveItem(PlayerInstance player, QuestState qs, int item, int... items)
 | 
			
		||||
	private void giveItem(PlayerInstance player, QuestState qs, int item, int... items)
 | 
			
		||||
	{
 | 
			
		||||
		if (!hasQuestItems(player, item))
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -444,7 +444,7 @@ public class Q00270_TheOneWhoEndsSilence extends Quest
 | 
			
		||||
	 * @param chance the reward chance
 | 
			
		||||
	 * @param atLeastOne if {@code true} it will reward two items if the chance is meet and one if the chance is not meet, if {@code false} if the chance is not meet doesn't reward, otherwise reward one item
 | 
			
		||||
	 */
 | 
			
		||||
	private static void giveItem(PlayerInstance player, Npc npc, int chance, boolean atLeastOne)
 | 
			
		||||
	private void giveItem(PlayerInstance player, Npc npc, int chance, boolean atLeastOne)
 | 
			
		||||
	{
 | 
			
		||||
		if ((player != null) && Util.checkIfInRange(Config.ALT_PARTY_RANGE, npc, player, false))
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -154,7 +154,7 @@ public class Q00306_CrystalOfFireAndIce extends Quest
 | 
			
		||||
		return htmltext;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void giveKillReward(PlayerInstance player, Npc npc)
 | 
			
		||||
	private void giveKillReward(PlayerInstance player, Npc npc)
 | 
			
		||||
	{
 | 
			
		||||
		if (Util.checkIfInRange(Config.ALT_PARTY_RANGE, npc, player, false))
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -505,7 +505,7 @@ public class Q00350_EnhanceYourWeapon extends Quest
 | 
			
		||||
	/**
 | 
			
		||||
	 * TODO: Implement using DocumentParser.
 | 
			
		||||
	 */
 | 
			
		||||
	private static void load()
 | 
			
		||||
	private void load()
 | 
			
		||||
	{
 | 
			
		||||
		try
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -842,7 +842,7 @@ public class Q00420_LittleWing extends Quest
 | 
			
		||||
	 * Gives the reward to the player.
 | 
			
		||||
	 * @param player the player
 | 
			
		||||
	 */
 | 
			
		||||
	private static void giveReward(PlayerInstance player)
 | 
			
		||||
	private void giveReward(PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		final int random = getRandom(100);
 | 
			
		||||
		for (int i : EGGS)
 | 
			
		||||
 
 | 
			
		||||
@@ -342,7 +342,7 @@ public class Q00453_NotStrongEnoughAlone extends Quest
 | 
			
		||||
		return htmltext;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void checkProgress(QuestState qs, int count, int... mobs)
 | 
			
		||||
	private void checkProgress(QuestState qs, int count, int... mobs)
 | 
			
		||||
	{
 | 
			
		||||
		for (int mob : mobs)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -781,7 +781,7 @@ public class Q00454_CompletelyLost extends Quest
 | 
			
		||||
	 * @param npc the NPC
 | 
			
		||||
	 * @param stringId the NPC String
 | 
			
		||||
	 */
 | 
			
		||||
	private static void broadcastNpcSay(Npc npc, NpcStringId stringId)
 | 
			
		||||
	private void broadcastNpcSay(Npc npc, NpcStringId stringId)
 | 
			
		||||
	{
 | 
			
		||||
		Broadcast.toKnownPlayers(npc, new NpcSay(npc, ChatType.NPC_GENERAL, stringId));
 | 
			
		||||
	}
 | 
			
		||||
@@ -792,7 +792,7 @@ public class Q00454_CompletelyLost extends Quest
 | 
			
		||||
	 * @param player the player
 | 
			
		||||
	 * @param stringId the NPC String
 | 
			
		||||
	 */
 | 
			
		||||
	private static void whisper(Npc npc, PlayerInstance player, NpcStringId stringId)
 | 
			
		||||
	private void whisper(Npc npc, PlayerInstance player, NpcStringId stringId)
 | 
			
		||||
	{
 | 
			
		||||
		player.sendPacket(new NpcSay(npc.getObjectId(), ChatType.WHISPER, npc.getId(), stringId));
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -193,7 +193,7 @@ public class Q00455_WingsOfSand extends Quest
 | 
			
		||||
	 * Reward the player.
 | 
			
		||||
	 * @param qs the quest state of the player to reward
 | 
			
		||||
	 */
 | 
			
		||||
	private static void giveItems(QuestState qs)
 | 
			
		||||
	private void giveItems(QuestState qs)
 | 
			
		||||
	{
 | 
			
		||||
		final PlayerInstance player = qs.getPlayer();
 | 
			
		||||
		int chance;
 | 
			
		||||
 
 | 
			
		||||
@@ -318,7 +318,7 @@ public class Q00456_DontKnowDontCare extends Quest
 | 
			
		||||
		return super.onKill(npc, killer, isSummon);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void rewardPlayer(PlayerInstance player, Npc npc)
 | 
			
		||||
	private void rewardPlayer(PlayerInstance player, Npc npc)
 | 
			
		||||
	{
 | 
			
		||||
		final int chance = getRandom(10000);
 | 
			
		||||
		final int reward;
 | 
			
		||||
 
 | 
			
		||||
@@ -345,7 +345,7 @@ public class Q00660_AidingTheFloranVillage extends Quest
 | 
			
		||||
		return htmltext;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void tradeItems(PlayerInstance player, long required, long itemCount1, long itemCount2, long itemCount3)
 | 
			
		||||
	private void tradeItems(PlayerInstance player, long required, long itemCount1, long itemCount2, long itemCount3)
 | 
			
		||||
	{
 | 
			
		||||
		if (itemCount1 < required)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -276,7 +276,7 @@ public class Q00694_BreakThroughTheHallOfSuffering extends Quest
 | 
			
		||||
		return htmltext;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void finishInstance(PlayerInstance player)
 | 
			
		||||
	private void finishInstance(PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
 | 
			
		||||
		
 | 
			
		||||
 
 | 
			
		||||
@@ -245,7 +245,7 @@ public class Q00695_DefendTheHallOfSuffering extends Quest
 | 
			
		||||
		return htmltext;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void finishInstance(PlayerInstance player)
 | 
			
		||||
	private void finishInstance(PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
 | 
			
		||||
		
 | 
			
		||||
 
 | 
			
		||||
@@ -201,7 +201,7 @@ public class Q00901_HowLavasaurusesAreMade extends Quest
 | 
			
		||||
		return htmltext;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void giveQuestItems(QuestState qs, int itemId)
 | 
			
		||||
	private void giveQuestItems(QuestState qs, int itemId)
 | 
			
		||||
	{
 | 
			
		||||
		final PlayerInstance player = qs.getPlayer();
 | 
			
		||||
		if (getQuestItemsCount(player, itemId) < 10)
 | 
			
		||||
 
 | 
			
		||||
@@ -324,7 +324,7 @@ public class Q10289_FadeToBlack extends Quest
 | 
			
		||||
		return htmltext;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void rewardPlayer(QuestState qs, boolean isLucky)
 | 
			
		||||
	private void rewardPlayer(QuestState qs, boolean isLucky)
 | 
			
		||||
	{
 | 
			
		||||
		if ((qs != null) && qs.isCond(1))
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -430,7 +430,7 @@ public class TerritoryWarSuperClass extends Quest
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void handleBecomeMercenaryQuest(PlayerInstance player, boolean catapult)
 | 
			
		||||
	private void handleBecomeMercenaryQuest(PlayerInstance player, boolean catapult)
 | 
			
		||||
	{
 | 
			
		||||
		int enemyCount = 10;
 | 
			
		||||
		int catapultCount = 1;
 | 
			
		||||
@@ -469,7 +469,7 @@ public class TerritoryWarSuperClass extends Quest
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void handleStepsForHonor(PlayerInstance player)
 | 
			
		||||
	private void handleStepsForHonor(PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		final QuestState _sfh = player.getQuestState(Q00176_StepsForHonor.class.getSimpleName());
 | 
			
		||||
		if ((_sfh != null) && _sfh.isStarted())
 | 
			
		||||
 
 | 
			
		||||
@@ -499,7 +499,7 @@ public class GameServer
 | 
			
		||||
		INSTANCE = new GameServer();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void printSection(String s)
 | 
			
		||||
	private void printSection(String s)
 | 
			
		||||
	{
 | 
			
		||||
		s = "=[ " + s + " ]";
 | 
			
		||||
		while (s.length() < 61)
 | 
			
		||||
 
 | 
			
		||||
@@ -186,7 +186,7 @@ public class ClassMasterInstance extends MerchantInstance
 | 
			
		||||
		player.sendPacket(new TutorialShowQuestionMark(1001));
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void showHtmlMenu(PlayerInstance player, int objectId, int level)
 | 
			
		||||
	private void showHtmlMenu(PlayerInstance player, int objectId, int level)
 | 
			
		||||
	{
 | 
			
		||||
		final NpcHtmlMessage html = new NpcHtmlMessage(objectId);
 | 
			
		||||
		
 | 
			
		||||
 
 | 
			
		||||
@@ -143,7 +143,7 @@ public class FishermanInstance extends MerchantInstance
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void sendHtml(PlayerInstance player, Npc npc, String htmlName)
 | 
			
		||||
	private void sendHtml(PlayerInstance player, Npc npc, String htmlName)
 | 
			
		||||
	{
 | 
			
		||||
		final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
 | 
			
		||||
		html.setFile(player, "data/html/fisherman/championship/" + htmlName);
 | 
			
		||||
 
 | 
			
		||||
@@ -907,7 +907,7 @@ public class VillageMasterInstance extends NpcInstance
 | 
			
		||||
		return player.getSubClasses().values().iterator();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void dissolveClan(PlayerInstance player, int clanId)
 | 
			
		||||
	private void dissolveClan(PlayerInstance player, int clanId)
 | 
			
		||||
	{
 | 
			
		||||
		if (!player.isClanLeader())
 | 
			
		||||
		{
 | 
			
		||||
@@ -968,7 +968,7 @@ public class VillageMasterInstance extends NpcInstance
 | 
			
		||||
		ClanTable.getInstance().scheduleRemoveClan(clan.getId());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void recoverClan(PlayerInstance player, int clanId)
 | 
			
		||||
	private void recoverClan(PlayerInstance player, int clanId)
 | 
			
		||||
	{
 | 
			
		||||
		if (!player.isClanLeader())
 | 
			
		||||
		{
 | 
			
		||||
@@ -981,7 +981,7 @@ public class VillageMasterInstance extends NpcInstance
 | 
			
		||||
		clan.updateClanInDB();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void createSubPledge(PlayerInstance player, String clanName, String leaderName, int pledgeType, int minClanLvl)
 | 
			
		||||
	private void createSubPledge(PlayerInstance player, String clanName, String leaderName, int pledgeType, int minClanLvl)
 | 
			
		||||
	{
 | 
			
		||||
		if (!player.isClanLeader())
 | 
			
		||||
		{
 | 
			
		||||
@@ -1092,7 +1092,7 @@ public class VillageMasterInstance extends NpcInstance
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void renameSubPledge(PlayerInstance player, int pledgeType, String pledgeName)
 | 
			
		||||
	private void renameSubPledge(PlayerInstance player, int pledgeType, String pledgeName)
 | 
			
		||||
	{
 | 
			
		||||
		if (!player.isClanLeader())
 | 
			
		||||
		{
 | 
			
		||||
@@ -1125,7 +1125,7 @@ public class VillageMasterInstance extends NpcInstance
 | 
			
		||||
		player.sendMessage("Pledge name changed.");
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void assignSubPledgeLeader(PlayerInstance player, String clanName, String leaderName)
 | 
			
		||||
	private void assignSubPledgeLeader(PlayerInstance player, String clanName, String leaderName)
 | 
			
		||||
	{
 | 
			
		||||
		if (!player.isClanLeader())
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -196,7 +196,7 @@ public abstract class AbstractOlympiadGame
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	protected static void removals(PlayerInstance player, boolean removeParty)
 | 
			
		||||
	protected void removals(PlayerInstance player, boolean removeParty)
 | 
			
		||||
	{
 | 
			
		||||
		try
 | 
			
		||||
		{
 | 
			
		||||
@@ -340,7 +340,7 @@ public abstract class AbstractOlympiadGame
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	protected static void playerStatusBack(PlayerInstance player)
 | 
			
		||||
	protected void playerStatusBack(PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		try
 | 
			
		||||
		{
 | 
			
		||||
@@ -391,7 +391,7 @@ public abstract class AbstractOlympiadGame
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	protected static void portPlayerBack(PlayerInstance player)
 | 
			
		||||
	protected void portPlayerBack(PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		if (player == null)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -711,7 +711,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
 | 
			
		||||
		_damageP2 = 0;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	protected static void saveResults(Participant one, Participant two, int winner, long startTime, long fightTime, CompetitionType type)
 | 
			
		||||
	protected void saveResults(Participant one, Participant two, int winner, long startTime, long fightTime, CompetitionType type)
 | 
			
		||||
	{
 | 
			
		||||
		try (Connection con = DatabaseFactory.getConnection();
 | 
			
		||||
			PreparedStatement ps = con.prepareStatement("INSERT INTO olympiad_fights (charOneId, charTwoId, charOneClass, charTwoClass, winner, start, time, classed) values(?,?,?,?,?,?,?,?)"))
 | 
			
		||||
 
 | 
			
		||||
@@ -182,7 +182,7 @@ public abstract class VoteSystem implements Runnable
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private static void announce(String msg)
 | 
			
		||||
	private void announce(String msg)
 | 
			
		||||
	{
 | 
			
		||||
		CreatureSay cs = new CreatureSay(0, ChatType.CRITICAL_ANNOUNCE, "", msg);
 | 
			
		||||
		Broadcast.toAllOnlinePlayers(cs);
 | 
			
		||||
 
 | 
			
		||||
@@ -286,7 +286,7 @@ public class RequestBypassToServer implements IClientIncomingPacket
 | 
			
		||||
	/**
 | 
			
		||||
	 * @param player
 | 
			
		||||
	 */
 | 
			
		||||
	private static void comeHere(PlayerInstance player)
 | 
			
		||||
	private void comeHere(PlayerInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		final WorldObject obj = player.getTarget();
 | 
			
		||||
		if (obj == null)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user