From 8c3eb07889f72955879c8a0e0881b51befb60067 Mon Sep 17 00:00:00 2001 From: Treeston Date: Thu, 1 Aug 2019 18:32:26 +0200 Subject: Scripts/FollowerAI: Some cleanup: - FollowerAI properly resumes follow after evading. - Removed duplicated getters from CreatureAI (IsEscorted vs IsEscortNPC), they were used to do the same thing - FollowerAI properly assists in combat. - FollowerAI properly despawns if quest is abandoned. - FollowerAI now supports dynamic respawning for escort NPCs. (cherry picked from commit 3d4bebd8d9210fbb84f8fc75742e248071192b09) --- src/server/game/AI/CreatureAI.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/server/game/AI/CreatureAI.h') diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index db0ccecac07..1feaf3354d8 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -141,6 +141,7 @@ class TC_GAME_API CreatureAI : public UnitAI virtual void SpellHitTarget(Unit* /*target*/, SpellInfo const* /*spellInfo*/) { } virtual void SpellHitTargetGameObject(GameObject* /*target*/, SpellInfo const* /*spellInfo*/) { } + // Should return true if the NPC is currently being escorted virtual bool IsEscorted() const { return false; } // Called when creature appears in the world (spawn, respawn, grid load etc...) @@ -229,9 +230,6 @@ class TC_GAME_API CreatureAI : public UnitAI // If a PlayerAI* is returned, that AI is placed on the player instead of the default charm AI // Object destruction is handled by Unit::RemoveCharmedBy virtual PlayerAI* GetAIForCharmedPlayer(Player* /*who*/) { return nullptr; } - // Should return true if the NPC is target of an escort quest - // If onlyIfActive is set, should return true only if the escort quest is currently active - virtual bool IsEscortNPC(bool /*onlyIfActive*/) const { return false; } // intended for encounter design/debugging. do not use for other purposes. expensive. int32 VisualizeBoundary(uint32 duration, Unit* owner = nullptr, bool fill = false) const; -- cgit v1.2.3