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)
This commit is contained in:
@@ -2586,7 +2586,10 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
var templateValues = Global.ObjectMgr.GetCreatureTemplateSparringValues(GetCreatureTemplate().Entry);
|
var templateValues = Global.ObjectMgr.GetCreatureTemplateSparringValues(GetCreatureTemplate().Entry);
|
||||||
if (!templateValues.Empty())
|
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
|
// Send a message to LocalDefense channel for players opposition team in the zone
|
||||||
|
|||||||
Reference in New Issue
Block a user