aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.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/Player.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/Player.cpp')
-rw-r--r--src/game/Player.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 27b6ea337df..65cc7b3bd31 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17073,10 +17073,36 @@ void Player::RestoreSpellMods(Spell * spell)
void Player::RemoveSpellMods(Spell * spell)
{
- if (!spell || spell->m_appliedMods.empty())
+ if (!spell)
+ return;
+ std::set <Aura *> checkedSpells;
+
+ AuraEffectList const & auraList = GetAurasByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
+ for(AuraEffectList::const_iterator itr = auraList.begin(); itr != auraList.end(); ++itr)
+ {
+ if (!(*itr)->GetParentAura()->GetAuraCharges())
+ continue;
+ SpellEntry const * spellInfo = (*itr)->GetSpellProto();
+
+ if (spellInfo->SpellFamilyName != spell->m_spellInfo->SpellFamilyName ||
+ checkedSpells.find((*itr)->GetParentAura()) != checkedSpells.end())
+ continue;
+ flag96 const * mask = spellmgr.GetSpellAffect((*itr)->GetId(), (*itr)->GetEffIndex());
+ if (!mask)
+ mask = &spellInfo->EffectSpellClassMask[(*itr)->GetEffIndex()];
+
+ if (spell->m_spellInfo->SpellFamilyFlags & *mask)
+ {
+ checkedSpells.insert((*itr)->GetParentAura());
+ spell->m_appliedMods.erase((*itr)->GetParentAura());
+ if ((*itr)->GetParentAura()->DropAuraCharge())
+ itr = auraList.begin();
+ }
+ }
+
+ if (spell->m_appliedMods.empty())
return;
- std::set <uint32> checkedSpells;
for(int i=0;i<MAX_SPELLMOD;++i)
{
for (SpellModList::iterator itr = m_spellMods[i].begin(); itr != m_spellMods[i].end();)