The addHpDownTrigger native AI script function registers a trigger on HP decreases. Whenever the HP level of a bot downcrosses the threshold, it triggers the specified user event or script function. Several triggers can be registered on the same group, even with the same threshold and event.
()addHpDownTrigger(threshold: f, user_event_n: f) // addHpDownTrigger_ff_
()addHpDownTrigger(threshold: f, callback: s) // addHpDownTrigger_fs_
()addHpDownTrigger(0.5, 5);
This example code registers a trigger that will trigger user event 5 when the HP level of a bot downcrosses 0.5.
()addHpDownTrigger(0.5, "onHPDecrease");
This example code registers a trigger that will call the "onHPDecrease" script function when the HP level of a bot downcrosses 0.5.