diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/Alarm.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/Alarm.java index 9fb4824246..6e30efaa15 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/Alarm.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/CrumaTower/Alarm/Alarm.java @@ -247,7 +247,7 @@ public final class Alarm extends AbstractNpcAI * @param memoState the memo state, if memo state is less than zero, only quest state is checked * @return {@code true} if the player has the memo state, {@code false} otherwise */ - private static final boolean verifyMemoState(L2PcInstance player, int questId, int memoState) + private static boolean verifyMemoState(L2PcInstance player, int questId, int memoState) { QuestState qs = null; switch (questId) @@ -272,7 +272,7 @@ public final class Alarm extends AbstractNpcAI * @param questId the quest ID * @param memoState the memo state */ - private static final void setMemoState(L2PcInstance player, int questId, int memoState) + private static void setMemoState(L2PcInstance player, int questId, int memoState) { QuestState qs = null; switch (questId) @@ -301,7 +301,7 @@ public final class Alarm extends AbstractNpcAI * @param slot the slot * @return the memo state ex */ - private static final int getMemoStateEx(L2PcInstance player, int questId, int slot) + private static int getMemoStateEx(L2PcInstance player, int questId, int slot) { QuestState qs = null; switch (questId) @@ -327,7 +327,7 @@ public final class Alarm extends AbstractNpcAI * @param slot the slot * @param memoStateEx the memo state ex */ - private static final void setMemoStateEx(L2PcInstance player, int questId, int slot, int memoStateEx) + private static void setMemoStateEx(L2PcInstance player, int questId, int slot, int memoStateEx) { QuestState qs = null; switch (questId) diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java index a2b9a3f2f7..a8f49820ee 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/DenOfDevil/DenOfEvil.java @@ -205,18 +205,15 @@ public final class DenOfEvil extends AbstractNpcAI final Skill skill = SkillData.getInstance().getSkill(6149, 1); skill.applyEffects(character, character); } - else + else if (character.doDie(null)) // mobs die { - if (character.doDie(null)) // mobs die + if (character.isNpc()) { - if (character.isNpc()) + // respawn eye + final L2Npc npc = (L2Npc) character; + if (CommonUtil.contains(EYE_IDS, npc.getId())) { - // respawn eye - final L2Npc npc = (L2Npc) character; - if (CommonUtil.contains(EYE_IDS, npc.getId())) - { - ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000); - } + ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000); } } } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/DragonValley/LairOfAntharas.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/DragonValley/LairOfAntharas.java index 998b45a84b..1de4440d5e 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/DragonValley/LairOfAntharas.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/DragonValley/LairOfAntharas.java @@ -32,17 +32,17 @@ import ai.AbstractNpcAI; public final class LairOfAntharas extends AbstractNpcAI { // NPC - final private static int KNORIKS = 22857; - final private static int DRAGON_KNIGHT = 22844; - final private static int DRAGON_KNIGHT2 = 22845; - final private static int ELITE_DRAGON_KNIGHT = 22846; + private static final int KNORIKS = 22857; + private static final int DRAGON_KNIGHT = 22844; + private static final int DRAGON_KNIGHT2 = 22845; + private static final int ELITE_DRAGON_KNIGHT = 22846; - final private static int DRAGON_GUARD = 22852; - final private static int DRAGON_MAGE = 22853; + private static final int DRAGON_GUARD = 22852; + private static final int DRAGON_MAGE = 22853; // Misc - final private static int KNIGHT_CHANCE = 30; - final private static int KNORIKS_CHANCE = 60; - final private static int KNORIKS_CHANCE2 = 50; + private static final int KNIGHT_CHANCE = 30; + private static final int KNORIKS_CHANCE = 60; + private static final int KNORIKS_CHANCE2 = 50; private LairOfAntharas() { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/ForgeOfTheGods/Valakas.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/ForgeOfTheGods/Valakas.java index f6583b58eb..290a4370ba 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/ForgeOfTheGods/Valakas.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/ForgeOfTheGods/Valakas.java @@ -360,18 +360,15 @@ public final class Valakas extends AbstractNpcAI callSkillAI(npc); } } - else + else if (event.equalsIgnoreCase("valakas_unlock")) { - if (event.equalsIgnoreCase("valakas_unlock")) - { - final L2Npc valakas = addSpawn(VALAKAS, -105200, -253104, -15264, 32768, false, 0); - GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas); - GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT); - } - else if (event.equalsIgnoreCase("remove_players")) - { - ZONE.oustAllPlayers(); - } + final L2Npc valakas = addSpawn(VALAKAS, -105200, -253104, -15264, 32768, false, 0); + GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas); + GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT); + } + else if (event.equalsIgnoreCase("remove_players")) + { + ZONE.oustAllPlayers(); } return super.onAdvEvent(event, npc, player); } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java index ea0d860ed0..75f380bbce 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/ImperialTomb/FourSepulchers/FourSepulchers.java @@ -198,9 +198,9 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade STORED_PROGRESS.put(3, 1); STORED_PROGRESS.put(4, 1); } - private final static int PARTY_MEMBER_COUNT = 4; - private final static int ENTRY_DELAY = 3; // minutes - private final static int TIME_ATTACK = 60; // minutes + private static final int PARTY_MEMBER_COUNT = 4; + private static final int ENTRY_DELAY = 3; // minutes + private static final int TIME_ATTACK = 60; // minutes private FourSepulchers() { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/LairOfAntharas/Antharas/Antharas.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/LairOfAntharas/Antharas/Antharas.java index 1b59d64ba8..10e3ab4cc4 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/LairOfAntharas/Antharas/Antharas.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/LairOfAntharas/Antharas/Antharas.java @@ -246,20 +246,17 @@ public final class Antharas extends AbstractNpcAI } } } + else if (!hasQuestItems(player, STONE)) + { + htmltext = "13001-03.html"; + } else { - if (!hasQuestItems(player, STONE)) + player.teleToLocation(179700 + getRandom(700), 113800 + getRandom(2100), -7709); + if (getStatus() != WAITING) { - htmltext = "13001-03.html"; - } - else - { - player.teleToLocation(179700 + getRandom(700), 113800 + getRandom(2100), -7709); - if (getStatus() != WAITING) - { - setStatus(WAITING); - startQuestTimer("SPAWN_ANTHARAS", Config.ANTHARAS_WAIT_TIME * 60000, null, null); - } + setStatus(WAITING); + startQuestTimer("SPAWN_ANTHARAS", Config.ANTHARAS_WAIT_TIME * 60000, null, null); } } return htmltext; diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/MithrilMines/MithrilMinesTeleporter/MithrilMinesTeleporter.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/MithrilMines/MithrilMinesTeleporter/MithrilMinesTeleporter.java index 4651a8cc29..f87f6f04d2 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/MithrilMines/MithrilMinesTeleporter/MithrilMinesTeleporter.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/MithrilMines/MithrilMinesTeleporter/MithrilMinesTeleporter.java @@ -29,7 +29,7 @@ import ai.AbstractNpcAI; public final class MithrilMinesTeleporter extends AbstractNpcAI { // NPC - private final static int TELEPORT_CRYSTAL = 32652; + private static final int TELEPORT_CRYSTAL = 32652; // Location private static final Location[] LOCS = { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/StakatoNest/StakatoNestTeleporter/StakatoNestTeleporter.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/StakatoNest/StakatoNestTeleporter/StakatoNestTeleporter.java index b3c6234a4b..26ca3119a6 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/StakatoNest/StakatoNestTeleporter/StakatoNestTeleporter.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/StakatoNest/StakatoNestTeleporter/StakatoNestTeleporter.java @@ -31,7 +31,7 @@ import quests.Q00240_ImTheOnlyOneYouCanTrust.Q00240_ImTheOnlyOneYouCanTrust; public final class StakatoNestTeleporter extends AbstractNpcAI { // Locations - private final static Location[] LOCS = + private static final Location[] LOCS = { new Location(80456, -52322, -5640), new Location(88718, -46214, -4640), @@ -40,7 +40,7 @@ public final class StakatoNestTeleporter extends AbstractNpcAI new Location(87682, -43291, -4128) }; // NPC - private final static int KINTAIJIN = 32640; + private static final int KINTAIJIN = 32640; private StakatoNestTeleporter() { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/TalkingIsland/Raina/Raina.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/TalkingIsland/Raina/Raina.java index 8d327f9a55..f6067cb82c 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/TalkingIsland/Raina/Raina.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/TalkingIsland/Raina/Raina.java @@ -67,14 +67,14 @@ public final class Raina extends AbstractNpcAI // Items private static final int SUBCLASS_CERTIFICATE = 30433; private static final int CHAOS_POMANDER = 37375; - private final static int ABELIUS_POWER = 32264; - private final static int SAPYROS_POWER = 32265; - private final static int ASHAGEN_POWER = 32266; - private final static int CRANIGG_POWER = 32267; - private final static int SOLTKREIG_POWER = 32268; - private final static int NAVIAROPE_POWER = 32269; - private final static int LEISTER_POWER = 32270; - private final static int LAKCIS_POWER = 32271; + private static final int ABELIUS_POWER = 32264; + private static final int SAPYROS_POWER = 32265; + private static final int ASHAGEN_POWER = 32266; + private static final int CRANIGG_POWER = 32267; + private static final int SOLTKREIG_POWER = 32268; + private static final int NAVIAROPE_POWER = 32269; + private static final int LEISTER_POWER = 32270; + private static final int LAKCIS_POWER = 32271; // Misc private static final Set mainSubclassSet; private static final Set neverSubclassed = EnumSet.of(PlayerClass.Overlord, PlayerClass.Warsmith); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/Wastelands/QueenAnt.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/Wastelands/QueenAnt.java index bc1a5fe03a..eb1fe1e89c 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/Wastelands/QueenAnt.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/areas/Wastelands/QueenAnt.java @@ -317,12 +317,9 @@ public final class QueenAnt extends AbstractNpcAI curse = CommonSkill.RAID_CURSE.getSkill(); } } - else + else if (!character.hasAbnormalType(CommonSkill.RAID_CURSE2.getSkill().getAbnormalType()) && (getRandom(4) == 0)) { - if (!character.hasAbnormalType(CommonSkill.RAID_CURSE2.getSkill().getAbnormalType()) && (getRandom(4) == 0)) - { - curse = CommonSkill.RAID_CURSE2.getSkill(); - } + curse = CommonSkill.RAID_CURSE2.getSkill(); } if (curse != null) diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/CastleAmbassador/CastleAmbassador.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/CastleAmbassador/CastleAmbassador.java index 37998a7543..1fc5df6996 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/CastleAmbassador/CastleAmbassador.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/CastleAmbassador/CastleAmbassador.java @@ -139,7 +139,7 @@ public final class CastleAmbassador extends AbstractNpcAI } htmltext = getHtm(player.getHtmlPrefix(), htmltext); - htmltext = htmltext.replace("%castleName%", String.valueOf(fortresss.getCastleByAmbassador(npc.getId()).getName())); + htmltext = htmltext.replace("%castleName%", fortresss.getCastleByAmbassador(npc.getId()).getName()); return htmltext; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java index cbf0d01eca..da6402acdf 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/CastleChamberlain/CastleChamberlain.java @@ -1100,8 +1100,8 @@ public final class CastleChamberlain extends AbstractNpcAI else { final NpcHtmlMessage html = getHtmlPacket(player, npc, "chamberlain-25.html"); - html.replace("%owner_name%", String.valueOf(player.getName())); - html.replace("%feud_name%", String.valueOf(String.valueOf(1001000 + castle.getResidenceId()))); + html.replace("%owner_name%", player.getName()); + html.replace("%feud_name%", String.valueOf(1001000 + castle.getResidenceId())); player.sendPacket(html); giveItems(player, CROWN, 1); } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/CastleTeleporter/CastleTeleporter.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/CastleTeleporter/CastleTeleporter.java index 85c2d4ab70..c7cd273165 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/CastleTeleporter/CastleTeleporter.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/CastleTeleporter/CastleTeleporter.java @@ -169,16 +169,13 @@ public final class CastleTeleporter extends AbstractNpcAI final Siege siege = npc.getCastle().getSiege(); htmltext = (npc.isScriptValue(0)) ? (siege.isInProgress() && (siege.getControlTowerCount() == 0)) ? "CastleTeleporter-05.html" : "CastleTeleporter-04.html" : "CastleTeleporter-06.html"; } + else if ((npc.getCastle().getOwnerId() == player.getClanId()) && (player.getClanId() != 0) && (player.getSiegeState() == 2)) // Deffender + { + htmltext = getHtmlName(npc) + ".html"; + } else { - if ((npc.getCastle().getOwnerId() == player.getClanId()) && (player.getClanId() != 0) && (player.getSiegeState() == 2)) // Deffender - { - htmltext = getHtmlName(npc) + ".html"; - } - else - { - htmltext = getHtmlName(npc) + "-no.html"; - } + htmltext = getHtmlName(npc) + "-no.html"; } return htmltext; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java index f1b7116438..5c069122e1 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java @@ -490,10 +490,10 @@ public final class ClanHallManager extends AbstractNpcAI { if (func != null) { - htmltext = htmltext.replaceAll("%" + name + "recovery%", String.valueOf((int) func.getTemplate().getValue()) + "%"); + htmltext = htmltext.replaceAll("%" + name + "recovery%", (int) func.getTemplate().getValue() + "%"); htmltext = htmltext.replaceAll("%" + name + "price%", "" + NpcStringId.FONT_COLOR_FFAABB_S1_FONT_ADENA_S2_DAY_S.getId() + ""); htmltext = htmltext.replace("%" + name + "expire%", "Withdraw the fee for the next time at " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(func.getExpiration()))); - htmltext = htmltext.replaceAll("%" + name + "deactive%", "[Deactivate]"); + htmltext = htmltext.replaceAll("%" + name + "deactive%", "[Deactivate]"); } else { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/MentorGuide/MentorGuide.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/MentorGuide/MentorGuide.java index 4f22ef3849..9aba4c962c 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/MentorGuide/MentorGuide.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/MentorGuide/MentorGuide.java @@ -73,12 +73,12 @@ public final class MentorGuide extends AbstractNpcAI implements IGameXmlReader private static final int MENTEE_HEADPHONE = 34759; private static final int DIPLOMA = 33805; // Skills - private final static SkillHolder[] MENTEE_BUFFS = + private static final SkillHolder[] MENTEE_BUFFS = { new SkillHolder(9233, 1), // Mentor's Guidance }; // Skills - private final static SkillHolder[] MENTEE_BUFFS_WITHOUT_MENTOR_ONLINE = + private static final SkillHolder[] MENTEE_BUFFS_WITHOUT_MENTOR_ONLINE = { new SkillHolder(9227, 1), // Mentor's Poem of Horn new SkillHolder(9228, 1), // Mentor's Poem of Drum diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/Minigame/Minigame.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/Minigame/Minigame.java index 80d092c77c..0c5846b39c 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/Minigame/Minigame.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/Minigame/Minigame.java @@ -290,23 +290,20 @@ public final class Minigame extends AbstractNpcAI startQuestTimer("end", 4000, room.getManager(), null); } } - else + else if (room.getAttemptNumber() == MAX_ATTEMPTS) { - if (room.getAttemptNumber() == MAX_ATTEMPTS) - { - room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_VE_FAILED_ANY_FURTHER_ATTEMPTS_WOULD_BE_WASTEFUL); - room.burnThemAll(); - startQuestTimer("off", 2000, room.getManager(), null); - room.getParticipant().removeListenerIf(EventType.ON_CREATURE_SKILL_USE, listener -> listener.getOwner() == room); - startQuestTimer("end", 4000, room.getManager(), null); - } - else if (room.getAttemptNumber() < MAX_ATTEMPTS) - { - room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TOO_BAD_I_WILL_NOT_GIVE_UP_ON_THIS_THOUGH); - room.burnThemAll(); - startQuestTimer("off", 2000, room.getManager(), null); - room.setAttemptNumber(room.getAttemptNumber() + 1); - } + room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_VE_FAILED_ANY_FURTHER_ATTEMPTS_WOULD_BE_WASTEFUL); + room.burnThemAll(); + startQuestTimer("off", 2000, room.getManager(), null); + room.getParticipant().removeListenerIf(EventType.ON_CREATURE_SKILL_USE, listener -> listener.getOwner() == room); + startQuestTimer("end", 4000, room.getManager(), null); + } + else if (room.getAttemptNumber() < MAX_ATTEMPTS) + { + room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TOO_BAD_I_WILL_NOT_GIVE_UP_ON_THIS_THOUGH); + room.burnThemAll(); + startQuestTimer("off", 2000, room.getManager(), null); + room.setAttemptNumber(room.getAttemptNumber() + 1); } } } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/MysteriousWizard/MysteriousWizard.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/MysteriousWizard/MysteriousWizard.java index 7e2e0bfba7..81fd5dfd64 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/MysteriousWizard/MysteriousWizard.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/MysteriousWizard/MysteriousWizard.java @@ -57,18 +57,15 @@ public final class MysteriousWizard extends AbstractNpcAI { htmltext = "33980.html"; } - else + else if (qs != null) { - if (qs != null) + if (qs.isCond(6)) { - if (qs.isCond(6)) - { - htmltext = "33980-05.html"; - } - else if (qs.isCond(7)) - { - htmltext = "33980-04.html"; - } + htmltext = "33980-05.html"; + } + else if (qs.isCond(7)) + { + htmltext = "33980-04.html"; } } return htmltext; diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java index 9eacdc44cd..d22a8b9b16 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java @@ -156,16 +156,13 @@ public final class OlyManager extends AbstractNpcAI implements IBypassHandler { player.sendPacket(SystemMessageId.UNABLE_TO_PROCESS_THIS_REQUEST_UNTIL_YOUR_INVENTORY_S_WEIGHT_AND_SLOT_COUNT_ARE_LESS_THAN_80_PERCENT_OF_CAPACITY); } + else if (event.equals("register1v1")) + { + OlympiadManager.getInstance().registerNoble(player, CompetitionType.NON_CLASSED); + } else { - if (event.equals("register1v1")) - { - OlympiadManager.getInstance().registerNoble(player, CompetitionType.NON_CLASSED); - } - else - { - OlympiadManager.getInstance().registerNoble(player, CompetitionType.CLASSED); - } + OlympiadManager.getInstance().registerNoble(player, CompetitionType.CLASSED); } break; } @@ -340,42 +337,39 @@ public final class OlyManager extends AbstractNpcAI implements IBypassHandler activeChar.sendPacket(new ExOlympiadMatchList()); } + else if ((olymanager == null) || (olymanager.getId() != MANAGER) || (!activeChar.inObserverMode() && !activeChar.isInsideRadius(olymanager, 300, false, false))) + { + return false; + } + else if (OlympiadManager.getInstance().isRegisteredInComp(activeChar)) + { + activeChar.sendPacket(SystemMessageId.YOU_MAY_NOT_OBSERVE_A_OLYMPIAD_GAMES_MATCH_WHILE_YOU_ARE_ON_THE_WAITING_LIST); + return false; + } + else if (!Olympiad.getInstance().inCompPeriod()) + { + activeChar.sendPacket(SystemMessageId.THE_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS); + return false; + } + else if (activeChar.isOnEvent()) + { + activeChar.sendMessage("You can not observe games while registered on an event"); + return false; + } else { - if ((olymanager == null) || (olymanager.getId() != MANAGER) || (!activeChar.inObserverMode() && !activeChar.isInsideRadius(olymanager, 300, false, false))) + final int arenaId = Integer.parseInt(command.substring(12).trim()); + final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(arenaId); + if (nextArena != null) { - return false; - } - else if (OlympiadManager.getInstance().isRegisteredInComp(activeChar)) - { - activeChar.sendPacket(SystemMessageId.YOU_MAY_NOT_OBSERVE_A_OLYMPIAD_GAMES_MATCH_WHILE_YOU_ARE_ON_THE_WAITING_LIST); - return false; - } - else if (!Olympiad.getInstance().inCompPeriod()) - { - activeChar.sendPacket(SystemMessageId.THE_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS); - return false; - } - else if (activeChar.isOnEvent()) - { - activeChar.sendMessage("You can not observe games while registered on an event"); - return false; - } - else - { - final int arenaId = Integer.parseInt(command.substring(12).trim()); - final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(arenaId); - if (nextArena != null) + final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); + if (spectatorSpawns.isEmpty()) { - final List spectatorSpawns = nextArena.getStadium().getZone().getSpectatorSpawns(); - if (spectatorSpawns.isEmpty()) - { - _LOG.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); - return false; - } - final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); - activeChar.enterOlympiadObserverMode(loc, arenaId); + _LOG.warning(getClass().getSimpleName() + ": Zone: " + nextArena.getStadium().getZone() + " doesn't have specatator spawns defined!"); + return false; } + final Location loc = spectatorSpawns.get(Rnd.get(spectatorSpawns.size())); + activeChar.enterOlympiadObserverMode(loc, arenaId); } } return true; diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/PrisonGuards.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/PrisonGuards.java index 2cb8c1fdc0..d9c9c55c10 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/PrisonGuards.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/PrisonGuards.java @@ -94,14 +94,11 @@ public final class PrisonGuards extends AbstractNpcAI npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IT_S_NOT_EASY_TO_OBTAIN); } } - else + else if (!player.isAffectedBySkill(TIMER) && (npc.calculateDistance(npc.getSpawn().getLocation(), false, false) < 2000)) { - if (!player.isAffectedBySkill(TIMER) && (npc.calculateDistance(npc.getSpawn().getLocation(), false, false) < 2000)) - { - npc.setTarget(player); - npc.doCast(STONE.getSkill()); - npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE); - } + npc.setTarget(player); + npc.doCast(STONE.getSkill()); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE); } return super.onAttack(npc, player, damage, isSummon); } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/TeleportWithCharm/TeleportWithCharm.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/TeleportWithCharm/TeleportWithCharm.java index 8b0e5c6fca..95edaff796 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/TeleportWithCharm/TeleportWithCharm.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/TeleportWithCharm/TeleportWithCharm.java @@ -29,14 +29,14 @@ import ai.AbstractNpcAI; public final class TeleportWithCharm extends AbstractNpcAI { // NPCs - private final static int WHIRPY = 30540; - private final static int TAMIL = 30576; + private static final int WHIRPY = 30540; + private static final int TAMIL = 30576; // Items - private final static int ORC_GATEKEEPER_CHARM = 1658; - private final static int DWARF_GATEKEEPER_TOKEN = 1659; + private static final int ORC_GATEKEEPER_CHARM = 1658; + private static final int DWARF_GATEKEEPER_TOKEN = 1659; // Locations - private final static Location ORC_TELEPORT = new Location(-80826, 149775, -3043); - private final static Location DWARF_TELEPORT = new Location(-80826, 149775, -3043); + private static final Location ORC_TELEPORT = new Location(-80826, 149775, -3043); + private static final Location DWARF_TELEPORT = new Location(-80826, 149775, -3043); private TeleportWithCharm() { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/servitors/GateOfUnlimitedSummoning.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/servitors/GateOfUnlimitedSummoning.java index efabf17cae..c2f747f3f8 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/servitors/GateOfUnlimitedSummoning.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/servitors/GateOfUnlimitedSummoning.java @@ -46,8 +46,8 @@ public final class GateOfUnlimitedSummoning extends AbstractNpcAI } // Skills - final static private int GATE_ROOT = 11289; - final static private int GATE_VORTEX = 11291; + private static final int GATE_ROOT = 11289; + private static final int GATE_VORTEX = 11291; private GateOfUnlimitedSummoning() { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/custom/events/Elpies/Elpies.java b/L2J_Mobius_Underground/dist/game/data/scripts/custom/events/Elpies/Elpies.java index de1f3451dc..93bb20bf3c 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/custom/events/Elpies/Elpies.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/custom/events/Elpies/Elpies.java @@ -223,7 +223,7 @@ public final class Elpies extends Event } } - private static final void dropItem(L2Npc mob, L2PcInstance player, int[][] droplist) + private static void dropItem(L2Npc mob, L2PcInstance player, int[][] droplist) { final int chance = getRandom(100); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/events/CharacterBirthday/CharacterBirthday.java b/L2J_Mobius_Underground/dist/game/data/scripts/events/CharacterBirthday/CharacterBirthday.java index 05606fb9a3..3b6d2221ef 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/events/CharacterBirthday/CharacterBirthday.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/events/CharacterBirthday/CharacterBirthday.java @@ -32,7 +32,7 @@ public final class CharacterBirthday extends AbstractNpcAI private static final int ALEGRIA = 32600; private static int SPAWNS = 0; - private final static int[] GK = + private static final int[] GK = { 30006, 30059, diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java b/L2J_Mobius_Underground/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java index a92d9a1f15..025b2b1ee6 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.java @@ -130,12 +130,9 @@ public final class FreyaCelebration extends LongTimeEvent caster.addItem("FreyaCelebration", FREYA_GIFT, 1, npc, true); } - else + else if (getRandom(10) < 2) { - if (getRandom(10) < 2) - { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), FREYA_TEXT[getRandom(FREYA_TEXT.length - 1)])); - } + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), FREYA_TEXT[getRandom(FREYA_TEXT.length - 1)])); } } return super.onSkillSee(npc, caster, skill, targets, isSummon); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/events/HeavyMedal/HeavyMedal.java b/L2J_Mobius_Underground/dist/game/data/scripts/events/HeavyMedal/HeavyMedal.java index 78c4ad7deb..45478108fe 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/events/HeavyMedal/HeavyMedal.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/events/HeavyMedal/HeavyMedal.java @@ -27,20 +27,20 @@ import com.l2jmobius.gameserver.model.quest.LongTimeEvent; */ public final class HeavyMedal extends LongTimeEvent { - private final static int CAT_ROY = 31228; - private final static int CAT_WINNIE = 31229; - private final static int GLITTERING_MEDAL = 6393; + private static final int CAT_ROY = 31228; + private static final int CAT_WINNIE = 31229; + private static final int GLITTERING_MEDAL = 6393; - private final static int WIN_CHANCE = 50; + private static final int WIN_CHANCE = 50; - private final static int[] MEDALS = + private static final int[] MEDALS = { 5, 10, 20, 40 }; - private final static int[] BADGES = + private static final int[] BADGES = { 6399, 6400, @@ -92,12 +92,12 @@ public final class HeavyMedal extends LongTimeEvent playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET); level++; } - htmltext = "31229-" + event.toLowerCase() + "-" + String.valueOf(level) + ".htm"; + htmltext = "31229-" + event.toLowerCase() + "-" + level + ".htm"; } } else if (event.equalsIgnoreCase("talk")) { - htmltext = String.valueOf(npc.getId()) + "-lvl-" + String.valueOf(level) + ".htm"; + htmltext = npc.getId() + "-lvl-" + level + ".htm"; } return htmltext; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/actionhandlers/L2StaticObjectInstanceAction.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/actionhandlers/L2StaticObjectInstanceAction.java index 2e78415fad..2c0368fa04 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/actionhandlers/L2StaticObjectInstanceAction.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/actionhandlers/L2StaticObjectInstanceAction.java @@ -51,29 +51,26 @@ public class L2StaticObjectInstanceAction implements IActionHandler // Notify the L2PcInstance AI with AI_INTENTION_INTERACT activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, staticObject); } - else + else if (staticObject.getType() == 2) { - if (staticObject.getType() == 2) + final String filename = (staticObject.getId() == 24230101) ? "data/html/signboards/tomb_of_crystalgolem.htm" : "data/html/signboards/pvp_signboard.htm"; + final String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename); + final NpcHtmlMessage html = new NpcHtmlMessage(staticObject.getObjectId()); + + if (content == null) { - final String filename = (staticObject.getId() == 24230101) ? "data/html/signboards/tomb_of_crystalgolem.htm" : "data/html/signboards/pvp_signboard.htm"; - final String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename); - final NpcHtmlMessage html = new NpcHtmlMessage(staticObject.getObjectId()); - - if (content == null) - { - html.setHtml("Signboard is missing:
" + filename + ""); - } - else - { - html.setHtml(content); - } - - activeChar.sendPacket(html); + html.setHtml("Signboard is missing:
" + filename + ""); } - else if (staticObject.getType() == 0) + else { - activeChar.sendPacket(staticObject.getMap()); + html.setHtml(content); } + + activeChar.sendPacket(html); + } + else if (staticObject.getType() == 0) + { + activeChar.sendPacket(staticObject.getMap()); } } return true; diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java index b286bf60ec..c0e4c540c7 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java @@ -39,7 +39,7 @@ import com.l2jmobius.gameserver.util.GMAudit; public class AdminBuffs implements IAdminCommandHandler { - private final static int PAGE_LIMIT = 20; + private static final int PAGE_LIMIT = 20; private static final String[] ADMIN_COMMANDS = { @@ -381,7 +381,7 @@ public class AdminBuffs implements IAdminCommandHandler String slots = ""; for (AbnormalType slot : target.getEffectList().getBlockedAbnormalTypes()) { - slots += slot.toString() + ", "; + slots += slot + ", "; } if (!slots.isEmpty() && (slots.length() > 3)) @@ -395,7 +395,7 @@ public class AdminBuffs implements IAdminCommandHandler if (Config.GMAUDIT) { - GMAudit.auditGMAction(activeChar.getName() + " [" + activeChar.getObjectId() + "]", "getbuffs", target.getName() + " (" + Integer.toString(target.getObjectId()) + ")", ""); + GMAudit.auditGMAction(activeChar.getName() + " [" + activeChar.getObjectId() + "]", "getbuffs", target.getName() + " (" + target.getObjectId() + ")", ""); } } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index 1cc8b026e1..7778c56402 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -620,17 +620,13 @@ public class AdminEditChar implements IAdminCommandHandler ps.setString(1, playerName); ps.execute(); } + else if (changeCreateExpiryTime) // removing penalty + { + player.setClanCreateExpiryTime(0); + } else { - // removing penalty - if (changeCreateExpiryTime) - { - player.setClanCreateExpiryTime(0); - } - else - { - player.setClanJoinExpiryTime(0); - } + player.setClanJoinExpiryTime(0); } activeChar.sendMessage("Clan penalty successfully removed to character: " + playerName); @@ -1161,8 +1157,8 @@ public class AdminEditChar implements IAdminCommandHandler adminReply.replace("%account%", player.getAccountName()); adminReply.replace("%ip%", ip); adminReply.replace("%hwid%", (player.getClient() != null) && (player.getClient().getHardwareInfo() != null) ? player.getClient().getHardwareInfo().getMacAddress() : "Unknown"); - adminReply.replace("%ai%", String.valueOf(player.getAI().getIntention().name())); - adminReply.replace("%inst%", player.isInInstance() ? "InstanceId:" + String.valueOf(player.getInstanceId()) + "" : ""); + adminReply.replace("%ai%", player.getAI().getIntention().name()); + adminReply.replace("%inst%", player.isInInstance() ? "InstanceId:" + player.getInstanceId() + "" : ""); adminReply.replace("%noblesse%", player.isNoble() ? "Yes" : "No"); activeChar.sendPacket(adminReply); } @@ -1292,12 +1288,9 @@ public class AdminEditChar implements IAdminCommandHandler { findDisconnected = true; } - else + else if (!IpAdress.matches("^(?:(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2(?:[0-4][0-9]|5[0-5]))\\.){3}(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2(?:[0-4][0-9]|5[0-5]))$")) { - if (!IpAdress.matches("^(?:(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2(?:[0-4][0-9]|5[0-5]))\\.){3}(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2(?:[0-4][0-9]|5[0-5]))$")) - { - throw new IllegalArgumentException("Malformed IPv4 number"); - } + throw new IllegalArgumentException("Malformed IPv4 number"); } int CharactersFound = 0; @@ -1365,7 +1358,7 @@ public class AdminEditChar implements IAdminCommandHandler } else if (CharactersFound > 20) { - adminReply.replace("%number%", " more than " + String.valueOf(CharactersFound)); + adminReply.replace("%number%", " more than " + CharactersFound); replyMSG2 = "s.
In order to avoid you a client crash I won't display results beyond the 20th character."; } else if (CharactersFound == 1) @@ -1605,7 +1598,7 @@ public class AdminEditChar implements IAdminCommandHandler final String owner = target.getActingPlayer().getName(); html.replace("%owner%", " " + owner + ""); html.replace("%class%", target.getClass().getSimpleName()); - html.replace("%ai%", target.hasAI() ? String.valueOf(target.getAI().getIntention().name()) : "NULL"); + html.replace("%ai%", target.hasAI() ? target.getAI().getIntention().name() : "NULL"); html.replace("%hp%", (int) target.getStatus().getCurrentHp() + "/" + target.getStat().getMaxHp()); html.replace("%mp%", (int) target.getStatus().getCurrentMp() + "/" + target.getStat().getMaxMp()); html.replace("%karma%", Integer.toString(target.getReputation())); @@ -1649,7 +1642,7 @@ public class AdminEditChar implements IAdminCommandHandler text.append("
"); } text.append(member.getLevel() + "" + member.getName() + ""); - text.append("" + member.getClassId().toString() + "
"); + text.append("" + member.getClassId() + ""); color = !color; } html.replace("%player%", target.getName()); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java index 874c07015c..9d557db2dc 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEventEngine.java @@ -381,12 +381,9 @@ public class AdminEventEngine implements IAdminCommandHandler } } } - else + else if ((activeChar.getTarget() != null) && (activeChar.getTarget() instanceof L2PcInstance)) { - if ((activeChar.getTarget() != null) && (activeChar.getTarget() instanceof L2PcInstance)) - { - L2Event.removeAndResetPlayer((L2PcInstance) activeChar.getTarget()); - } + L2Event.removeAndResetPlayer((L2PcInstance) activeChar.getTarget()); } showEventControl(activeChar); } @@ -464,7 +461,7 @@ public class AdminEventEngine implements IAdminCommandHandler result.append(""); - return note + result.toString(); + return note + result; } public void showMainPage(L2PcInstance activeChar) diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminFortSiege.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminFortSiege.java index 448dacfcdd..b8fc29af5e 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminFortSiege.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminFortSiege.java @@ -82,18 +82,15 @@ public class AdminFortSiege implements IAdminCommandHandler { activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET); } + else if (fort.getSiege().addAttacker(player, false) == 4) + { + final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_CLAN_HAS_BEEN_REGISTERED_TO_S1_S_FORTRESS_BATTLE); + sm.addCastleId(fort.getResidenceId()); + player.sendPacket(sm); + } else { - if (fort.getSiege().addAttacker(player, false) == 4) - { - final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_CLAN_HAS_BEEN_REGISTERED_TO_S1_S_FORTRESS_BATTLE); - sm.addCastleId(fort.getResidenceId()); - player.sendPacket(sm); - } - else - { - player.sendMessage("During registering error occurred!"); - } + player.sendMessage("During registering error occurred!"); } } else if (command.equalsIgnoreCase("admin_clear_fortsiege_list")) diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java index f0b792500f..bb357a155b 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java @@ -454,7 +454,7 @@ public final class AdminPForge implements IAdminCommandHandler target = activeChar.getTarget(); if ((target != null) && (target instanceof L2Character)) { - value = String.valueOf(((L2Character) target).getTitle()); + value = ((L2Character) target).getTitle(); } else { @@ -465,7 +465,7 @@ public final class AdminPForge implements IAdminCommandHandler target = activeChar.getTarget(); if (target != null) { - value = String.valueOf(target.getName()); + value = target.getName(); } else { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPremium.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPremium.java index 4bb7ec5905..036c291a2c 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPremium.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPremium.java @@ -119,14 +119,14 @@ public class AdminPremium implements IAdminCommandHandler // TODO: Add check if account exists XD PremiumManager.getInstance().updatePremiumData(months, accountName); - admin.sendMessage("Account " + accountName + " will now have premium status until " + String.valueOf(new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumEndDate(accountName))) + "."); + admin.sendMessage("Account " + accountName + " will now have premium status until " + new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumEndDate(accountName)) + "."); } private void viewPremiumInfo(L2PcInstance admin, String accountName) { if (PremiumManager.getInstance().getPremiumEndDate(accountName) > 0) { - admin.sendMessage("Account " + accountName + " has premium status until " + String.valueOf(new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumEndDate(accountName))) + "."); + admin.sendMessage("Account " + accountName + " has premium status until " + new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumEndDate(accountName)) + "."); } else { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java index 8490500087..5b95022983 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminPunishment.java @@ -385,7 +385,7 @@ public class AdminPunishment implements IAdminCommandHandler return true; } - private static final String findCharId(String key) + private static String findCharId(String key) { final int charId = CharNameTable.getInstance().getIdByName(key); if (charId > 0) // Yeah its a char name! diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java index 7d43b18428..592bb7489e 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminShowQuests.java @@ -90,7 +90,7 @@ public class AdminShowQuests implements IAdminCommandHandler { val[0] = "full"; } - if (cmdParams[2].indexOf("_") != -1) + if (cmdParams[2].contains("_")) { val[0] = "name"; val[1] = cmdParams[2]; diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminSpawn.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminSpawn.java index 6bc3dce918..dc9686475c 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminSpawn.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminSpawn.java @@ -324,16 +324,13 @@ public class AdminSpawn implements IAdminCommandHandler } } } + else if (showposition && (npc != null)) + { + activeChar.sendMessage(index + " - " + spawn.getTemplate().getName() + " (" + spawn + "): " + npc.getX() + " " + npc.getY() + " " + npc.getZ()); + } else { - if (showposition && (npc != null)) - { - activeChar.sendMessage(index + " - " + spawn.getTemplate().getName() + " (" + spawn + "): " + npc.getX() + " " + npc.getY() + " " + npc.getZ()); - } - else - { - activeChar.sendMessage(index + " - " + spawn.getTemplate().getName() + " (" + spawn + "): " + spawn.getX() + " " + spawn.getY() + " " + spawn.getZ()); - } + activeChar.sendMessage(index + " - " + spawn.getTemplate().getName() + " (" + spawn + "): " + spawn.getX() + " " + spawn.getY() + " " + spawn.getZ()); } } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/Observation.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/Observation.java index 3b1e3544c3..5ec5c94594 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/Observation.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/Observation.java @@ -154,7 +154,7 @@ public class Observation implements IBypassHandler return false; } - private static final void doObserve(L2PcInstance player, L2Npc npc, Location pos, long cost) + private static void doObserve(L2PcInstance player, L2Npc npc, Location pos, long cost) { if (player.reduceAdena("Broadcast", cost, npc, true)) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/PlayerHelp.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/PlayerHelp.java index d9de630584..6c16720329 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/PlayerHelp.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/PlayerHelp.java @@ -42,7 +42,7 @@ public class PlayerHelp implements IBypassHandler } final String path = command.substring(12); - if (path.indexOf("..") != -1) + if (path.contains("..")) { return false; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/PrivateWarehouse.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/PrivateWarehouse.java index 12ef9be11b..740b004b22 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/PrivateWarehouse.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/PrivateWarehouse.java @@ -73,7 +73,7 @@ public class PrivateWarehouse implements IBypassHandler return false; } - private static final void showWithdrawWindow(L2PcInstance player) + private static void showWithdrawWindow(L2PcInstance player) { player.sendPacket(ActionFailed.STATIC_PACKET); player.setActiveWarehouse(player.getWarehouse()); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/Wear.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/Wear.java index 9e14cc1c49..9291747b2a 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/Wear.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/Wear.java @@ -68,7 +68,7 @@ public class Wear implements IBypassHandler return false; } - private static final void showWearWindow(L2PcInstance player, int val) + private static void showWearWindow(L2PcInstance player, int val) { final L2BuyList buyList = BuyListData.getInstance().getBuyList(val); if (buyList == null) diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/communityboard/FavoriteBoard.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/communityboard/FavoriteBoard.java index aa63a0d182..8a6c7949d7 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/communityboard/FavoriteBoard.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/communityboard/FavoriteBoard.java @@ -69,7 +69,7 @@ public class FavoriteBoard implements IParseBoardHandler { while (rs.next()) { - String link = list.replaceAll("%fav_bypass%", String.valueOf(rs.getString("favBypass"))); + String link = list.replaceAll("%fav_bypass%", rs.getString("favBypass")); link = link.replaceAll("%fav_title%", rs.getString("favTitle")); final SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); link = link.replaceAll("%fav_add_date%", date.format(rs.getTimestamp("favAddDate"))); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/communityboard/RegionBoard.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/communityboard/RegionBoard.java index 3a41f2786e..7a9b5fd57d 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/communityboard/RegionBoard.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/communityboard/RegionBoard.java @@ -64,7 +64,7 @@ public class RegionBoard implements IWriteBoardHandler link = link.replace("%region_name%", String.valueOf(REGIONS[i])); link = link.replace("%region_owning_clan%", (clan != null ? clan.getName() : "NPC")); link = link.replace("%region_owning_clan_alliance%", ((clan != null) && (clan.getAllyName() != null) ? clan.getAllyName() : "")); - link = link.replace("%region_tax_rate%", String.valueOf(castle.getTaxRate() * 100) + "%"); + link = link.replace("%region_tax_rate%", (castle.getTaxRate() * 100) + "%"); sb.append(link); } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java index 6347e3f0b2..84f3d3d721 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/ClassChange.java @@ -37,7 +37,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ability.ExAcquireAPSkillLi public class ClassChange extends AbstractEffect { private final int _index; - private final static int IDENTITY_CRISIS_SKILL_ID = 1570; + private static final int IDENTITY_CRISIS_SKILL_ID = 1570; public ClassChange(StatsSet params) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/CreateItemRandom.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/CreateItemRandom.java index 105c4219da..4811702e93 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/CreateItemRandom.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/CreateItemRandom.java @@ -69,7 +69,8 @@ public class CreateItemRandom extends AbstractEffect double comulativeChance = 0; for (ItemChanceHolder holder : item.getItem().getCreateItems()) { - if ((comulativeChance += holder.getChance()) >= random) + comulativeChance += holder.getChance(); + if (comulativeChance >= random) { selectedItem = holder; break; diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/Heal.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/Heal.java index e709534a37..109a70b11b 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/Heal.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/Heal.java @@ -131,21 +131,18 @@ public final class Heal extends AbstractEffect { effected.sendPacket(SystemMessageId.REJUVENATING_HP); } + else if (effector.isPlayer() && (effector != effected)) + { + final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_HAS_BEEN_RESTORED_BY_C1); + sm.addString(effector.getName()); + sm.addInt((int) amount); + effected.sendPacket(sm); + } else { - if (effector.isPlayer() && (effector != effected)) - { - final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_HAS_BEEN_RESTORED_BY_C1); - sm.addString(effector.getName()); - sm.addInt((int) amount); - effected.sendPacket(sm); - } - else - { - final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HP_HAS_BEEN_RESTORED); - sm.addInt((int) amount); - effected.sendPacket(sm); - } + final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HP_HAS_BEEN_RESTORED); + sm.addInt((int) amount); + effected.sendPacket(sm); } } } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/TwoHandedBluntBonus.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/TwoHandedBluntBonus.java index 79be2fdb65..ab0d351cda 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/TwoHandedBluntBonus.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/TwoHandedBluntBonus.java @@ -33,8 +33,8 @@ import com.l2jmobius.gameserver.model.stats.Stats; */ public class TwoHandedBluntBonus extends AbstractEffect { - private final static Condition _weaponTypeCondition = new ConditionUsingItemType(WeaponType.BLUNT.mask()); - private final static Condition _slotCondition = new ConditionUsingSlotType(L2Item.SLOT_LR_HAND); + private static final Condition _weaponTypeCondition = new ConditionUsingItemType(WeaponType.BLUNT.mask()); + private static final Condition _slotCondition = new ConditionUsingSlotType(L2Item.SLOT_LR_HAND); protected final double _pAtkAmount; protected final StatModifierType _pAtkmode; diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/TwoHandedSwordBonus.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/TwoHandedSwordBonus.java index 8df3ca20ee..4d9fe2bfab 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/TwoHandedSwordBonus.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/TwoHandedSwordBonus.java @@ -33,8 +33,8 @@ import com.l2jmobius.gameserver.model.stats.Stats; */ public class TwoHandedSwordBonus extends AbstractEffect { - private final static Condition _weaponTypeCondition = new ConditionUsingItemType(WeaponType.SWORD.mask()); - private final static Condition _slotCondition = new ConditionUsingSlotType(L2Item.SLOT_LR_HAND); + private static final Condition _weaponTypeCondition = new ConditionUsingItemType(WeaponType.SWORD.mask()); + private static final Condition _slotCondition = new ConditionUsingSlotType(L2Item.SLOT_LR_HAND); protected final double _pAtkAmount; protected final StatModifierType _pAtkmode; diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/itemhandlers/FatedSupportBox.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/itemhandlers/FatedSupportBox.java index 45884513f4..4caf32fa34 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/itemhandlers/FatedSupportBox.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/itemhandlers/FatedSupportBox.java @@ -91,20 +91,17 @@ public class FatedSupportBox implements IItemHandler { player.addItem(getClass().getSimpleName(), FATED_BOX_WIZARD, 1, player, true); } + else if (CategoryData.getInstance().isInCategory(CategoryType.SUB_GROUP_ROGUE, classId.getId())) + { + player.addItem(getClass().getSimpleName(), FATED_BOX_ROGUE, 1, player, true); + } + else if (CategoryData.getInstance().isInCategory(CategoryType.SUB_GROUP_KNIGHT, classId.getId())) + { + player.addItem(getClass().getSimpleName(), FATED_BOX_FIGHTER, 1, player, true); + } else { - if (CategoryData.getInstance().isInCategory(CategoryType.SUB_GROUP_ROGUE, classId.getId())) - { - player.addItem(getClass().getSimpleName(), FATED_BOX_ROGUE, 1, player, true); - } - else if (CategoryData.getInstance().isInCategory(CategoryType.SUB_GROUP_KNIGHT, classId.getId())) - { - player.addItem(getClass().getSimpleName(), FATED_BOX_FIGHTER, 1, player, true); - } - else - { - player.addItem(getClass().getSimpleName(), FATED_BOX_WARRIOR, 1, player, true); - } + player.addItem(getClass().getSimpleName(), FATED_BOX_WARRIOR, 1, player, true); } break; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java index ad8ef4a113..1724eb4fe8 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/telnethandlers/server/Debug.java @@ -252,7 +252,7 @@ public class Debug implements ITelnetCommand final StackTraceElement[] stes = entry.getValue(); final Thread t = entry.getKey(); sb.append("--------------\r\n"); - sb.append(t.toString() + " (" + t.getId() + ")\r\n"); + sb.append(t + " (" + t.getId() + ")\r\n"); sb.append("State: " + t.getState() + "\r\n"); sb.append("isAlive: " + t.isAlive() + " | isDaemon: " + t.isDaemon() + " | isInterrupted: " + t.isInterrupted() + "\r\n"); sb.append("\r\n"); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/telnethandlers/server/ThreadPoolDebug.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/telnethandlers/server/ThreadPoolDebug.java index f4596cb5b7..f140741d63 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/telnethandlers/server/ThreadPoolDebug.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/telnethandlers/server/ThreadPoolDebug.java @@ -136,7 +136,7 @@ public class ThreadPoolDebug implements ITelnetCommand return sb.toString(); } - private static final T getObject(Class sourceClass, Object sourceInstance, String fieldName, Class targetClass) + private static T getObject(Class sourceClass, Object sourceInstance, String fieldName, Class targetClass) { try { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/instances/IceQueensCastleBattle/IceQueensCastleBattle.java b/L2J_Mobius_Underground/dist/game/data/scripts/instances/IceQueensCastleBattle/IceQueensCastleBattle.java index de156c2b7a..7615844602 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/instances/IceQueensCastleBattle/IceQueensCastleBattle.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/instances/IceQueensCastleBattle/IceQueensCastleBattle.java @@ -784,13 +784,10 @@ public final class IceQueensCastleBattle extends AbstractInstance npc.doCast(ICE_BALL.getSkill()); } } - else + else if (canReachMostHated && SkillCaster.checkUseConditions(npc, ICE_BALL.getSkill())) { - if (canReachMostHated && SkillCaster.checkUseConditions(npc, ICE_BALL.getSkill())) - { - npc.setTarget(mostHated); - npc.doCast(ICE_BALL.getSkill()); - } + npc.setTarget(mostHated); + npc.doCast(ICE_BALL.getSkill()); } } else if (getRandom(10000) < 800) @@ -803,13 +800,10 @@ public final class IceQueensCastleBattle extends AbstractInstance npc.doCast(SUMMON_ELEMENTAL.getSkill()); } } - else + else if (canReachMostHated && SkillCaster.checkUseConditions(npc, SUMMON_ELEMENTAL.getSkill())) { - if (canReachMostHated && SkillCaster.checkUseConditions(npc, SUMMON_ELEMENTAL.getSkill())) - { - npc.setTarget(mostHated); - npc.doCast(SUMMON_ELEMENTAL.getSkill()); - } + npc.setTarget(mostHated); + npc.doCast(SUMMON_ELEMENTAL.getSkill()); } } else if (getRandom(10000) < 1500) @@ -871,13 +865,10 @@ public final class IceQueensCastleBattle extends AbstractInstance npc.doCast(ICE_BALL.getSkill()); } } - else + else if (canReachMostHated && SkillCaster.checkUseConditions(npc, ICE_BALL.getSkill())) { - if (canReachMostHated && SkillCaster.checkUseConditions(npc, ICE_BALL.getSkill())) - { - npc.setTarget(mostHated); - npc.doCast(ICE_BALL.getSkill()); - } + npc.setTarget(mostHated); + npc.doCast(ICE_BALL.getSkill()); } } else if (getRandom(10000) < 1333) @@ -890,13 +881,10 @@ public final class IceQueensCastleBattle extends AbstractInstance npc.doCast(SUMMON_ELEMENTAL.getSkill()); } } - else + else if (canReachMostHated && SkillCaster.checkUseConditions(npc, SUMMON_ELEMENTAL.getSkill())) { - if (canReachMostHated && SkillCaster.checkUseConditions(npc, SUMMON_ELEMENTAL.getSkill())) - { - npc.setTarget(mostHated); - npc.doCast(SUMMON_ELEMENTAL.getSkill()); - } + npc.setTarget(mostHated); + npc.doCast(SUMMON_ELEMENTAL.getSkill()); } } else if (getRandom(10000) < 1500) diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/instances/IstinaCavern/IstinaCavern.java b/L2J_Mobius_Underground/dist/game/data/scripts/instances/IstinaCavern/IstinaCavern.java index ad1c5fcc95..e27404b391 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/instances/IstinaCavern/IstinaCavern.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/instances/IstinaCavern/IstinaCavern.java @@ -140,16 +140,13 @@ public final class IstinaCavern extends AbstractInstance } } } - else + else if (event.equals("enterInstanceCommon")) { - if (event.equals("enterInstanceCommon")) - { - enterInstance(player, npc, TEMPLATE_ID_COMMON); - } - else if (event.equals("enterInstanceExtreme")) - { - enterInstance(player, npc, TEMPLATE_ID_EXTREME); - } + enterInstance(player, npc, TEMPLATE_ID_COMMON); + } + else if (event.equals("enterInstanceExtreme")) + { + enterInstance(player, npc, TEMPLATE_ID_EXTREME); } return htmltext; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/instances/KartiasLabyrinth/KartiasLabyrinth.java b/L2J_Mobius_Underground/dist/game/data/scripts/instances/KartiasLabyrinth/KartiasLabyrinth.java index 0cf4bb5c1e..4b8d1e585b 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/instances/KartiasLabyrinth/KartiasLabyrinth.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/instances/KartiasLabyrinth/KartiasLabyrinth.java @@ -584,20 +584,17 @@ public final class KartiasLabyrinth extends AbstractInstance npc.deleteMe(); } } - else // Mini bosses + else if (npc.isScriptValue(1)) { - if (npc.isScriptValue(1)) - { - npc.setScriptValue(2); - addMoveToDesire(npc, instance.getTemplateParameters().getLocation("bossEscapeLoc2"), 23); - } - else if (npc.isScriptValue(2)) - { - instance.setParameter("MINIBOSS_SURVIVED", true); - instance.openCloseDoor(instance.getTemplateParameters().getInt("thirdDoorId"), true); - instance.setStatus(3); // Used for notify helper's AI - npc.deleteMe(); - } + npc.setScriptValue(2); + addMoveToDesire(npc, instance.getTemplateParameters().getLocation("bossEscapeLoc2"), 23); + } + else if (npc.isScriptValue(2)) + { + instance.setParameter("MINIBOSS_SURVIVED", true); + instance.openCloseDoor(instance.getTemplateParameters().getInt("thirdDoorId"), true); + instance.setStatus(3); // Used for notify helper's AI + npc.deleteMe(); } } super.onMoveFinished(npc); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/instances/LastImperialTomb/LastImperialTomb.java b/L2J_Mobius_Underground/dist/game/data/scripts/instances/LastImperialTomb/LastImperialTomb.java index 39a14835d2..faaa7893d5 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/instances/LastImperialTomb/LastImperialTomb.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/instances/LastImperialTomb/LastImperialTomb.java @@ -406,7 +406,7 @@ public final class LastImperialTomb extends AbstractInstance case "FRINTEZZA_INTRO_19": { final Instance world = player.getInstanceWorld(); - Map portraits = new HashMap<>(); + final Map portraits = new HashMap<>(); for (int i = 0; i < PORTRAIT_SPAWNS.length; i++) { final L2Npc portrait = addSpawn(PORTRAIT_SPAWNS[i][0], PORTRAIT_SPAWNS[i][1], PORTRAIT_SPAWNS[i][2], PORTRAIT_SPAWNS[i][3], PORTRAIT_SPAWNS[i][4], false, 0, false, world.getId()); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00016_TheComingDarkness/Q00016_TheComingDarkness.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00016_TheComingDarkness/Q00016_TheComingDarkness.java index ff5146ebf0..e485fea04e 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00016_TheComingDarkness/Q00016_TheComingDarkness.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00016_TheComingDarkness/Q00016_TheComingDarkness.java @@ -219,12 +219,9 @@ public final class Q00016_TheComingDarkness extends Quest { htmltext = "31512-01.html"; } - else + else if (qs.isMemoState(1)) { - if (qs.isMemoState(1)) - { - htmltext = "31512-04.html"; - } + htmltext = "31512-04.html"; } break; } @@ -234,12 +231,9 @@ public final class Q00016_TheComingDarkness extends Quest { htmltext = "31513-01.html"; } - else + else if (qs.isMemoState(2)) { - if (qs.isMemoState(2)) - { - htmltext = "31513-04.html"; - } + htmltext = "31513-04.html"; } break; } @@ -249,12 +243,9 @@ public final class Q00016_TheComingDarkness extends Quest { htmltext = "31514-01.html"; } - else + else if (qs.isMemoState(3)) { - if (qs.isMemoState(3)) - { - htmltext = "31514-04.html"; - } + htmltext = "31514-04.html"; } break; } @@ -264,12 +255,9 @@ public final class Q00016_TheComingDarkness extends Quest { htmltext = "31515-01.html"; } - else + else if (qs.isMemoState(4)) { - if (qs.isMemoState(4)) - { - htmltext = "31515-04.html"; - } + htmltext = "31515-04.html"; } break; } @@ -279,12 +267,9 @@ public final class Q00016_TheComingDarkness extends Quest { htmltext = "31516-01.html"; } - else + else if (qs.isMemoState(5)) { - if (qs.isMemoState(5)) - { - htmltext = "31516-04.html"; - } + htmltext = "31516-04.html"; } break; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00017_LightAndDarkness/Q00017_LightAndDarkness.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00017_LightAndDarkness/Q00017_LightAndDarkness.java index 95031bc1ae..f6f95c658f 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00017_LightAndDarkness/Q00017_LightAndDarkness.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00017_LightAndDarkness/Q00017_LightAndDarkness.java @@ -204,12 +204,9 @@ public final class Q00017_LightAndDarkness extends Quest { htmltext = "31508-01.html"; } - else + else if (qs.isMemoState(1)) { - if (qs.isMemoState(1)) - { - htmltext = "31508-04.html"; - } + htmltext = "31508-04.html"; } break; } @@ -219,12 +216,9 @@ public final class Q00017_LightAndDarkness extends Quest { htmltext = "31509-01.html"; } - else + else if (qs.isMemoState(2)) { - if (qs.isMemoState(2)) - { - htmltext = "31509-04.html"; - } + htmltext = "31509-04.html"; } break; } @@ -234,12 +228,9 @@ public final class Q00017_LightAndDarkness extends Quest { htmltext = "31510-01.html"; } - else + else if (qs.isMemoState(3)) { - if (qs.isMemoState(3)) - { - htmltext = "31510-04.html"; - } + htmltext = "31510-04.html"; } break; } @@ -249,12 +240,9 @@ public final class Q00017_LightAndDarkness extends Quest { htmltext = "31511-01.html"; } - else + else if (qs.isMemoState(4)) { - if (qs.isMemoState(4)) - { - htmltext = "31511-04.html"; - } + htmltext = "31511-04.html"; } break; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00177_SplitDestiny/Q00177_SplitDestiny.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00177_SplitDestiny/Q00177_SplitDestiny.java index e9acc368ec..a2ed81b2e7 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00177_SplitDestiny/Q00177_SplitDestiny.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00177_SplitDestiny/Q00177_SplitDestiny.java @@ -235,56 +235,53 @@ public final class Q00177_SplitDestiny extends Quest { htmltext = "33344-12.htm"; } + else if (!player.isSubClassActive() || !player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) || (player.getLevel() < 80)) + { + htmltext = "33344-02.htm"; + } + else if (!CategoryData.getInstance().isInCategory(CategoryType.AWAKEN_GROUP, player.getBaseClass())) + { + htmltext = "33344-03.htm"; + } + else if (CategoryData.getInstance().isInCategory(CategoryType.SIGEL_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.SIGEL_CANDIDATE)) + { + htmltext = "33344-sigel.htm"; + } + else if (CategoryData.getInstance().isInCategory(CategoryType.TYRR_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.TYRR_CANDIDATE)) + { + htmltext = "33344-tyrr.htm"; + } + else if (CategoryData.getInstance().isInCategory(CategoryType.OTHELL_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.OTHELL_CANDIDATE)) + { + htmltext = "33344-othell.htm"; + } + else if (CategoryData.getInstance().isInCategory(CategoryType.YUL_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.YUL_CANDIDATE)) + { + htmltext = "33344-yul.htm"; + } + else if (CategoryData.getInstance().isInCategory(CategoryType.FEOH_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.FEOH_CANDIDATE)) + { + htmltext = "33344-feoh.htm"; + } + else if (CategoryData.getInstance().isInCategory(CategoryType.ISS_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.ISS_CANDIDATE)) + { + htmltext = "33344-iss.htm"; + } + else if (CategoryData.getInstance().isInCategory(CategoryType.WYNN_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.WYNN_CANDIDATE)) + { + htmltext = "33344-wynn.htm"; + } + else if (CategoryData.getInstance().isInCategory(CategoryType.AEORE_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.AEORE_CANDIDATE)) + { + htmltext = "33344-aeore.htm"; + } + else if (player.hasDualClass()) + { + htmltext = "33344-12.htm"; + } else { - if (!player.isSubClassActive() || !player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) || (player.getLevel() < 80)) - { - htmltext = "33344-02.htm"; - } - else if (!CategoryData.getInstance().isInCategory(CategoryType.AWAKEN_GROUP, player.getBaseClass())) - { - htmltext = "33344-03.htm"; - } - else if (CategoryData.getInstance().isInCategory(CategoryType.SIGEL_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.SIGEL_CANDIDATE)) - { - htmltext = "33344-sigel.htm"; - } - else if (CategoryData.getInstance().isInCategory(CategoryType.TYRR_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.TYRR_CANDIDATE)) - { - htmltext = "33344-tyrr.htm"; - } - else if (CategoryData.getInstance().isInCategory(CategoryType.OTHELL_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.OTHELL_CANDIDATE)) - { - htmltext = "33344-othell.htm"; - } - else if (CategoryData.getInstance().isInCategory(CategoryType.YUL_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.YUL_CANDIDATE)) - { - htmltext = "33344-yul.htm"; - } - else if (CategoryData.getInstance().isInCategory(CategoryType.FEOH_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.FEOH_CANDIDATE)) - { - htmltext = "33344-feoh.htm"; - } - else if (CategoryData.getInstance().isInCategory(CategoryType.ISS_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.ISS_CANDIDATE)) - { - htmltext = "33344-iss.htm"; - } - else if (CategoryData.getInstance().isInCategory(CategoryType.WYNN_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.WYNN_CANDIDATE)) - { - htmltext = "33344-wynn.htm"; - } - else if (CategoryData.getInstance().isInCategory(CategoryType.AEORE_GROUP, player.getBaseClass()) && player.isInCategory(CategoryType.AEORE_CANDIDATE)) - { - htmltext = "33344-aeore.htm"; - } - else if (player.hasDualClass()) - { - htmltext = "33344-12.htm"; - } - else - { - htmltext = "33344-01.htm"; - } + htmltext = "33344-01.htm"; } } else if ((npc.getId() == ISHUMA) && qs.isStarted()) diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00193_SevenSignsDyingMessage/Q00193_SevenSignsDyingMessage.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00193_SevenSignsDyingMessage/Q00193_SevenSignsDyingMessage.java index 46d4de8b92..7c3a31fe9e 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00193_SevenSignsDyingMessage/Q00193_SevenSignsDyingMessage.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00193_SevenSignsDyingMessage/Q00193_SevenSignsDyingMessage.java @@ -233,7 +233,7 @@ public final class Q00193_SevenSignsDyingMessage extends Quest @Override public String onTalk(L2Npc npc, L2PcInstance player) { - QuestState st = getQuestState(player, true); + final QuestState st = getQuestState(player, true); String htmltext = getNoQuestMsg(player); switch (st.getState()) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00194_SevenSignsMammonsContract/Q00194_SevenSignsMammonsContract.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00194_SevenSignsMammonsContract/Q00194_SevenSignsMammonsContract.java index b2ed04c7d0..e192c525a7 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00194_SevenSignsMammonsContract/Q00194_SevenSignsMammonsContract.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00194_SevenSignsMammonsContract/Q00194_SevenSignsMammonsContract.java @@ -347,7 +347,7 @@ public final class Q00194_SevenSignsMammonsContract extends Quest @Override public String onTalk(L2Npc npc, L2PcInstance player) { - QuestState st = getQuestState(player, true); + final QuestState st = getQuestState(player, true); String htmltext = getNoQuestMsg(player); switch (st.getState()) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00195_SevenSignsSecretRitualOfThePriests/Q00195_SevenSignsSecretRitualOfThePriests.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00195_SevenSignsSecretRitualOfThePriests/Q00195_SevenSignsSecretRitualOfThePriests.java index 2f2312b0b7..c5c0965166 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00195_SevenSignsSecretRitualOfThePriests/Q00195_SevenSignsSecretRitualOfThePriests.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00195_SevenSignsSecretRitualOfThePriests/Q00195_SevenSignsSecretRitualOfThePriests.java @@ -223,7 +223,7 @@ public final class Q00195_SevenSignsSecretRitualOfThePriests extends Quest @Override public String onTalk(L2Npc npc, L2PcInstance player) { - QuestState st = getQuestState(player, true); + final QuestState st = getQuestState(player, true); String htmltext = getNoQuestMsg(player); switch (st.getState()) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00196_SevenSignsSealOfTheEmperor/Q00196_SevenSignsSealOfTheEmperor.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00196_SevenSignsSealOfTheEmperor/Q00196_SevenSignsSealOfTheEmperor.java index f1e4ac8986..5ca0c0ba4b 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00196_SevenSignsSealOfTheEmperor/Q00196_SevenSignsSealOfTheEmperor.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00196_SevenSignsSealOfTheEmperor/Q00196_SevenSignsSealOfTheEmperor.java @@ -234,7 +234,7 @@ public final class Q00196_SevenSignsSealOfTheEmperor extends Quest @Override public String onTalk(L2Npc npc, L2PcInstance player) { - QuestState st = getQuestState(player, true); + final QuestState st = getQuestState(player, true); String htmltext = getNoQuestMsg(player); switch (st.getState()) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00197_SevenSignsTheSacredBookOfSeal/Q00197_SevenSignsTheSacredBookOfSeal.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00197_SevenSignsTheSacredBookOfSeal/Q00197_SevenSignsTheSacredBookOfSeal.java index f581c63aa7..ad81283085 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00197_SevenSignsTheSacredBookOfSeal/Q00197_SevenSignsTheSacredBookOfSeal.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00197_SevenSignsTheSacredBookOfSeal/Q00197_SevenSignsTheSacredBookOfSeal.java @@ -247,7 +247,7 @@ public final class Q00197_SevenSignsTheSacredBookOfSeal extends Quest @Override public String onTalk(L2Npc npc, L2PcInstance player) { - QuestState st = getQuestState(player, true); + final QuestState st = getQuestState(player, true); String htmltext = getNoQuestMsg(player); switch (st.getState()) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00198_SevenSignsEmbryo/Q00198_SevenSignsEmbryo.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00198_SevenSignsEmbryo/Q00198_SevenSignsEmbryo.java index e1d6a3217a..dea7df501e 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00198_SevenSignsEmbryo/Q00198_SevenSignsEmbryo.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00198_SevenSignsEmbryo/Q00198_SevenSignsEmbryo.java @@ -197,7 +197,7 @@ public final class Q00198_SevenSignsEmbryo extends Quest @Override public String onTalk(L2Npc npc, L2PcInstance player) { - QuestState st = getQuestState(player, true); + final QuestState st = getQuestState(player, true); String htmltext = getNoQuestMsg(player); switch (st.getState()) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00463_IMustBeaGenius/Q00463_IMustBeaGenius.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00463_IMustBeaGenius/Q00463_IMustBeaGenius.java index 282024b8a6..3ae6967f1a 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00463_IMustBeaGenius/Q00463_IMustBeaGenius.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00463_IMustBeaGenius/Q00463_IMustBeaGenius.java @@ -223,18 +223,15 @@ public class Q00463_IMustBeaGenius extends Quest { htmltext = "32069-04.html"; } + else if (st.getInt("var") == 1) + { + htmltext = "32069-06a.html"; + } else { - if (st.getInt("var") == 1) - { - htmltext = "32069-06a.html"; - } - else - { - takeItems(player, COLLECTION, -1); - st.set("var", "1"); - htmltext = "32069-06.html"; - } + takeItems(player, COLLECTION, -1); + st.set("var", "1"); + htmltext = "32069-06.html"; } break; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00474_WaitingForTheSummer/Q00474_WaitingForTheSummer.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00474_WaitingForTheSummer/Q00474_WaitingForTheSummer.java index 9a70e02688..31fa5ada65 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00474_WaitingForTheSummer/Q00474_WaitingForTheSummer.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00474_WaitingForTheSummer/Q00474_WaitingForTheSummer.java @@ -109,25 +109,22 @@ public final class Q00474_WaitingForTheSummer extends Quest break; } } - else + else if (qs.isStarted() && qs.isCond(2)) { - if (qs.isStarted() && qs.isCond(2)) + if (!isSimulated) { - if (!isSimulated) + giveAdena(player, 194000, true); + if (player.getLevel() >= MIN_LEVEL) { - giveAdena(player, 194000, true); - if (player.getLevel() >= MIN_LEVEL) - { - addExpAndSp(player, 1879400, 451); - } - qs.exitQuest(QuestType.DAILY, true); + addExpAndSp(player, 1879400, 451); } - htmltext = "31981-01.html"; - } - else if (qs.isCompleted() && !qs.isNowAvailable()) - { - htmltext = "31981-02.html"; + qs.exitQuest(QuestType.DAILY, true); } + htmltext = "31981-01.html"; + } + else if (qs.isCompleted() && !qs.isNowAvailable()) + { + htmltext = "31981-02.html"; } return htmltext; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00476_PlainMission/Q00476_PlainMission.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00476_PlainMission/Q00476_PlainMission.java index acb5c0e3c5..82d314d244 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00476_PlainMission/Q00476_PlainMission.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00476_PlainMission/Q00476_PlainMission.java @@ -210,14 +210,11 @@ public final class Q00476_PlainMission extends Quest playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); } } - else + else if (killedGrendel < 45) { - if (killedGrendel < 45) - { - killedGrendel++; - st.set("killed_" + GRENDEL[0], killedGrendel); - playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); - } + killedGrendel++; + st.set("killed_" + GRENDEL[0], killedGrendel); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); } if ((killedAntelope == 45) && (killedBandersnatch == 45) && (killedBuffalo == 45) && (killedGrendel == 45)) diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00620_FourGoblets/Q00620_FourGoblets.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00620_FourGoblets/Q00620_FourGoblets.java index 8eb8910f96..22249d2e7a 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00620_FourGoblets/Q00620_FourGoblets.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00620_FourGoblets/Q00620_FourGoblets.java @@ -30,16 +30,16 @@ import com.l2jmobius.gameserver.model.quest.QuestState; public class Q00620_FourGoblets extends Quest { // NPCs - private final static int NAMELESS_SPIRIT = 31453; - private final static int GHOST_OF_WIGOTH_1 = 31452; - private final static int GHOST_OF_WIGOTH_2 = 31454; - private final static int CONQ_SM = 31921; - private final static int EMPER_SM = 31922; - private final static int SAGES_SM = 31923; - private final static int JUDGE_SM = 31924; - private final static int GHOST_CHAMBERLAIN_1 = 31919; - private final static int GHOST_CHAMBERLAIN_2 = 31920; - private final static int[] NPCS = + private static final int NAMELESS_SPIRIT = 31453; + private static final int GHOST_OF_WIGOTH_1 = 31452; + private static final int GHOST_OF_WIGOTH_2 = 31454; + private static final int CONQ_SM = 31921; + private static final int EMPER_SM = 31922; + private static final int SAGES_SM = 31923; + private static final int JUDGE_SM = 31924; + private static final int GHOST_CHAMBERLAIN_1 = 31919; + private static final int GHOST_CHAMBERLAIN_2 = 31920; + private static final int[] NPCS = { NAMELESS_SPIRIT, GHOST_OF_WIGOTH_1, @@ -53,25 +53,25 @@ public class Q00620_FourGoblets extends Quest }; // Reward - private final static int ANTIQUE_BROOCH = 7262; + private static final int ANTIQUE_BROOCH = 7262; // Items - private final static int ENTRANCE_PASS = 7075; - private final static int GRAVE_PASS = 7261; - private final static int[] GOBLETS = + private static final int ENTRANCE_PASS = 7075; + private static final int GRAVE_PASS = 7261; + private static final int[] GOBLETS = { 7256, 7257, 7258, 7259 }; - private final static int BOSS_1 = 25339; - private final static int BOSS_2 = 25342; - private final static int BOSS_3 = 25346; - private final static int BOSS_4 = 25349; + private static final int BOSS_1 = 25339; + private static final int BOSS_2 = 25342; + private static final int BOSS_3 = 25346; + private static final int BOSS_4 = 25349; - private final static int RELIC = 7254; - private final static int SEALED_BOX = 7255; - private final static int[] QI = + private static final int RELIC = 7254; + private static final int SEALED_BOX = 7255; + private static final int[] QI = { ANTIQUE_BROOCH, SEALED_BOX, @@ -112,7 +112,7 @@ public class Q00620_FourGoblets extends Quest public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { String htmltext = event; - QuestState st = player.getQuestState(getName()); + final QuestState st = player.getQuestState(getName()); if (st == null) { return htmltext; @@ -141,7 +141,7 @@ public class Q00620_FourGoblets extends Quest htmltext = "31454-13.htm"; takeItems(player, SEALED_BOX, 1); int reward = 0; - int rnd = Rnd.get(5); + final int rnd = Rnd.get(5); if (rnd == 0) { giveItems(player, 57, 10000); @@ -152,7 +152,7 @@ public class Q00620_FourGoblets extends Quest if (Rnd.get(1000) < 848) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 43) { giveItems(player, 1884, 42); @@ -197,7 +197,7 @@ public class Q00620_FourGoblets extends Quest else if (Rnd.get(1000) < 323) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 335) { giveItems(player, 1888, 1); @@ -233,7 +233,7 @@ public class Q00620_FourGoblets extends Quest if (Rnd.get(1000) < 847) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 148) { giveItems(player, 1878, 8); @@ -278,7 +278,7 @@ public class Q00620_FourGoblets extends Quest else if (Rnd.get(1000) < 251) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 350) { giveItems(player, 1887, 1); @@ -314,7 +314,7 @@ public class Q00620_FourGoblets extends Quest if (Rnd.get(1000) < 31) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 223) { giveItems(player, 730, 1); @@ -331,7 +331,7 @@ public class Q00620_FourGoblets extends Quest else if (Rnd.get(1000) < 50) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 202) { giveItems(player, 729, 1); @@ -351,7 +351,7 @@ public class Q00620_FourGoblets extends Quest if (Rnd.get(1000) < 329) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 88) { giveItems(player, 6698, 1); @@ -424,7 +424,7 @@ public class Q00620_FourGoblets extends Quest else if (Rnd.get(1000) < 54) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 100) { giveItems(player, 6688, 1); @@ -524,18 +524,15 @@ public class Q00620_FourGoblets extends Quest st.getPlayer().teleToLocation(178298, -84574, -7216); htmltext = null; } + else if (getQuestItemsCount(player, GRAVE_PASS) >= 1) + { + takeItems(player, GRAVE_PASS, 1); + st.getPlayer().teleToLocation(178298, -84574, -7216); + htmltext = null; + } else { - if (getQuestItemsCount(player, GRAVE_PASS) >= 1) - { - takeItems(player, GRAVE_PASS, 1); - st.getPlayer().teleToLocation(178298, -84574, -7216); - htmltext = null; - } - else - { - htmltext = "31919-0.htm"; - } + htmltext = "31919-0.htm"; } break; } @@ -546,18 +543,15 @@ public class Q00620_FourGoblets extends Quest st.getPlayer().teleToLocation(186942, -75602, -2834); htmltext = null; } + else if (getQuestItemsCount(player, GRAVE_PASS) >= 1) + { + takeItems(player, GRAVE_PASS, 1); + st.getPlayer().teleToLocation(186942, -75602, -2834); + htmltext = null; + } else { - if (getQuestItemsCount(player, GRAVE_PASS) >= 1) - { - takeItems(player, GRAVE_PASS, 1); - st.getPlayer().teleToLocation(186942, -75602, -2834); - htmltext = null; - } - else - { - htmltext = "31920-0.htm"; - } + htmltext = "31920-0.htm"; } break; } @@ -596,7 +590,7 @@ public class Q00620_FourGoblets extends Quest htmltext = "31919-3.htm"; takeItems(player, SEALED_BOX, 1); int reward = 0; - int rnd = Rnd.get(5); + final int rnd = Rnd.get(5); if (rnd == 0) { giveItems(player, 57, 10000); @@ -607,7 +601,7 @@ public class Q00620_FourGoblets extends Quest if (Rnd.get(1000) < 848) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 43) { giveItems(player, 1884, 42); @@ -652,7 +646,7 @@ public class Q00620_FourGoblets extends Quest else if (Rnd.get(1000) < 323) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 335) { giveItems(player, 1888, 1); @@ -688,7 +682,7 @@ public class Q00620_FourGoblets extends Quest if (Rnd.get(1000) < 847) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 148) { giveItems(player, 1878, 8); @@ -733,7 +727,7 @@ public class Q00620_FourGoblets extends Quest else if (Rnd.get(1000) < 251) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 350) { giveItems(player, 1887, 1); @@ -769,7 +763,7 @@ public class Q00620_FourGoblets extends Quest if (Rnd.get(1000) < 31) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 223) { giveItems(player, 730, 1); @@ -787,7 +781,7 @@ public class Q00620_FourGoblets extends Quest { reward = 1; } - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 202) { giveItems(player, 729, 1); @@ -806,7 +800,7 @@ public class Q00620_FourGoblets extends Quest if (Rnd.get(1000) < 329) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 88) { giveItems(player, 6698, 1); @@ -879,7 +873,7 @@ public class Q00620_FourGoblets extends Quest else if (Rnd.get(1000) < 54) { reward = 1; - int i = Rnd.get(1000); + final int i = Rnd.get(1000); if (i < 100) { giveItems(player, 6688, 1); @@ -1076,75 +1070,54 @@ public class Q00620_FourGoblets extends Quest { htmltext = "31454-4.htm"; } + else if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1) + { + htmltext = "31454-8.htm"; + } else { - if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1) - { - htmltext = "31454-8.htm"; - } - else - { - htmltext = "31454-12.htm"; - } + htmltext = "31454-12.htm"; } } + else if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && ((getQuestItemsCount(talker, GOBLETS[3])) >= 1)) + { + htmltext = "31454-3.htm"; + } + else if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1) + { + htmltext = "31454-7.htm"; + } else { - if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && ((getQuestItemsCount(talker, GOBLETS[3])) >= 1)) - { - htmltext = "31454-3.htm"; - } - else - { - if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1) - { - htmltext = "31454-7.htm"; - } - else - { - htmltext = "31454-11.htm"; - } - } + htmltext = "31454-11.htm"; } } + else if (getQuestItemsCount(talker, SEALED_BOX) >= 1) + { + if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && (getQuestItemsCount(talker, GOBLETS[3]) >= 1)) + { + htmltext = "31454-2.htm"; + } + else if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1) + { + htmltext = "31454-6.htm"; + } + else + { + htmltext = "31454-10.htm"; + } + } + else if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && (getQuestItemsCount(talker, GOBLETS[3]) >= 1)) + { + htmltext = "31454-1.htm"; + } + else if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1) + { + htmltext = "31454-5.htm"; + } else { - if (getQuestItemsCount(talker, SEALED_BOX) >= 1) - { - if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && (getQuestItemsCount(talker, GOBLETS[3]) >= 1)) - { - htmltext = "31454-2.htm"; - } - else - { - if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1) - { - htmltext = "31454-6.htm"; - } - else - { - htmltext = "31454-10.htm"; - } - } - } - else - { - if ((getQuestItemsCount(talker, GOBLETS[0]) >= 1) && (getQuestItemsCount(talker, GOBLETS[1]) >= 1) && (getQuestItemsCount(talker, GOBLETS[2]) >= 1) && (getQuestItemsCount(talker, GOBLETS[3]) >= 1)) - { - htmltext = "31454-1.htm"; - } - else - { - if ((getQuestItemsCount(talker, GOBLETS[0]) + getQuestItemsCount(talker, GOBLETS[1]) + getQuestItemsCount(talker, GOBLETS[2]) + getQuestItemsCount(talker, GOBLETS[3])) > 1) - { - htmltext = "31454-5.htm"; - } - else - { - htmltext = "31454-9.htm"; - } - } - } + htmltext = "31454-9.htm"; } break; } @@ -1182,7 +1155,7 @@ public class Q00620_FourGoblets extends Quest { final QuestState st = killer.getQuestState(getName()); final L2PcInstance partyMember = getRandomPartyMember(killer, 3); - int npcId = npc.getId(); + final int npcId = npc.getId(); if ((st != null) && (st.getCond() > 0) && (npcId >= 18120) && (npcId <= 18256)) { if (Rnd.get(100) < 15) diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00663_SeductiveWhispers/Q00663_SeductiveWhispers.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00663_SeductiveWhispers/Q00663_SeductiveWhispers.java index d0e95de970..b3e71325e5 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00663_SeductiveWhispers/Q00663_SeductiveWhispers.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00663_SeductiveWhispers/Q00663_SeductiveWhispers.java @@ -296,7 +296,7 @@ public class Q00663_SeductiveWhispers extends Quest boolean isPlayerWin = false; boolean isNpcWin = false; String htmltext; - String table = getHtm(player.getHtmlPrefix(), "table.html"); + final String table = getHtm(player.getHtmlPrefix(), "table.html"); if (isPlayerTurn) { @@ -330,19 +330,16 @@ public class Q00663_SeductiveWhispers extends Quest htmltext = htmltext.replace("%table%", table); } } + else if ((playerCard != null) && (npcCard != null) && isWinner(playerCard, npcCard, false)) + { + htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-24.html" : "30846-21.html"); + htmltext = htmltext.replace("%table%", table); + isNpcWin = true; + } else { - if ((playerCard != null) && (npcCard != null) && isWinner(playerCard, npcCard, false)) - { - htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-24.html" : "30846-21.html"); - htmltext = htmltext.replace("%table%", table); - isNpcWin = true; - } - else - { - htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-23.html" : "30846-17.html"); - htmltext = htmltext.replace("%table%", table); - } + htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-23.html" : "30846-17.html"); + htmltext = htmltext.replace("%table%", table); } htmltext = htmltext.replaceAll("%player_name%", player.getName()); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00772_PurifyingSouls/Q00772_PurifyingSouls.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00772_PurifyingSouls/Q00772_PurifyingSouls.java index 53a362585a..8018de3482 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00772_PurifyingSouls/Q00772_PurifyingSouls.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00772_PurifyingSouls/Q00772_PurifyingSouls.java @@ -157,12 +157,9 @@ public class Q00772_PurifyingSouls extends Quest } } } - else + else if (qs.isCompleted() && !qs.isNowAvailable()) { - if (qs.isCompleted() && !qs.isNowAvailable()) - { - htmltext = "33838-10.htm"; - } + htmltext = "33838-10.htm"; } return htmltext; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00784_TheQuietKiller/Q00784_TheQuietKiller.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00784_TheQuietKiller/Q00784_TheQuietKiller.java index 194103e833..b615e3341f 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00784_TheQuietKiller/Q00784_TheQuietKiller.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q00784_TheQuietKiller/Q00784_TheQuietKiller.java @@ -232,12 +232,9 @@ public class Q00784_TheQuietKiller extends Quest } } } - else + else if (qs.isCompleted() && !qs.isNowAvailable()) { - if (qs.isCompleted() && !qs.isNowAvailable()) - { - htmltext = "31554-10.html"; - } + htmltext = "31554-10.html"; } return htmltext; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10275_ContainingTheAttributePower/Q10275_ContainingTheAttributePower.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10275_ContainingTheAttributePower/Q10275_ContainingTheAttributePower.java index 09eec3d216..e43b35992a 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10275_ContainingTheAttributePower/Q10275_ContainingTheAttributePower.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10275_ContainingTheAttributePower/Q10275_ContainingTheAttributePower.java @@ -119,7 +119,7 @@ public class Q10275_ContainingTheAttributePower extends Quest if (Util.isDigit(event)) { - htmltext = Integer.toString(npc.getId()) + "-1" + event + ".html"; + htmltext = npc.getId() + "-1" + event + ".html"; giveItems(player, 10520 + CommonUtil.constrain(Integer.parseInt(event), 0, 6), 2); addExpAndSp(player, 202160, 20375); st.exitQuest(false, true); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java index e4140ce35d..3f089b1640 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java @@ -229,7 +229,7 @@ public final class Q10292_SevenSignsGirlOfDoubt extends Quest @Override public String onTalk(L2Npc npc, L2PcInstance player) { - QuestState st = getQuestState(player, true); + final QuestState st = getQuestState(player, true); String htmltext = getNoQuestMsg(player); switch (npc.getId()) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom/Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom/Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.java index 62930d3c5e..a0f4ebb33f 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom/Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom/Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.java @@ -220,7 +220,7 @@ public final class Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom extends @Override public String onTalk(L2Npc npc, L2PcInstance player) { - QuestState qs = getQuestState(player, true); + final QuestState qs = getQuestState(player, true); String htmltext = getNoQuestMsg(player); switch (npc.getId()) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10294_SevenSignsToTheMonasteryOfSilence/Q10294_SevenSignsToTheMonasteryOfSilence.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10294_SevenSignsToTheMonasteryOfSilence/Q10294_SevenSignsToTheMonasteryOfSilence.java index afd0c1daff..89c68608d2 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10294_SevenSignsToTheMonasteryOfSilence/Q10294_SevenSignsToTheMonasteryOfSilence.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10294_SevenSignsToTheMonasteryOfSilence/Q10294_SevenSignsToTheMonasteryOfSilence.java @@ -303,7 +303,7 @@ public final class Q10294_SevenSignsToTheMonasteryOfSilence extends Quest @Override public String onTalk(L2Npc npc, L2PcInstance player) { - QuestState qs = getQuestState(player, true); + final QuestState qs = getQuestState(player, true); String htmltext = getNoQuestMsg(player); switch (npc.getId()) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10295_SevenSignsSolinasTomb/Q10295_SevenSignsSolinasTomb.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10295_SevenSignsSolinasTomb/Q10295_SevenSignsSolinasTomb.java index e8b2231110..52ce7e1e2d 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10295_SevenSignsSolinasTomb/Q10295_SevenSignsSolinasTomb.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10295_SevenSignsSolinasTomb/Q10295_SevenSignsSolinasTomb.java @@ -53,7 +53,7 @@ public final class Q10295_SevenSignsSolinasTomb extends Quest return null; } - String htmltext = null; + final String htmltext = null; switch (event) { @@ -65,7 +65,7 @@ public final class Q10295_SevenSignsSolinasTomb extends Quest public String onTalk(L2Npc npc, L2PcInstance player) { // QuestState qs = getQuestState(player, true); - String htmltext = getNoQuestMsg(player); + final String htmltext = getNoQuestMsg(player); switch (npc.getId()) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal/Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal/Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal.java index 365033c69e..c86232d1bf 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal/Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal/Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal.java @@ -53,7 +53,7 @@ public final class Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal extends Quest return null; } - String htmltext = null; + final String htmltext = null; switch (event) { @@ -65,7 +65,7 @@ public final class Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal extends Quest public String onTalk(L2Npc npc, L2PcInstance player) { // QuestState qs = getQuestState(player, true); - String htmltext = getNoQuestMsg(player); + final String htmltext = getNoQuestMsg(player); switch (npc.getId()) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10326_RespectYourElders/Q10326_RespectYourElders.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10326_RespectYourElders/Q10326_RespectYourElders.java index 8e784ecd82..899aab4af2 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10326_RespectYourElders/Q10326_RespectYourElders.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10326_RespectYourElders/Q10326_RespectYourElders.java @@ -41,7 +41,7 @@ public final class Q10326_RespectYourElders extends Quest private static final int HANDERMONKEY = 32971; // Locations private static final Location HANDERMONKEY_SPAWN = new Location(-116617, 255497, -1432); - private final static Location[] HANDERMONKEY_LOC = + private static final Location[] HANDERMONKEY_LOC = { new Location(-116560, 255951, -1457), new Location(-116688, 256597, -1472), diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10329_BackupSeekers/Q10329_BackupSeekers.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10329_BackupSeekers/Q10329_BackupSeekers.java index 1b21961593..1adb578e90 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10329_BackupSeekers/Q10329_BackupSeekers.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10329_BackupSeekers/Q10329_BackupSeekers.java @@ -46,7 +46,7 @@ public final class Q10329_BackupSeekers extends Quest // Locations private static final Location BART_SPAWN_1 = new Location(-117955, 255832, -1320); private static final Location BART_SPAWN_2 = new Location(-114121, 252445, -1560); - private final static Location[] BART_LOC_1 = + private static final Location[] BART_LOC_1 = { new Location(-117063, 255528, -1296), new Location(-115766, 254791, -1504), @@ -54,7 +54,7 @@ public final class Q10329_BackupSeekers extends Quest new Location(-114606, 253534, -1528), new Location(-114375, 252807, -1536), }; - private final static Location[] BART_LOC_2 = + private static final Location[] BART_LOC_2 = { new Location(-114410, 252220, -1591), new Location(-114416, 250812, -1760), diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10358_DividedSakumPoslof/Q10358_DividedSakumPoslof.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10358_DividedSakumPoslof/Q10358_DividedSakumPoslof.java index 82bbe3bc3d..cd3ac18aa7 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10358_DividedSakumPoslof/Q10358_DividedSakumPoslof.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10358_DividedSakumPoslof/Q10358_DividedSakumPoslof.java @@ -179,14 +179,11 @@ public final class Q10358_DividedSakumPoslof extends Quest playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); } } - else + else if (killedVeelans < 23) { - if (killedVeelans < 23) - { - killedVeelans++; - st.set("killed_" + VEELEAN, killedVeelans); - playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); - } + killedVeelans++; + st.set("killed_" + VEELEAN, killedVeelans); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); } if ((killedZombies == 20) && (killedVeelans == 23)) diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10365_SeekerEscort/Q10365_SeekerEscort.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10365_SeekerEscort/Q10365_SeekerEscort.java index 309aad18c0..73940fe8fc 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10365_SeekerEscort/Q10365_SeekerEscort.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10365_SeekerEscort/Q10365_SeekerEscort.java @@ -46,7 +46,7 @@ public final class Q10365_SeekerEscort extends Quest // Locations private static final Location BLOODHOUND_SPAWN_1 = new Location(-110624, 238369, -2920); private static final Location BLOODHOUND_SPAWN_2 = new Location(-112660, 233942, -3072); - private final static Location[] BLOODHOUND_LOC_1 = + private static final Location[] BLOODHOUND_LOC_1 = { new Location(-110574, 238972, -2920), new Location(-110723, 239275, -2920), @@ -68,7 +68,7 @@ public final class Q10365_SeekerEscort extends Quest new Location(-112199, 240141, -2920), new Location(-112291, 240201, -2920), }; - private final static Location[] BLOODHOUND_LOC_2 = + private static final Location[] BLOODHOUND_LOC_2 = { new Location(-112403, 233676, -3096), new Location(-112174, 233487, -3120), diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10420_TheVarkaSilenosSupporters/Q10420_TheVarkaSilenosSupporters.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10420_TheVarkaSilenosSupporters/Q10420_TheVarkaSilenosSupporters.java index 09f81288d9..58d2195cee 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10420_TheVarkaSilenosSupporters/Q10420_TheVarkaSilenosSupporters.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10420_TheVarkaSilenosSupporters/Q10420_TheVarkaSilenosSupporters.java @@ -166,13 +166,10 @@ public final class Q10420_TheVarkaSilenosSupporters extends Quest playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); } } - else + else if (wizardCount < 50) { - if (wizardCount < 50) - { - st.set("KillCount_" + EMBRYO_WIZARD, ++wizardCount); - playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); - } + st.set("KillCount_" + EMBRYO_WIZARD, ++wizardCount); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); } if ((shooterCount >= 50) && (wizardCount >= 50)) @@ -180,27 +177,21 @@ public final class Q10420_TheVarkaSilenosSupporters extends Quest st.setCond(2, true); } } - else + else if (CommonUtil.contains(WIZARD_MONSTERS, npc.getId())) { - if (CommonUtil.contains(WIZARD_MONSTERS, npc.getId())) + if (st.getInt("KillCount_" + EMBRYO_WIZARD) < 50) { - if (st.getInt("KillCount_" + EMBRYO_WIZARD) < 50) - { - final L2Npc embryo = addSpawn(EMBRYO_WIZARD, npc, false, 60000); - addAttackPlayerDesire(embryo, killer); - embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH); - } - } - else - { - if (st.getInt("KillCount_" + EMBRYO_SHOOTER) < 50) - { - final L2Npc embryo = addSpawn(EMBRYO_SHOOTER, npc, false, 60000); - addAttackPlayerDesire(embryo, killer); - embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH); - } + final L2Npc embryo = addSpawn(EMBRYO_WIZARD, npc, false, 60000); + addAttackPlayerDesire(embryo, killer); + embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH); } } + else if (st.getInt("KillCount_" + EMBRYO_SHOOTER) < 50) + { + final L2Npc embryo = addSpawn(EMBRYO_SHOOTER, npc, false, 60000); + addAttackPlayerDesire(embryo, killer); + embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH); + } } return super.onKill(npc, killer, isSummon); } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10425_TheKetraOrcSupporters/Q10425_TheKetraOrcSupporters.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10425_TheKetraOrcSupporters/Q10425_TheKetraOrcSupporters.java index 61dfdec605..1b023f5648 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10425_TheKetraOrcSupporters/Q10425_TheKetraOrcSupporters.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10425_TheKetraOrcSupporters/Q10425_TheKetraOrcSupporters.java @@ -169,13 +169,10 @@ public final class Q10425_TheKetraOrcSupporters extends Quest playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); } } - else + else if (wizardCount < 50) { - if (wizardCount < 50) - { - qs.set("KillCount_" + EMBRYO_WIZARD, ++wizardCount); - playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); - } + qs.set("KillCount_" + EMBRYO_WIZARD, ++wizardCount); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); } if ((shooterCount >= 50) && (wizardCount >= 50)) @@ -183,27 +180,21 @@ public final class Q10425_TheKetraOrcSupporters extends Quest qs.setCond(2, true); } } - else + else if (CommonUtil.contains(WIZARD_MONSTERS, npc.getId())) { - if (CommonUtil.contains(WIZARD_MONSTERS, npc.getId())) + if (qs.getInt("KillCount_" + EMBRYO_WIZARD) < 50) { - if (qs.getInt("KillCount_" + EMBRYO_WIZARD) < 50) - { - final L2Npc embryo = addSpawn(EMBRYO_WIZARD, npc, false, 60000); - addAttackPlayerDesire(embryo, killer); - embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH); - } - } - else - { - if (qs.getInt("KillCount_" + EMBRYO_SHOOTER) < 50) - { - final L2Npc embryo = addSpawn(EMBRYO_SHOOTER, npc, false, 60000); - addAttackPlayerDesire(embryo, killer); - embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH); - } + final L2Npc embryo = addSpawn(EMBRYO_WIZARD, npc, false, 60000); + addAttackPlayerDesire(embryo, killer); + embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH); } } + else if (qs.getInt("KillCount_" + EMBRYO_SHOOTER) < 50) + { + final L2Npc embryo = addSpawn(EMBRYO_SHOOTER, npc, false, 60000); + addAttackPlayerDesire(embryo, killer); + embryo.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DARE_INTERFERE_WITH_EMBRYO_SURELY_YOU_WISH_FOR_DEATH); + } } return super.onKill(npc, killer, isSummon); } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10436_KekropusLetterTheSealOfPunishment/Q10436_KekropusLetterTheSealOfPunishment.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10436_KekropusLetterTheSealOfPunishment/Q10436_KekropusLetterTheSealOfPunishment.java index e019acfe80..8305267e4b 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10436_KekropusLetterTheSealOfPunishment/Q10436_KekropusLetterTheSealOfPunishment.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10436_KekropusLetterTheSealOfPunishment/Q10436_KekropusLetterTheSealOfPunishment.java @@ -16,8 +16,6 @@ */ package quests.Q10436_KekropusLetterTheSealOfPunishment; -import quests.LetterQuest; - import com.l2jmobius.gameserver.enums.CategoryType; import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.actor.L2Character; @@ -27,6 +25,8 @@ import com.l2jmobius.gameserver.model.quest.QuestState; import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; +import quests.LetterQuest; + /** * Kekropus' Letter: The Seal of Punishment (10436) * @author Stayway diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10440_TheSealOfPunishmentTheFields/Q10440_TheSealOfPunishmentTheFields.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10440_TheSealOfPunishmentTheFields/Q10440_TheSealOfPunishmentTheFields.java index 8de4f6c0b7..03952f6a9c 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10440_TheSealOfPunishmentTheFields/Q10440_TheSealOfPunishmentTheFields.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10440_TheSealOfPunishmentTheFields/Q10440_TheSealOfPunishmentTheFields.java @@ -107,7 +107,7 @@ public class Q10440_TheSealOfPunishmentTheFields extends Quest final int stoneId = Integer.parseInt(event.replaceAll("reward_", "")); giveItems(player, stoneId, 15); giveStoryQuestReward(player, 60); - int count = qs.getInt(KILL_COUNT_VAR); + final int count = qs.getInt(KILL_COUNT_VAR); if ((count >= 50) && (count < 100)) { addExpAndSp(player, 28240800, 6777); @@ -226,7 +226,7 @@ public class Q10440_TheSealOfPunishmentTheFields extends Quest final QuestState qs = getQuestState(killer, false); if ((qs != null) && (qs.getCond() > 0)) { - int count = qs.getInt(KILL_COUNT_VAR) + 1; + final int count = qs.getInt(KILL_COUNT_VAR) + 1; qs.set(KILL_COUNT_VAR, count); if ((count >= 50) && (qs.isMemoState(1))) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10734_DoOrDie/Q10734_DoOrDie.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10734_DoOrDie/Q10734_DoOrDie.java index 5616e2a893..9fa123f95d 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10734_DoOrDie/Q10734_DoOrDie.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10734_DoOrDie/Q10734_DoOrDie.java @@ -41,7 +41,7 @@ public final class Q10734_DoOrDie extends Quest private static final int ADVENTURER_S_GUIDE_APPRENTICE = 33950; private static final int TRAINING_DUMMY = 19546; // Skills - private final static SkillHolder[] COMMON_BUFFS = + private static final SkillHolder[] COMMON_BUFFS = { new SkillHolder(5182, 1), // Blessing of Protection new SkillHolder(15642, 1), // Horn Melody diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java index 982c4b5857..2ae7573a45 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10742_AFurryFriend/Q10742_AFurryFriend.java @@ -96,26 +96,22 @@ public final class Q10742_AFurryFriend extends Quest showOnScreenMsg(player, NpcStringId.RICKY_IS_NOT_HERE_NTRY_SEARCHING_ANOTHER_KIKU_S_CAVE, ExShowScreenMessage.TOP_CENTER, 8000); htmltext = "33995-02.html"; } - else + else if (!L2World.getInstance().getVisibleObjects(player, L2Npc.class, 500).stream().anyMatch(n -> (n.getId() == RICKY) && (n.getSummoner() == player))) { - // Check if player has Ricky spawned - if (!L2World.getInstance().getVisibleObjects(player, L2Npc.class, 500).stream().anyMatch(n -> (n.getId() == RICKY) && (n.getSummoner() == player))) - { - showOnScreenMsg(player, NpcStringId.TAKE_RICKY_TO_LEIRA_IN_UNDER_2_MINUTES, ExShowScreenMessage.MIDDLE_CENTER, 5000); - player.sendPacket(new ExSendUIEvent(player, false, false, 120, 0, NpcStringId.REMAINING_TIME)); - - // Spawn Ricky - final L2Npc ricky = addSpawn(RICKY, player, true, 120000); - ricky.setSummoner(player); - ricky.setTitle(player.getAppearance().getVisibleName()); - ricky.setIsRunning(true); - ricky.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); - startQuestTimer("CHECK_RICKY_DISTANCE", 2500, ricky, player); - } - else // Already have Ricky - { - htmltext = "33995-03.html"; - } + showOnScreenMsg(player, NpcStringId.TAKE_RICKY_TO_LEIRA_IN_UNDER_2_MINUTES, ExShowScreenMessage.MIDDLE_CENTER, 5000); + player.sendPacket(new ExSendUIEvent(player, false, false, 120, 0, NpcStringId.REMAINING_TIME)); + + // Spawn Ricky + final L2Npc ricky = addSpawn(RICKY, player, true, 120000); + ricky.setSummoner(player); + ricky.setTitle(player.getAppearance().getVisibleName()); + ricky.setIsRunning(true); + ricky.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); + startQuestTimer("CHECK_RICKY_DISTANCE", 2500, ricky, player); + } + else // Already have Ricky + { + htmltext = "33995-03.html"; } } break; diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10757_QuietingTheStorm/Q10757_QuietingTheStorm.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10757_QuietingTheStorm/Q10757_QuietingTheStorm.java index 7cdc786b42..e356b3949d 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10757_QuietingTheStorm/Q10757_QuietingTheStorm.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10757_QuietingTheStorm/Q10757_QuietingTheStorm.java @@ -134,13 +134,10 @@ public final class Q10757_QuietingTheStorm extends Quest sendNpcLogList(killer); } } - else + else if (windimaCount != 1) { - if (windimaCount != 1) - { - qs.set(WINDIMA_COUNT_VAR, ++windimaCount); - sendNpcLogList(killer); - } + qs.set(WINDIMA_COUNT_VAR, ++windimaCount); + sendNpcLogList(killer); } if ((vortexCount >= 5) && (windimaCount >= 1)) diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10764_FreeSpirit/Q10764_FreeSpirit.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10764_FreeSpirit/Q10764_FreeSpirit.java index 94647b0270..a774df3136 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10764_FreeSpirit/Q10764_FreeSpirit.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10764_FreeSpirit/Q10764_FreeSpirit.java @@ -120,26 +120,23 @@ public final class Q10764_FreeSpirit extends Quest break; } } + else if (qs.isStarted() && qs.isCond(1)) + { + final int npcId = (npc.getId() == WIND_SPIRIT) ? LIBERATED_WIND_SPIRIT : LIBERATED_TREE_SPIRIT; + + giveItems(player, LOOSENED_CHAIN, 1); + addSpawn(npcId, npc, false, 2500); + npc.deleteMe(); + + if (getQuestItemsCount(player, LOOSENED_CHAIN) >= 10) + { + qs.setCond(2, true); + } + htmltext = null; + } else { - if (qs.isStarted() && qs.isCond(1)) - { - final int npcId = (npc.getId() == WIND_SPIRIT) ? LIBERATED_WIND_SPIRIT : LIBERATED_TREE_SPIRIT; - - giveItems(player, LOOSENED_CHAIN, 1); - addSpawn(npcId, npc, false, 2500); - npc.deleteMe(); - - if (getQuestItemsCount(player, LOOSENED_CHAIN) >= 10) - { - qs.setCond(2, true); - } - htmltext = null; - } - else - { - htmltext = npc.getId() + "-01.html"; - } + htmltext = npc.getId() + "-01.html"; } return htmltext; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10794_InvestigateTheForest/Q10794_InvestigateTheForest.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10794_InvestigateTheForest/Q10794_InvestigateTheForest.java index 728bd3fea1..33ee666a78 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10794_InvestigateTheForest/Q10794_InvestigateTheForest.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10794_InvestigateTheForest/Q10794_InvestigateTheForest.java @@ -195,7 +195,7 @@ public final class Q10794_InvestigateTheForest extends Quest final QuestState qs = getQuestState(killer, false); if ((qs != null) && qs.isCond(1)) { - int count = qs.getInt(KILL_COUNT_VAR) + 1; + final int count = qs.getInt(KILL_COUNT_VAR) + 1; qs.set(KILL_COUNT_VAR, count); if (count >= 50) { diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/vehicles/AirShipController.java b/L2J_Mobius_Underground/dist/game/data/scripts/vehicles/AirShipController.java index b351563fc8..b87a53cbb1 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/vehicles/AirShipController.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/vehicles/AirShipController.java @@ -391,16 +391,13 @@ public abstract class AirShipController extends AbstractNpcAI { _log.warning(getName() + ": Fuel consumption not defined."); } + else if (_teleportsTable.length != _fuelTable.length) + { + _log.warning(getName() + ": Fuel consumption not match teleport list."); + } else { - if (_teleportsTable.length != _fuelTable.length) - { - _log.warning(getName() + ": Fuel consumption not match teleport list."); - } - else - { - AirShipManager.getInstance().registerAirShipTeleportList(_dockZone, _locationId, _teleportsTable, _fuelTable); - } + AirShipManager.getInstance().registerAirShipTeleportList(_dockZone, _locationId, _teleportsTable, _fuelTable); } } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/commons/util/IXmlReader.java b/L2J_Mobius_Underground/java/com/l2jmobius/commons/util/IXmlReader.java index f00d334b9b..0317816fd8 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/commons/util/IXmlReader.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/commons/util/IXmlReader.java @@ -656,7 +656,7 @@ public interface IXmlReader * @param node * @return {@code true} if the node is an element type, {@code false} otherwise */ - public static boolean isNode(Node node) + static boolean isNode(Node node) { return node.getNodeType() == Node.ELEMENT_NODE; } @@ -665,7 +665,7 @@ public interface IXmlReader * @param node * @return {@code true} if the node is an element type, {@code false} otherwise */ - public static boolean isText(Node node) + static boolean isText(Node node) { return node.getNodeType() == Node.TEXT_NODE; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/commons/util/Rnd.java b/L2J_Mobius_Underground/java/com/l2jmobius/commons/util/Rnd.java index f91148c116..ddef918e21 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/commons/util/Rnd.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/commons/util/Rnd.java @@ -303,7 +303,7 @@ public final class Rnd protected static volatile long SEED_UNIQUIFIER = 8682522807148012L; - public static final Random directRandom() + public static Random directRandom() { return rnd.directRandom(); } @@ -313,7 +313,7 @@ public final class Rnd * @return A random double number from 0 to 1 * @see com.l2jmobius.commons.util.Rnd#nextDouble() */ - public static final double get() + public static double get() { return rnd.nextDouble(); } @@ -323,7 +323,7 @@ public final class Rnd * @param n The superior limit (exclusive) * @return A random integer number from 0 to n-1 */ - public static final int get(int n) + public static int get(int n) { return rnd.get(n); } @@ -334,7 +334,7 @@ public final class Rnd * @param max The maximum value * @return A random integer number from min to max */ - public static final int get(int min, int max) + public static int get(int min, int max) { return rnd.get(min, max); } @@ -345,12 +345,12 @@ public final class Rnd * @param max The maximum value * @return A random long number from min to max */ - public static final long get(long min, long max) + public static long get(long min, long max) { return rnd.get(min, max); } - public static final RandomContainer newInstance(RandomType type) + public static RandomContainer newInstance(RandomType type) { switch (type) { @@ -375,7 +375,7 @@ public final class Rnd * @return A random boolean state (true or false) * @see java.util.Random#nextBoolean() */ - public static final boolean nextBoolean() + public static boolean nextBoolean() { return rnd.nextBoolean(); } @@ -385,7 +385,7 @@ public final class Rnd * @param array The array to be filled with random byte numbers * @see java.util.Random#nextBytes(byte[] bytes) */ - public static final void nextBytes(byte[] array) + public static void nextBytes(byte[] array) { rnd.nextBytes(array); } @@ -395,7 +395,7 @@ public final class Rnd * @return A random double number from 0 to 1 * @see java.util.Random#nextDouble() */ - public static final double nextDouble() + public static double nextDouble() { return rnd.nextDouble(); } @@ -405,7 +405,7 @@ public final class Rnd * @return A random integer number from 0 to 1 * @see java.util.Random#nextFloat() */ - public static final float nextFloat() + public static float nextFloat() { return rnd.nextFloat(); } @@ -415,7 +415,7 @@ public final class Rnd * @return A random gaussian double number from 0 to 1 * @see java.util.Random#nextGaussian() */ - public static final double nextGaussian() + public static double nextGaussian() { return rnd.nextGaussian(); } @@ -425,7 +425,7 @@ public final class Rnd * @return A random integer number from Integer.MIN_VALUE to Integer.MAX_VALUE * @see java.util.Random#nextInt() */ - public static final int nextInt() + public static int nextInt() { return rnd.nextInt(); } @@ -435,7 +435,7 @@ public final class Rnd * @return int * @see com.l2jmobius.commons.util.Rnd#get(int n) */ - public static final int nextInt(int n) + public static int nextInt(int n) { return get(n); } @@ -445,7 +445,7 @@ public final class Rnd * @return A random integer number from Long.MIN_VALUE to Long.MAX_VALUE * @see java.util.Random#nextLong() */ - public static final long nextLong() + public static long nextLong() { return rnd.nextLong(); } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/GeoData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/GeoData.java index aacfc708bf..41007ee949 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/GeoData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/GeoData.java @@ -621,6 +621,6 @@ public class GeoData private static class SingletonHolder { - protected final static GeoData _instance = new GeoData(); + protected static final GeoData _instance = new GeoData(); } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 73f5633707..f002b9cb3a 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -222,17 +222,14 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable { intention = AI_INTENTION_ACTIVE; } - else + else if (npc.getSpawn() != null) { - if (npc.getSpawn() != null) + final Location loc = npc.getSpawn().getLocation(); + final int range = Config.MAX_DRIFT_RANGE; + + if (!npc.isInsideRadius(loc, range + range, true, false)) { - final Location loc = npc.getSpawn().getLocation(); - final int range = Config.MAX_DRIFT_RANGE; - - if (!npc.isInsideRadius(loc, range + range, true, false)) - { - intention = AI_INTENTION_ACTIVE; - } + intention = AI_INTENTION_ACTIVE; } } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/ActionData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/ActionData.java index d8aa7678b4..0bffdc5bb1 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/ActionData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/ActionData.java @@ -84,7 +84,7 @@ public class ActionData implements IGameXmlReader * Gets the single instance of ActionData. * @return single instance of ActionData */ - public static final ActionData getInstance() + public static ActionData getInstance() { return SingletonHolder._instance; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/AlchemyData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/AlchemyData.java index 9e19f96009..a5d8153b82 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/AlchemyData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/AlchemyData.java @@ -128,7 +128,7 @@ public class AlchemyData implements IGameXmlReader * Gets the single instance of AlchemyData. * @return single instance of AlchemyData */ - public static final AlchemyData getInstance() + public static AlchemyData getInstance() { return SingletonHolder._instance; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/CubicData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/CubicData.java index 58c7ba1d53..01f5dfc81f 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/CubicData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/CubicData.java @@ -160,7 +160,7 @@ public class CubicData implements IGameXmlReader * Gets the single instance of CubicData. * @return single instance of CubicData */ - public static final CubicData getInstance() + public static CubicData getInstance() { return SingletonHolder._instance; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/DailyMissionData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/DailyMissionData.java index c8dfd9b5cf..62d47f53aa 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/DailyMissionData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/DailyMissionData.java @@ -128,7 +128,7 @@ public class DailyMissionData implements IGameXmlReader * Gets the single instance of DailyMissionData. * @return single instance of DailyMissionData */ - public static final DailyMissionData getInstance() + public static DailyMissionData getInstance() { return SingletonHolder._instance; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/EnchantItemHPBonusData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/EnchantItemHPBonusData.java index 730938195e..e558e2fde2 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/EnchantItemHPBonusData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/EnchantItemHPBonusData.java @@ -110,7 +110,7 @@ public class EnchantItemHPBonusData implements IGameXmlReader * Gets the single instance of EnchantHPBonusData. * @return single instance of EnchantHPBonusData */ - public static final EnchantItemHPBonusData getInstance() + public static EnchantItemHPBonusData getInstance() { return SingletonHolder._instance; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/EnsoulData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/EnsoulData.java index 09ae422f58..239b582894 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/EnsoulData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/EnsoulData.java @@ -191,7 +191,7 @@ public class EnsoulData implements IGameXmlReader * Gets the single instance of EnsoulData. * @return single instance of EnsoulData */ - public static final EnsoulData getInstance() + public static EnsoulData getInstance() { return SingletonHolder._instance; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java index b140244ddb..736d8a2778 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java @@ -60,7 +60,7 @@ public class NpcData implements IGameXmlReader private final Map _npcs = new HashMap<>(); private final Map _clans = new HashMap<>(); - private final static List _masterMonsterIDs = new ArrayList<>(); + private static final List _masterMonsterIDs = new ArrayList<>(); protected NpcData() { @@ -525,49 +525,46 @@ public class NpcData implements IGameXmlReader aiSkillScopes.add(shortOrLongRangeScope); } } + else if (skill.hasEffectType(L2EffectType.DISPEL, L2EffectType.DISPEL_BY_SLOT)) + { + aiSkillScopes.add(AISkillScope.NEGATIVE); + aiSkillScopes.add(shortOrLongRangeScope); + } + else if (skill.hasEffectType(L2EffectType.HEAL)) + { + aiSkillScopes.add(AISkillScope.HEAL); + } + else if (skill.hasEffectType(L2EffectType.PHYSICAL_ATTACK, L2EffectType.PHYSICAL_ATTACK_HP_LINK, L2EffectType.MAGICAL_ATTACK, L2EffectType.DEATH_LINK, L2EffectType.HP_DRAIN)) + { + aiSkillScopes.add(AISkillScope.ATTACK); + aiSkillScopes.add(AISkillScope.UNIVERSAL); + aiSkillScopes.add(shortOrLongRangeScope); + } + else if (skill.hasEffectType(L2EffectType.SLEEP)) + { + aiSkillScopes.add(AISkillScope.IMMOBILIZE); + } + else if (skill.hasEffectType(L2EffectType.BLOCK_ACTIONS, L2EffectType.ROOT)) + { + aiSkillScopes.add(AISkillScope.IMMOBILIZE); + aiSkillScopes.add(shortOrLongRangeScope); + } + else if (skill.hasEffectType(L2EffectType.MUTE, L2EffectType.BLOCK_CONTROL)) + { + aiSkillScopes.add(AISkillScope.COT); + aiSkillScopes.add(shortOrLongRangeScope); + } + else if (skill.hasEffectType(L2EffectType.DMG_OVER_TIME, L2EffectType.DMG_OVER_TIME_PERCENT)) + { + aiSkillScopes.add(shortOrLongRangeScope); + } + else if (skill.hasEffectType(L2EffectType.RESURRECTION)) + { + aiSkillScopes.add(AISkillScope.RES); + } else { - if (skill.hasEffectType(L2EffectType.DISPEL, L2EffectType.DISPEL_BY_SLOT)) - { - aiSkillScopes.add(AISkillScope.NEGATIVE); - aiSkillScopes.add(shortOrLongRangeScope); - } - else if (skill.hasEffectType(L2EffectType.HEAL)) - { - aiSkillScopes.add(AISkillScope.HEAL); - } - else if (skill.hasEffectType(L2EffectType.PHYSICAL_ATTACK, L2EffectType.PHYSICAL_ATTACK_HP_LINK, L2EffectType.MAGICAL_ATTACK, L2EffectType.DEATH_LINK, L2EffectType.HP_DRAIN)) - { - aiSkillScopes.add(AISkillScope.ATTACK); - aiSkillScopes.add(AISkillScope.UNIVERSAL); - aiSkillScopes.add(shortOrLongRangeScope); - } - else if (skill.hasEffectType(L2EffectType.SLEEP)) - { - aiSkillScopes.add(AISkillScope.IMMOBILIZE); - } - else if (skill.hasEffectType(L2EffectType.BLOCK_ACTIONS, L2EffectType.ROOT)) - { - aiSkillScopes.add(AISkillScope.IMMOBILIZE); - aiSkillScopes.add(shortOrLongRangeScope); - } - else if (skill.hasEffectType(L2EffectType.MUTE, L2EffectType.BLOCK_CONTROL)) - { - aiSkillScopes.add(AISkillScope.COT); - aiSkillScopes.add(shortOrLongRangeScope); - } - else if (skill.hasEffectType(L2EffectType.DMG_OVER_TIME, L2EffectType.DMG_OVER_TIME_PERCENT)) - { - aiSkillScopes.add(shortOrLongRangeScope); - } - else if (skill.hasEffectType(L2EffectType.RESURRECTION)) - { - aiSkillScopes.add(AISkillScope.RES); - } - else - { - aiSkillScopes.add(AISkillScope.UNIVERSAL); - } + aiSkillScopes.add(AISkillScope.UNIVERSAL); } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/OptionData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/OptionData.java index d4cf530b83..898b376a5b 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/OptionData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/OptionData.java @@ -121,7 +121,7 @@ public class OptionData implements IGameXmlReader * Gets the single instance of OptionsData. * @return single instance of OptionsData */ - public static final OptionData getInstance() + public static OptionData getInstance() { return SingletonHolder._instance; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/PlayerTemplateData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/PlayerTemplateData.java index 5cf8f0a649..472309b543 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/PlayerTemplateData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/PlayerTemplateData.java @@ -182,7 +182,7 @@ public final class PlayerTemplateData implements IGameXmlReader return _playerTemplates.get(ClassId.getClassId(classId)); } - public static final PlayerTemplateData getInstance() + public static PlayerTemplateData getInstance() { return SingletonHolder._instance; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/ResidenceFunctionsData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/ResidenceFunctionsData.java index 8e2d52d4c3..66951e9e59 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/ResidenceFunctionsData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/ResidenceFunctionsData.java @@ -101,7 +101,7 @@ public final class ResidenceFunctionsData implements IGameXmlReader return _functions.get(id); } - public static final ResidenceFunctionsData getInstance() + public static ResidenceFunctionsData getInstance() { return SingletonHolder.INSTANCE; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SayuneData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SayuneData.java index 272b4e5677..835bd96930 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SayuneData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SayuneData.java @@ -103,7 +103,7 @@ public class SayuneData implements IGameXmlReader * Gets the single instance of SayuneData. * @return single instance of SayuneData */ - public static final SayuneData getInstance() + public static SayuneData getInstance() { return SingletonHolder._instance; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SiegeScheduleData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SiegeScheduleData.java index 3d64592581..265bf7c528 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SiegeScheduleData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SiegeScheduleData.java @@ -115,7 +115,7 @@ public class SiegeScheduleData implements IGameXmlReader return _scheduleData; } - public static final SiegeScheduleData getInstance() + public static SiegeScheduleData getInstance() { return SingletonHolder._instance; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillData.java index 6810897ef2..21c6213923 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillData.java @@ -490,7 +490,7 @@ public class SkillData implements IGameXmlReader final String stringGeneralValue = String.valueOf(generalValue); if (stringGeneralValue.startsWith("@")) { - Map> variableValue = variableValues.get(stringGeneralValue); + final Map> variableValue = variableValues.get(stringGeneralValue); if (variableValue != null) { values = variableValue; @@ -546,11 +546,11 @@ public class SkillData implements IGameXmlReader { for (int j = fromSubLevel; j <= toSubLevel; j++) { - Map subValues = values.computeIfAbsent(i, k -> new HashMap<>()); - Map variables = new HashMap<>(); + final Map subValues = values.computeIfAbsent(i, k -> new HashMap<>()); + final Map variables = new HashMap<>(); variables.put("index", (i - fromLevel) + 1d); variables.put("subIndex", (j - fromSubLevel) + 1d); - Object base = values.getOrDefault(i, Collections.emptyMap()).get(-1); + final Object base = values.getOrDefault(i, Collections.emptyMap()).get(-1); if ((base != null) && !(base instanceof StatsSet)) { variables.put("base", Double.parseDouble(String.valueOf(base))); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/datatables/MerchantPriceConfigTable.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/datatables/MerchantPriceConfigTable.java index a6d4239316..4b093105f3 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/datatables/MerchantPriceConfigTable.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/datatables/MerchantPriceConfigTable.java @@ -101,7 +101,7 @@ public class MerchantPriceConfigTable implements InstanceListManager } } - final MerchantPriceConfig defaultMpc = this.getMerchantPriceConfig(defaultPriceConfigId); + final MerchantPriceConfig defaultMpc = getMerchantPriceConfig(defaultPriceConfigId); if (defaultMpc == null) { throw new IllegalStateException("'defaultPriceConfig' points to an non-loaded priceConfig"); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/engines/DocumentBase.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/engines/DocumentBase.java index a58df9dbe8..81915d1bab 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/engines/DocumentBase.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/engines/DocumentBase.java @@ -1253,7 +1253,7 @@ public abstract class DocumentBase final char ch = value.isEmpty() ? ' ' : value.charAt(0); if ((ch == '#') || (ch == '-') || Character.isDigit(ch)) { - set.set(name, String.valueOf(getValue(value, level))); + set.set(name, getValue(value, level)); } else { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/enums/CategoryType.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/enums/CategoryType.java index 492a6a20ad..f4cda80dfb 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/enums/CategoryType.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/enums/CategoryType.java @@ -170,7 +170,7 @@ public enum CategoryType * @param categoryName * @return A {@code CategoryType} if category was found, {@code null} if category was not found */ - public static final CategoryType findByName(String categoryName) + public static CategoryType findByName(String categoryName) { for (CategoryType type : values()) { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/enums/IllegalActionPunishmentType.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/enums/IllegalActionPunishmentType.java index cbe5fe7cc5..ba94111d39 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/enums/IllegalActionPunishmentType.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/enums/IllegalActionPunishmentType.java @@ -28,7 +28,7 @@ public enum IllegalActionPunishmentType KICKBAN, JAIL; - public static final IllegalActionPunishmentType findByName(String name) + public static IllegalActionPunishmentType findByName(String name) { for (IllegalActionPunishmentType type : values()) { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java index be9d9db1eb..4bf663ecee 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/instancemanager/CastleManorManager.java @@ -113,7 +113,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable // Send debug message if (Config.DEBUG) { - LOGGER.info(getClass().getSimpleName() + ": Current mode " + _mode.toString()); + LOGGER.info(getClass().getSimpleName() + ": Current mode " + _mode); } } else @@ -432,7 +432,7 @@ public final class CastleManorManager implements IGameXmlReader, IStorable scheduleModeChange(); if (Config.DEBUG) { - LOGGER.info(getClass().getSimpleName() + ": Manor mode changed to " + _mode.toString() + "!"); + LOGGER.info(getClass().getSimpleName() + ": Manor mode changed to " + _mode + "!"); } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/instancemanager/ClanHallAuctionManager.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/instancemanager/ClanHallAuctionManager.java index 82118792ff..d2b187b945 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/instancemanager/ClanHallAuctionManager.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/instancemanager/ClanHallAuctionManager.java @@ -89,7 +89,7 @@ public class ClanHallAuctionManager extends AbstractEventManager partyLvl) { - rewardedMembers.add(partyPlayer); - if (partyPlayer.getLevel() > partyLvl) + if (attackerParty.isInCommandChannel()) { - if (attackerParty.isInCommandChannel()) - { - partyLvl = attackerParty.getCommandChannel().getLevel(); - } - else - { - partyLvl = partyPlayer.getLevel(); - } + partyLvl = attackerParty.getCommandChannel().getLevel(); + } + else + { + partyLvl = partyPlayer.getLevel(); } } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java index c246f7e635..47b5a5105b 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -331,17 +331,14 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe addSkill(skill); } } - else + else if (isSummon()) { - if (isSummon()) + // Copy the skills of the L2Summon from its template to the L2Character Instance + // The skills list can be affected by spell effects so it's necessary to make a copy + // to avoid that a spell affecting a L2Summon, affects others L2Summon of the same type too. + for (Skill skill : template.getSkills().values()) { - // Copy the skills of the L2Summon from its template to the L2Character Instance - // The skills list can be affected by spell effects so it's necessary to make a copy - // to avoid that a spell affecting a L2Summon, affects others L2Summon of the same type too. - for (Skill skill : template.getSkills().values()) - { - addSkill(skill); - } + addSkill(skill); } } @@ -1125,12 +1122,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return; } } - else + else if (_disableRangedAttackEndTime > GameTimeController.getInstance().getGameTicks()) { - if (_disableRangedAttackEndTime > GameTimeController.getInstance().getGameTicks()) - { - return; - } + return; } } @@ -1635,7 +1629,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe * @param itemObjId the item object ID * @return if the item has a reuse time stamp, the remaining time, otherwise -1 */ - public synchronized final long getItemRemainingReuseTime(int itemObjId) + public final synchronized long getItemRemainingReuseTime(int itemObjId) { final TimeStamp reuseStamp = (_reuseTimeStampsItems != null) ? _reuseTimeStampsItems.get(itemObjId) : null; return reuseStamp != null ? reuseStamp.getRemaining() : -1; @@ -1706,7 +1700,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe * Removes a skill reuse time stamp. * @param skill the skill to remove */ - public synchronized final void removeTimeStamp(Skill skill) + public final synchronized void removeTimeStamp(Skill skill) { if (_reuseTimeStampsSkills != null) { @@ -1717,7 +1711,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe /** * Removes all skill reuse time stamps. */ - public synchronized final void resetTimeStamps() + public final synchronized void resetTimeStamps() { if (_reuseTimeStampsSkills != null) { @@ -1730,7 +1724,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe * @param hashCode the skill hash code * @return if the skill has a reuse time stamp, the remaining time, otherwise -1 */ - public synchronized final long getSkillRemainingReuseTime(long hashCode) + public final synchronized long getSkillRemainingReuseTime(long hashCode) { final TimeStamp reuseStamp = (_reuseTimeStampsSkills != null) ? _reuseTimeStampsSkills.get(hashCode) : null; return reuseStamp != null ? reuseStamp.getRemaining() : -1; @@ -1741,7 +1735,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe * @param hashCode the skill hash code * @return {@code true} if the skill is under reuse time, {@code false} otherwise */ - public synchronized final boolean hasSkillReuse(long hashCode) + public final synchronized boolean hasSkillReuse(long hashCode) { final TimeStamp reuseStamp = (_reuseTimeStampsSkills != null) ? _reuseTimeStampsSkills.get(hashCode) : null; return (reuseStamp != null) && reuseStamp.hasNotPassed(); @@ -1752,7 +1746,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe * @param hashCode the skill hash code * @return if the skill has a reuse time stamp, the skill reuse time stamp, otherwise {@code null} */ - public synchronized final TimeStamp getSkillReuseTimeStamp(long hashCode) + public final synchronized TimeStamp getSkillReuseTimeStamp(long hashCode) { return _reuseTimeStampsSkills != null ? _reuseTimeStampsSkills.get(hashCode) : null; } @@ -1809,7 +1803,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe /** * Removes all the disabled skills. */ - public synchronized final void resetDisabledSkills() + public final synchronized void resetDisabledSkills() { if (_disabledSkills != null) { @@ -3018,12 +3012,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe { player.broadcastCharInfo(); } - else + else if (su.hasUpdates()) { - if (su.hasUpdates()) - { - broadcastPacket(su); - } + broadcastPacket(su); } if (hasServitors() && isAffected(EffectFlag.SERVITOR_SHARE)) { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/L2Npc.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/L2Npc.java index 6cba860179..8f172d8007 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/L2Npc.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/L2Npc.java @@ -651,12 +651,9 @@ public class L2Npc extends L2Character return temp; } } - else + else if (HtmCache.getInstance().isLoadable(temp)) { - if (HtmCache.getInstance().isLoadable(temp)) - { - return temp; - } + return temp; } // If the file is not found, the standard message "I have nothing to say to you" is returned diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/L2Summon.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/L2Summon.java index 748edaf2eb..dcd3fc90d9 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/L2Summon.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/L2Summon.java @@ -850,16 +850,13 @@ public abstract class L2Summon extends L2Playable activeChar.sendPacket(new PetItemList(getInventory().getItems())); } } + else if (isPet()) + { + activeChar.sendPacket(new ExPetInfo(this, activeChar, 0)); + } else { - if (isPet()) - { - activeChar.sendPacket(new ExPetInfo(this, activeChar, 0)); - } - else - { - activeChar.sendPacket(new SummonInfo(this, activeChar, 0)); - } + activeChar.sendPacket(new SummonInfo(this, activeChar, 0)); } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/DoppelgangerInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/DoppelgangerInstance.java index 223df4870c..b7f954248a 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/DoppelgangerInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/DoppelgangerInstance.java @@ -92,12 +92,9 @@ public class DoppelgangerInstance extends L2Npc getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, getSummoner()); } } - else + else if (getAI().getIntention() == CtrlIntention.AI_INTENTION_FOLLOW) { - if (getAI().getIntention() == CtrlIntention.AI_INTENTION_FOLLOW) - { - getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); - } + getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2FortManagerInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2FortManagerInstance.java index 81e24c70a0..65524c5221 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2FortManagerInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2FortManagerInstance.java @@ -371,9 +371,9 @@ public class L2FortManagerInstance extends L2MerchantInstance break; } - html.replace("%cost%", String.valueOf(cost) + "Adena /" + String.valueOf(Config.FS_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); - html.replace("%use%", "Provides additional HP recovery for clan members in the fortress." + String.valueOf(percent) + "%"); - html.replace("%apply%", "recovery hp " + String.valueOf(percent)); + html.replace("%cost%", cost + "Adena /" + (Config.FS_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%use%", "Provides additional HP recovery for clan members in the fortress." + percent + "%"); + html.replace("%apply%", "recovery hp " + percent); sendHtmlMessage(player, html); return; } @@ -394,9 +394,9 @@ public class L2FortManagerInstance extends L2MerchantInstance cost = Config.FS_MPREG2_FEE; break; } - html.replace("%cost%", String.valueOf(cost) + "Adena /" + String.valueOf(Config.FS_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); - html.replace("%use%", "Provides additional MP recovery for clan members in the fortress." + String.valueOf(percent) + "%"); - html.replace("%apply%", "recovery mp " + String.valueOf(percent)); + html.replace("%cost%", cost + "Adena /" + (Config.FS_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%use%", "Provides additional MP recovery for clan members in the fortress." + percent + "%"); + html.replace("%apply%", "recovery mp " + percent); sendHtmlMessage(player, html); return; } @@ -417,9 +417,9 @@ public class L2FortManagerInstance extends L2MerchantInstance cost = Config.FS_EXPREG2_FEE; break; } - html.replace("%cost%", String.valueOf(cost) + "Adena /" + String.valueOf(Config.FS_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); - html.replace("%use%", "Restores the Exp of any clan member who is resurrected in the fortress." + String.valueOf(percent) + "%"); - html.replace("%apply%", "recovery exp " + String.valueOf(percent)); + html.replace("%cost%", cost + "Adena /" + (Config.FS_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%use%", "Restores the Exp of any clan member who is resurrected in the fortress." + percent + "%"); + html.replace("%apply%", "recovery exp " + percent); sendHtmlMessage(player, html); return; } @@ -440,7 +440,7 @@ public class L2FortManagerInstance extends L2MerchantInstance if (getFort().getFortFunction(Fort.FUNC_RESTORE_HP).getLvl() == Integer.parseInt(val)) { html.setFile(player.getHtmlPrefix(), "data/html/fortress/functions-used.htm"); - html.replace("%val%", String.valueOf(val) + "%"); + html.replace("%val%", val + "%"); sendHtmlMessage(player, html); return; } @@ -485,7 +485,7 @@ public class L2FortManagerInstance extends L2MerchantInstance if (getFort().getFortFunction(Fort.FUNC_RESTORE_MP).getLvl() == Integer.parseInt(val)) { html.setFile(player.getHtmlPrefix(), "data/html/fortress/functions-used.htm"); - html.replace("%val%", String.valueOf(val) + "%"); + html.replace("%val%", val + "%"); sendHtmlMessage(player, html); return; } @@ -530,7 +530,7 @@ public class L2FortManagerInstance extends L2MerchantInstance if (getFort().getFortFunction(Fort.FUNC_RESTORE_EXP).getLvl() == Integer.parseInt(val)) { html.setFile(player.getHtmlPrefix(), "data/html/fortress/functions-used.htm"); - html.replace("%val%", String.valueOf(val) + "%"); + html.replace("%val%", val + "%"); sendHtmlMessage(player, html); return; } @@ -566,7 +566,7 @@ public class L2FortManagerInstance extends L2MerchantInstance final String mp = "[40%][50%]"; if (getFort().getFortFunction(Fort.FUNC_RESTORE_HP) != null) { - html.replace("%hp_recovery%", String.valueOf(getFort().getFortFunction(Fort.FUNC_RESTORE_HP).getLvl()) + "% (" + String.valueOf(getFort().getFortFunction(Fort.FUNC_RESTORE_HP).getLease()) + "Adena /" + String.valueOf(Config.FS_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%hp_recovery%", getFort().getFortFunction(Fort.FUNC_RESTORE_HP).getLvl() + "% (" + getFort().getFortFunction(Fort.FUNC_RESTORE_HP).getLease() + "Adena /" + (Config.FS_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%hp_period%", "Withdraw the fee for the next time at " + format.format(getFort().getFortFunction(Fort.FUNC_RESTORE_HP).getEndTime())); html.replace("%change_hp%", "[Deactivate]" + hp); } @@ -578,7 +578,7 @@ public class L2FortManagerInstance extends L2MerchantInstance } if (getFort().getFortFunction(Fort.FUNC_RESTORE_EXP) != null) { - html.replace("%exp_recovery%", String.valueOf(getFort().getFortFunction(Fort.FUNC_RESTORE_EXP).getLvl()) + "% (" + String.valueOf(getFort().getFortFunction(Fort.FUNC_RESTORE_EXP).getLease()) + "Adena /" + String.valueOf(Config.FS_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%exp_recovery%", getFort().getFortFunction(Fort.FUNC_RESTORE_EXP).getLvl() + "% (" + getFort().getFortFunction(Fort.FUNC_RESTORE_EXP).getLease() + "Adena /" + (Config.FS_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%exp_period%", "Withdraw the fee for the next time at " + format.format(getFort().getFortFunction(Fort.FUNC_RESTORE_EXP).getEndTime())); html.replace("%change_exp%", "[Deactivate]" + exp); } @@ -590,7 +590,7 @@ public class L2FortManagerInstance extends L2MerchantInstance } if (getFort().getFortFunction(Fort.FUNC_RESTORE_MP) != null) { - html.replace("%mp_recovery%", String.valueOf(getFort().getFortFunction(Fort.FUNC_RESTORE_MP).getLvl()) + "% (" + String.valueOf(getFort().getFortFunction(Fort.FUNC_RESTORE_MP).getLease()) + "Adena /" + String.valueOf(Config.FS_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%mp_recovery%", getFort().getFortFunction(Fort.FUNC_RESTORE_MP).getLvl() + "% (" + getFort().getFortFunction(Fort.FUNC_RESTORE_MP).getLease() + "Adena /" + (Config.FS_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%mp_period%", "Withdraw the fee for the next time at " + format.format(getFort().getFortFunction(Fort.FUNC_RESTORE_MP).getEndTime())); html.replace("%change_mp%", "[Deactivate]" + mp); } @@ -645,9 +645,9 @@ public class L2FortManagerInstance extends L2MerchantInstance cost = Config.FS_SUPPORT2_FEE; break; } - html.replace("%cost%", String.valueOf(cost) + "Adena /" + String.valueOf(Config.FS_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%cost%", cost + "Adena /" + (Config.FS_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%use%", "Enables the use of supplementary magic."); - html.replace("%apply%", "other support " + String.valueOf(stage)); + html.replace("%apply%", "other support " + stage); sendHtmlMessage(player, html); return; } @@ -668,9 +668,9 @@ public class L2FortManagerInstance extends L2MerchantInstance cost = Config.FS_TELE2_FEE; break; } - html.replace("%cost%", String.valueOf(cost) + "Adena /" + String.valueOf(Config.FS_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); - html.replace("%use%", "Teleports clan members in a fort to the target Stage " + String.valueOf(stage) + " staging area"); - html.replace("%apply%", "other tele " + String.valueOf(stage)); + html.replace("%cost%", cost + "Adena /" + (Config.FS_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%use%", "Teleports clan members in a fort to the target Stage " + stage + " staging area"); + html.replace("%apply%", "other tele " + stage); sendHtmlMessage(player, html); return; } @@ -691,7 +691,7 @@ public class L2FortManagerInstance extends L2MerchantInstance if (getFort().getFortFunction(Fort.FUNC_TELEPORT).getLvl() == Integer.parseInt(val)) { html.setFile(player.getHtmlPrefix(), "data/html/fortress/functions-used.htm"); - html.replace("%val%", "Stage " + String.valueOf(val)); + html.replace("%val%", "Stage " + val); sendHtmlMessage(player, html); return; } @@ -736,7 +736,7 @@ public class L2FortManagerInstance extends L2MerchantInstance if (getFort().getFortFunction(Fort.FUNC_SUPPORT).getLvl() == Integer.parseInt(val)) { html.setFile(player.getHtmlPrefix(), "data/html/fortress/functions-used.htm"); - html.replace("%val%", "Stage " + String.valueOf(val)); + html.replace("%val%", "Stage " + val); sendHtmlMessage(player, html); return; } @@ -774,7 +774,7 @@ public class L2FortManagerInstance extends L2MerchantInstance final String support = "[Level 1][Level 2]"; if (getFort().getFortFunction(Fort.FUNC_TELEPORT) != null) { - html.replace("%tele%", "Stage " + String.valueOf(getFort().getFortFunction(Fort.FUNC_TELEPORT).getLvl()) + " (" + String.valueOf(getFort().getFortFunction(Fort.FUNC_TELEPORT).getLease()) + "Adena /" + String.valueOf(Config.FS_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%tele%", "Stage " + getFort().getFortFunction(Fort.FUNC_TELEPORT).getLvl() + " (" + getFort().getFortFunction(Fort.FUNC_TELEPORT).getLease() + "Adena /" + (Config.FS_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%tele_period%", "Withdraw the fee for the next time at " + format.format(getFort().getFortFunction(Fort.FUNC_TELEPORT).getEndTime())); html.replace("%change_tele%", "[Deactivate]" + tele); } @@ -786,7 +786,7 @@ public class L2FortManagerInstance extends L2MerchantInstance } if (getFort().getFortFunction(Fort.FUNC_SUPPORT) != null) { - html.replace("%support%", "Stage " + String.valueOf(getFort().getFortFunction(Fort.FUNC_SUPPORT).getLvl()) + " (" + String.valueOf(getFort().getFortFunction(Fort.FUNC_SUPPORT).getLease()) + "Adena /" + String.valueOf(Config.FS_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%support%", "Stage " + getFort().getFortFunction(Fort.FUNC_SUPPORT).getLvl() + " (" + getFort().getFortFunction(Fort.FUNC_SUPPORT).getLease() + "Adena /" + (Config.FS_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%support_period%", "Withdraw the fee for the next time at " + format.format(getFort().getFortFunction(Fort.FUNC_SUPPORT).getEndTime())); html.replace("%change_support%", "[Deactivate]" + support); } @@ -850,19 +850,16 @@ public class L2FortManagerInstance extends L2MerchantInstance { player.doCast(skill); } + else if (!((skill.getMpConsume() + skill.getMpInitialConsume()) > getCurrentMp())) + { + doCast(skill); + } else { - if (!((skill.getMpConsume() + skill.getMpInitialConsume()) > getCurrentMp())) - { - this.doCast(skill); - } - else - { - html.setFile(player.getHtmlPrefix(), "data/html/fortress/support-no_mana.htm"); - html.replace("%mp%", String.valueOf((int) getCurrentMp())); - sendHtmlMessage(player, html); - return; - } + html.setFile(player.getHtmlPrefix(), "data/html/fortress/support-no_mana.htm"); + html.replace("%mp%", String.valueOf((int) getCurrentMp())); + sendHtmlMessage(player, html); + return; } html.setFile(player.getHtmlPrefix(), "data/html/fortress/support-done.htm"); html.replace("%mp%", String.valueOf((int) getCurrentMp())); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java index 2ca1b939b2..b1c6992b77 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java @@ -146,18 +146,15 @@ public class L2NpcInstance extends L2Npc sm.addInt(minLevel); player.sendPacket(sm); } + else if (player.getClassId().level() == 1) + { + final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_ARE_NO_OTHER_SKILLS_TO_LEARN_PLEASE_COME_BACK_AFTER_S1ND_CLASS_CHANGE); + sm.addInt(2); + player.sendPacket(sm); + } else { - if (player.getClassId().level() == 1) - { - final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_ARE_NO_OTHER_SKILLS_TO_LEARN_PLEASE_COME_BACK_AFTER_S1ND_CLASS_CHANGE); - sm.addInt(2); - player.sendPacket(sm); - } - else - { - player.sendPacket(SystemMessageId.THERE_ARE_NO_OTHER_SKILLS_TO_LEARN); - } + player.sendPacket(SystemMessageId.THERE_ARE_NO_OTHER_SKILLS_TO_LEARN); } } else diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ObservationInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ObservationInstance.java index 94c214ec23..3e30137084 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ObservationInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2ObservationInstance.java @@ -49,16 +49,13 @@ public final class L2ObservationInstance extends L2Npc filename = "data/html/observation/" + getId() + "-Oracle-" + val + ".htm"; } } + else if (val == 0) + { + filename = "data/html/observation/" + getId() + ".htm"; + } else { - if (val == 0) - { - filename = "data/html/observation/" + getId() + ".htm"; - } - else - { - filename = "data/html/observation/" + getId() + "-" + val + ".htm"; - } + filename = "data/html/observation/" + getId() + "-" + val + ".htm"; } final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index d2ff391df8..be71862ae3 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -3287,20 +3287,17 @@ public final class L2PcInstance extends L2Playable sendPacket(sm); } } + else if (process.equalsIgnoreCase("Sweeper") || process.equalsIgnoreCase("Quest")) + { + final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1); + sm.addItemName(itemId); + sendPacket(sm); + } else { - if (process.equalsIgnoreCase("Sweeper") || process.equalsIgnoreCase("Quest")) - { - final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1); - sm.addItemName(itemId); - sendPacket(sm); - } - else - { - final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_OBTAINED_S1); - sm.addItemName(itemId); - sendPacket(sm); - } + final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_OBTAINED_S1); + sm.addItemName(itemId); + sendPacket(sm); } } @@ -3967,18 +3964,15 @@ public final class L2PcInstance extends L2Playable { client.cleanMe(true); } - else + else if (client.getChannel().isActive()) { - if (client.getChannel().isActive()) + if (closeClient) { - if (closeClient) - { - client.close(LeaveWorld.STATIC_PACKET); - } - else - { - client.close(ServerClose.STATIC_PACKET); - } + client.close(LeaveWorld.STATIC_PACKET); + } + else + { + client.close(ServerClose.STATIC_PACKET); } } } @@ -4372,13 +4366,9 @@ public final class L2PcInstance extends L2Playable } } - else + else if (target != null) // _interactTarget=null should never happen but one never knows ^^; { - // _interactTarget=null should never happen but one never knows ^^; - if (target != null) - { - target.onAction(this); - } + target.onAction(this); } } @@ -5257,19 +5247,16 @@ public final class L2PcInstance extends L2Playable player.setPvpKills(player.getPvpKills() + 1); } + else if ((getReputation() > 0) && (getPkKills() == 0)) + { + player.setReputation(0); + player.setPkKills(player.getPkKills() + 1); + } else { - if ((getReputation() > 0) && (getPkKills() == 0)) - { - player.setReputation(0); - player.setPkKills(player.getPkKills() + 1); - } - else - { - // Calculate new karma and increase pk count - player.setReputation(player.getReputation() - Formulas.calculateKarmaGain(player.getPkKills(), killedPlayable.isSummon())); - player.setPkKills(player.getPkKills() + 1); - } + // Calculate new karma and increase pk count + player.setReputation(player.getReputation() - Formulas.calculateKarmaGain(player.getPkKills(), killedPlayable.isSummon())); + player.setPkKills(player.getPkKills() + 1); } final UserInfo ui = new UserInfo(this, false); @@ -9288,7 +9275,7 @@ public final class L2PcInstance extends L2Playable public void sendSkillList(int lastLearnedSkillId) { boolean isDisabled = false; - SkillList sl = new SkillList(); + final SkillList sl = new SkillList(); for (Skill s : getSkillList()) { @@ -9969,16 +9956,13 @@ public final class L2PcInstance extends L2Playable { reviver.sendPacket(SystemMessageId.RESURRECTION_HAS_ALREADY_BEEN_PROPOSED); // Resurrection is already been proposed. } + else if (Pet) + { + reviver.sendPacket(SystemMessageId.A_PET_CANNOT_BE_RESURRECTED_WHILE_IT_S_OWNER_IS_IN_THE_PROCESS_OF_RESURRECTING); // A pet cannot be resurrected while it's owner is in the process of resurrecting. + } else { - if (Pet) - { - reviver.sendPacket(SystemMessageId.A_PET_CANNOT_BE_RESURRECTED_WHILE_IT_S_OWNER_IS_IN_THE_PROCESS_OF_RESURRECTING); // A pet cannot be resurrected while it's owner is in the process of resurrecting. - } - else - { - reviver.sendPacket(SystemMessageId.WHILE_A_PET_IS_BEING_RESURRECTED_IT_CANNOT_HELP_IN_RESURRECTING_ITS_MASTER); // While a pet is attempting to resurrect, it cannot help in resurrecting its master. - } + reviver.sendPacket(SystemMessageId.WHILE_A_PET_IS_BEING_RESURRECTED_IT_CANNOT_HELP_IN_RESURRECTING_ITS_MASTER); // While a pet is attempting to resurrect, it cannot help in resurrecting its master. } return; } @@ -10190,13 +10174,10 @@ public final class L2PcInstance extends L2Playable } } } - else + else if (_teleportWatchdog != null) { - if (_teleportWatchdog != null) - { - _teleportWatchdog.cancel(false); - _teleportWatchdog = null; - } + _teleportWatchdog.cancel(false); + _teleportWatchdog = null; } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java index 8cff1c2830..97eb0b081c 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PetInstance.java @@ -214,7 +214,7 @@ public class L2PetInstance extends L2Summon } } - public synchronized static L2PetInstance spawnPet(L2NpcTemplate template, L2PcInstance owner, L2ItemInstance control) + public static synchronized L2PetInstance spawnPet(L2NpcTemplate template, L2PcInstance owner, L2ItemInstance control) { if (L2World.getInstance().getPet(owner.getObjectId()) != null) { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2StaticObjectInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2StaticObjectInstance.java index ed69a0173d..dee915f5b2 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2StaticObjectInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2StaticObjectInstance.java @@ -162,7 +162,7 @@ public final class L2StaticObjectInstance extends L2Character public void setMeshIndex(int meshIndex) { _meshIndex = meshIndex; - this.broadcastPacket(new StaticObject(this)); + broadcastPacket(new StaticObject(this)); } /** diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/base/PlayerClass.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/base/PlayerClass.java index 7507fdfdcd..77cb71d248 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/base/PlayerClass.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/base/PlayerClass.java @@ -257,7 +257,7 @@ public enum PlayerClass _type = pType; } - public static final EnumSet getSet(Race race, ClassLevel level) + public static EnumSet getSet(Race race, ClassLevel level) { final EnumSet allOf = EnumSet.noneOf(PlayerClass.class); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java index 269987695e..4a9bbd34ac 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/cubic/CubicInstance.java @@ -80,7 +80,8 @@ public class CubicInstance double commulativeChance = 0; for (CubicSkill cubicSkill : _template.getSkills()) { - if ((commulativeChance += cubicSkill.getTriggerRate()) > random) + commulativeChance += cubicSkill.getTriggerRate(); + if (commulativeChance > random) { final Skill skill = cubicSkill.getSkill(); if ((skill != null) && (Rnd.get(100) < cubicSkill.getSuccessRate())) diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/cubic/ICubicConditionHolder.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/cubic/ICubicConditionHolder.java index 70a61fcddd..7f1ca986c1 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/cubic/ICubicConditionHolder.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/cubic/ICubicConditionHolder.java @@ -24,7 +24,7 @@ import com.l2jmobius.gameserver.model.cubic.conditions.ICubicCondition; */ public interface ICubicConditionHolder { - public boolean validateConditions(CubicInstance cubic, L2Character owner, L2Character target); + boolean validateConditions(CubicInstance cubic, L2Character owner, L2Character target); - public void addCondition(ICubicCondition condition); + void addCondition(ICubicCondition condition); } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/cubic/conditions/ICubicCondition.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/cubic/conditions/ICubicCondition.java index 3b06d9aab9..4bd8567f1d 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/cubic/conditions/ICubicCondition.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/cubic/conditions/ICubicCondition.java @@ -24,5 +24,5 @@ import com.l2jmobius.gameserver.model.cubic.CubicInstance; */ public interface ICubicCondition { - public boolean test(CubicInstance cubic, L2Character owner, L2Character target); + boolean test(CubicInstance cubic, L2Character owner, L2Character target); } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Castle.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Castle.java index cc4e56a029..2ef599c33b 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Castle.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Castle.java @@ -353,16 +353,13 @@ public final class Castle extends AbstractResidence } _treasury -= amount; } + else if ((_treasury + amount) > Inventory.MAX_ADENA) + { + _treasury = Inventory.MAX_ADENA; + } else { - if ((_treasury + amount) > Inventory.MAX_ADENA) - { - _treasury = Inventory.MAX_ADENA; - } - else - { - _treasury += amount; - } + _treasury += amount; } try (Connection con = DatabaseFactory.getInstance().getConnection(); @@ -750,26 +747,23 @@ public final class Castle extends AbstractResidence { _function.put(type, new CastleFunction(type, lvl, lease, 0, rate, 0, false)); } + else if ((lvl == 0) && (lease == 0)) + { + removeFunction(type); + } else { - if ((lvl == 0) && (lease == 0)) + final int diffLease = lease - _function.get(type).getLease(); + if (diffLease > 0) { - removeFunction(type); + _function.remove(type); + _function.put(type, new CastleFunction(type, lvl, lease, 0, rate, -1, false)); } else { - final int diffLease = lease - _function.get(type).getLease(); - if (diffLease > 0) - { - _function.remove(type); - _function.put(type, new CastleFunction(type, lvl, lease, 0, rate, -1, false)); - } - else - { - _function.get(type).setLease(lease); - _function.get(type).setLvl(lvl); - _function.get(type).dbSave(); - } + _function.get(type).setLease(lease); + _function.get(type).setLvl(lvl); + _function.get(type).dbSave(); } } return true; diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Duel.java index cffe85e59e..c8cfdbc0a1 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Duel.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Duel.java @@ -920,20 +920,17 @@ public class Duel } } - else + else if (player == _playerA) { - if (player == _playerA) - { - _surrenderRequest = 1; - _playerA.setDuelState(DUELSTATE_DEAD); - _playerB.setDuelState(DUELSTATE_WINNER); - } - else if (player == _playerB) - { - _surrenderRequest = 2; - _playerB.setDuelState(DUELSTATE_DEAD); - _playerA.setDuelState(DUELSTATE_WINNER); - } + _surrenderRequest = 1; + _playerA.setDuelState(DUELSTATE_DEAD); + _playerB.setDuelState(DUELSTATE_WINNER); + } + else if (player == _playerB) + { + _surrenderRequest = 2; + _playerB.setDuelState(DUELSTATE_DEAD); + _playerA.setDuelState(DUELSTATE_WINNER); } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Fort.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Fort.java index dd0c255cdf..1aa9d4cc83 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Fort.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Fort.java @@ -268,11 +268,7 @@ public final class Fort extends AbstractResidence */ public FortFunction getFortFunction(int type) { - if (_function.get(type) != null) - { - return _function.get(type); - } - return null; + return _function.get(type); } public void endOfSiege(L2Clan clan) @@ -690,26 +686,23 @@ public final class Fort extends AbstractResidence { _function.put(type, new FortFunction(type, lvl, lease, 0, rate, 0, false)); } + else if ((lvl == 0) && (lease == 0)) + { + removeFunction(type); + } else { - if ((lvl == 0) && (lease == 0)) + final int diffLease = lease - _function.get(type).getLease(); + if (diffLease > 0) { - removeFunction(type); + _function.remove(type); + _function.put(type, new FortFunction(type, lvl, lease, 0, rate, -1, false)); } else { - final int diffLease = lease - _function.get(type).getLease(); - if (diffLease > 0) - { - _function.remove(type); - _function.put(type, new FortFunction(type, lvl, lease, 0, rate, -1, false)); - } - else - { - _function.get(type).setLease(lease); - _function.get(type).setLvl(lvl); - _function.get(type).dbSave(); - } + _function.get(type).setLease(lease); + _function.get(type).setLvl(lvl); + _function.get(type).dbSave(); } } return true; diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/FortSiege.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/FortSiege.java index 062641fad9..c3c80f4589 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/FortSiege.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/FortSiege.java @@ -169,7 +169,7 @@ public class FortSiege implements Siegable } else { - _log.warning(getClass().getSimpleName() + ": Exception: ScheduleStartSiegeTask(): unknown siege time: " + String.valueOf(_time)); + _log.warning(getClass().getSimpleName() + ": Exception: ScheduleStartSiegeTask(): unknown siege time: " + _time); } } catch (Exception e) diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Siege.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Siege.java index a0e2e1f267..a9ead559aa 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Siege.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/entity/Siege.java @@ -1454,12 +1454,9 @@ public class Siege implements Siegable return; } } - else + else if (getAttackerClans().size() >= SiegeManager.getInstance().getAttackerMaxClans()) { - if (getAttackerClans().size() >= SiegeManager.getInstance().getAttackerMaxClans()) - { - return; - } + return; } if (!isUpdateRegistration) @@ -1668,10 +1665,6 @@ public class Siege implements Siegable public final Castle getCastle() { - if (_castle == null) - { - return null; - } return _castle; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/eventengine/IConditionalEventScheduler.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/eventengine/IConditionalEventScheduler.java index 58d040229b..b36f1a48ba 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/eventengine/IConditionalEventScheduler.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/eventengine/IConditionalEventScheduler.java @@ -21,7 +21,7 @@ package com.l2jmobius.gameserver.model.eventengine; */ public interface IConditionalEventScheduler { - public boolean test(); + boolean test(); - public void run(); + void run(); } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/eventengine/drop/IEventDrop.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/eventengine/drop/IEventDrop.java index 557c484ce0..2abc1edaaa 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/eventengine/drop/IEventDrop.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/eventengine/drop/IEventDrop.java @@ -25,5 +25,5 @@ import com.l2jmobius.gameserver.model.holders.ItemHolder; */ public interface IEventDrop { - public Collection calculateDrops(); + Collection calculateDrops(); } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/events/AbstractScript.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/events/AbstractScript.java index 78ec6037f5..2e89885645 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/events/AbstractScript.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/events/AbstractScript.java @@ -2438,21 +2438,18 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime player.sendPacket(smsg); } // Otherwise, send message of object reward to client + else if (count > 1) + { + final SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S2_S1_S); + smsg.addItemName(item); + smsg.addLong(count); + player.sendPacket(smsg); + } else { - if (count > 1) - { - final SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S2_S1_S); - smsg.addItemName(item); - smsg.addLong(count); - player.sendPacket(smsg); - } - else - { - final SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1); - smsg.addItemName(item); - player.sendPacket(smsg); - } + final SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1); + smsg.addItemName(item); + player.sendPacket(smsg); } // send packets player.sendPacket(new ExUserInfoInvenWeight(player)); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/html/formatters/DefaultFormatter.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/html/formatters/DefaultFormatter.java index 16e9318c5a..902e70b9a1 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/html/formatters/DefaultFormatter.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/html/formatters/DefaultFormatter.java @@ -23,7 +23,7 @@ import com.l2jmobius.gameserver.model.html.IBypassFormatter; */ public class DefaultFormatter implements IBypassFormatter { - public final static DefaultFormatter INSTANCE = new DefaultFormatter(); + public static final DefaultFormatter INSTANCE = new DefaultFormatter(); @Override public String formatBypass(String bypass, int page) diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java index d30670daab..4e71b8b22d 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java @@ -402,12 +402,9 @@ public final class Instance implements IIdentifiable, INamable door.openMe(); } } - else + else if (door.isOpen()) { - if (door.isOpen()) - { - door.closeMe(); - } + door.closeMe(); } } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemauction/AuctionDateGenerator.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemauction/AuctionDateGenerator.java index 9c22473230..a74d40064b 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemauction/AuctionDateGenerator.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemauction/AuctionDateGenerator.java @@ -55,7 +55,7 @@ public final class AuctionDateGenerator checkMinuteOfHour(0); } - public synchronized final long nextDate(long date) + public final synchronized long nextDate(long date) { _calendar.setTimeInMillis(date); _calendar.set(Calendar.MILLISECOND, 0); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java index 66e416164b..6b216c3ba4 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemauction/ItemAuctionInstance.java @@ -412,7 +412,7 @@ public final class ItemAuctionInstance { if (!_auction.setAuctionState(state, ItemAuctionState.STARTED)) { - throw new IllegalStateException("Could not set auction state: " + ItemAuctionState.STARTED.toString() + ", expected: " + state.toString()); + throw new IllegalStateException("Could not set auction state: " + ItemAuctionState.STARTED + ", expected: " + state); } LOGGER.info(getClass().getSimpleName() + ": Auction " + _auction.getAuctionId() + " has started for instance " + _auction.getInstanceId()); @@ -470,7 +470,7 @@ public final class ItemAuctionInstance if (!_auction.setAuctionState(state, ItemAuctionState.FINISHED)) { - throw new IllegalStateException("Could not set auction state: " + ItemAuctionState.FINISHED.toString() + ", expected: " + state.toString()); + throw new IllegalStateException("Could not set auction state: " + ItemAuctionState.FINISHED + ", expected: " + state); } onAuctionFinished(_auction); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index dadb9a7e55..d5a764dff5 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -478,7 +478,7 @@ public abstract class ItemContainer */ public L2ItemInstance destroyItem(String process, L2ItemInstance item, L2PcInstance actor, Object reference) { - return this.destroyItem(process, item, item.getCount(), actor, reference); + return destroyItem(process, item, item.getCount(), actor, reference); } /** @@ -547,7 +547,7 @@ public abstract class ItemContainer { return null; } - return this.destroyItem(process, item, count, actor, reference); + return destroyItem(process, item, count, actor, reference); } /** diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java index 5e367ba77b..34c5f4b4cc 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/itemcontainer/PcInventory.java @@ -580,7 +580,7 @@ public class PcInventory extends Inventory @Override public L2ItemInstance destroyItem(String process, L2ItemInstance item, L2PcInstance actor, Object reference) { - return this.destroyItem(process, item, item.getCount(), actor, reference); + return destroyItem(process, item, item.getCount(), actor, reference); } /** @@ -631,7 +631,7 @@ public class PcInventory extends Inventory { return null; } - return this.destroyItem(process, item, count, actor, reference); + return destroyItem(process, item, count, actor, reference); } /** @@ -651,7 +651,7 @@ public class PcInventory extends Inventory { return null; } - return this.destroyItem(process, item, count, actor, reference); + return destroyItem(process, item, count, actor, reference); } /** diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java index f9a9b9e7b0..1806747fcb 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java @@ -1430,7 +1430,7 @@ public final class L2ItemInstance extends L2Object */ public void updateDatabase() { - this.updateDatabase(false); + updateDatabase(false); } /** diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index 28b84da7e4..91344e3a2b 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -782,7 +782,7 @@ public class SkillCaster implements Runnable @Override public String toString() { - return super.toString() + " [caster: " + String.valueOf(_caster.get()) + " skill: " + String.valueOf(_skill) + " target: " + String.valueOf(_target.get()) + " type: " + String.valueOf(_castingType) + "]"; + return super.toString() + " [caster: " + _caster.get() + " skill: " + _skill + " target: " + _target.get() + " type: " + _castingType + "]"; } /** diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/spawns/NpcSpawnTemplate.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/spawns/NpcSpawnTemplate.java index 9018f8548b..6ba00e8c0a 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/spawns/NpcSpawnTemplate.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/spawns/NpcSpawnTemplate.java @@ -233,7 +233,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized float cumulativeChance = 0; for (ChanceLocation loc : _locations) { - if (locRandom <= (cumulativeChance += loc.getChance())) + cumulativeChance += loc.getChance(); + if (locRandom <= cumulativeChance) { return loc; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/Formulas.java index 92ef9496f8..50053f0aad 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/Formulas.java @@ -439,7 +439,7 @@ public final class Formulas * @param skill * @return the hit time of the skill. */ - public static final int calcHitTime(L2Character creature, Skill skill) + public static int calcHitTime(L2Character creature, Skill skill) { int skillTime = skill.getHitTime() - SKILL_LAUNCH_TIME; @@ -457,7 +457,7 @@ public final class Formulas return Math.max(skillTime, 0); } - public static final int calcSkillCancelTime(L2Character creature, Skill skill) + public static int calcSkillCancelTime(L2Character creature, Skill skill) { // Fishing skills. if ((skill.getId() == 1312) || (skill.getId() == 1314) || (skill.getId() == 1315)) @@ -474,7 +474,7 @@ public final class Formulas * @param skill * @return */ - public static final double calcSkillTimeFactor(L2Character creature, Skill skill) + public static double calcSkillTimeFactor(L2Character creature, Skill skill) { double factor = 0; if (skill.isPhysical() || skill.isDance()) // is_magic = 0 or 3 @@ -980,18 +980,15 @@ public final class Formulas attack_attribute = 0; defence_attribute = target.getDefenseElementValue(AttributeType.NONE_ARMOR); } + else if (attacker.getAttackElement() == skill.getAttributeType()) + { + attack_attribute = attacker.getAttackElementValue(attacker.getAttackElement()) + skill.getAttributeValue(); + defence_attribute = target.getDefenseElementValue(attacker.getAttackElement()); + } else { - if (attacker.getAttackElement() == skill.getAttributeType()) - { - attack_attribute = attacker.getAttackElementValue(attacker.getAttackElement()) + skill.getAttributeValue(); - defence_attribute = target.getDefenseElementValue(attacker.getAttackElement()); - } - else - { - attack_attribute = skill.getAttributeValue(); - defence_attribute = target.getDefenseElementValue(skill.getAttributeType()); - } + attack_attribute = skill.getAttributeValue(); + defence_attribute = target.getDefenseElementValue(skill.getAttributeType()); } } else diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/IStatsFunction.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/IStatsFunction.java index 377844e3d0..e4d16e5190 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/IStatsFunction.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/IStatsFunction.java @@ -569,5 +569,5 @@ public interface IStatsFunction return Math.max(minValue, value); } - public double calc(L2Character creature, Optional base, Stats stat); + double calc(L2Character creature, Optional base, Stats stat); } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/finalizers/ShieldDefenceFinalizer.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/finalizers/ShieldDefenceFinalizer.java index 9f2b3dd191..dcd42b032e 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/finalizers/ShieldDefenceFinalizer.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/finalizers/ShieldDefenceFinalizer.java @@ -32,7 +32,7 @@ public class ShieldDefenceFinalizer implements IStatsFunction { throwIfPresent(base); - double baseValue = calcWeaponPlusBaseValue(creature, stat); + final double baseValue = calcWeaponPlusBaseValue(creature, stat); return Stats.defaultValue(creature, stat, baseValue); } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/finalizers/ShieldDefenceRateFinalizer.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/finalizers/ShieldDefenceRateFinalizer.java index c97237a913..71b4c2047d 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/finalizers/ShieldDefenceRateFinalizer.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/stats/finalizers/ShieldDefenceRateFinalizer.java @@ -32,7 +32,7 @@ public class ShieldDefenceRateFinalizer implements IStatsFunction { throwIfPresent(base); - double baseValue = calcWeaponPlusBaseValue(creature, stat); + final double baseValue = calcWeaponPlusBaseValue(creature, stat); return Stats.defaultValue(creature, stat, baseValue); } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/Attack.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/Attack.java index 63e2071d65..0ce2d3b54f 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/Attack.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/Attack.java @@ -125,16 +125,13 @@ public final class Attack implements IClientIncomingPacket { target.onAction(activeChar); } + else if ((target.getObjectId() != activeChar.getObjectId()) && (activeChar.getPrivateStoreType() == PrivateStoreType.NONE) && (activeChar.getActiveRequester() == null)) + { + target.onForcedAttack(activeChar); + } else { - if ((target.getObjectId() != activeChar.getObjectId()) && (activeChar.getPrivateStoreType() == PrivateStoreType.NONE) && (activeChar.getActiveRequester() == null)) - { - target.onForcedAttack(activeChar); - } - else - { - activeChar.sendPacket(ActionFailed.STATIC_PACKET); - } + activeChar.sendPacket(ActionFailed.STATIC_PACKET); } } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/AttackRequest.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/AttackRequest.java index 5f800250a6..f3dc36381d 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/AttackRequest.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/AttackRequest.java @@ -114,16 +114,13 @@ public final class AttackRequest implements IClientIncomingPacket { target.onAction(activeChar); } + else if ((target.getObjectId() != activeChar.getObjectId()) && (activeChar.getPrivateStoreType() == PrivateStoreType.NONE) && (activeChar.getActiveRequester() == null)) + { + target.onForcedAttack(activeChar); + } else { - if ((target.getObjectId() != activeChar.getObjectId()) && (activeChar.getPrivateStoreType() == PrivateStoreType.NONE) && (activeChar.getActiveRequester() == null)) - { - target.onForcedAttack(activeChar); - } - else - { - activeChar.sendPacket(ActionFailed.STATIC_PACKET); - } + activeChar.sendPacket(ActionFailed.STATIC_PACKET); } } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestActionUse.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestActionUse.java index de793eb0c5..e1ba080e6f 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestActionUse.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestActionUse.java @@ -93,7 +93,7 @@ public final class RequestActionUse implements IClientIncomingPacket if (!(Arrays.binarySearch(allowedActions, _actionId) >= 0)) { client.sendPacket(ActionFailed.STATIC_PACKET); - _log.warning("Player " + activeChar + " used action which he does not have! Id = " + _actionId + " transform: " + String.valueOf(activeChar.getTransformation().orElse(null))); + _log.warning("Player " + activeChar + " used action which he does not have! Id = " + _actionId + " transform: " + activeChar.getTransformation().orElse(null)); return; } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAnswerJoinParty.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAnswerJoinParty.java index 0d4d2eb331..2e3621c40f 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAnswerJoinParty.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAnswerJoinParty.java @@ -106,12 +106,9 @@ public final class RequestAnswerJoinParty implements IClientIncomingPacket party.removePartyMember(requestor, MessageType.NONE); } } - else + else if (party.getMemberCount() == 1) { - if (party.getMemberCount() == 1) - { - party.removePartyMember(requestor, MessageType.NONE); - } + party.removePartyMember(requestor, MessageType.NONE); } party.setPendingInvitation(false); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestBypassToServer.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestBypassToServer.java index b393d512e5..3390eec424 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestBypassToServer.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestBypassToServer.java @@ -305,7 +305,7 @@ public final class RequestBypassToServer implements IClientIncomingPacket sb.append("StackTrace:"); for (StackTraceElement ste : e.getStackTrace()) { - sb.append(ste.toString() + ""); + sb.append(ste + ""); } sb.append(""); // item html diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestConfirmSiegeWaitingList.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestConfirmSiegeWaitingList.java index 609296a7b2..b17c053948 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestConfirmSiegeWaitingList.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestConfirmSiegeWaitingList.java @@ -90,12 +90,9 @@ public final class RequestConfirmSiegeWaitingList implements IClientIncomingPack return; } } - else + else if ((castle.getSiege().checkIsDefenderWaiting(clan)) || (castle.getSiege().checkIsDefender(clan))) { - if ((castle.getSiege().checkIsDefenderWaiting(clan)) || (castle.getSiege().checkIsDefender(clan))) - { - castle.getSiege().removeSiegeClan(_clanId); - } + castle.getSiege().removeSiegeClan(_clanId); } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index fccb7543a2..2bb718a32a 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -202,16 +202,13 @@ public final class RequestEnchantItem implements IClientIncomingPacket _logEnchant.info("Success, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", +" + item.getEnchantLevel() + " " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); } } + else if (support == null) + { + _logEnchant.info("Success, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "]"); + } else { - if (support == null) - { - _logEnchant.info("Success, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "]"); - } - else - { - _logEnchant.info("Success, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); - } + _logEnchant.info("Success, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); } } @@ -268,16 +265,13 @@ public final class RequestEnchantItem implements IClientIncomingPacket _logEnchant.info("Safe Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", +" + item.getEnchantLevel() + " " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); } } + else if (support == null) + { + _logEnchant.info("Safe Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "]"); + } else { - if (support == null) - { - _logEnchant.info("Safe Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "]"); - } - else - { - _logEnchant.info("Safe Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); - } + _logEnchant.info("Safe Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); } } } @@ -332,16 +326,13 @@ public final class RequestEnchantItem implements IClientIncomingPacket _logEnchant.info("Blessed Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", +" + item.getEnchantLevel() + " " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); } } + else if (support == null) + { + _logEnchant.info("Blessed Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "]"); + } else { - if (support == null) - { - _logEnchant.info("Blessed Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "]"); - } - else - { - _logEnchant.info("Blessed Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); - } + _logEnchant.info("Blessed Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); } } } @@ -375,16 +366,13 @@ public final class RequestEnchantItem implements IClientIncomingPacket _logEnchant.info("Unable to destroy, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", +" + item.getEnchantLevel() + " " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); } } + else if (support == null) + { + _logEnchant.info("Unable to destroy, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "]"); + } else { - if (support == null) - { - _logEnchant.info("Unable to destroy, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "]"); - } - else - { - _logEnchant.info("Unable to destroy, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); - } + _logEnchant.info("Unable to destroy, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); } } return; @@ -432,16 +420,13 @@ public final class RequestEnchantItem implements IClientIncomingPacket _logEnchant.info("Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", +" + item.getEnchantLevel() + " " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); } } + else if (support == null) + { + _logEnchant.info("Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "]"); + } else { - if (support == null) - { - _logEnchant.info("Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "]"); - } - else - { - _logEnchant.info("Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); - } + _logEnchant.info("Fail, Character:" + activeChar.getName() + " [" + activeChar.getObjectId() + "] Account:" + activeChar.getAccountName() + " IP:" + activeChar.getIPAddress() + ", " + item.getName() + "(" + item.getCount() + ") [" + item.getObjectId() + "], " + scroll.getName() + "(" + scroll.getCount() + ") [" + scroll.getObjectId() + "], " + support.getName() + "(" + support.getCount() + ") [" + support.getObjectId() + "]"); } } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestPetitionCancel.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestPetitionCancel.java index c2f40b32ef..f11526c04e 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestPetitionCancel.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestPetitionCancel.java @@ -68,31 +68,28 @@ public final class RequestPetitionCancel implements IClientIncomingPacket activeChar.sendPacket(SystemMessageId.YOUR_PETITION_IS_BEING_PROCESSED); } } - else + else if (PetitionManager.getInstance().isPlayerPetitionPending(activeChar)) { - if (PetitionManager.getInstance().isPlayerPetitionPending(activeChar)) + if (PetitionManager.getInstance().cancelActivePetition(activeChar)) { - if (PetitionManager.getInstance().cancelActivePetition(activeChar)) - { - final int numRemaining = Config.MAX_PETITIONS_PER_PLAYER - PetitionManager.getInstance().getPlayerTotalPetitionCount(activeChar); - - final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_PETITION_WAS_CANCELED_YOU_MAY_SUBMIT_S1_MORE_PETITION_S_TODAY); - sm.addString(String.valueOf(numRemaining)); - activeChar.sendPacket(sm); - - // Notify all GMs that the player's pending petition has been cancelled. - final String msgContent = activeChar.getName() + " has canceled a pending petition."; - AdminData.getInstance().broadcastToGMs(new CreatureSay(activeChar.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent)); - } - else - { - activeChar.sendPacket(SystemMessageId.FAILED_TO_CANCEL_PETITION_PLEASE_TRY_AGAIN_LATER); - } + final int numRemaining = Config.MAX_PETITIONS_PER_PLAYER - PetitionManager.getInstance().getPlayerTotalPetitionCount(activeChar); + + final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_PETITION_WAS_CANCELED_YOU_MAY_SUBMIT_S1_MORE_PETITION_S_TODAY); + sm.addString(String.valueOf(numRemaining)); + activeChar.sendPacket(sm); + + // Notify all GMs that the player's pending petition has been cancelled. + final String msgContent = activeChar.getName() + " has canceled a pending petition."; + AdminData.getInstance().broadcastToGMs(new CreatureSay(activeChar.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent)); } else { - activeChar.sendPacket(SystemMessageId.YOU_HAVE_NOT_SUBMITTED_A_PETITION); + activeChar.sendPacket(SystemMessageId.FAILED_TO_CANCEL_PETITION_PLEASE_TRY_AGAIN_LATER); } } + else + { + activeChar.sendPacket(SystemMessageId.YOU_HAVE_NOT_SUBMITTED_A_PETITION); + } } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/Say2.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/Say2.java index 2a169fa35c..986659f07e 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/Say2.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/Say2.java @@ -114,7 +114,7 @@ public final class Say2 implements IClientIncomingPacket ChatType chatType = ChatType.findByClientId(_type); if (chatType == null) { - _log.warning("Say2: Invalid type: " + _type + " Player : " + activeChar.getName() + " text: " + String.valueOf(_text)); + _log.warning("Say2: Invalid type: " + _type + " Player : " + activeChar.getName() + " text: " + _text); activeChar.sendPacket(ActionFailed.STATIC_PACKET); activeChar.logout(); return; @@ -155,12 +155,9 @@ public final class Say2 implements IClientIncomingPacket { activeChar.sendPacket(SystemMessageId.YOU_HAVE_BEEN_REPORTED_AS_AN_ILLEGAL_PROGRAM_USER_SO_CHATTING_IS_NOT_ALLOWED); } - else + else if (Config.BAN_CHAT_CHANNELS.contains(chatType)) { - if (Config.BAN_CHAT_CHANNELS.contains(chatType)) - { - activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER); - } + activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER); } return; } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/SendWareHouseWithDrawList.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/SendWareHouseWithDrawList.java index 188110f133..899d7dad12 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/SendWareHouseWithDrawList.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/SendWareHouseWithDrawList.java @@ -116,13 +116,10 @@ public final class SendWareHouseWithDrawList implements IClientIncomingPacket return; } } - else + else if ((warehouse instanceof ClanWarehouse) && !player.isClanLeader()) { - if ((warehouse instanceof ClanWarehouse) && !player.isClanLeader()) - { - player.sendPacket(SystemMessageId.ITEMS_LEFT_AT_THE_CLAN_HALL_WAREHOUSE_CAN_ONLY_BE_RETRIEVED_BY_THE_CLAN_LEADER_DO_YOU_WANT_TO_CONTINUE); - return; - } + player.sendPacket(SystemMessageId.ITEMS_LEFT_AT_THE_CLAN_HALL_WAREHOUSE_CAN_ONLY_BE_RETRIEVED_BY_THE_CLAN_LEADER_DO_YOU_WANT_TO_CONTINUE); + return; } int weight = 0; diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/appearance/RequestExTryToPutShapeShiftingEnchantSupportItem.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/appearance/RequestExTryToPutShapeShiftingEnchantSupportItem.java index 1de32ef605..ace7358a2d 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/appearance/RequestExTryToPutShapeShiftingEnchantSupportItem.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/appearance/RequestExTryToPutShapeShiftingEnchantSupportItem.java @@ -93,7 +93,8 @@ public class RequestExTryToPutShapeShiftingEnchantSupportItem implements IClient return; } - if ((stone = inventory.getItemByObjectId(stone.getObjectId())) == null) + stone = inventory.getItemByObjectId(stone.getObjectId()); + if (stone == null) { client.sendPacket(ExShapeShiftingResult.FAILED); player.removeRequest(ShapeShiftingItemRequest.class); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/appearance/RequestExTryToPutShapeShiftingTargetItem.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/appearance/RequestExTryToPutShapeShiftingTargetItem.java index 40c8c0bfd3..2a35501572 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/appearance/RequestExTryToPutShapeShiftingTargetItem.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/appearance/RequestExTryToPutShapeShiftingTargetItem.java @@ -91,7 +91,8 @@ public class RequestExTryToPutShapeShiftingTargetItem implements IClientIncoming return; } - if ((stone = inventory.getItemByObjectId(stone.getObjectId())) == null) + stone = inventory.getItemByObjectId(stone.getObjectId()); + if (stone == null) { client.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED); player.removeRequest(ShapeShiftingItemRequest.class); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java index 1291afa177..55c335e3b7 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/appearance/RequestShapeShiftingItem.java @@ -105,7 +105,8 @@ public class RequestShapeShiftingItem implements IClientIncomingPacket return; } - if ((stone = inventory.getItemByObjectId(stone.getObjectId())) == null) + stone = inventory.getItemByObjectId(stone.getObjectId()); + if (stone == null) { client.sendPacket(ExShapeShiftingResult.FAILED); player.removeRequest(ShapeShiftingItemRequest.class); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/dailymission/RequestTodoList.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/dailymission/RequestTodoList.java index 80f5d3cd4f..30f343eee4 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/dailymission/RequestTodoList.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/dailymission/RequestTodoList.java @@ -52,13 +52,13 @@ public class RequestTodoList implements IClientIncomingPacket { // case 1: // { - // player.sendPacket(new ExTodoListInzone()); - // break; + // player.sendPacket(new ExTodoListInzone()); + // break; // } // case 2: // { - // player.sendPacket(new ExTodoListInzone()); - // break; + // player.sendPacket(new ExTodoListInzone()); + // break; // } case 9: { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java index 3de059b566..3313e3ba9a 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/mentoring/ConfirmMenteeAdd.java @@ -72,32 +72,29 @@ public class ConfirmMenteeAdd implements IClientIncomingPacket mentee.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_DECLINED_S1_S_MENTORING_OFFER).addCharName(mentor)); mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_DECLINED_BECOMING_YOUR_MENTEE).addCharName(mentee)); } - else + else if (validate(mentor, mentee)) { - if (validate(mentor, mentee)) + try (Connection con = DatabaseFactory.getInstance().getConnection(); + PreparedStatement statement = con.prepareStatement("INSERT INTO character_mentees (charId, mentorId) VALUES (?, ?)")) { - try (Connection con = DatabaseFactory.getInstance().getConnection(); - PreparedStatement statement = con.prepareStatement("INSERT INTO character_mentees (charId, mentorId) VALUES (?, ?)")) - { - statement.setInt(1, mentee.getObjectId()); - statement.setInt(2, mentor.getObjectId()); - statement.execute(); - - MentorManager.getInstance().addMentor(mentor.getObjectId(), mentee.getObjectId()); - - // Notify to scripts - EventDispatcher.getInstance().notifyEventAsync(new OnPlayerMenteeAdd(mentor, mentee), mentor); - - mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.FROM_NOW_ON_S1_WILL_BE_YOUR_MENTEE).addCharName(mentee)); - mentor.sendPacket(new ExMentorList(mentor)); - - mentee.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.FROM_NOW_ON_S1_WILL_BE_YOUR_MENTOR).addCharName(mentor)); - mentee.sendPacket(new ExMentorList(mentee)); - } - catch (Exception e) - { - _log.log(Level.WARNING, e.getMessage(), e); - } + statement.setInt(1, mentee.getObjectId()); + statement.setInt(2, mentor.getObjectId()); + statement.execute(); + + MentorManager.getInstance().addMentor(mentor.getObjectId(), mentee.getObjectId()); + + // Notify to scripts + EventDispatcher.getInstance().notifyEventAsync(new OnPlayerMenteeAdd(mentor, mentee), mentor); + + mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.FROM_NOW_ON_S1_WILL_BE_YOUR_MENTEE).addCharName(mentee)); + mentor.sendPacket(new ExMentorList(mentor)); + + mentee.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.FROM_NOW_ON_S1_WILL_BE_YOUR_MENTOR).addCharName(mentor)); + mentee.sendPacket(new ExMentorList(mentee)); + } + catch (Exception e) + { + _log.log(Level.WARNING, e.getMessage(), e); } } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExMagicAttackInfo.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExMagicAttackInfo.java index 197b9004da..cd0207167a 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExMagicAttackInfo.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExMagicAttackInfo.java @@ -25,14 +25,14 @@ import com.l2jmobius.gameserver.network.client.OutgoingPackets; public class ExMagicAttackInfo implements IClientOutgoingPacket { // TODO: Enum - public final static int CRITICAL = 1; - public final static int CRITICAL_HEAL = 2; - public final static int OVERHIT = 3; - public final static int EVADED = 4; - public final static int BLOCKED = 5; - public final static int RESISTED = 6; - public final static int IMMUNE = 7; - public final static int IMMUNE2 = 8; + public static final int CRITICAL = 1; + public static final int CRITICAL_HEAL = 2; + public static final int OVERHIT = 3; + public static final int EVADED = 4; + public static final int BLOCKED = 5; + public static final int RESISTED = 6; + public static final int IMMUNE = 7; + public static final int IMMUNE2 = 8; private final int _caster; private final int _target; diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExPledgeRecruitBoardSearch.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExPledgeRecruitBoardSearch.java index 999c0347f6..24d99e1bf2 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExPledgeRecruitBoardSearch.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExPledgeRecruitBoardSearch.java @@ -29,13 +29,13 @@ import com.l2jmobius.gameserver.network.client.OutgoingPackets; public class ExPledgeRecruitBoardSearch implements IClientOutgoingPacket { final List _clanList; - final private int _currentPage; - final private int _totalNumberOfPage; - final private int _clanOnCurrentPage; - final private int _startIndex; - final private int _endIndex; + private final int _currentPage; + private final int _totalNumberOfPage; + private final int _clanOnCurrentPage; + private final int _startIndex; + private final int _endIndex; - final static int CLAN_PER_PAGE = 12; + static final int CLAN_PER_PAGE = 12; public ExPledgeRecruitBoardSearch(List clanList, int currentPage) { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExResponseBeautyList.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExResponseBeautyList.java index ce655da8bb..a74e0a49d7 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExResponseBeautyList.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExResponseBeautyList.java @@ -33,8 +33,8 @@ public class ExResponseBeautyList implements IClientOutgoingPacket private final int _type; private final Map _beautyItem; - public final static int SHOW_FACESHAPE = 1; - public final static int SHOW_HAIRSTYLE = 0; + public static final int SHOW_FACESHAPE = 1; + public static final int SHOW_HAIRSTYLE = 0; public ExResponseBeautyList(L2PcInstance activeChar, int type) { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExResponseBeautyRegistReset.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExResponseBeautyRegistReset.java index 2a20a662ad..b26c7dd7d0 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExResponseBeautyRegistReset.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExResponseBeautyRegistReset.java @@ -29,11 +29,11 @@ public class ExResponseBeautyRegistReset implements IClientOutgoingPacket private final int _type; private final int _result; - public final static int FAILURE = 0; - public final static int SUCCESS = 1; + public static final int FAILURE = 0; + public static final int SUCCESS = 1; - public final static int CHANGE = 0; - public final static int RESTORE = 1; + public static final int CHANGE = 0; + public static final int RESTORE = 1; public ExResponseBeautyRegistReset(L2PcInstance activeChar, int type, int result) { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExShowBeautyMenu.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExShowBeautyMenu.java index 7856ea14d4..9bee4263be 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExShowBeautyMenu.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExShowBeautyMenu.java @@ -29,8 +29,8 @@ public class ExShowBeautyMenu implements IClientOutgoingPacket private final int _type; // TODO: Enum - public final static int MODIFY_APPEARANCE = 0; - public final static int RESTORE_APPEARANCE = 1; + public static final int MODIFY_APPEARANCE = 0; + public static final int RESTORE_APPEARANCE = 1; public ExShowBeautyMenu(L2PcInstance activeChar, int type) { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExShowScreenMessage.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExShowScreenMessage.java index 1b3766212c..07b494ff0c 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExShowScreenMessage.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExShowScreenMessage.java @@ -224,14 +224,11 @@ public class ExShowScreenMessage implements IClientOutgoingPacket { packet.writeS(_text); } - else + else if (_parameters != null) { - if (_parameters != null) + for (String s : _parameters) { - for (String s : _parameters) - { - packet.writeS(s); - } + packet.writeS(s); } } return true; diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ceremonyofchaos/ExCuriousHouseRemainTime.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ceremonyofchaos/ExCuriousHouseRemainTime.java index 45d319131b..44c5412d2f 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ceremonyofchaos/ExCuriousHouseRemainTime.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ceremonyofchaos/ExCuriousHouseRemainTime.java @@ -25,7 +25,7 @@ import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; */ public class ExCuriousHouseRemainTime implements IClientOutgoingPacket { - final private int _time; + private final int _time; public ExCuriousHouseRemainTime(int time) { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/pathfinding/cellnodes/CellNodeBuffer.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/pathfinding/cellnodes/CellNodeBuffer.java index bf3072c3f7..8f8a87a079 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/pathfinding/cellnodes/CellNodeBuffer.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/pathfinding/cellnodes/CellNodeBuffer.java @@ -276,24 +276,21 @@ public class CellNodeBuffer { weight = Config.HIGH_WEIGHT; } - else + else if (isHighWeight(x + 1, y, geoZ)) { - if (isHighWeight(x + 1, y, geoZ)) - { - weight = Config.MEDIUM_WEIGHT; - } - else if (isHighWeight(x - 1, y, geoZ)) - { - weight = Config.MEDIUM_WEIGHT; - } - else if (isHighWeight(x, y + 1, geoZ)) - { - weight = Config.MEDIUM_WEIGHT; - } - else if (isHighWeight(x, y - 1, geoZ)) - { - weight = Config.MEDIUM_WEIGHT; - } + weight = Config.MEDIUM_WEIGHT; + } + else if (isHighWeight(x - 1, y, geoZ)) + { + weight = Config.MEDIUM_WEIGHT; + } + else if (isHighWeight(x, y + 1, geoZ)) + { + weight = Config.MEDIUM_WEIGHT; + } + else if (isHighWeight(x, y - 1, geoZ)) + { + weight = Config.MEDIUM_WEIGHT; } newNode.setParent(_current); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/scripting/java/JavaExecutionContext.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/scripting/java/JavaExecutionContext.java index 6593986e94..7eb34ca17a 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/scripting/java/JavaExecutionContext.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/scripting/java/JavaExecutionContext.java @@ -151,7 +151,7 @@ public final class JavaExecutionContext extends AbstractExecutionContext diagnostic : fileManagerDiagnostics.getDiagnostics()) { - out.println("\t" + diagnostic.getKind().toString() + ": " + diagnostic.getSource().getName() + ", Line " + diagnostic.getLineNumber() + ", Column " + diagnostic.getColumnNumber()); + out.println("\t" + diagnostic.getKind() + ": " + diagnostic.getSource().getName() + ", Line " + diagnostic.getLineNumber() + ", Column " + diagnostic.getColumnNumber()); out.println("\t\tcode: " + diagnostic.getCode()); out.println("\t\tmessage: " + diagnostic.getMessage(null)); } @@ -162,7 +162,7 @@ public final class JavaExecutionContext extends AbstractExecutionContext diagnostic : compilationDiagnostics.getDiagnostics()) { - out.println("\t" + diagnostic.getKind().toString() + ": " + diagnostic.getSource().getName() + ", Line " + diagnostic.getLineNumber() + ", Column " + diagnostic.getColumnNumber()); + out.println("\t" + diagnostic.getKind() + ": " + diagnostic.getSource().getName() + ", Line " + diagnostic.getLineNumber() + ", Column " + diagnostic.getColumnNumber()); out.println("\t\tcode: " + diagnostic.getCode()); out.println("\t\tmessage: " + diagnostic.getMessage(null)); } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/Evolve.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/Evolve.java index 2bb8a246e0..c01bee7451 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/Evolve.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/Evolve.java @@ -47,7 +47,7 @@ public final class Evolve { protected static final Logger _log = Logger.getLogger(Evolve.class.getName()); - public static final boolean doEvolve(L2PcInstance player, L2Npc npc, int itemIdtake, int itemIdgive, int petminlvl) + public static boolean doEvolve(L2PcInstance player, L2Npc npc, int itemIdtake, int itemIdgive, int petminlvl) { if ((itemIdtake == 0) || (itemIdgive == 0) || (petminlvl == 0)) { @@ -158,7 +158,7 @@ public final class Evolve return true; } - public static final boolean doRestore(L2PcInstance player, L2Npc npc, int itemIdtake, int itemIdgive, int petminlvl) + public static boolean doRestore(L2PcInstance player, L2Npc npc, int itemIdtake, int itemIdgive, int petminlvl) { if ((itemIdtake == 0) || (itemIdgive == 0) || (petminlvl == 0)) { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/MinionList.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/MinionList.java index e538949266..10bebbe63e 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/MinionList.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/MinionList.java @@ -331,7 +331,7 @@ public class MinionList * @param minionId The L2NpcTemplate Identifier of the Minion to spawn * @return */ - public static final L2MonsterInstance spawnMinion(L2MonsterInstance master, int minionId) + public static L2MonsterInstance spawnMinion(L2MonsterInstance master, int minionId) { // Get the template of the Minion to spawn final L2NpcTemplate minionTemplate = NpcData.getInstance().getTemplate(minionId); @@ -343,7 +343,7 @@ public class MinionList return initializeNpcInstance(master, new L2MonsterInstance(minionTemplate)); } - protected static final L2MonsterInstance initializeNpcInstance(L2MonsterInstance master, L2MonsterInstance minion) + protected static L2MonsterInstance initializeNpcInstance(L2MonsterInstance master, L2MonsterInstance minion) { minion.stopAllEffects(); minion.setIsDead(false); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/PrimeFinder.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/PrimeFinder.java index 70b630359f..a454fd5289 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/PrimeFinder.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/PrimeFinder.java @@ -345,7 +345,7 @@ public final class PrimeFinder * @param desiredCapacity the capacity desired by the user. * @return the capacity which should be used for a hashtable. */ - public static final int nextPrime(int desiredCapacity) + public static int nextPrime(int desiredCapacity) { int i = Arrays.binarySearch(PRIME_CAPACITIES, desiredCapacity); if (i < 0) diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/Util.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/Util.java index 43cfe8082c..3795e02b4d 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/Util.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/util/Util.java @@ -493,7 +493,7 @@ public final class Util if (Config.HTML_ACTION_CACHE_DEBUG) { - LOGGER.info("Cached html bypass(" + scope.toString() + "): '" + bypass + "'"); + LOGGER.info("Cached html bypass(" + scope + "): '" + bypass + "'"); } player.addHtmlAction(scope, bypass); bypassStart = htmlLower.indexOf("=\"bypass ", bypassEnd); @@ -530,7 +530,7 @@ public final class Util if (Config.HTML_ACTION_CACHE_DEBUG) { - LOGGER.info("Cached html link(" + scope.toString() + "): '" + htmlLink + "'"); + LOGGER.info("Cached html link(" + scope + "): '" + htmlLink + "'"); } // let's keep an action cache with "link " lowercase literal kept player.addHtmlAction(scope, "link " + htmlLink); @@ -556,7 +556,7 @@ public final class Util if (Config.HTML_ACTION_CACHE_DEBUG) { - LOGGER.info("Set html action npc(" + scope.toString() + "): " + npcObjId); + LOGGER.info("Set html action npc(" + scope + "): " + npcObjId); } player.setHtmlActionOriginObjectId(scope, npcObjId); buildHtmlBypassCache(player, scope, html); @@ -645,32 +645,29 @@ public final class Util activeChar.sendPacket(new ShowBoard(html, "1001")); fillMultiEditContent(activeChar, fillMultiEdit); } + else if (html.length() < 16250) + { + activeChar.sendPacket(new ShowBoard(html, "101")); + activeChar.sendPacket(new ShowBoard(null, "102")); + activeChar.sendPacket(new ShowBoard(null, "103")); + } + else if (html.length() < (16250 * 2)) + { + activeChar.sendPacket(new ShowBoard(html.substring(0, 16250), "101")); + activeChar.sendPacket(new ShowBoard(html.substring(16250), "102")); + activeChar.sendPacket(new ShowBoard(null, "103")); + } + else if (html.length() < (16250 * 3)) + { + activeChar.sendPacket(new ShowBoard(html.substring(0, 16250), "101")); + activeChar.sendPacket(new ShowBoard(html.substring(16250, 16250 * 2), "102")); + activeChar.sendPacket(new ShowBoard(html.substring(16250 * 2), "103")); + } else { - if (html.length() < 16250) - { - activeChar.sendPacket(new ShowBoard(html, "101")); - activeChar.sendPacket(new ShowBoard(null, "102")); - activeChar.sendPacket(new ShowBoard(null, "103")); - } - else if (html.length() < (16250 * 2)) - { - activeChar.sendPacket(new ShowBoard(html.substring(0, 16250), "101")); - activeChar.sendPacket(new ShowBoard(html.substring(16250), "102")); - activeChar.sendPacket(new ShowBoard(null, "103")); - } - else if (html.length() < (16250 * 3)) - { - activeChar.sendPacket(new ShowBoard(html.substring(0, 16250), "101")); - activeChar.sendPacket(new ShowBoard(html.substring(16250, 16250 * 2), "102")); - activeChar.sendPacket(new ShowBoard(html.substring(16250 * 2), "103")); - } - else - { - activeChar.sendPacket(new ShowBoard("
Error: HTML was too long!
", "101")); - activeChar.sendPacket(new ShowBoard(null, "102")); - activeChar.sendPacket(new ShowBoard(null, "103")); - } + activeChar.sendPacket(new ShowBoard("
Error: HTML was too long!
", "101")); + activeChar.sendPacket(new ShowBoard(null, "102")); + activeChar.sendPacket(new ShowBoard(null, "103")); } } diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/log/formatter/EnchantFormatter.java b/L2J_Mobius_Underground/java/com/l2jmobius/log/formatter/EnchantFormatter.java index 08427248a8..2a97825e5f 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/log/formatter/EnchantFormatter.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/log/formatter/EnchantFormatter.java @@ -51,7 +51,7 @@ public class EnchantFormatter extends Formatter if (p instanceof L2PcInstance) { final L2PcInstance player = (L2PcInstance) p; - StringUtil.append(output, "Character:", player.getName(), " [" + String.valueOf(player.getObjectId()) + "] Account:", player.getAccountName()); + StringUtil.append(output, "Character:", player.getName(), " [" + player.getObjectId() + "] Account:", player.getAccountName()); if ((player.getClient() != null) && !player.getClient().isDetached()) { StringUtil.append(output, " IP:", player.getClient().getConnectionAddress().getHostAddress());