Adjustment for multiple servitor defend mode.
Contributed by vass.
This commit is contained in:
parent
be9b0d7914
commit
95bb4638c4
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
|
|
||||||
if (_isDefending)
|
if (_isDefending)
|
||||||
{
|
{
|
||||||
defendAttack(attacker);
|
allServitorsDefend(attacker);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -248,6 +248,19 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void allServitorsDefend(Creature attacker)
|
||||||
|
{
|
||||||
|
final Creature Owner = getActor().getOwner();
|
||||||
|
if ((Owner != null) && Owner.getActingPlayer().hasServitors())
|
||||||
|
{
|
||||||
|
Owner.getActingPlayer().getServitors().values().stream().filter(summon -> ((SummonAI) summon.getAI()).isDefending()).forEach(summon -> ((SummonAI) summon.getAI()).defendAttack(attacker));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
defendAttack(attacker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void avoidAttack(Creature attacker)
|
private void avoidAttack(Creature attacker)
|
||||||
{
|
{
|
||||||
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
// Don't move while casting. It breaks casting animation, but still casts the skill... looks so bugged.
|
||||||
@ -273,9 +286,9 @@ public class SummonAI extends PlayableAI implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Summon summon = getActor();
|
final Summon summon = getActor();
|
||||||
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false) && summon.getOwner().isInsideRadius3D(_actor, 2 * AVOID_RADIUS))
|
if ((summon.getOwner() != null) && (summon.getOwner() != attacker) && !summon.isMoving() && summon.canAttack(attacker, false))
|
||||||
{
|
{
|
||||||
summon.doAutoAttack(attacker);
|
summon.doAttack(attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user