diff options
Diffstat (limited to 'src/bindings/scripts')
| -rw-r--r-- | src/bindings/scripts/include/sc_creature.cpp | 17 | ||||
| -rw-r--r-- | src/bindings/scripts/scripts/creature/mob_event_ai.cpp | 19 |
2 files changed, 13 insertions, 23 deletions
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index b3fd3723466..a74b59c872c 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -141,17 +141,24 @@ void ScriptedAI::UpdateAI(const uint32 diff) void ScriptedAI::EnterEvadeMode() { - m_creature->InterruptNonMeleeSpells(true); + //m_creature->InterruptNonMeleeSpells(true); m_creature->RemoveAllAuras(); m_creature->DeleteThreatList(); m_creature->CombatStop(); m_creature->LoadCreaturesAddon(); - - if (m_creature->isAlive()) - m_creature->GetMotionMaster()->MoveTargetedHome(); - m_creature->SetLootRecipient(NULL); + if(m_creature->isAlive()) + { + if(Unit* owner = m_creature->GetOwner()) + { + if(owner->isAlive()) + m_creature->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE); + } + else + m_creature->GetMotionMaster()->MoveTargetedHome(); + } + InCombat = false; Reset(); } diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp index 657a1f41b5b..7d8b11d21af 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp @@ -1033,26 +1033,9 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI void EnterEvadeMode() { - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(); - m_creature->LoadCreaturesAddon(); - if( m_creature->isAlive() ) - { - if (Unit* owner = m_creature->GetOwner()) - { - if (owner->isAlive()) - m_creature->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE); - } - else - m_creature->GetMotionMaster()->MoveTargetedHome(); - } + ScriptedAI::EnterEvadeMode(); - m_creature->SetLootRecipient(NULL); - - InCombat = false; IsFleeing = false; - Reset(); //Handle Evade events for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i) |
