mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 01:29:07 +00:00
fix(Core/Spells): SPELL_AURA_DAMAGE_SHIELD auras should be modified by absorbs and resistance. (#5418)
This commit is contained in:
@@ -1612,8 +1612,12 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
if (Unit* caster = (*dmgShieldItr)->GetCaster())
|
||||
damage = this->SpellDamageBonusTaken(caster, i_spellProto, damage, SPELL_DIRECT_DAMAGE);
|
||||
|
||||
// No Unit::CalcAbsorbResist here - opcode doesn't send that data - this damage is probably not affected by that
|
||||
Unit::DealDamageMods(this, damage, nullptr);
|
||||
uint32 absorb = 0;
|
||||
uint32 resist = 0;
|
||||
Unit::CalcAbsorbResist(victim, this, i_spellProto->GetSchoolMask(), SPELL_DIRECT_DAMAGE, damage, &absorb, &resist, i_spellProto);
|
||||
damage -= absorb + resist;
|
||||
|
||||
Unit::DealDamageMods(this, damage, &absorb);
|
||||
|
||||
// TODO: Move this to a packet handler
|
||||
WorldPacket data(SMSG_SPELLDAMAGESHIELD, (8 + 8 + 4 + 4 + 4 + 4));
|
||||
@@ -1623,7 +1627,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
data << uint32(damage); // Damage
|
||||
int32 overkill = int32(damage) - int32(GetHealth());
|
||||
data << uint32(overkill > 0 ? overkill : 0); // Overkill
|
||||
data << uint32(i_spellProto->SchoolMask);
|
||||
data << uint32(i_spellProto->GetSchoolMask());
|
||||
victim->SendMessageToSet(&data, true);
|
||||
|
||||
Unit::DealDamage(victim, this, damage, 0, SPELL_DIRECT_DAMAGE, i_spellProto->GetSchoolMask(), i_spellProto, true);
|
||||
|
||||
Reference in New Issue
Block a user