Repository navigation
fix(Core/Player): Recalculate level-scaled passive auras on level up - #28608
Conversation
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.
There was a problem hiding this comment.
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.
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Low Merge Risk:
|
Self-review — worktree-fix-level-scaled-auras → masterOutcome 9 findings across 5 rounds — 4 fixed, 2 deferred, 3 dismissed — final round 1 finding, dismissed Reviewed By Claude Code, claude-opus-5-5 — self-review v0.10, 2026-11-29 Tested 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 Diff Metadata Carried from rounds 1-4: (1) pet level up stale values → deferred, follow-up for pets; (2) Round 5 —
|
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.
Changes Proposed:
This PR proposes changes to:
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::GiveLevelnow recalculates, after the new level is set and beforeUpdateAllStats(), every effect withRealPointsPerLevel != 0on the player's own passive auras. It usesAuraEffect::RecalculateAmount, so effects marked as not recalculable are skipped. This covers XP level ups, Refer-A-Friend granted levels and.character levelin both directions.The filter is generic on purpose. Player-reachable passives it affects:
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.
Issues Addressed:
SOURCE:
The changes have been validated through:
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:
How to Test the Changes:
.character level 70, learn 2/2 Magic Absorption and check the character sheet: 70 to all resistances..levelup 1: every resistance rises by 1 to 71 without relogging (before this PR they stayed at 70)..levelup 1while 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:
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.