diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java index aff9ab6b16..516544f2ec 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java @@ -48,7 +48,37 @@ public class FindPvP implements IBypassHandler return false; } - final L2PcInstance mostPvP = getMostPvP(); + L2PcInstance mostPvP = null; + int max = -1; + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if ((player == null) // + || (player.getPvpFlag() == 0) // + || (player.getInstanceId() != 0) // + || player.isGM() // + || player.isInsideZone(ZoneId.PEACE) // + || player.isInsideZone(ZoneId.SIEGE) // + || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND)) + { + continue; + } + + int count = 0; + for (L2PcInstance pl : L2World.getInstance().getVisibleObjects(player, L2PcInstance.class)) + { + if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE)) + { + count++; + } + } + + if (count > max) + { + max = count; + mostPvP = player; + } + } + if (mostPvP != null) { // Check if the player's clan is already outnumbering the PvP @@ -114,42 +144,6 @@ public class FindPvP implements IBypassHandler return false; } - private L2PcInstance getMostPvP() - { - L2PcInstance mostPvP = null; - int max = -1; - for (L2PcInstance player : L2World.getInstance().getPlayers()) - { - if ((player == null) // - || (player.getPvpFlag() == 0) // - || (player.getInstanceId() != 0) // - || player.isGM() // - || player.isInsideZone(ZoneId.PEACE) // - || player.isInsideZone(ZoneId.SIEGE) // - || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND)) - { - continue; - } - - int count = 0; - for (L2PcInstance pl : L2World.getInstance().getVisibleObjects(player, L2PcInstance.class)) - { - if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE)) - { - count++; - } - } - - if (count > max) - { - max = count; - mostPvP = player; - } - } - - return mostPvP; - } - @Override public String[] getBypassList() { diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java index aff9ab6b16..516544f2ec 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java @@ -48,7 +48,37 @@ public class FindPvP implements IBypassHandler return false; } - final L2PcInstance mostPvP = getMostPvP(); + L2PcInstance mostPvP = null; + int max = -1; + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if ((player == null) // + || (player.getPvpFlag() == 0) // + || (player.getInstanceId() != 0) // + || player.isGM() // + || player.isInsideZone(ZoneId.PEACE) // + || player.isInsideZone(ZoneId.SIEGE) // + || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND)) + { + continue; + } + + int count = 0; + for (L2PcInstance pl : L2World.getInstance().getVisibleObjects(player, L2PcInstance.class)) + { + if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE)) + { + count++; + } + } + + if (count > max) + { + max = count; + mostPvP = player; + } + } + if (mostPvP != null) { // Check if the player's clan is already outnumbering the PvP @@ -114,42 +144,6 @@ public class FindPvP implements IBypassHandler return false; } - private L2PcInstance getMostPvP() - { - L2PcInstance mostPvP = null; - int max = -1; - for (L2PcInstance player : L2World.getInstance().getPlayers()) - { - if ((player == null) // - || (player.getPvpFlag() == 0) // - || (player.getInstanceId() != 0) // - || player.isGM() // - || player.isInsideZone(ZoneId.PEACE) // - || player.isInsideZone(ZoneId.SIEGE) // - || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND)) - { - continue; - } - - int count = 0; - for (L2PcInstance pl : L2World.getInstance().getVisibleObjects(player, L2PcInstance.class)) - { - if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE)) - { - count++; - } - } - - if (count > max) - { - max = count; - mostPvP = player; - } - } - - return mostPvP; - } - @Override public String[] getBypassList() { diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java index aff9ab6b16..516544f2ec 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java @@ -48,7 +48,37 @@ public class FindPvP implements IBypassHandler return false; } - final L2PcInstance mostPvP = getMostPvP(); + L2PcInstance mostPvP = null; + int max = -1; + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if ((player == null) // + || (player.getPvpFlag() == 0) // + || (player.getInstanceId() != 0) // + || player.isGM() // + || player.isInsideZone(ZoneId.PEACE) // + || player.isInsideZone(ZoneId.SIEGE) // + || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND)) + { + continue; + } + + int count = 0; + for (L2PcInstance pl : L2World.getInstance().getVisibleObjects(player, L2PcInstance.class)) + { + if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE)) + { + count++; + } + } + + if (count > max) + { + max = count; + mostPvP = player; + } + } + if (mostPvP != null) { // Check if the player's clan is already outnumbering the PvP @@ -114,42 +144,6 @@ public class FindPvP implements IBypassHandler return false; } - private L2PcInstance getMostPvP() - { - L2PcInstance mostPvP = null; - int max = -1; - for (L2PcInstance player : L2World.getInstance().getPlayers()) - { - if ((player == null) // - || (player.getPvpFlag() == 0) // - || (player.getInstanceId() != 0) // - || player.isGM() // - || player.isInsideZone(ZoneId.PEACE) // - || player.isInsideZone(ZoneId.SIEGE) // - || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND)) - { - continue; - } - - int count = 0; - for (L2PcInstance pl : L2World.getInstance().getVisibleObjects(player, L2PcInstance.class)) - { - if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE)) - { - count++; - } - } - - if (count > max) - { - max = count; - mostPvP = player; - } - } - - return mostPvP; - } - @Override public String[] getBypassList() { diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java index 9e7af025fb..982caa80d4 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java @@ -48,7 +48,37 @@ public class FindPvP implements IBypassHandler return false; } - final L2PcInstance mostPvP = getMostPvP(); + L2PcInstance mostPvP = null; + int max = -1; + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if ((player == null) // + || (player.getPvpFlag() == 0) // + || (player.getInstanceId() != 0) // + || player.isGM() // + || player.isInsideZone(ZoneId.PEACE) // + || player.isInsideZone(ZoneId.SIEGE) // + || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND)) + { + continue; + } + + int count = 0; + for (L2PcInstance pl : player.getKnownList().getKnownPlayers().values()) + { + if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE)) + { + count++; + } + } + + if (count > max) + { + max = count; + mostPvP = player; + } + } + if (mostPvP != null) { // Check if the player's clan is already outnumbering the PvP @@ -114,42 +144,6 @@ public class FindPvP implements IBypassHandler return false; } - private L2PcInstance getMostPvP() - { - L2PcInstance mostPvP = null; - int max = -1; - for (L2PcInstance player : L2World.getInstance().getPlayers()) - { - if ((player == null) // - || (player.getPvpFlag() == 0) // - || (player.getInstanceId() != 0) // - || player.isGM() // - || player.isInsideZone(ZoneId.PEACE) // - || player.isInsideZone(ZoneId.SIEGE) // - || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND)) - { - continue; - } - - int count = 0; - for (L2PcInstance pl : player.getKnownList().getKnownPlayers().values()) - { - if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE)) - { - count++; - } - } - - if (count > max) - { - max = count; - mostPvP = player; - } - } - - return mostPvP; - } - @Override public String[] getBypassList() { diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java index aff9ab6b16..516544f2ec 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/bypasshandlers/FindPvP.java @@ -48,7 +48,37 @@ public class FindPvP implements IBypassHandler return false; } - final L2PcInstance mostPvP = getMostPvP(); + L2PcInstance mostPvP = null; + int max = -1; + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if ((player == null) // + || (player.getPvpFlag() == 0) // + || (player.getInstanceId() != 0) // + || player.isGM() // + || player.isInsideZone(ZoneId.PEACE) // + || player.isInsideZone(ZoneId.SIEGE) // + || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND)) + { + continue; + } + + int count = 0; + for (L2PcInstance pl : L2World.getInstance().getVisibleObjects(player, L2PcInstance.class)) + { + if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE)) + { + count++; + } + } + + if (count > max) + { + max = count; + mostPvP = player; + } + } + if (mostPvP != null) { // Check if the player's clan is already outnumbering the PvP @@ -114,42 +144,6 @@ public class FindPvP implements IBypassHandler return false; } - private L2PcInstance getMostPvP() - { - L2PcInstance mostPvP = null; - int max = -1; - for (L2PcInstance player : L2World.getInstance().getPlayers()) - { - if ((player == null) // - || (player.getPvpFlag() == 0) // - || (player.getInstanceId() != 0) // - || player.isGM() // - || player.isInsideZone(ZoneId.PEACE) // - || player.isInsideZone(ZoneId.SIEGE) // - || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND)) - { - continue; - } - - int count = 0; - for (L2PcInstance pl : L2World.getInstance().getVisibleObjects(player, L2PcInstance.class)) - { - if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE)) - { - count++; - } - } - - if (count > max) - { - max = count; - mostPvP = player; - } - } - - return mostPvP; - } - @Override public String[] getBypassList() {