Improved pledge affect scopes.

This commit is contained in:
MobiusDevelopment
2019-05-14 02:34:21 +00:00
parent b19c2ec3d9
commit 01df677c28
24 changed files with 180 additions and 84 deletions

View File

@@ -50,17 +50,18 @@ public class PartyPledge implements IAffectScopeHandler
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final Party party = player.getParty(); final Party party = player.getParty();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
@@ -68,7 +69,9 @@ public class PartyPledge implements IAffectScopeHandler
if (p != player) if (p != player)
{ {
if (((p.getClanId() == 0) && (p.getParty() == null)) || ((p.getClanId() != player.getClanId()) && (party != player.getParty()))) final Party pParty = p.getParty();
final int pClanId = p.getClanId();
if (((pClanId == 0) && (pParty == null)) || ((clanId != pClanId) && (party != pParty)))
{ {
return false; return false;
} }

View File

@@ -47,24 +47,29 @@ public class Pledge implements IAffectScopeHandler
{ {
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
} }
if ((p != player) && ((p.getClanId() == 0) || (p.getClanId() != player.getClanId()))) if (p != player)
{ {
return false; final int pClanId = p.getClanId();
if ((pClanId == 0) || (pClanId != clanId))
{
return false;
}
} }
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p)) if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p))
{ {

View File

@@ -50,17 +50,18 @@ public class PartyPledge implements IAffectScopeHandler
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final Party party = player.getParty(); final Party party = player.getParty();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
@@ -68,7 +69,9 @@ public class PartyPledge implements IAffectScopeHandler
if (p != player) if (p != player)
{ {
if (((p.getClanId() == 0) && (p.getParty() == null)) || ((p.getClanId() != player.getClanId()) && (party != player.getParty()))) final Party pParty = p.getParty();
final int pClanId = p.getClanId();
if (((pClanId == 0) && (pParty == null)) || ((clanId != pClanId) && (party != pParty)))
{ {
return false; return false;
} }

View File

@@ -47,24 +47,29 @@ public class Pledge implements IAffectScopeHandler
{ {
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
} }
if ((p != player) && ((p.getClanId() == 0) || (p.getClanId() != player.getClanId()))) if (p != player)
{ {
return false; final int pClanId = p.getClanId();
if ((pClanId == 0) || (pClanId != clanId))
{
return false;
}
} }
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p)) if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p))
{ {

View File

@@ -50,17 +50,18 @@ public class PartyPledge implements IAffectScopeHandler
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final Party party = player.getParty(); final Party party = player.getParty();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
@@ -68,7 +69,9 @@ public class PartyPledge implements IAffectScopeHandler
if (p != player) if (p != player)
{ {
if (((p.getClanId() == 0) && (p.getParty() == null)) || ((p.getClanId() != player.getClanId()) && (party != player.getParty()))) final Party pParty = p.getParty();
final int pClanId = p.getClanId();
if (((pClanId == 0) && (pParty == null)) || ((clanId != pClanId) && (party != pParty)))
{ {
return false; return false;
} }

View File

@@ -47,24 +47,29 @@ public class Pledge implements IAffectScopeHandler
{ {
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
} }
if ((p != player) && ((p.getClanId() == 0) || (p.getClanId() != player.getClanId()))) if (p != player)
{ {
return false; final int pClanId = p.getClanId();
if ((pClanId == 0) || (pClanId != clanId))
{
return false;
}
} }
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p)) if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p))
{ {

View File

@@ -50,17 +50,18 @@ public class PartyPledge implements IAffectScopeHandler
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final Party party = player.getParty(); final Party party = player.getParty();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
@@ -68,7 +69,9 @@ public class PartyPledge implements IAffectScopeHandler
if (p != player) if (p != player)
{ {
if (((p.getClanId() == 0) && (p.getParty() == null)) || ((p.getClanId() != player.getClanId()) && (party != player.getParty()))) final Party pParty = p.getParty();
final int pClanId = p.getClanId();
if (((pClanId == 0) && (pParty == null)) || ((clanId != pClanId) && (party != pParty)))
{ {
return false; return false;
} }

View File

@@ -47,24 +47,29 @@ public class Pledge implements IAffectScopeHandler
{ {
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
} }
if ((p != player) && ((p.getClanId() == 0) || (p.getClanId() != player.getClanId()))) if (p != player)
{ {
return false; final int pClanId = p.getClanId();
if ((pClanId == 0) || (pClanId != clanId))
{
return false;
}
} }
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p)) if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p))
{ {

View File

@@ -50,17 +50,18 @@ public class PartyPledge implements IAffectScopeHandler
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final Party party = player.getParty(); final Party party = player.getParty();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
@@ -68,7 +69,9 @@ public class PartyPledge implements IAffectScopeHandler
if (p != player) if (p != player)
{ {
if (((p.getClanId() == 0) && (p.getParty() == null)) || ((p.getClanId() != player.getClanId()) && (party != player.getParty()))) final Party pParty = p.getParty();
final int pClanId = p.getClanId();
if (((pClanId == 0) && (pParty == null)) || ((clanId != pClanId) && (party != pParty)))
{ {
return false; return false;
} }

View File

@@ -47,24 +47,29 @@ public class Pledge implements IAffectScopeHandler
{ {
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
} }
if ((p != player) && ((p.getClanId() == 0) || (p.getClanId() != player.getClanId()))) if (p != player)
{ {
return false; final int pClanId = p.getClanId();
if ((pClanId == 0) || (pClanId != clanId))
{
return false;
}
} }
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p)) if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p))
{ {

View File

@@ -50,17 +50,18 @@ public class PartyPledge implements IAffectScopeHandler
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final Party party = player.getParty(); final Party party = player.getParty();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
@@ -68,7 +69,9 @@ public class PartyPledge implements IAffectScopeHandler
if (p != player) if (p != player)
{ {
if (((p.getClanId() == 0) && (p.getParty() == null)) || ((p.getClanId() != player.getClanId()) && (party != player.getParty()))) final Party pParty = p.getParty();
final int pClanId = p.getClanId();
if (((pClanId == 0) && (pParty == null)) || ((clanId != pClanId) && (party != pParty)))
{ {
return false; return false;
} }

View File

@@ -47,24 +47,29 @@ public class Pledge implements IAffectScopeHandler
{ {
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
} }
if ((p != player) && ((p.getClanId() == 0) || (p.getClanId() != player.getClanId()))) if (p != player)
{ {
return false; final int pClanId = p.getClanId();
if ((pClanId == 0) || (pClanId != clanId))
{
return false;
}
} }
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p)) if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p))
{ {

View File

@@ -50,17 +50,18 @@ public class PartyPledge implements IAffectScopeHandler
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final Party party = player.getParty(); final Party party = player.getParty();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
@@ -68,7 +69,9 @@ public class PartyPledge implements IAffectScopeHandler
if (p != player) if (p != player)
{ {
if (((p.getClanId() == 0) && (p.getParty() == null)) || ((p.getClanId() != player.getClanId()) && (party != player.getParty()))) final Party pParty = p.getParty();
final int pClanId = p.getClanId();
if (((pClanId == 0) && (pParty == null)) || ((clanId != pClanId) && (party != pParty)))
{ {
return false; return false;
} }

View File

@@ -47,24 +47,29 @@ public class Pledge implements IAffectScopeHandler
{ {
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
} }
if ((p != player) && ((p.getClanId() == 0) || (p.getClanId() != player.getClanId()))) if (p != player)
{ {
return false; final int pClanId = p.getClanId();
if ((pClanId == 0) || (pClanId != clanId))
{
return false;
}
} }
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p)) if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p))
{ {

View File

@@ -50,17 +50,18 @@ public class PartyPledge implements IAffectScopeHandler
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final Party party = player.getParty(); final Party party = player.getParty();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
@@ -68,7 +69,9 @@ public class PartyPledge implements IAffectScopeHandler
if (p != player) if (p != player)
{ {
if (((p.getClanId() == 0) && (p.getParty() == null)) || ((p.getClanId() != player.getClanId()) && (party != player.getParty()))) final Party pParty = p.getParty();
final int pClanId = p.getClanId();
if (((pClanId == 0) && (pParty == null)) || ((clanId != pClanId) && (party != pParty)))
{ {
return false; return false;
} }

View File

@@ -47,24 +47,29 @@ public class Pledge implements IAffectScopeHandler
{ {
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
} }
if ((p != player) && ((p.getClanId() == 0) || (p.getClanId() != player.getClanId()))) if (p != player)
{ {
return false; final int pClanId = p.getClanId();
if ((pClanId == 0) || (pClanId != clanId))
{
return false;
}
} }
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p)) if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p))
{ {

View File

@@ -50,17 +50,18 @@ public class PartyPledge implements IAffectScopeHandler
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final Party party = player.getParty(); final Party party = player.getParty();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
@@ -68,7 +69,9 @@ public class PartyPledge implements IAffectScopeHandler
if (p != player) if (p != player)
{ {
if (((p.getClanId() == 0) && (p.getParty() == null)) || ((p.getClanId() != player.getClanId()) && (party != player.getParty()))) final Party pParty = p.getParty();
final int pClanId = p.getClanId();
if (((pClanId == 0) && (pParty == null)) || ((clanId != pClanId) && (party != pParty)))
{ {
return false; return false;
} }

View File

@@ -47,24 +47,29 @@ public class Pledge implements IAffectScopeHandler
{ {
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
} }
if ((p != player) && ((p.getClanId() == 0) || (p.getClanId() != player.getClanId()))) if (p != player)
{ {
return false; final int pClanId = p.getClanId();
if ((pClanId == 0) || (pClanId != clanId))
{
return false;
}
} }
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p)) if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p))
{ {

View File

@@ -50,17 +50,18 @@ public class PartyPledge implements IAffectScopeHandler
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final Party party = player.getParty(); final Party party = player.getParty();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
@@ -68,7 +69,9 @@ public class PartyPledge implements IAffectScopeHandler
if (p != player) if (p != player)
{ {
if (((p.getClanId() == 0) && (p.getParty() == null)) || ((p.getClanId() != player.getClanId()) && (party != player.getParty()))) final Party pParty = p.getParty();
final int pClanId = p.getClanId();
if (((pClanId == 0) && (pParty == null)) || ((clanId != pClanId) && (party != pParty)))
{ {
return false; return false;
} }

View File

@@ -47,24 +47,29 @@ public class Pledge implements IAffectScopeHandler
{ {
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
} }
if ((p != player) && ((p.getClanId() == 0) || (p.getClanId() != player.getClanId()))) if (p != player)
{ {
return false; final int pClanId = p.getClanId();
if ((pClanId == 0) || (pClanId != clanId))
{
return false;
}
} }
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p)) if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p))
{ {

View File

@@ -50,17 +50,18 @@ public class PartyPledge implements IAffectScopeHandler
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final Party party = player.getParty(); final Party party = player.getParty();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
@@ -68,7 +69,9 @@ public class PartyPledge implements IAffectScopeHandler
if (p != player) if (p != player)
{ {
if (((p.getClanId() == 0) && (p.getParty() == null)) || ((p.getClanId() != player.getClanId()) && (party != player.getParty()))) final Party pParty = p.getParty();
final int pClanId = p.getClanId();
if (((pClanId == 0) && (pParty == null)) || ((clanId != pClanId) && (party != pParty)))
{ {
return false; return false;
} }

View File

@@ -47,24 +47,29 @@ public class Pledge implements IAffectScopeHandler
{ {
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
} }
if ((p != player) && ((p.getClanId() == 0) || (p.getClanId() != player.getClanId()))) if (p != player)
{ {
return false; final int pClanId = p.getClanId();
if ((pClanId == 0) || (pClanId != clanId))
{
return false;
}
} }
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p)) if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p))
{ {

View File

@@ -50,17 +50,18 @@ public class PartyPledge implements IAffectScopeHandler
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final Party party = player.getParty(); final Party party = player.getParty();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
@@ -68,7 +69,9 @@ public class PartyPledge implements IAffectScopeHandler
if (p != player) if (p != player)
{ {
if (((p.getClanId() == 0) && (p.getParty() == null)) || ((p.getClanId() != player.getClanId()) && (party != player.getParty()))) final Party pParty = p.getParty();
final int pClanId = p.getClanId();
if (((pClanId == 0) && (pParty == null)) || ((clanId != pClanId) && (party != pParty)))
{ {
return false; return false;
} }

View File

@@ -47,24 +47,29 @@ public class Pledge implements IAffectScopeHandler
{ {
final Playable playable = (Playable) target; final Playable playable = (Playable) target;
final PlayerInstance player = playable.getActingPlayer(); final PlayerInstance player = playable.getActingPlayer();
final int clanId = player.getClanId();
// Create the target filter. // Create the target filter.
final AtomicInteger affected = new AtomicInteger(0); final AtomicInteger affected = new AtomicInteger(0);
final Predicate<Playable> filter = plbl -> final Predicate<Playable> filter = c ->
{ {
if ((affectLimit > 0) && (affected.get() >= affectLimit)) if ((affectLimit > 0) && (affected.get() >= affectLimit))
{ {
return false; return false;
} }
final PlayerInstance p = plbl.getActingPlayer(); final PlayerInstance p = c.getActingPlayer();
if ((p == null) || p.isDead()) if ((p == null) || p.isDead())
{ {
return false; return false;
} }
if ((p != player) && ((p.getClanId() == 0) || (p.getClanId() != player.getClanId()))) if (p != player)
{ {
return false; final int pClanId = p.getClanId();
if ((pClanId == 0) || (pClanId != clanId))
{
return false;
}
} }
if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p)) if ((affectObject != null) && !affectObject.checkAffectedObject(creature, p))
{ {