aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.h
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2016-02-19 19:14:56 +0100
committertreeston <treeston.mmoc@gmail.com>2016-02-23 13:41:56 +0100
commit2f14664340ba486a226a0c48d285e7141a16b62f (patch)
treecd92f2229a2e4a214b62e979afcf2f6a15b286cd /src/server/game/AI/CreatureAI.h
parente4dfbb60fd85ad9fb8fbbd700b684c6ece8abdbb (diff)
Core/UnitAI: Rework creature-controlled player behavior.
- Removed hacked control mechanism, use proper PlayerAI instead - Port old hacky code to new SimpleCharmedPlayerAI class - Make adjustments to aforementioned code to fix bugs: - Properly clean up movement after charm ends - Only try to attack a target if charmer is engaged in combat
Diffstat (limited to 'src/server/game/AI/CreatureAI.h')
-rw-r--r--src/server/game/AI/CreatureAI.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h
index 239fda577a7..e009e2ed0b6 100644
--- a/src/server/game/AI/CreatureAI.h
+++ b/src/server/game/AI/CreatureAI.h
@@ -28,6 +28,7 @@ class WorldObject;
class Unit;
class Creature;
class Player;
+class PlayerAI;
class SpellInfo;
#define TIME_INTERVAL_LOOK 5000
@@ -186,6 +187,11 @@ class CreatureAI : public UnitAI
virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; }
+ // Called when a player is charmed by the creature
+ // 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; }
+
// intended for encounter design/debugging. do not use for other purposes. expensive.
int32 VisualizeBoundary(uint32 duration, Unit* owner=nullptr, bool fill=false) const;
virtual bool CheckInRoom();