Skip to content

Commit

Permalink
[9283] Apply SPELL_AURA_MOD_HEALING_PCT to any healing.
Browse files Browse the repository at this point in the history
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
laise authored and VladimirMangos committed Feb 1, 2010
1 parent b9c7fc7 commit ab19757
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
32 changes: 18 additions & 14 deletions src/game/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
// 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)
if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE)
if(Unit* owner = GetOwner())
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
// Taken/Done total percent damage auras
float DoneTotalMod = 1.0f;
float TakenTotalMod = 1.0f;
int32 DoneTotal = 0;
int32 TakenTotal = 0;

Expand Down Expand Up @@ -9508,15 +9521,6 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
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);
for(AuraList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i)
if ((*i)->isAffectedOnSpell(spellProto))
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9282"
#define REVISION_NR "9283"
#endif // __REVISION_NR_H__

0 comments on commit ab19757

Please sign in to comment.