Core/SAI: Allow SMART_EVENT_HEALTH_PCT to be triggered out of combat
Port From (https://github.com/TrinityCore/TrinityCore/commit/1248bdffcb13f846fa42c6aee77cea685c756e51)
This commit is contained in:
@@ -3111,7 +3111,7 @@ namespace Game.AI
|
|||||||
break;
|
break;
|
||||||
case SmartEvents.HealthPct:
|
case SmartEvents.HealthPct:
|
||||||
{
|
{
|
||||||
if (_me == null || !_me.IsEngaged() || _me.GetMaxHealth() == 0)
|
if (_me == null || _me.IsInEvadeMode() || _me.GetMaxHealth() == 0)
|
||||||
return;
|
return;
|
||||||
uint perc = (uint)_me.GetHealthPct();
|
uint perc = (uint)_me.GetHealthPct();
|
||||||
if (perc > e.Event.minMaxRepeat.max || perc < e.Event.minMaxRepeat.min)
|
if (perc > e.Event.minMaxRepeat.max || perc < e.Event.minMaxRepeat.min)
|
||||||
@@ -3523,7 +3523,7 @@ namespace Game.AI
|
|||||||
}
|
}
|
||||||
case SmartEvents.FriendlyHealthPCT:
|
case SmartEvents.FriendlyHealthPCT:
|
||||||
{
|
{
|
||||||
if (_me == null || !_me.IsEngaged())
|
if (_me == null || _me.IsInEvadeMode())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Unit unitTarget = null;
|
Unit unitTarget = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user