[Core, Creature] Implement Creature/Pet Interrupts

This commit is contained in:
e
2012-09-04 23:04:59 -04:00
parent f9a1fabc7b
commit 98f5d4ef4a
8 changed files with 92 additions and 1 deletions
@@ -1308,7 +1308,7 @@ bool CreatureEventAI::CanCast(Unit* target, SpellInfo const* spell, bool trigger
//Silenced so we can't cast
if (!triggered && me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
return false;
//Check for power
if (!triggered && me->GetPower((Powers)spell->PowerType) < spell->CalcPowerCost(me, spell->GetSchoolMask()))
return false;
@@ -1316,6 +1316,10 @@ bool CreatureEventAI::CanCast(Unit* target, SpellInfo const* spell, bool trigger
//Unit is out of range of this spell
if (!me->IsInRange(target, spell->GetMinRange(false), spell->GetMaxRange(false)))
return false;
//Spell is on cooldown
if (me->HasSpellCooldown(spell->Id))
return false;
return true;
}