Distinguish getVisibleObjectsInRange from getVisibleObjects.
This commit is contained in:
@@ -314,7 +314,7 @@ public final class Antharas extends AbstractNpcAI
|
||||
}
|
||||
case "START_MOVE":
|
||||
{
|
||||
for (L2PcInstance players : L2World.getInstance().getVisibleObjects(npc, L2PcInstance.class, 4000))
|
||||
for (L2PcInstance players : L2World.getInstance().getVisibleObjectsInRange(npc, L2PcInstance.class, 4000))
|
||||
{
|
||||
if (players.isHero())
|
||||
{
|
||||
|
||||
@@ -301,7 +301,7 @@ public final class Baium extends AbstractNpcAI
|
||||
}
|
||||
else
|
||||
{
|
||||
for (L2Character creature : L2World.getInstance().getVisibleObjects(npc, L2PcInstance.class, 2000))
|
||||
for (L2Character creature : L2World.getInstance().getVisibleObjectsInRange(npc, L2PcInstance.class, 2000))
|
||||
{
|
||||
if (zone.isInsideZone(creature) && !creature.isDead())
|
||||
{
|
||||
@@ -336,7 +336,7 @@ public final class Baium extends AbstractNpcAI
|
||||
else
|
||||
{
|
||||
boolean found = false;
|
||||
for (L2Playable creature : L2World.getInstance().getVisibleObjects(mob, L2Playable.class, 1000))
|
||||
for (L2Playable creature : L2World.getInstance().getVisibleObjectsInRange(mob, L2Playable.class, 1000))
|
||||
{
|
||||
if (zone.isInsideZone(creature) && !creature.isDead())
|
||||
{
|
||||
|
||||
@@ -79,7 +79,7 @@ public class SiegeGuards extends AbstractNpcAI
|
||||
final L2Object target = npc.getTarget();
|
||||
if (!npc.isInCombat() || (target == null) || (npc.calculateDistance2D(target) > npc.getAggroRange()) || target.isInvul())
|
||||
{
|
||||
for (L2Character nearby : L2World.getInstance().getVisibleObjects(npc, L2Character.class, npc.getAggroRange()))
|
||||
for (L2Character nearby : L2World.getInstance().getVisibleObjectsInRange(npc, L2Character.class, npc.getAggroRange()))
|
||||
{
|
||||
if (nearby.isPlayable() && GeoEngine.getInstance().canSeeTarget(npc, nearby))
|
||||
{
|
||||
|
||||
@@ -144,7 +144,7 @@ public final class AdminPcCafePoints implements IAdminCommandHandler
|
||||
}
|
||||
else if (range > 0)
|
||||
{
|
||||
final int count = increaseForAll(L2World.getInstance().getVisibleObjects(activeChar, L2PcInstance.class, range), value);
|
||||
final int count = increaseForAll(L2World.getInstance().getVisibleObjectsInRange(activeChar, L2PcInstance.class, range), value);
|
||||
BuilderUtil.sendSysMessage(activeChar, "You increased PC Cafe point(s) of all players (" + count + ") in range " + range + " by " + value + ".");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -129,7 +129,7 @@ public final class AdminPrimePoints implements IAdminCommandHandler
|
||||
}
|
||||
else if (range > 0)
|
||||
{
|
||||
final int count = increaseForAll(L2World.getInstance().getVisibleObjects(activeChar, L2PcInstance.class, range), value);
|
||||
final int count = increaseForAll(L2World.getInstance().getVisibleObjectsInRange(activeChar, L2PcInstance.class, range), value);
|
||||
BuilderUtil.sendSysMessage(activeChar, "You increased Prime Point(s) of all players (" + count + ") in range " + range + " by " + value + ".");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -175,7 +175,7 @@ public class AdminScan implements IAdminCommandHandler
|
||||
html.setFile(activeChar, "data/html/admin/scan.htm");
|
||||
|
||||
//@formatter:off
|
||||
final PageResult result = PageBuilder.newBuilder(L2World.getInstance().getVisibleObjects(activeChar, L2Npc.class, radius, condition), 15, bypassParser.toString())
|
||||
final PageResult result = PageBuilder.newBuilder(L2World.getInstance().getVisibleObjectsInRange(activeChar, L2Npc.class, radius, condition), 15, bypassParser.toString())
|
||||
.currentPage(page)
|
||||
.pageHandler(NextPrevPageHandler.INSTANCE)
|
||||
.formatter(BypassParserFormatter.INSTANCE)
|
||||
|
||||
@@ -45,7 +45,7 @@ public class OpExistNpcSkillCondition implements ISkillCondition
|
||||
@Override
|
||||
public boolean canUse(L2Character caster, Skill skill, L2Object target)
|
||||
{
|
||||
final List<L2Npc> npcs = L2World.getInstance().getVisibleObjects(caster, L2Npc.class, _range);
|
||||
final List<L2Npc> npcs = L2World.getInstance().getVisibleObjectsInRange(caster, L2Npc.class, _range);
|
||||
return _isAround == npcs.stream().anyMatch(npc -> _npcIds.contains(npc.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class RangeSortByHp implements IAffectScopeHandler
|
||||
return true;
|
||||
};
|
||||
|
||||
final List<L2Character> result = L2World.getInstance().getVisibleObjects(target, L2Character.class, affectRange, filter);
|
||||
final List<L2Character> result = L2World.getInstance().getVisibleObjectsInRange(target, L2Character.class, affectRange, filter);
|
||||
|
||||
// Add object of origin since its skipped in the getVisibleObjects method.
|
||||
if (target.isCharacter() && filter.test((L2Character) target))
|
||||
|
||||
@@ -310,7 +310,7 @@ public class Q00255_Tutorial extends Quest
|
||||
{
|
||||
// check for too many gems on ground
|
||||
int counter = 0;
|
||||
for (L2ItemInstance item : L2World.getInstance().getVisibleObjects(killer, L2ItemInstance.class, 1500))
|
||||
for (L2ItemInstance item : L2World.getInstance().getVisibleObjectsInRange(killer, L2ItemInstance.class, 1500))
|
||||
{
|
||||
if (item.getId() == BLUE_GEM)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user