Created
April 8, 2012 22:12
-
-
Save Subv/2340072 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp | |
index 9ab3754..cc02ae9 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), bonus(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 += bonus; | |
// 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 += bonus; | |
} | |
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..d96cf6c 100644 | |
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h | |
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h | |
@@ -91,6 +91,7 @@ class AuraEffect | |
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras | |
void HandleShapeshiftBoosts(Unit* target, bool apply) const; | |
+ void SetBonus(int32 _bonus) { bonus = _bonus; } | |
private: | |
Aura* const m_base; | |
@@ -98,6 +99,7 @@ class AuraEffect | |
int32 const m_baseAmount; | |
int32 m_amount; | |
+ int32 bonus; | |
SpellModifier* m_spellmod; | |
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp | |
index b6cdc00..a55e5cc 100755 | |
--- a/src/server/game/Spells/Auras/SpellAuras.cpp | |
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp | |
@@ -1747,6 +1747,26 @@ 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; | |
+ int32 bonus = 0; | |
+ switch (GetSpellInfo()->Effects[i].ApplyAuraName) | |
+ { | |
+ case SPELL_AURA_PERIODIC_HEAL: | |
+ bonus = caster->SpellHealingBonus(target, m_spellInfo, GetEffect(i)->GetAmount(), DOT, GetStackAmount()); | |
+ break; | |
+ case SPELL_AURA_PERIODIC_DAMAGE: | |
+ default: | |
+ bonus = caster->SpellDamageBonus(target, m_spellInfo, GetEffect(i)->GetAmount(), DOT, GetStackAmount()); | |
+ break; | |
+ } | |
+ GetEffect(i)->SetBonus(bonus - 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