Core/AI: Make charmed creatures follow their owner
Port From (https://github.com/TrinityCore/TrinityCore/commit/144cfc2bcebbd0d2bbce5f97a06f634d17d62e79)
This commit is contained in:
@@ -623,6 +623,14 @@ namespace Game.AI
|
||||
_allySet.Add(owner.GetGUID());
|
||||
}
|
||||
|
||||
public override void OnCharmed(bool isNew)
|
||||
{
|
||||
if (me.IsCharmed())
|
||||
me.GetMotionMaster().MoveFollow(me.GetCharmer(), SharedConst.PetFollowDist, me.GetFollowAngle());
|
||||
|
||||
base.OnCharmed(isNew);
|
||||
}
|
||||
|
||||
void ClearCharmInfoFlags()
|
||||
{
|
||||
// Quick access to set all flags to FALSE
|
||||
|
||||
@@ -741,6 +741,9 @@ namespace Game.AI
|
||||
|
||||
_isCharmed = charmed;
|
||||
|
||||
if (charmed)
|
||||
me.GetMotionMaster().MoveFollow(me.GetCharmer(), SharedConst.PetFollowDist, me.GetFollowAngle());
|
||||
|
||||
if (!charmed && !me.IsInEvadeMode())
|
||||
{
|
||||
if (_repeatWaypointPath)
|
||||
|
||||
Reference in New Issue
Block a user