From 81321b390a828ce5f25f9f70502d831f49595e66 Mon Sep 17 00:00:00 2001 From: thenecromancer Date: Sun, 24 Jan 2010 15:43:58 +0100 Subject: Add support for Maelstrom Weapon to prevent melee attack interruption when affecting spells --HG-- branch : trunk --- src/game/Spell.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/game/Spell.cpp') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index f48a808225d..daa9f71289e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3369,11 +3369,24 @@ void Spell::finish(bool ok) if (IsMeleeAttackResetSpell()) { - m_caster->resetAttackTimer(BASE_ATTACK); - if(m_caster->haveOffhandWeapon()) - m_caster->resetAttackTimer(OFF_ATTACK); - if(!(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT)) - m_caster->resetAttackTimer(RANGED_ATTACK); + bool found = false; + Unit::AuraEffectList const& vIgnoreReset = m_caster->GetAuraEffectsByType(SPELL_AURA_IGNORE_MELEE_RESET); + for (Unit::AuraEffectList::const_iterator i = vIgnoreReset.begin(); i != vIgnoreReset.end(); ++i) + { + if ((*i)->IsAffectedOnSpell(m_spellInfo)) + { + found = true; + break; + } + } + if (!found) + { + m_caster->resetAttackTimer(BASE_ATTACK); + if(m_caster->haveOffhandWeapon()) + m_caster->resetAttackTimer(OFF_ATTACK); + if(!(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT)) + m_caster->resetAttackTimer(RANGED_ATTACK); + } } // potions disabled by client, send event "not in combat" if need -- cgit v1.2.3