aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h2
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.cpp10
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.h1
-rwxr-xr-xsrc/server/game/Spells/SpellScript.h2
4 files changed, 11 insertions, 4 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index 02b5825d5ec..68629d2044c 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -13,7 +13,7 @@ typedef void(AuraEffect::*pAuraEffectHandler)(AuraApplication const * aurApp, ui
class AuraEffect
{
- friend Aura::Aura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID);
+ friend void Aura::_InitEffects(uint8 effMask, Unit * caster, int32 *baseAmount);
friend Aura::~Aura();
private:
~AuraEffect();
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 875c2e4c6bd..e417427ec28 100755
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -337,8 +337,6 @@ m_owner(owner), m_timeCla(0), m_updateTargetMapInterval(0),
m_casterLevel(caster ? caster->getLevel() : m_spellProto->spellLevel), m_procCharges(0), m_stackAmount(1),
m_isRemoved(false), m_isSingleTarget(false)
{
- LoadScripts();
-
if (m_spellProto->manaPerSecond || m_spellProto->manaPerSecondPerLevel)
m_timeCla = 1 * IN_MILLISECONDS;
@@ -363,7 +361,11 @@ m_isRemoved(false), m_isSingleTarget(false)
m_procCharges = m_spellProto->procCharges;
if (modOwner)
modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, m_procCharges);
+}
+void Aura::_InitEffects(uint8 effMask, Unit * caster, int32 *baseAmount)
+{
+ // shouldn't be in constructor - functions in AuraEffect::AuraEffect use polymorphism
for (uint8 i=0 ; i<MAX_SPELL_EFFECTS; ++i)
{
if (effMask & (uint8(1) << i))
@@ -1846,6 +1848,8 @@ UnitAura::UnitAura(SpellEntry const* spellproto, uint8 effMask, WorldObject * ow
: Aura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID)
{
m_AuraDRGroup = DIMINISHING_NONE;
+ LoadScripts();
+ _InitEffects(effMask, caster, baseAmount);
GetUnitOwner()->_AddAura(this, caster);
};
@@ -1955,9 +1959,11 @@ void UnitAura::FillTargetMap(std::map<Unit *, uint8> & targets, Unit * caster)
DynObjAura::DynObjAura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID)
: Aura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID)
{
+ LoadScripts();
ASSERT(GetDynobjOwner());
ASSERT(GetDynobjOwner()->IsInWorld());
ASSERT(GetDynobjOwner()->GetMap() == caster->GetMap());
+ _InitEffects(effMask, caster, baseAmount);
GetDynobjOwner()->SetAura(this);
}
diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h
index 00d40fd6e3a..7b50c8c4a32 100755
--- a/src/server/game/Spells/Auras/SpellAuras.h
+++ b/src/server/game/Spells/Auras/SpellAuras.h
@@ -85,6 +85,7 @@ class Aura
static Aura * TryCreate(SpellEntry const* spellproto, WorldObject * owner, Unit * caster, int32 *baseAmount = NULL, Item * castItem = NULL, uint64 casterGUID = 0);
static Aura * Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount = NULL, Item * castItem = NULL, uint64 casterGUID = 0);
explicit Aura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID);
+ void _InitEffects(uint8 effMask, Unit * caster, int32 *baseAmount);
~Aura();
SpellEntry const* GetSpellProto() const { return m_spellProto; }
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h
index 8042c00b5b4..6a57befef41 100755
--- a/src/server/game/Spells/SpellScript.h
+++ b/src/server/game/Spells/SpellScript.h
@@ -448,7 +448,7 @@ class AuraScript : public _SpellScript
// executed when periodic aura effect ticks on target
// example: OnEffectPeriodic += AuraEffectPeriodicFn(class::function, EffectIndexSpecifier, EffectAuraNameSpecifier);
- // where function is: void function (AuraEffect const * aurEff, AuraEffectHandleModes mode);
+ // where function is: void function (AuraEffect const * aurEff);
HookList<EffectPeriodicHandler> OnEffectPeriodic;
#define AuraEffectPeriodicFn(F, I, N) EffectPeriodicHandlerFunction(&F, I, N)