diff options
| author | megamage <none@none> | 2009-01-27 15:23:26 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2009-01-27 15:23:26 -0600 |
| commit | beb293383cb54ef5c1a3e805ee20f2797daa6e4c (patch) | |
| tree | 86f0fadeaea12b4fd8616cf7ec0b839977cf39f4 /src/game/Creature.cpp | |
| parent | ed6337550e8655e24ed078bbc288f7ac2b448f77 (diff) | |
*Add creature extra flag "immune to taunt" and "charmed ai".
*Fix the bug that creature still use its ai when charmed. Only creature with charmed ai flag can use its ai when charmed.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
| -rw-r--r-- | src/game/Creature.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 8c72efff03d..56b5ff2ed3f 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -375,6 +375,12 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data ) else SetReactState(REACT_AGGRESSIVE); + if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_TAUNT) + { + ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + } + return true; } @@ -482,7 +488,7 @@ void Creature::Update(uint32 diff) if(!isAlive()) break; - if(!IsInEvadeMode()) + if(!IsInEvadeMode() && m_AI_enabled) { // do not allow the AI to be changed during update m_AI_locked = true; @@ -599,6 +605,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai) i_AI = ai ? ai : FactorySelector::selectAI(this); if (oldAI) delete oldAI; + m_AI_enabled = true; return true; } @@ -611,6 +618,9 @@ void Creature::InitPossessedAI() // Signal the old AI that it's been disabled i_AI->OnPossess(true); + + if(!(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_CHARM_AI)) + m_AI_enabled = false; } void Creature::DisablePossessedAI() @@ -621,6 +631,8 @@ void Creature::DisablePossessedAI() // Signal the old AI that it's been re-enabled i_AI->OnPossess(false); + + m_AI_enabled = true; } bool Creature::Create (uint32 guidlow, Map *map, uint32 Entry, uint32 team, const CreatureData *data) |
