AI/TotemAI: Tell Shaman Totems to stay put and stop moving.
Port From (https://github.com/TrinityCore/TrinityCore/commit/007eb8c9311320217fdda0bc0e6c05044254edfe)
This commit is contained in:
@@ -90,6 +90,7 @@ namespace Game.AI
|
|||||||
public override void MoveInLineOfSight(Unit unit) { }
|
public override void MoveInLineOfSight(Unit unit) { }
|
||||||
public override void AttackStart(Unit unit) { }
|
public override void AttackStart(Unit unit) { }
|
||||||
public override void UpdateAI(uint diff) { }
|
public override void UpdateAI(uint diff) { }
|
||||||
|
public override void JustAppeared() { }
|
||||||
public override void EnterEvadeMode(EvadeReason why) { }
|
public override void EnterEvadeMode(EvadeReason why) { }
|
||||||
public override void OnCharmed(bool isNew) { }
|
public override void OnCharmed(bool isNew) { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
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)
|
void DoAttack(Unit target, bool chase)
|
||||||
{
|
{
|
||||||
// Handles attack with or without chase and also resets flags
|
// Handles attack with or without chase and also resets flags
|
||||||
@@ -431,28 +431,28 @@ namespace Game.AI
|
|||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case MovementGeneratorType.Point:
|
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
|
ClearCharmInfoFlags();
|
||||||
// pet's GUIDLow since we set that as the waypoint ID
|
me.GetCharmInfo().SetIsAtStay(true);
|
||||||
if (id == me.GetGUID().GetCounter() && me.GetCharmInfo().IsReturning())
|
me.GetMotionMaster().MoveIdle();
|
||||||
{
|
|
||||||
ClearCharmInfoFlags();
|
|
||||||
me.GetCharmInfo().SetIsAtStay(true);
|
|
||||||
me.GetMotionMaster().MoveIdle();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case MovementGeneratorType.Follow:
|
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,
|
ClearCharmInfoFlags();
|
||||||
// otherwise we're probably chasing a creature
|
me.GetCharmInfo().SetIsFollowing(true);
|
||||||
if (me.GetCharmerOrOwner() && me.GetCharmInfo() != null && id == me.GetCharmerOrOwner().GetGUID().GetCounter() && me.GetCharmInfo().IsReturning())
|
|
||||||
{
|
|
||||||
ClearCharmInfoFlags();
|
|
||||||
me.GetCharmInfo().SetIsFollowing(true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -534,7 +534,7 @@ namespace Game.AI
|
|||||||
break;
|
break;
|
||||||
case TextEmotes.Soothe:
|
case TextEmotes.Soothe:
|
||||||
if (me.IsPet() && me.ToPet().IsPetGhoul())
|
if (me.IsPet() && me.ToPet().IsPetGhoul())
|
||||||
me.HandleEmoteCommand( Emote.OneshotOmnicastGhoul);
|
me.HandleEmoteCommand(Emote.OneshotOmnicastGhoul);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -637,6 +637,7 @@ namespace Game.AI
|
|||||||
// default CreatureAI functions which interfere with the PetAI
|
// default CreatureAI functions which interfere with the PetAI
|
||||||
public override void MoveInLineOfSight(Unit who) { }
|
public override void MoveInLineOfSight(Unit who) { }
|
||||||
public override void MoveInLineOfSight_Safe(Unit who) { }
|
public override void MoveInLineOfSight_Safe(Unit who) { }
|
||||||
|
public override void JustAppeared() { } // we will control following manually
|
||||||
public override void EnterEvadeMode(EvadeReason why) { }
|
public override void EnterEvadeMode(EvadeReason why) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,11 +25,15 @@ namespace Game.AI
|
|||||||
{
|
{
|
||||||
ObjectGuid _victimGuid;
|
ObjectGuid _victimGuid;
|
||||||
|
|
||||||
public TotemAI(Creature c) : base(c)
|
public TotemAI(Creature creature) : base(creature)
|
||||||
{
|
{
|
||||||
_victimGuid = ObjectGuid.Empty;
|
_victimGuid = ObjectGuid.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void MoveInLineOfSight(Unit who) { }
|
||||||
|
|
||||||
|
public override void JustAppeared() { }
|
||||||
|
|
||||||
public override void EnterEvadeMode(EvadeReason why)
|
public override void EnterEvadeMode(EvadeReason why)
|
||||||
{
|
{
|
||||||
me.CombatStop(true);
|
me.CombatStop(true);
|
||||||
@@ -77,5 +81,7 @@ namespace Game.AI
|
|||||||
else
|
else
|
||||||
_victimGuid.Clear();
|
_victimGuid.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void AttackStart(Unit victim) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user