-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(Core/Spells): simplify and fix Blood-Caked Strike calculation #22243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(Core/Spells): simplify and fix Blood-Caked Strike calculation #22243
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors the weapon damage calculation for Blood-Caked Strike to sum percentage modifiers instead of applying and multiplying raw damage, ensuring extra disease-based damage is normalized like the base.
- Introduces
weaponDamagePercentMod
to accumulate all percent-based weapon damage modifiers. - Updates the Blood-Caked Strike branch to add disease-based percent instead of calculating and applying flat bonus damage.
- Removes the duplicate
weaponDamagePercentMod
declaration and changes howSPELL_EFFECT_WEAPON_PERCENT_DAMAGE
updates the modifier.
Comments suppressed due to low confidence (4)
src/server/game/Spells/SpellEffects.cpp:3345
- [nitpick] The name weaponDamagePercentMod is very similar to totalDamagePercentMod and may be confusing; consider renaming to weaponPercentMod or weaponModAccumulator for clarity.
float weaponDamagePercentMod = 0.0f;
src/server/game/Spells/SpellEffects.cpp:3533
- The new Blood-Caked Strike percent-based logic isn't covered by existing tests; consider adding unit tests for 0–3 diseases to confirm correct percent accumulation and normalization.
if (m_spellInfo->SpellIconID == 1736)
src/server/game/Spells/SpellEffects.cpp:3345
- Initializing weaponDamagePercentMod to 0.0f will omit the base 100% weapon damage for spells without additional modifiers; consider starting this at 100.0f if you intend to include base damage.
float weaponDamagePercentMod = 0.0f;
src/server/game/Spells/SpellEffects.cpp:3575
- CalculateSpellDamage returns a raw damage value, not a percentage; adding it directly to weaponDamagePercentMod may lead to incorrect modifiers. Verify you're summing percent values rather than raw damage.
weaponDamagePercentMod += CalculateSpellDamage(j, unitTarget);
int32 weaponDamage = m_caster->CalculateDamage(m_attackType, false, true); | ||
ApplyPct(weaponDamage, std::min(uint32(3), unitTarget->GetDiseasesByCaster(m_caster->GetGUID())) * 12.5f); | ||
spell_bonus = weaponDamage; | ||
weaponDamagePercentMod += std::min(uint32(3), unitTarget->GetDiseasesByCaster(m_caster->GetGUID())) * 12.5f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the Blood-Caked Strike - Blood-Caked Blade
spell require different handling than the ones above? Judging from the tooltips, they can be handled similarly
// Plague Strike
// Obliterate (12.5% more damage per disease)
If not, the same calcs should be done like below
AddPct(totalDamagePercentMod, disease_amt * unitTarget->GetDiseasesByCaster(m_caster->GetGUID());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very different. Obliterate increases the total damage per disease, Blood-Caked Strike adds straight 12.5% of the weapon percent per disease (or 50% total damage per disease)
It came to me in a dream that spells such as Slam exist, starting the weaponDamagePercent at 0 would have made them do 0% weapon damage |
Changes Proposed:
This PR proposes changes to:
Just add 50% total damage per disease (25% base + 12.5% per disease)
The extra damage per disease of Blood-Caked Strike now also will be normalized, as the base damage is.
SOURCE:
The changes have been validated through:
Tests Performed:
This PR has been:
How to Test the Changes:
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.