fix(Core/Script): Creatures will not interrupt channeling spells anymore on engage if the spell has attribute "Allow Actions During Channeling". (#26710)
Co-authored-by: sogladev <46423958+sogladev@users.noreply.github.com>
This commit is contained in:
@@ -876,7 +876,14 @@ void SmartAI::JustEngagedWith(Unit* enemy)
|
|||||||
{
|
{
|
||||||
// Xinef: Interrupt channeled spells
|
// Xinef: Interrupt channeled spells
|
||||||
if (IsAIControlled())
|
if (IsAIControlled())
|
||||||
|
{
|
||||||
|
if (Spell* spell = me->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
|
||||||
|
{
|
||||||
|
if (!spell->GetSpellInfo()->IsActionAllowedChannel())
|
||||||
me->InterruptSpell(CURRENT_CHANNELED_SPELL, true, true);
|
me->InterruptSpell(CURRENT_CHANNELED_SPELL, true, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GetScript()->ProcessEventsFor(SMART_EVENT_AGGRO, enemy);
|
GetScript()->ProcessEventsFor(SMART_EVENT_AGGRO, enemy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4191,6 +4191,8 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell)
|
|||||||
if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] &&
|
if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] &&
|
||||||
m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75)
|
m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75)
|
||||||
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
|
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
|
||||||
|
|
||||||
|
if (!pSpell->GetSpellInfo()->IsActionAllowedChannel())
|
||||||
AddUnitState(UNIT_STATE_CASTING);
|
AddUnitState(UNIT_STATE_CASTING);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user