*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
+1 -1
View File
@@ -37,7 +37,7 @@ class TRINITY_DLL_DECL AggressorAI : public CreatureAI
typedef std::vector<uint32> SpellVct;
class TRINITY_DLL_DECL SpellAI : public CreatureAI
class TRINITY_DLL_SPEC SpellAI : public CreatureAI
{
public:
explicit SpellAI(Creature *c) : CreatureAI(c) {}
+2
View File
@@ -112,6 +112,8 @@ void CreatureAI::EnterEvadeMode()
if(me->isAlive())
me->GetMotionMaster()->MoveTargetedHome();
Reset();
}
inline bool SelectTargetHelper(const Unit * me, const Unit * target, const bool &playerOnly, const float &dist, const int32 &aura)
+1 -1
View File
@@ -123,7 +123,7 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI
//virtual void AttackedBy(Unit* attacker);
// Called when creature is spawned or respawned (for reseting variables)
virtual void JustRespawned() {}
virtual void JustRespawned() { Reset(); }
// Called at waypoint reached or point movement finished
virtual void MovementInform(uint32 /*MovementType*/, uint32 /*Data*/) {}
+12 -6
View File
@@ -28,35 +28,41 @@ class TRINITY_DLL_DECL PassiveAI : public CreatureAI
{
public:
explicit PassiveAI(Creature *c) : CreatureAI(c) {}
~PassiveAI() {}
void MoveInLineOfSight(Unit *) {}
void AttackStart(Unit *) {}
void UpdateAI(const uint32);
static int Permissible(const Creature *) { return PERMIT_BASE_IDLE; }
};
class TRINITY_DLL_DECL PossessedAI : public PassiveAI
class TRINITY_DLL_DECL PossessedAI : public CreatureAI
{
public:
explicit PossessedAI(Creature *c) : PassiveAI(c) {}
explicit PossessedAI(Creature *c) : CreatureAI(c) {}
void MoveInLineOfSight(Unit *) {}
void AttackStart(Unit *target);
void UpdateAI(const uint32);
void EnterEvadeMode() {}
void JustDied(Unit*);
void KilledUnit(Unit* victim);
static int Permissible(const Creature *) { return PERMIT_BASE_IDLE; }
};
class TRINITY_DLL_DECL NullCreatureAI : public PassiveAI
class TRINITY_DLL_DECL NullCreatureAI : public CreatureAI
{
public:
explicit NullCreatureAI(Creature *c) : PassiveAI(c) {}
explicit NullCreatureAI(Creature *c) : CreatureAI(c) {}
void MoveInLineOfSight(Unit *) {}
void AttackStart(Unit *) {}
void UpdateAI(const uint32) {}
void EnterEvadeMode() {}
static int Permissible(const Creature *) { return PERMIT_BASE_IDLE; }
};
class TRINITY_DLL_DECL CritterAI : public PassiveAI
+1 -1
View File
@@ -23,7 +23,7 @@
#include "Creature.h"
class TempSummon : public Creature
class TRINITY_DLL_SPEC TempSummon : public Creature
{
public:
explicit TempSummon(SummonPropertiesEntry const *properties, Unit *owner);