Core/Spell:

* Fix SPELL_DAMAGE_CLASS_NONE calculation for SpellHealingBonusTaken
* Fix some codestyles
This commit is contained in:
Vincent-Michael
2012-05-13 21:07:59 +02:00
parent fa7e9d3c0d
commit ede623b473
+7 -4
View File
@@ -10814,11 +10814,11 @@ 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
AuraEffectList const& mDummyAuras = GetAuraEffectsByType(SPELL_AURA_DUMMY); AuraEffectList const& mDummyAuras = GetAuraEffectsByType(SPELL_AURA_DUMMY);
for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
{ {
@@ -11411,7 +11411,10 @@ 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
@@ -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;