diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Creature.cpp | 14 | ||||
-rw-r--r-- | src/game/Creature.h | 3 |
2 files changed, 16 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) diff --git a/src/game/Creature.h b/src/game/Creature.h index 563a9ddb80c..f51f5f6be47 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -132,6 +132,8 @@ enum CreatureFlagsExtra CREATURE_FLAG_EXTRA_NO_XP_AT_KILL = 0x00000040, // creature kill not provide XP CREATURE_FLAG_EXTRA_TRIGGER = 0x00000080, // trigger creature CREATURE_FLAG_EXTRA_WORLDEVENT = 0x00004000, // custom flag for world event creatures (left room for merging) + CREATURE_FLAG_EXTRA_CHARM_AI = 0x00008000, // use ai when charmed + CREATURE_FLAG_EXTRA_NO_TAUNT = 0x00010000, // cannot be taunted }; // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform @@ -671,6 +673,7 @@ class TRINITY_DLL_SPEC Creature : public Unit bool m_AlreadyCallAssistance; bool m_regenHealth; bool m_AI_locked; + bool m_AI_enabled; bool m_isDeadByDefault; SpellSchoolMask m_meleeDamageSchoolMask; |