fix(Scripts/ZulGurub): Hakkar's Blood Siphon (#12196)

This commit is contained in:
UltraNix
2022-07-09 16:05:09 +02:00
committed by GitHub
parent 32ba21d029
commit 346150c92a
12 changed files with 90 additions and 44 deletions

View File

@@ -491,7 +491,7 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket)
if (!spellInfo)
return;
// not allow remove spells with attr SPELL_ATTR0_CANT_CANCEL
// not allow remove spells with attr SPELL_ATTR0_NO_AURA_CANCEL
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_AURA_CANCEL))
{
return;
@@ -569,12 +569,33 @@ void WorldSession::HandleCancelAutoRepeatSpellOpcode(WorldPacket& /*recvPacket*/
void WorldSession::HandleCancelChanneling(WorldPacket& recvData)
{
recvData.read_skip<uint32>(); // spellid, not used
uint32 spellID = 0;
recvData >> spellID;
// ignore for remote control state (for player case)
Unit* mover = _player->m_mover;
if (mover != _player && mover->GetTypeId() == TYPEID_PLAYER)
if (!mover)
{
return;
}
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
if (!spellInfo)
{
return;
}
// not allow remove spells with attr SPELL_ATTR0_NO_AURA_CANCEL
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_AURA_CANCEL))
{
return;
}
Spell* spell = mover->GetCurrentSpell(CURRENT_CHANNELED_SPELL);
if (!spell || spell->GetSpellInfo()->Id != spellInfo->Id)
{
return;
}
mover->InterruptSpell(CURRENT_CHANNELED_SPELL);
}