Skip to content

Instantly share code, notes, and snippets.

@Subv
Created April 8, 2012 21:49
Show Gist options
  • Save Subv/2340028 to your computer and use it in GitHub Desktop.
Save Subv/2340028 to your computer and use it in GitHub Desktop.
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 9ab3754..8e65f9e 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -376,7 +376,7 @@ AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* cast
m_base(base), m_spellInfo(base->GetSpellInfo()),
m_baseAmount(baseAmount ? *baseAmount : m_spellInfo->Effects[effIndex].BasePoints),
m_spellmod(NULL), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex),
-m_canBeRecalculated(true), m_isPeriodic(false)
+m_canBeRecalculated(true), m_isPeriodic(false), damageBonus(0), healingBonus(0)
{
CalculatePeriodic(caster, true, false);
@@ -6156,7 +6156,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
if (GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE)
{
- damage = caster->SpellDamageBonus(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
+ damage += damageBonus;
// Calculate armor mitigation
if (Unit::IsDamageReducedByArmor(GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), GetEffIndex()))
@@ -6413,7 +6413,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
damage += addition;
}
- damage = caster->SpellHealingBonus(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
+ damage += healingBonus;
}
bool crit = IsPeriodicTickCrit(target, caster);
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index 6407991..e56cd49 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -91,6 +91,8 @@ class AuraEffect
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
void HandleShapeshiftBoosts(Unit* target, bool apply) const;
+ void SetDamageBonus(int32 bonus) { damageBonus = bonus; }
+ void SetHealingBonus(int32 bonus) { healingBonus = bonus; }
private:
Aura* const m_base;
@@ -98,6 +100,8 @@ class AuraEffect
int32 const m_baseAmount;
int32 m_amount;
+ int32 damageBonus;
+ int32 healingBonus;
SpellModifier* m_spellmod;
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index b6cdc00..6a980b3 100755
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1747,6 +1747,16 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
}
break;
}
+ if (apply)
+ {
+ for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ if (!GetSpellInfo()->Effects[i].Effect || !GetSpellInfo()->Effects[i].ApplyAuraName)
+ continue;
+ GetEffect(i)->SetDamageBonus(caster->SpellDamageBonus(target, m_spellInfo, GetEffect(i)->GetAmount(), DOT, GetStackAmount()) - GetEffect(i)->GetAmount());
+ GetEffect(i)->SetHealingBonus(caster->SpellHealingBonus(target, GetSpellInfo(), GetEffect(i)->GetAmount(), DOT, GetStackAmount()); - GetEffect(i)->GetAmount());
+ }
+ }
}
bool Aura::CanBeAppliedOn(Unit* target)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment