Skip to content

fix(Core/Spells): Allow low-level targets for spells ignoring aura scaling - #28617

Merged
Nyeriah merged 3 commits into
azerothcore:masterfrom
Nyeriah:fix-5788-beast-lore-low-level
Nov 30, 2026
Merged

Nyeriah merged 3 commits into
azerothcore:masterfrom
Nyeriah:fix-5788-beast-lore-low-level

Conversation

@Nyeriah

@Nyeriah Nyeriah commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Changes Proposed:

This PR proposes changes to:

  • Core (units, players, creatures, game systems).
  • Scripts (bosses, spell scripts, creature scripts).
  • Database (SAI, creatures, etc).

Aura scaling in Spell::prepare removes any target whose level + 10 is below the spell's SpellLevel and fails the cast with "Target is too low level". It did this even for spells flagged SPELL_ATTR2_ALLOW_LOW_LEVEL_BUFF, which the client treats as "ignore aura scaling". Beast Lore (1462) has SpellLevel 24 and that attribute, so it failed on every target below level 14.

The fix skips filling the aura scale mask for spells with that attribute. SpellInfo::GetAuraRankForLevel already returns the spell unchanged for them, so nothing else about the applied aura changes. Only the low-level target filter stops dropping targets.

Other player spells with the attribute that went through this filter, all of which can now target low-level units:

  • Beast Lore (1462)
  • Divine Intervention (19753), previously needed a level 20+ party member
  • Soulstone Resurrection (20707, 20762, 20763, 20764, 20765, 27239, 47883), higher ranks previously could not be placed on low-level players
  • Focus Magic (54646), previously needed a level 10+ target

Health Funnel and Mind Vision carry the attribute too but are channeled, so aura scaling never applied to them. The remaining spells with the attribute target the caster or are negative auras, so they are unaffected.

Mend Pet, also mentioned in the issue, does not carry the attribute and is left as is. Its rank 1 needs a pet of level 2 or higher, which every hunter pet already is in play: Tame Beast is learned at level 10 and a tamed pet starts at no less than the hunter's level minus 5.

The PR also adds TestAC_5788_BeastLoreOnLowLevelBeast (e2e/suites/spells/aura): a level 80 hunter casts Beast Lore on a level 1 Diseased Young Wolf and the aura must land. On the current master the cast fails with SPELL_FAILED_LOWLEVEL.

AI-assisted Pull Requests

  • AI tools (e.g. Claude, ChatGPT, or similar) were used entirely or partially to prepare this pull request. If checked, specify which tools and models below.
    • Tools/models used: Claude Code (Claude Opus 5.5)
  • I have read and understood the AC guidelines for AI Agentic Engineering

Issues Addressed:

SOURCE:

The changes have been validated through:

  • Live research (checked on live servers, e.g Classic WotLK, Retail, etc.)
  • Sniffs (remember to share them with the open source community!)
  • Video evidence, knowledge databases or other public sources (e.g forums, Wowhead, etc.)
  • The changes promoted by this pull request come partially or entirely from another project (cherry-pick). Cherry-picks must be committed using the proper --author tag in order to be accepted, thus crediting the original authors, unless otherwise unable to be found

cMaNGOS skips its low-level target check for spells with this attribute: cmangos/mangos-wotlk@c96bb69

Tests Performed:

This PR has been:

  • Tested in-game by the author.
  • Tested in-game by other community members/someone else other than the author/has been live on production servers.
  • This pull request requires further testing and may have edge cases to be tested.

How to Test the Changes:

  • This pull request can be tested by following the reproduction steps provided in the linked issue
  • This pull request requires further testing. Provide steps to test your changes. If it requires any specific setup e.g multiple players please specify it as well.
  1. On a hunter, cast Beast Lore (1462) on a beast below level 14 (for example a level 1 to 5 critter or wolf). It should apply and show the beast's info.
  2. On a level 60+ warlock, place Soulstone Resurrection (47883) on a low-level player. It should apply.
  3. On a paladin, cast Divine Intervention (19753) on a party member below level 20, and on a mage cast Focus Magic (54646) on a player below level 10. Both should apply.
  4. Regression check: cast a normal rank-scaled buff such as Power Word: Fortitude (max rank) on a low-level player. It should still be downranked as before.

Known Issues and TODO List:

  • [ ]
  • [ ]

How to Test AzerothCore PRs

When a PR is ready to be tested, it will be marked as [WAITING TO BE TESTED].

You can help by testing PRs and writing your feedback here on the PR's page on GitHub. Follow the instructions here:

http://www.azerothcore.org/wiki/How-to-test-a-PR

REMEMBER: when testing a PR that changes something generic (i.e. a part of code that handles more than one specific thing), the tester should not only check that the PR does its job (e.g. fixing spell XXX) but especially check that the PR does not cause any regression (i.e. introducing new bugs).

For example: if a PR fixes spell X by changing a part of code that handles spells X, Y, and Z, we should not only test X, but we should test Y and Z as well.

…aling

Aura scaling dropped every target whose level + 10 was below the spell's
SpellLevel, even for spells with SPELL_ATTR2_ALLOW_LOW_LEVEL_BUFF. Beast
Lore (1462, SpellLevel 24) therefore failed on anything below level 14.

Skip filling the aura scale mask for spells with that attribute.
GetAuraRankForLevel already ignores rank selection for them, so the only
change is that low-level targets are no longer removed.

Closes azerothcore#5788

Ported from cMaNGOS mangos-wotlk:
cmangos/mangos-wotlk@c96bb69
Copilot AI balanced review requested due to automatic review settings November 29, 2026 23:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Nyeriah

