Core/SAI: Implement SMART_TARGET_ACTION_INVOKER in SMART_EVENT_FRIENDLY_HEALTH_PCT

Port From (https://github.com/TrinityCore/TrinityCore/commit/902ed74c2adaf2dadcd38f1fb96963f7ec46df07)
This commit is contained in:
hondacrx
2022-03-11 17:54:05 -05:00
parent 7d1b910f24
commit 70ba25ad06
3 changed files with 63 additions and 20 deletions
@@ -818,6 +818,10 @@ namespace Game.AI
case SmartTargets.PlayerRange:
case SmartTargets.PlayerDistance:
break;
case SmartTargets.ActionInvoker:
if (!NotNULL(e, e.Event.friendlyHealthPct.radius))
return false;
break;
default:
Log.outError(LogFilter.Sql, $"SmartAIMgr: {e} uses invalid target_type {e.GetTargetType()}, skipped.");
return false;
@@ -2303,6 +2307,7 @@ namespace Game.AI
public uint maxHpPct;
public uint repeatMin;
public uint repeatMax;
public uint radius;
}
public struct Distance
{