diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 8f2c6b3c2..d2e76a9c4 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2676,6 +2676,9 @@ void Spell::cancel() if(m_spellState == SPELL_STATE_FINISHED) return; + // channeled spells don't display interrupted message even if they are interrupted, possible other cases with no "Interrupted" message + bool sendInterrupt = IsChanneledSpell(m_spellInfo) ? false : true; + m_autoRepeat = false; switch (m_spellState) { @@ -2683,7 +2686,9 @@ void Spell::cancel() case SPELL_STATE_DELAYED: { SendInterrupted(0); - SendCastResult(SPELL_FAILED_INTERRUPTED); + + if (sendInterrupt) + SendCastResult(SPELL_FAILED_INTERRUPTED); } break; case SPELL_STATE_CASTING: @@ -2700,7 +2705,9 @@ void Spell::cancel() SendChannelUpdate(0); SendInterrupted(0); - SendCastResult(SPELL_FAILED_INTERRUPTED); + + if (sendInterrupt) + SendCastResult(SPELL_FAILED_INTERRUPTED); } break; default: diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 7094f526e..1893b5070 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -888,10 +888,12 @@ void Aura::ApplyModifier(bool apply, bool Real) { AuraType aura = m_modifier.m_auraname; + GetHolder()->SetInUse(true); SetInUse(true); if(aura < TOTAL_AURAS) (*this.*AuraHandler [aura])(apply, Real); SetInUse(false); + GetHolder()->SetInUse(false); } bool Aura::isAffectedOnSpell(SpellEntry const *spell) const @@ -2195,18 +2197,6 @@ void Aura::HandleAuraDummy(bool apply, bool Real) return; } - - if (m_removeMode == AURA_REMOVE_BY_DEATH) - { - // Stop caster Arcane Missle chanelling on death - if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_MAGE && (GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000800))) - { - if (Unit* caster = GetCaster()) - caster->InterruptSpell(CURRENT_CHANNELED_SPELL); - - return; - } - } } // AT APPLY & REMOVE @@ -3362,7 +3352,6 @@ void Aura::HandleModPossess(bool apply, bool Real) } else { - p_caster->InterruptSpell(CURRENT_CHANNELED_SPELL); // the spell is not automatically canceled when interrupted, do it now p_caster->SetCharm(NULL); camera.ResetView(); @@ -7685,14 +7674,12 @@ void SpellAuraHolder::RemoveAura(SpellEffectIndex index) void SpellAuraHolder::ApplyAuraModifiers(bool apply, bool real) { - SetInUse(true); for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i) { Aura *aur = GetAuraByEffectIndex(SpellEffectIndex(i)); if (aur) aur->ApplyModifier(apply, real); } - SetInUse(false); } void SpellAuraHolder::_AddSpellAuraHolder() @@ -8725,7 +8712,7 @@ void SpellAuraHolder::Update(uint32 diff) if(!caster->IsWithinDistInMap(m_target, max_range)) { - m_target->RemoveAurasByCasterSpell(GetId(), GetCasterGUID()); + caster->InterruptSpell(CURRENT_CHANNELED_SPELL); return; } } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b3ca0d021..f6e258237 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4518,10 +4518,10 @@ void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode) // Statue unsummoned at holder remove SpellEntry const* AurSpellInfo = holder->GetSpellProto(); Totem* statue = NULL; - if(IsChanneledSpell(AurSpellInfo)) - if(Unit* caster = holder->GetCaster()) - if(caster->GetTypeId()==TYPEID_UNIT && ((Creature*)caster)->isTotem() && ((Totem*)caster)->GetTotemType()==TOTEM_STATUE) - statue = ((Totem*)caster); + Unit* caster = holder->GetCaster(); + if(IsChanneledSpell(AurSpellInfo) && caster) + if(caster->GetTypeId()==TYPEID_UNIT && ((Creature*)caster)->isTotem() && ((Totem*)caster)->GetTotemType()==TOTEM_STATUE) + statue = ((Totem*)caster); if (m_spellAuraHoldersUpdateIterator != m_spellAuraHolders.end() && m_spellAuraHoldersUpdateIterator->second == holder) ++m_spellAuraHoldersUpdateIterator; @@ -4559,6 +4559,9 @@ void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode) m_deletedHolders.push_back(holder); else delete holder; + + if (IsChanneledSpell(AurSpellInfo) && caster && caster->GetGUID() != GetGUID()) + caster->InterruptSpell(CURRENT_CHANNELED_SPELL); } void Unit::RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder *holder, SpellEffectIndex index, AuraRemoveMode mode) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 6e0e71efb..5383c9265 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10019" + #define REVISION_NR "10189" #endif // __REVISION_NR_H__