Core/SAI: Implement SMART_TARGET_ACTION_INVOKER in SMART_EVENT_FRIENDLY_HEALTH_PCT (#25318)

* Core/SAI: Implement SMART_TARGET_ACTION_INVOKER in SMART_EVENT_FRIENDLY_HEALTH_PCT

* Require radius (5th parameter) to be set

(cherry picked from commit cbed1039c4)
This commit is contained in:
Giacomo Pozzoni
2020-08-25 14:14:06 +02:00
committed by Shauren
parent 71cbe9f318
commit 902ed74c2a
5 changed files with 59 additions and 15 deletions

View File

@@ -1018,6 +1018,10 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_TARGET_PLAYER_RANGE:
case SMART_TARGET_PLAYER_DISTANCE:
break;
case SMART_TARGET_ACTION_INVOKER:
if (!NotNULL(e, e.event.friendlyHealthPct.radius))
return false;
break;
default:
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry " SI64FMTD " SourceType %u Event %u Action %u uses invalid target_type %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.GetTargetType());
return false;