Merge pull request #6511 from Vincent-Michael/SpellHealingBonusTaken

Core/Spell: Fix SPELL_DAMAGE_CLASS_NONE calculation for SpellHealingBonusTaken
This commit is contained in:
kandera
2012-05-14 06:49:12 -07:00
+6 -3
View File
@@ -10814,8 +10814,8 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
int32 TakenTotal = 0; int32 TakenTotal = 0;
float TakenTotalMod = 1.0f; float TakenTotalMod = 1.0f;
//from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN // from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
//multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085) // multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085)
TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, spellProto->GetSchoolMask()); TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, spellProto->GetSchoolMask());
//.. taken pct: dummy auras //.. taken pct: dummy auras
@@ -11411,8 +11411,11 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u
{ {
// No bonus healing for SPELL_DAMAGE_CLASS_NONE class spells by default // No bonus healing for SPELL_DAMAGE_CLASS_NONE class spells by default
if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE) if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE)
{
healamount = int32(healamount * TakenTotalMod);
return healamount < 0 ? 0 : healamount; return healamount < 0 ? 0 : healamount;
} }
}
// Default calculation // Default calculation
if (TakenAdvertisedBenefit) if (TakenAdvertisedBenefit)
@@ -11820,7 +11823,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType
return uint32(std::max(tmpDamage, 0.0f)); return uint32(std::max(tmpDamage, 0.0f));
} }
uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const *spellProto) uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const* spellProto)
{ {
if (pdamage == 0) if (pdamage == 0)
return 0; return 0;