Created
April 8, 2012 19:18
-
-
Save Subv/2339403 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 6fa6270..b62e318 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), critChance(0) | |
{ | |
CalculatePeriodic(caster, true, false); | |
@@ -6160,7 +6160,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/*caster->SpellDamageBonus(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount())*/; | |
// Calculate armor mitigation | |
if (Unit::IsDamageReducedByArmor(GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), GetEffIndex())) | |
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h | |
index 6407991..17fcc58 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 SetBonus(int32 damage) { bonus = damage; } | |
+ void SetCritChance(uint32 chance) { critChance = chance; } | |
private: | |
Aura* const m_base; | |
@@ -98,6 +100,8 @@ class AuraEffect | |
int32 const m_baseAmount; | |
int32 m_amount; | |
+ int32 bonus; | |
+ uint32 critChance; | |
SpellModifier* m_spellmod; | |
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp | |
index b6cdc00..7c1e075 100755 | |
--- a/src/server/game/Spells/Auras/SpellAuras.cpp | |
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp | |
@@ -1747,6 +1747,17 @@ 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) | |
+ continue; | |
+ | |
+ if (GetSpellInfo()->Effects[i].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE || GetSpellInfo()->Effects[i].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE_PERCENT) | |
+ GetEffect(i)->SetBonus(caster->SpellDamageBonus(target, m_spellInfo, 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