*Update creature AI functions.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-11 11:46:48 -05:00
parent 5658963117
commit f631b2a2d6
9 changed files with 27 additions and 52 deletions
+5 -21
View File
@@ -9,6 +9,7 @@
#include "Item.h"
#include "Spell.h"
#include "ObjectMgr.h"
#include "TemporarySummon.h"
// Spell summary for ScriptedAI::SelectSpell
struct TSpellSummary {
@@ -56,7 +57,10 @@ void SummonList::DespawnAll()
{
erase(begin());
summon->SetVisibility(VISIBILITY_OFF);
summon->setDeathState(JUST_DIED);
if(summon->HasSummonMask(SUMMON_MASK_SUMMON) && !summon->isPet())
((TempSummon*)summon)->UnSummon();
else
summon->setDeathState(JUST_DIED);
summon->RemoveCorpse();
}
}
@@ -109,26 +113,6 @@ void ScriptedAI::UpdateAI(const uint32 diff)
}
}
void ScriptedAI::EnterEvadeMode()
{
//m_creature->InterruptNonMeleeSpells(true);
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop();
m_creature->LoadCreaturesAddon();
m_creature->SetLootRecipient(NULL);
if(m_creature->isAlive())
m_creature->GetMotionMaster()->MoveTargetedHome();
Reset();
}
void ScriptedAI::JustRespawned()
{
Reset();
}
void ScriptedAI::DoStartMovement(Unit* victim, float distance, float angle)
{
if (!victim)