Fix monsters casting while stunned (#177)

This commit is contained in:
Gonzalo Murillas 2022-05-17 13:41:30 -03:00 committed by GitHub
parent 5160cd4f5c
commit 28e0616414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3305,6 +3305,10 @@ SpellCastResult Creature::TryToCast(Unit* pTarget, const SpellEntry* pSpellInfo,
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
}
if (hasUnitState(UNIT_STAT_STUNNED)) {
return SPELL_FAILED_STUNNED;
}
// This spell should only be cast when target does not have the aura it applies.
if ((uiCastFlags & CF_AURA_NOT_PRESENT) && pTarget->HasAura(pSpellInfo->Id))
{