Core/Spell:

* Fix Spells with DmgClass SPELL_DAMAGE_CLASS_NONE
* Fix SPELL_AURA_PERIODIC_HEAL calculation
* Fix Swiftmend heal calculation
* Fix some codestyle
This commit is contained in:
Vincent-Michael
2012-05-13 16:29:01 +02:00
parent 2459305c76
commit 79a735fb01
3 changed files with 32 additions and 23 deletions
+17 -5
View File
@@ -11201,7 +11201,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
if (Unit* owner = GetOwner()) if (Unit* owner = GetOwner())
return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, stack); return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, stack);
// no bonus for heal potions/bandages // No bonus healing for potion spells
if (spellProto->SpellFamilyName == SPELLFAMILY_POTION) if (spellProto->SpellFamilyName == SPELLFAMILY_POTION)
return healamount; return healamount;
@@ -11293,6 +11293,12 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
(spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK)); (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK));
} }
} }
else
{
// No bonus healing for SPELL_DAMAGE_CLASS_NONE class spells by default
if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE)
return healamount < 0 ? 0 : healamount;
}
// Default calculation // Default calculation
if (DoneAdvertisedBenefit) if (DoneAdvertisedBenefit)
@@ -11356,11 +11362,11 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, u
float TakenTotalMod = 1.0f; float TakenTotalMod = 1.0f;
// Healing taken percent // Healing taken percent
float minval = (float)GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT); float minval = float(GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT));
if (minval) if (minval)
AddPctF(TakenTotalMod, minval); AddPctF(TakenTotalMod, minval);
float maxval = (float)GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT); float maxval = float(GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT));
if (maxval) if (maxval)
AddPctF(TakenTotalMod, maxval); AddPctF(TakenTotalMod, maxval);
@@ -11386,11 +11392,11 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, u
if (damagetype == DOT) if (damagetype == DOT)
{ {
// Healing over time taken percent // Healing over time taken percent
float minval_hot = (float)GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT); float minval_hot = float(GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT));
if (minval_hot) if (minval_hot)
AddPctF(TakenTotalMod, minval_hot); AddPctF(TakenTotalMod, minval_hot);
float maxval_hot = (float)GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT); float maxval_hot = float(GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT));
if (maxval_hot) if (maxval_hot)
AddPctF(TakenTotalMod, maxval_hot); AddPctF(TakenTotalMod, maxval_hot);
} }
@@ -11401,6 +11407,12 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, u
float factorMod = 1.0f; float factorMod = 1.0f;
if (bonus) if (bonus)
coeff = (damagetype == DOT) ? bonus->dot_damage : bonus->direct_damage; coeff = (damagetype == DOT) ? bonus->dot_damage : bonus->direct_damage;
else
{
// No bonus healing for SPELL_DAMAGE_CLASS_NONE class spells by default
if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE)
return healamount < 0 ? 0 : healamount;
}
// Default calculation // Default calculation
if (TakenAdvertisedBenefit) if (TakenAdvertisedBenefit)
@@ -6457,7 +6457,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
damage += addition; damage += addition;
} }
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
} }
-3
View File
@@ -1560,10 +1560,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
int32 tickheal = targetAura->GetAmount(); int32 tickheal = targetAura->GetAmount();
if (Unit* auraCaster = targetAura->GetCaster()) if (Unit* auraCaster = targetAura->GetCaster())
{
tickheal = auraCaster->SpellHealingBonusDone(unitTarget, targetAura->GetSpellInfo(), tickheal, DOT); tickheal = auraCaster->SpellHealingBonusDone(unitTarget, targetAura->GetSpellInfo(), tickheal, DOT);
tickheal = unitTarget->SpellHealingBonusTaken(auraCaster, targetAura->GetSpellInfo(), tickheal, DOT);
}
//int32 tickheal = targetAura->GetSpellInfo()->EffectBasePoints[idx] + 1; //int32 tickheal = targetAura->GetSpellInfo()->EffectBasePoints[idx] + 1;
//It is said that talent bonus should not be included //It is said that talent bonus should not be included