Nyeriah commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Self-review (b782738)

Scope. One condition added to the aura scaling gate in Spell::prepare. With the attribute set, m_auraScaleMask stays 0, so TargetInfo::scaleAura stays false, the low-level filter in SelectSpellTargets is skipped, and DoSpellHitOnUnit applies m_spellInfo directly. That matches what GetAuraRankForLevel already returned for these spells, so the applied aura is unchanged. The module hooks OnScaleAuraUnitAdd and OnRemoveAuraScaleTargets see a zero mask for these spells, the same as for any unscaled spell.

Reach. Checked every 3.3.5 Spell.dbc entry with SPELL_ATTR2_ALLOW_LOW_LEVEL_BUFF, a SpellLevel and a positive apply-aura effect. Changed: Beast Lore, Divine Intervention, all Soulstone Resurrection ranks, Focus Magic. Unaffected: Health Funnel and Mind Vision (channeled, never scaled), and the self-targeted or negative ones (Windfury Weapon 32911, Call Pet 45322, Power Word: Shield 500, Misdirection's self aura, Necrotic Plague). CanScalingEverything and totem casts are left as they were.

Upstream. cMaNGOS skips its low-level check for this attribute (killerwife, cmangos/mangos-wotlk@c96bb69), credited with --author. TrinityCore 3.3.5 has the same filter as AC without the attribute check, so it has no fix to compare against.

Checks. codestyle-cpp.py passes. Not built locally.

Testing. In-game results are up to the author. Beyond the issue's Beast Lore repro, please check a Soulstone placed by a level 70+ warlock on a low-level player, and that normal downranked buffs (max-rank Power Word: Fortitude on a low-level player) still downrank.

No findings.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Spell::prepare now excludes spells marked with SPELL_ATTR2_ALLOW_LOW_LEVEL_BUFF from controlled-unit aura scaling. The existing CanScalingEverything and totem conditions remain unchanged.

Severity of issue fixed: Low

Merge Risk: Minimal · up to b7827

This change lets spells such as Beast Lore, Soulstone Resurrection, Divine Intervention and Focus Magic target low-level units. Spells without the attribute keep the existing scaling gate. No concrete merge-blocking risk was found; in-game testing is still worthwhile.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0643d9d and b782738.

Files selected for processing: 1

  • src/server/game/Spells/Spell.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@github-actions github-actions Bot added CORE Related to the core file-cpp Used to trigger the matrix build labels Nov 29, 2026
Casts Beast Lore (1462) on a level 1 beast and expects the aura to land.
An unfixed core fails the cast with SPELL_FAILED_LOWLEVEL.
@github-actions github-actions Bot added the e2e This PR contains a end-to-end test label Nov 30, 2026
@Nyeriah

Nyeriah commented Nov 30, 2026

Copy link
Copy Markdown
Member Author

Self-review: fix-5788-beast-lore-low-level → master

Outcome 4 findings, all fixed. The final round was clean.

Reviewed ce479f6385 (fix-5788-beast-lore-low-level vs master, merge-base diff: 3 files, +67 −2)

By Claude Code, Claude Opus 5.5, self-review v0.10, 2026-11-29

Tested TestAC_5788_BeastLoreOnLowLevelBeast on a local Windows Release stack. Without the fix it failed with AC#5788 CONFIRMED BUG (SPELL_FAILED_LOWLEVEL). With the fix it passed twice with -count=2, both before and after the finding 4 change.

Review details (3 rounds)

Intent Let player spells flagged SPELL_ATTR2_ALLOW_LOW_LEVEL_BUFF (for example Beast Lore 1462, SpellLevel 24) target units more than 10 levels below SpellLevel by not filling the aura-scaling mask for them (ported from cMaNGOS). Add a live-stack e2e regression test casting Beast Lore on a level 1 beast.

Project rules .agents/docs/self-review-rules.md found and applied

Diff d5f223d29eb78f83122060ee9f93f45b68ee68b8

Metadata 5a639754cf58712681fd8710336972e0f8d0f857

Round 1 (working tree on b78273874b, untracked e2e test included): 4 findings

  1. e2e/suites/spells/aura/beast_lore_e2e_test.go: the test was uncommitted and missing from the commit and the PR description → fixed: committed in ce479f6385, description line drafted
  2. e2e/README.md:154: the spells/aura inventory row didn't list the new test or Beast Lore not working on targets below level 14 #5788 → fixed
  3. PR body Closes #5788: the issue's Mend Pet note (pets below level 2) wasn't addressed → fixed: description line drafted explaining that hunter pets are never below level 5 in play (Tame Beast at 10, pet level at least the hunter's minus 5)
  4. beast_lore_e2e_test.go:52: any failed cast was reported as AC#5788 CONFIRMED BUG → fixed: only SPELL_FAILED_LOWLEVEL is a confirmed bug, anything else goes through Assertf

Round 2 (ce479f6385, round 1 fixes and the new commit subject): clean

The reviewer raised the PR body's missing test mention again. That is finding 1's unapplied draft, still pending.

Round 3 (ce479f6385, PR description with the finding 1 and 3 lines applied): clean

@Nyeriah
Nyeriah merged commit 0cb60ea into azerothcore:master Nov 30, 2026
9 of 18 checks passed
@Nyeriah
Nyeriah deleted the fix-5788-beast-lore-low-level branch November 30, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE Related to the core e2e This PR contains a end-to-end test file-cpp Used to trigger the matrix build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Beast Lore not working on targets below level 14

4 participants