-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(Core/Spells): weapon damage based magic abilities gain too much effect from spell aura % damage increase #22232
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?
Conversation
… effect from spell aura 79 % damage increase
I'd say the problem lies in the implementation of MeleeDamageBonusDone, where it doesn't apply %damage auras when the spell only is physical, but still applies auras that mod physical to other spells azerothcore-wotlk/src/server/game/Entities/Unit/Unit.cpp Lines 13187 to 13208 in 8d9636e
So if we change L13197, we can filter out all auras that mod physical // mods for SPELL_SCHOOL_MASK_NORMAL still are already factored in base melee damage calculation
int32 bonusSchoolMask = (*i)->GetMiscValue();
if (!(bonusSchoolMask & SPELL_SCHOOL_MASK_NORMAL) && (bonusSchoolMask & damageSchoolMask))
|
Fix an issue where weapon damage based magic spells gained too much bonus from percentage damage bonuses
Revert an earlier change, as a different place in code was changed instead
Thank you for the code change suggestion, applying it certainly put things on the right track. If I manually add the flat damage bonus of frost strike * damage modifier to the actual damage of frost strike I get the exact value I would expect though So the flat damage portion of frost strike is now not gaining the bonus damage when it should I'll try to figure it out but I am a bit new at modifying any core code on this project so I will be a little slow, and would certainly accept help |
@Macs-Account Can you check this out? I am not really happy about adding the Phys schoolmask if it is a %Weapon Spell, but it does work. https://github.com/Tereneckla/azerothcore-wotlk/tree/ele-pct-weapon-spells |
Yea, I can see the reasoning behind that but that's misrepresenting the data, which I could see leading to problems down the road. I haven't had time to sit down and trace out the code path of how every effect on the spells get processed, but if I had to guess any spell that has weapon % damage on it has the entire spell processed through the same means, so the weapon % and flat school damage components both get sent down the same method chain. If that's the case the solution is probably to have the school damage effect portion of the ability get treated as a spell. If this is getting too complicated, my original commit of just having the addPct bool be true if physical and false if not did result in the correct total damage being calculated. That might give a good clue as to the issue as well. |
Yeah, adding the phys mask was a misguided late evening addition by me. I thought these spells should benefit from phys modifiers as they scale of physical damage (weapon damage), but they don't. I rectified that in the branch I linked. Your initial solution still is valid, I generalized it a bit. It probably is the version we should go with as it is slightly faster. My branch cut out the usage of precalculated values Did some tests, and my version is ~6% slower. 4731ns vs 4455ns bool const isPhysical = (m_spellSchoolMask & SPELL_SCHOOL_MASK_NORMAL);
if (isPhysical && (fixed_bonus || spell_bonus))
{
UnitMods unitMod;
switch (m_attackType)
{
default:
case BASE_ATTACK:
unitMod = UNIT_MOD_DAMAGE_MAINHAND;
break;
case OFF_ATTACK:
unitMod = UNIT_MOD_DAMAGE_OFFHAND;
break;
case RANGED_ATTACK:
unitMod = UNIT_MOD_DAMAGE_RANGED;
break;
}
float weapon_total_pct = m_caster->GetModifierValue(unitMod, TOTAL_PCT);
fixed_bonus = int32(fixed_bonus * weapon_total_pct);
spell_bonus = int32(spell_bonus * weapon_total_pct);
}
int32 weaponDamage = 0;
// Dancing Rune Weapon
if (m_caster->GetEntry() == 27893)
{
if (Unit* owner = m_caster->GetOwner())
weaponDamage = owner->CalculateDamage(m_attackType, normalized, isPhysical);
}
else
{
weaponDamage = m_caster->CalculateDamage(m_attackType, normalized, isPhysical);
} |
I tested that and it seemed to work properly with the variety of spells I was using to test. I will adjust this commit. Thank you! |
Revert a change (alternative solution being used)
Adjust the process of percentage damage modifications being applied to weapon damage based abilities based on whether or not it is physical
Could you update the original issue under "Steps to reproduce the problem" or this PR under "Tests Performed" with a list of spell IDs and auras to test this? |
@sogladev Done! Added to this PR |
@sogladev I am new to this process, is there something I need to do at this point for this PR or is anything left done by the team? |
Nothing needs to be done on your end. The label "To Be Merged" means it will get merged soon^tm. If you want more details, the process is described on the wiki here: |
Changes Proposed:
This PR proposes changes to:
Issues Addressed:
SOURCE:
The changes have been validated through:
Tests Performed:
This PR has been:
Methodology
List of SpellIds to use while testing this
49143 - Frost Strike (Magic damage based on both Weapon % damage and flat damage)
45902 - Blood Strike (Physical damage based on both Weapon % damage and flat damage)
45477 - Icy Touch (Magic damage dealing spell)
53209 - Chimera Shot (Magic damage based on Weapon % damage only)
48266 - Blood presence for damage buff
To test, get an average damage of a spell without the aura (for spells that have damage ranges). Write it down as X
Apply a % damage buff to yourself. Write it down as Y
Get an average damage of a spell with the aura active (for spells that have damage ranges). Write that down as Z
Z/X should equal very close to Y (within statistical variation)
For ease of testing you can optionally turn up the damage % buff on blood presence or make a custom spell with a really high value of aura name 79
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.