Removed stream usage from SummonExceptMaster affect scope.
This commit is contained in:
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -41,15 +40,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
final int affectLimit = skill.getAffectLimit();
|
final int affectLimit = skill.getAffectLimit();
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -41,15 +40,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
final int affectLimit = skill.getAffectLimit();
|
final int affectLimit = skill.getAffectLimit();
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,13 +23,12 @@ import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
|
|||||||
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
import org.l2jmobius.gameserver.handler.IAffectScopeHandler;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
import org.l2jmobius.gameserver.model.skill.targets.AffectScope;
|
||||||
import org.l2jmobius.gameserver.util.Util;
|
import org.l2jmobius.gameserver.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nik
|
* @author Nik, Mobius
|
||||||
*/
|
*/
|
||||||
public class SummonExceptMaster implements IAffectScopeHandler
|
public class SummonExceptMaster implements IAffectScopeHandler
|
||||||
{
|
{
|
||||||
@@ -42,15 +41,33 @@ public class SummonExceptMaster implements IAffectScopeHandler
|
|||||||
|
|
||||||
if (target.isPlayable())
|
if (target.isPlayable())
|
||||||
{
|
{
|
||||||
final Player player = target.getActingPlayer();
|
int count = 0;
|
||||||
//@formatter:off
|
final int limit = (affectLimit > 0) ? affectLimit : Integer.MAX_VALUE;
|
||||||
player.getServitorsAndPets().stream()
|
for (Creature c : target.getActingPlayer().getServitorsAndPets())
|
||||||
.filter(c -> !c.isDead())
|
{
|
||||||
.filter(c -> (affectRange <= 0) || Util.checkIfInRange(affectRange, c, target, true))
|
if (c.isDead())
|
||||||
.filter(c -> (affectObject == null) || affectObject.checkAffectedObject(creature, c))
|
{
|
||||||
.limit(affectLimit > 0 ? affectLimit : Long.MAX_VALUE)
|
continue;
|
||||||
.forEach(action);
|
}
|
||||||
//@formatter:on
|
|
||||||
|
if ((affectRange > 0) && !Util.checkIfInRange(affectRange, c, target, true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, c))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
|
action.accept(c);
|
||||||
|
|
||||||
|
if (count >= limit)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user