[9283] Apply SPELL_AURA_MOD_HEALING_PCT to any healing.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
laise 2010-02-02 01:55:33 +03:00 committed by VladimirMangos
parent 742f8df025
commit 868a4d20a4
2 changed files with 19 additions and 15 deletions

View file

@ -9349,19 +9349,32 @@ uint32 Unit::SpellCriticalHealingBonus(SpellEntry const *spellProto, uint32 dama
uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack) uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack)
{ {
// No heal amount for this class spells
if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE)
return healamount;
// For totems get healing bonus from owner (statue isn't totem in fact) // For totems get healing bonus from owner (statue isn't totem in fact)
if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE) if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE)
if(Unit* owner = GetOwner()) if(Unit* owner = GetOwner())
return owner->SpellHealingBonus(pVictim, spellProto, healamount, damagetype, stack); return owner->SpellHealingBonus(pVictim, spellProto, healamount, damagetype, stack);
float TakenTotalMod = 1.0f;
// Healing taken percent
float minval = pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
if(minval)
TakenTotalMod *= (100.0f + minval) / 100.0f;
float maxval = pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
if(maxval)
TakenTotalMod *= (100.0f + maxval) / 100.0f;
// No heal amount for this class spells
if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE)
{
healamount = healamount * TakenTotalMod;
return healamount < 0 ? 0 : uint32(healamount);
}
// Healing Done // Healing Done
// Taken/Done total percent damage auras // Taken/Done total percent damage auras
float DoneTotalMod = 1.0f; float DoneTotalMod = 1.0f;
float TakenTotalMod = 1.0f;
int32 DoneTotal = 0; int32 DoneTotal = 0;
int32 TakenTotal = 0; int32 TakenTotal = 0;
@ -9508,15 +9521,6 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
TakenTotalMod *= ((*itr)->GetModifier()->m_amount+100.0f) / 100.0f; TakenTotalMod *= ((*itr)->GetModifier()->m_amount+100.0f) / 100.0f;
} }
// Healing taken percent
float minval = pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
if(minval)
TakenTotalMod *= (100.0f + minval) / 100.0f;
float maxval = pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
if(maxval)
TakenTotalMod *= (100.0f + maxval) / 100.0f;
AuraList const& mHealingGet= pVictim->GetAurasByType(SPELL_AURA_MOD_HEALING_RECEIVED); AuraList const& mHealingGet= pVictim->GetAurasByType(SPELL_AURA_MOD_HEALING_RECEIVED);
for(AuraList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i) for(AuraList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i)
if ((*i)->isAffectedOnSpell(spellProto)) if ((*i)->isAffectedOnSpell(spellProto))

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9282" #define REVISION_NR "9283"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__