Skip to content

fix(Core/Player): Recalculate level-scaled passive auras on level up - #28608

Merged
Nyeriah merged 2 commits into
azerothcore:masterfrom
Nyeriah:worktree-fix-level-scaled-auras
Nov 29, 2026
Merged

Nyeriah merged 2 commits into
azerothcore:masterfrom
Nyeriah:worktree-fix-level-scaled-auras

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 effect amounts that scale with level (EffectRealPointsPerLevel) are computed only when the aura is applied, and nothing recalculated them when the player's level changed. Passive auras therefore kept the previous level's value until the next login, which reapplies passives. The reported case is Magic Absorption: a level 71 mage with 2/2 showed 68 to all resistances, and a relog fixed it.

Player::GiveLevel now recalculates, after the new level is set and before UpdateAllStats(), every effect with RealPointsPerLevel != 0 on the player's own passive auras. It uses AuraEffect::RecalculateAmount, so effects marked as not recalculable are skipped. This covers XP level ups, Refer-A-Friend granted levels and .character level in both directions.

The filter is generic on purpose. Player-reachable passives it affects:

  • Magic Absorption (29441, 29444): resistance follows level, the reported bug.
  • Dire Bear Form (Passive) 9635 and Bear Form (Passive) 1178 (only between levels 10 and 40, its MaxLevel), effect 2 attack power, and Cat Form (Passive) 3025 attack power: now follow the level while shapeshifted instead of on the next form change.
  • Weapon enchant passives (Flametongue, Earthliving, Windfury Weapon (Passive), Frozen Rune Weapon): follow the level within their MaxLevel clamp instead of on reapplying the enchant.

Adds the e2e test TestSpells_MagicAbsorptionScalesOnLevelUp (e2e/suites/spells/aura/): a level 70 mage learns Magic Absorption rank 2, runs .levelup 1, and its fire, nature, frost, shadow and arcane resistances (UNIT_FIELD_RESISTANCES) must read 71 without a relog. On master they stay at 70.

AI-assisted Pull Requests

Important

Using AI tools to prepare pull requests is allowed, but it must be disclosed and it must follow our AC guidelines for AI Agentic Engineering (link below).

You are expected to fully understand the changes you submit and to be able to explain and justify them when maintainers ask.

  • 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

Magic Absorption rank 2 increases all resistances by 1 per level, matching its Spell.dbc data (effect 1 SPELL_AURA_MOD_RESISTANCE, RealPointsPerLevel 1.0). A relog already yields the correct value, so the level up path is the only one out of line.

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. Create a mage of any race, .character level 70, learn 2/2 Magic Absorption and check the character sheet: 70 to all resistances.
  2. .levelup 1: every resistance rises by 1 to 71 without relogging (before this PR they stayed at 70).
  3. Druid regression check: an untalented level 70 druid with Dire Bear Form (9634) learned shifts into it and notes attack power, then .levelup 1 while still in form. Attack power rises by 7 (+4 from 2 Strength, +3 from Dire Bear Form (Passive)) without leaving the form; before this PR it rose by 4.

Known Issues and TODO List:

  • Hunter pets have the same stale value on pet level up (Pet::GivePetLevel, e.g. Tamed Pet Passive 11 / 55566 resistance); left for a follow-up.

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.

Aura amounts using EffectRealPointsPerLevel are computed only when the
aura is applied, so passives such as Magic Absorption kept the previous
level's value until the next login. Recalculate those effects for the
player's own passive auras in Player::GiveLevel.
Copilot AI balanced review requested due to automatic review settings November 29, 2026 20:55

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.

@github-actions github-actions Bot added CORE Related to the core file-cpp Used to trigger the matrix build labels Nov 29, 2026
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

After a player levels up, Player::GiveLevel recalculates effects with nonzero RealPointsPerLevel on passive auras cast by that player. It skips other auras and effects without per-level scaling.

Severity of issue fixed: Low

Merge Risk: Minimal · up to 195fa

This change recalculates level-scaled passive effects, such as Magic Absorption resistance, when a player levels up. No concrete merge-blocking defect was found. The PR author has not marked it as tested in-game, so a quick manual check of levels 70 to 71 is sensible before merge.

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 11ae1aa and 195fae8.

Files selected for processing: 1

  • src/server/game/Entities/Player/Player.cpp

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

@Nyeriah

Nyeriah commented Nov 29, 2026 •

Copy link
Copy Markdown
Member Author

Self-review — worktree-fix-level-scaled-auras → master

Outcome 9 findings across 5 rounds — 4 fixed, 2 deferred, 3 dismissed — final round 1 finding, dismissed

Reviewed 41b97cde16 (worktree-fix-level-scaled-auras vs upstream/master, merge-base diff — 3 files, +126 −1)

By Claude Code, claude-opus-5-5 — self-review v0.10, 2026-11-29

Tested TestSpells_MagicAbsorptionScalesOnLevelUp run locally on a build without the core fix: fails as expected, resistances stay at 70 after .levelup to 71

Review details (round 5; rounds 1-4 in fix-level-scaled-auras.SELF-REVIEW.md and -2.md)

Intent When a player's level changes, passive auras whose effect amounts scale per level (EffectRealPointsPerLevel, e.g. Magic Absorption 29441/29444) are recalculated to the new level instead of keeping the value from when they were applied until the next login. A live-stack e2e test covers Magic Absorption.

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

Diff 5e23d66d1c583eb1d1413e6adf9cd7f0fae6b2b2

Metadata 0f3e9c1852561ce79b89eefd8e2dd9b3188e13f4

Carried from rounds 1-4: (1) pet level up stale values → deferred, follow-up for pets; (2) .reset level bypass → dismissed; (3) filter width unstated → deferred, since written in the PR description; (4) test step race guidance → fixed; (5) claimed conflict with the issue → dismissed; (6) Bear Form passive capped at 40 → fixed; (7) Orc mage / racial resistances → fixed; (8) druid +3 vs +7 attack power → fixed.

Round 5 — 41b97cde16, delta since 195fae8021 (new e2e test, README inventory) and changed metadata, 1 finding

  1. e2e/suites/spells/aura/magic_absorption_e2e_test.go:93 — SetTarget(self) + FlushWorld before .levelup 1 are redundant, the command falls back to self → dismissed: explicit self-target keeps the test independent of the selection NewSolo leaves behind; same pattern as the Glyph of Backstab test

A level 70 mage with Magic Absorption rank 2 levels up with
.levelup 1, and its fire, nature, frost, shadow and arcane
resistances must read 71 without a relog.
@github-actions github-actions Bot added the e2e This PR contains a end-to-end test label Nov 29, 2026
@Nyeriah
Nyeriah merged commit 0643d9d into azerothcore:master Nov 29, 2026
17 of 21 checks passed
dimtoneff pushed a commit to dimtoneff/azerothcore-wotlk that referenced this pull request Nov 29, 2026
@Nyeriah
Nyeriah deleted the worktree-fix-level-scaled-auras branch November 30, 2026 00:07
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.

[MageTalent] Magic absorbtion does not give the right amount of resist.

3 participants