mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[9283] Apply SPELL_AURA_MOD_HEALING_PCT to any healing.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
742f8df025
commit
868a4d20a4
2 changed files with 19 additions and 15 deletions
|
|
@ -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;
|
||||
|
||||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9282"
|
||||
#define REVISION_NR "9283"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue