Merged FindPvP search method to useBypass.
This commit is contained in:
parent
92384cfcba
commit
6cb9a64ac0
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user