From 791998574152ffa8c01ac6cd52372a5f29384e59 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 21 Feb 2024 21:10:29 -0500 Subject: [PATCH] Core/Creatures: Prevent resetting creature sparring health thresholds on evade if it was changed to a custom value by a script Port From (https://github.com/TrinityCore/TrinityCore/commit/305cb9a81a1567759e4e3b3adcc4c6ba0b128df7) --- Source/Game/Entities/Creature/Creature.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 59a8d7e1b..4d1f4f168 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -2586,7 +2586,10 @@ namespace Game.Entities { var templateValues = Global.ObjectMgr.GetCreatureTemplateSparringValues(GetCreatureTemplate().Entry); if (!templateValues.Empty()) - _sparringHealthPct = templateValues.SelectRandom(); + { + if (templateValues.Contains(_sparringHealthPct)) // only re-randomize sparring value if it was loaded from template (not when set to custom value from script) + _sparringHealthPct = templateValues.SelectRandom(); + } } // Send a message to LocalDefense channel for players opposition team in the zone