*Backed out changeset f2d288ace33d

--HG--
branch : trunk
This commit is contained in:
maximius
2009-09-17 01:07:22 -07:00
parent f7601aa00e
commit 1be0e825ce
3 changed files with 5 additions and 2 deletions
+2
View File
@@ -72,6 +72,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; }
float GetMaxPlayerDistance() { return MaxPlayerDistance; }
bool IsEscorted() {return IsBeingEscorted;}
void SetCanMelee(bool usemelee) { CanMelee = usemelee; }
void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; }
void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; }
+1
View File
@@ -123,6 +123,7 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI
// Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc)
//virtual void AttackedBy(Unit* attacker);
virtual bool IsEscorted () {return false;}
// Called when creature is spawned or respawned (for reseting variables)
virtual void JustRespawned() { Reset(); }
+2 -2
View File
@@ -10529,8 +10529,8 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
if(GetTypeId() != TYPEID_PLAYER)
{
// Set home position at place of engaging combat for escorted creatures
//if(((Creature*)this)->IsAIEnabled)
//if (((Creature *)this)->AI()->IsEscorted())
if(((Creature*)this)->IsAIEnabled)
if (((Creature *)this)->AI()->IsEscorted())
((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
if(enemy)
{