aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellAuras.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2009-06-06 12:53:38 +0200
committerQAston <none@none>2009-06-06 12:53:38 +0200
commite6941a4f412a442ca97ef1b454837f74077e5f6c (patch)
tree52b15f1a811f80a885dff7a8021aabf13012b63f /src/game/SpellAuras.cpp
parent8bc014b42d283376d4bb196543081ce91d9c0242 (diff)
*Remove Arcane Blast on Arcane Missiles and Arcane Barrage cast
*Spell_affect entry for Fingers of frost - by Larva *use spellaffect entries in every affect check *Allow spell_affect table to modify affect data for any spell --HG-- branch : trunk
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r--src/game/SpellAuras.cpp36
1 files changed, 9 insertions, 27 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 8e1ab386ae2..7c3fc42f32a 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -161,7 +161,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&AuraEffect::HandleAuraHover, //106 SPELL_AURA_HOVER
&AuraEffect::HandleAddModifier, //107 SPELL_AURA_ADD_FLAT_MODIFIER
&AuraEffect::HandleAddModifier, //108 SPELL_AURA_ADD_PCT_MODIFIER
- &AuraEffect::HandleAddTargetTrigger, //109 SPELL_AURA_ADD_TARGET_TRIGGER
+ &AuraEffect::HandleNoImmediateEffect, //109 SPELL_AURA_ADD_TARGET_TRIGGER
&AuraEffect::HandleModPowerRegenPCT, //110 SPELL_AURA_MOD_POWER_REGEN_PERCENT
&AuraEffect::HandleNoImmediateEffect, //111 SPELL_AURA_ADD_CASTER_HIT_TRIGGER implemented in Unit::SelectMagnetTarget
&AuraEffect::HandleNoImmediateEffect, //112 SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
@@ -1513,8 +1513,13 @@ bool AuraEffect::isAffectedOnSpell(SpellEntry const *spell) const
// Check family name
if (spell->SpellFamilyName != m_spellProto->SpellFamilyName)
return false;
- // Check EffectClassMask
- if (m_spellProto->EffectSpellClassMask[m_effIndex] & spell->SpellFamilyFlags)
+
+ // Check EffectClassMask and Spell_Affect table
+ flag96 const *spellAffect = spellmgr.GetSpellAffect(GetId(), m_effIndex);
+ if (!spellAffect)
+ spellAffect = &m_spellProto->EffectSpellClassMask[m_effIndex];
+
+ if (*spellAffect & spell->SpellFamilyFlags)
return true;
return false;
}
@@ -1589,7 +1594,7 @@ void AuraEffect::HandleAddModifier(bool apply, bool Real, bool changeAmount)
Aura * aur = iter->second;
// only passive auras-active auras should have amount set on spellcast and not be affected
// if aura is casted by others, it will not be affected
- if (aur->IsPassive() && aur->GetCasterGUID() == guid && isAffectedOnSpell(aur->GetSpellProto()))
+ if (aur->IsPassive() && aur->GetCasterGUID() == guid && spellmgr.IsAffectedByMod(aur->GetSpellProto(), m_spellmod))
{
if (modOp == SPELLMOD_ALL_EFFECTS)
{
@@ -1621,29 +1626,6 @@ void AuraEffect::HandleAddModifier(bool apply, bool Real, bool changeAmount)
break;
}
}
-void AuraEffect::HandleAddTargetTrigger(bool apply, bool Real, bool /*changeAmount*/)
-{
- // Use SpellModifier structure for check
- // used only fields:
- // spellId, mask, mask2
- if (apply)
- {
- SpellModifier *mod = new SpellModifier;
- mod->spellId = GetId();
-
- flag96 const *spellAffect = spellmgr.GetSpellAffect(GetId(), m_effIndex);
- if (!spellAffect)
- spellAffect = &m_spellProto->EffectSpellClassMask[m_effIndex];
-
- mod->mask = *spellAffect;
- m_spellmod = mod;
- }
- else
- {
- delete m_spellmod;
- m_spellmod = NULL;
- }
-}
void AuraEffect::TriggerSpell()
{