feat(Core/SmartScripts): SMART_ACTION_SET_HEALTH_PCT

This commit is contained in:
IntelligentQuantum
2022-01-05 16:08:14 +03:30
committed by GitHub
parent 86f1b87fe6
commit e28bdf9bde
3 changed files with 36 additions and 0 deletions

View File

@@ -1172,6 +1172,16 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
break;
}
case SMART_ACTION_SET_HEALTH_PCT:
{
if (e.action.setHealthPct.percent > 100 || !e.action.setHealthPct.percent)
{
LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u is trying to set invalid HP percent %u, skipped.",
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setHealthPct.percent);
return false;
}
break;
}
case SMART_ACTION_START_CLOSEST_WAYPOINT:
case SMART_ACTION_FOLLOW:
case SMART_ACTION_SET_ORIENTATION: