mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[10189] Fix display of Interrupted message and fix channelled spells interrupting
This commit is contained in:
parent
eadeda8f5d
commit
904ef55b4e
4 changed files with 20 additions and 23 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10019"
|
||||
#define REVISION_NR "10189"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue