diff --git a/Source/Game/AI/CoreAI/PassiveAI.cs b/Source/Game/AI/CoreAI/PassiveAI.cs index 0d3aa2e65..c664c5e51 100644 --- a/Source/Game/AI/CoreAI/PassiveAI.cs +++ b/Source/Game/AI/CoreAI/PassiveAI.cs @@ -90,6 +90,7 @@ namespace Game.AI public override void MoveInLineOfSight(Unit unit) { } public override void AttackStart(Unit unit) { } public override void UpdateAI(uint diff) { } + public override void JustAppeared() { } public override void EnterEvadeMode(EvadeReason why) { } public override void OnCharmed(bool isNew) { } } diff --git a/Source/Game/AI/CoreAI/PetAI.cs b/Source/Game/AI/CoreAI/PetAI.cs index 3bb3612b1..71e384215 100644 --- a/Source/Game/AI/CoreAI/PetAI.cs +++ b/Source/Game/AI/CoreAI/PetAI.cs @@ -387,7 +387,7 @@ namespace Game.AI me.RemoveUnitFlag(UnitFlags.PetInCombat); // on player pets, this flag indicates that we're actively going after a target - we're returning, so remove it } - + void DoAttack(Unit target, bool chase) { // Handles attack with or without chase and also resets flags @@ -431,28 +431,28 @@ namespace Game.AI switch (type) { case MovementGeneratorType.Point: + { + // Pet is returning to where stay was clicked. data should be + // pet's GUIDLow since we set that as the waypoint ID + if (id == me.GetGUID().GetCounter() && me.GetCharmInfo().IsReturning()) { - // Pet is returning to where stay was clicked. data should be - // pet's GUIDLow since we set that as the waypoint ID - if (id == me.GetGUID().GetCounter() && me.GetCharmInfo().IsReturning()) - { - ClearCharmInfoFlags(); - me.GetCharmInfo().SetIsAtStay(true); - me.GetMotionMaster().MoveIdle(); - } - break; + ClearCharmInfoFlags(); + me.GetCharmInfo().SetIsAtStay(true); + me.GetMotionMaster().MoveIdle(); } + break; + } case MovementGeneratorType.Follow: + { + // If data is owner's GUIDLow then we've reached follow point, + // otherwise we're probably chasing a creature + if (me.GetCharmerOrOwner() && me.GetCharmInfo() != null && id == me.GetCharmerOrOwner().GetGUID().GetCounter() && me.GetCharmInfo().IsReturning()) { - // If data is owner's GUIDLow then we've reached follow point, - // otherwise we're probably chasing a creature - if (me.GetCharmerOrOwner() && me.GetCharmInfo() != null && id == me.GetCharmerOrOwner().GetGUID().GetCounter() && me.GetCharmInfo().IsReturning()) - { - ClearCharmInfoFlags(); - me.GetCharmInfo().SetIsFollowing(true); - } - break; + ClearCharmInfoFlags(); + me.GetCharmInfo().SetIsFollowing(true); } + break; + } default: break; } @@ -534,7 +534,7 @@ namespace Game.AI break; case TextEmotes.Soothe: if (me.IsPet() && me.ToPet().IsPetGhoul()) - me.HandleEmoteCommand( Emote.OneshotOmnicastGhoul); + me.HandleEmoteCommand(Emote.OneshotOmnicastGhoul); break; } } @@ -637,6 +637,7 @@ namespace Game.AI // default CreatureAI functions which interfere with the PetAI public override void MoveInLineOfSight(Unit who) { } public override void MoveInLineOfSight_Safe(Unit who) { } + public override void JustAppeared() { } // we will control following manually public override void EnterEvadeMode(EvadeReason why) { } } } diff --git a/Source/Game/AI/CoreAI/TotemAI.cs b/Source/Game/AI/CoreAI/TotemAI.cs index 636c76f35..09a6af8b7 100644 --- a/Source/Game/AI/CoreAI/TotemAI.cs +++ b/Source/Game/AI/CoreAI/TotemAI.cs @@ -25,11 +25,15 @@ namespace Game.AI { ObjectGuid _victimGuid; - public TotemAI(Creature c) : base(c) + public TotemAI(Creature creature) : base(creature) { _victimGuid = ObjectGuid.Empty; } + public override void MoveInLineOfSight(Unit who) { } + + public override void JustAppeared() { } + public override void EnterEvadeMode(EvadeReason why) { me.CombatStop(true); @@ -77,5 +81,7 @@ namespace Game.AI else _victimGuid.Clear(); } + + public override void AttackStart(Unit victim) { } } }