diff options
author | megamage <none@none> | 2009-02-05 22:49:07 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-05 22:49:07 -0600 |
commit | 9332f1e58df687ffb9f199aca227dce46ce7cf45 (patch) | |
tree | 2b34dabc1b80c3b8f83ef1cc4597d0da66a2df8f /src/game/Spell.cpp | |
parent | f00befd879b74db116d657080c26a5055ee43b97 (diff) |
*Update linked spell. Add new type: linked aura.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r-- | src/game/Spell.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 73b0f2af528..25fca09f80d 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1215,15 +1215,14 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->AI()) ((Creature*)m_caster)->AI()->SpellHitTarget(unit, m_spellInfo); - if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id + 1000000)) + if(m_customAttr & SPELL_ATTR_CU_LINK_HIT) { - for(std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) - { - if(*i < 0) - unit->RemoveAurasDueToSpell(-(*i)); - else - unit->CastSpell(unit, *i, true, 0, 0, m_caster->GetGUID()); - } + if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id + SPELL_LINK_HIT)) + for(std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) + if(*i < 0) + unit->RemoveAurasDueToSpell(-(*i)); + else + unit->CastSpell(unit, *i, true, 0, 0, m_caster->GetGUID()); } //This is not needed with procflag patch @@ -2291,15 +2290,14 @@ void Spell::cast(bool skipCheck) TakePower(); } - if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id)) + if(m_customAttr & SPELL_ATTR_CU_LINK_CAST) { - for(std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) - { - if(*i < 0) - m_caster->RemoveAurasDueToSpell(-(*i)); - else - m_caster->CastSpell(m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster, *i, true); - } + if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id)) + for(std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) + if(*i < 0) + m_caster->RemoveAurasDueToSpell(-(*i)); + else + m_caster->CastSpell(m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster, *i, true); } SetExecutedCurrently(false); |