Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Tereneckla
Copy link
Contributor

@Tereneckla Tereneckla commented May 29, 2025

Changes Proposed:

This PR proposes changes to:

  • Core (units, players, creatures, game systems).

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:

  • 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

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.

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.

@github-actions github-actions bot added CORE Related to the core file-cpp Used to trigger the matrix build labels May 29, 2025
@TheSCREWEDSoftware TheSCREWEDSoftware requested review from Copilot, sogladev and Nyeriah and removed request for Copilot May 29, 2025 21:54
Copy link

@Copilot Copilot AI left a 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 how SPELL_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;
Copy link
Member

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());

Copy link
Contributor Author

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)

@sogladev sogladev added Testing in Progress Tested This PR has been tested and is working. and removed Testing in Progress labels May 30, 2025
@sogladev sogladev changed the title refactor(Core/Spells) simplify (and fix) Blood-Caked Strike calculation fix(Core/Spells): simplify and fix Blood-Caked Strike calculation May 30, 2025
@Tereneckla
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CORE Related to the core file-cpp Used to trigger the matrix build Tested This PR has been tested and is working. To Be Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants