fix(ai): restore pre-AOS berserk energy vortexes and blade spirits (#2666)

#2132 let a player's energy vortex or blade spirits in pre-AOS Felucca target their own caster, gated by `FollowsAcquireRules`. #2232's AI overhaul moved the summon checks into `IsInvalidSummonTarget`, which excluded the caster in every era, and dropped the gate. Since then `FollowsAcquireRules` has had no readers and summons have never turned on their caster.

## Changes

- `IsInvalidSummonTarget` reads `FollowsAcquireRules` again. A summon that follows the acquire rules spares its caster and anyone the caster's harmful spells would spare. The vortex and blade spirits don't follow them in pre-AOS Felucca when a player summoned them.
- The animated-dead restrictions (no players, no other animated dead, no pets) apply to every animated summon regardless of that setting.
- `AcquireNewFocusMob` sets a berserk summon's caster aside and targets them only when nobody else is available. #2132 meant to prefer others, but its check only worked when the caster was scanned before the other candidates, and the vortex's Int-plus-Magery ranking usually puts a nearby caster first.
- The AOS summon-target check no longer dereferences a missing `SummonMaster`. A summon whose caster was deleted before a reload comes back without one.

Controlled summons are unaffected: since #2665 they target through `HandleControlled` and never reach this scan.

## Tests

`SummonAcquireRulesTests` has 6 cases, skipped without client map data. Pre-AOS Felucca: a vortex and blade spirits each target their caster when the caster is alone, and a vortex targets a bystander even when the caster ranks higher. Pre-AOS Trammel and AOS Felucca: the caster is still spared. An AOS scan next to a summon with no master doesn't throw. `UOContent.Tests`: 1148 passed, 2 skipped, 0 failed on Windows.
This commit is contained in:
Kamron Batman 2026-09-23 10:29:20 -07:00 • committed by GitHub
parent 6b910ff089
commit 3eb3f0fb5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 149 additions and 13 deletions

View file

@ -55,7 +55,8 @@ namespace Server.Mobiles
public override bool BleedImmune => true;
public override Poison PoisonImmune => Poison.Lethal;
public override bool FollowsAcquireRules => Core.AOS || !Summoned || SummonMaster?.Player != true || Map != Map.Felucca;
public override bool FollowsAcquireRules => Core.AOS || !Summoned || SummonMaster?.Player != true ||
(Map?.Rules & MapRules.HarmfulRestrictions) != 0;
public override double GetFightModeRanking(Mobile m, FightMode acqType, bool bPlayerOnly) =>
(m.Str + m.Skills.Tactics.Value) / Math.Max(this.GetDistanceToSqrt(m), 1.0);

View file

@ -63,7 +63,8 @@ namespace Server.Mobiles
public override bool BleedImmune => true;
public override Poison PoisonImmune => Poison.Lethal;
public override bool FollowsAcquireRules => Core.AOS || !Summoned || SummonMaster?.Player != true || Map != Map.Felucca;
public override bool FollowsAcquireRules => Core.AOS || !Summoned || SummonMaster?.Player != true ||
(Map?.Rules & MapRules.HarmfulRestrictions) != 0;
public override double GetFightModeRanking(Mobile m, FightMode acqType, bool bPlayerOnly) =>
(m.Int + m.Skills.Magery.Value) / Math.Max(this.GetDistanceToSqrt(m), 1.0);