[8629] don't let eventaicreatures cast spells in stuns etc.

also small correction to feign death (unit could still turn around
to face his victim with this aura)
This commit is contained in:
balrok 2009-10-11 21:48:23 +02:00
parent 2be50d4b95
commit 01318dbc8c
3 changed files with 4 additions and 3 deletions

View file

@ -1341,7 +1341,8 @@ bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Trigge
return false; return false;
//Silenced so we can't cast //Silenced so we can't cast
if (!Triggered && m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) if (!Triggered && (m_creature->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DIED)
|| m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)))
return false; return false;
//Check for power //Check for power

View file

@ -10234,7 +10234,7 @@ bool Unit::SelectHostilTarget()
if(target) if(target)
{ {
if(!hasUnitState(UNIT_STAT_STUNNED)) if(!hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_DIED))
SetInFront(target); SetInFront(target);
((Creature*)this)->AI()->AttackStart(target); ((Creature*)this)->AI()->AttackStart(target);
return true; return true;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8628" #define REVISION_NR "8629"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__