Core: Combat/threat system rewrite

Port From (https://github.com/TrinityCore/TrinityCore/commit/34c7810fe507eca1b8b9389630db5d5d26d92e77)
This commit is contained in:
hondacrx
2021-05-18 12:25:40 -04:00
parent 891c3b6478
commit 9851142796
37 changed files with 3454 additions and 3345 deletions
+3 -10
View File
@@ -56,8 +56,6 @@ namespace Game.AI
me.GetMotionMaster().Clear();
me.GetMotionMaster().MoveIdle();
me.CombatStop();
me.GetHostileRefManager().DeleteReferences();
return;
}
@@ -454,9 +452,9 @@ namespace Game.AI
}
}
me.ClearInPetCombat();
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
@@ -464,12 +462,7 @@ namespace Game.AI
if (me.Attack(target, true))
{
// properly fix fake combat after pet is sent to attack
Unit owner = me.GetOwner();
if (owner != null)
owner.AddUnitFlag(UnitFlags.PetInCombat);
me.AddUnitFlag(UnitFlags.PetInCombat);
me.AddUnitFlag(UnitFlags.PetInCombat); // on player pets, this flag indicates we're actively going after a target - that's what we're doing, so set it
// Play sound to let the player know the pet is attacking something it picked on its own
if (me.HasReactState(ReactStates.Aggressive) && !me.GetCharmInfo().IsCommandAttack())