*Implement simple charmed AI for players charmed by creatures.
--HG-- branch : trunk
This commit is contained in:
1 parent
7312c5034e
commit
f7e5b2ba69
4 files changed
+51
-27
No files matched your search
@@ -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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user