2016-09-04 09:25:03 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2021-10-11 20:48:30 +00:00
|
|
|
["CBA_settingsInitialized", {
|
2024-02-05 17:04:24 +00:00
|
|
|
TRACE_1("settingsInitialized",GVAR(enabledFor));
|
2024-07-23 13:28:40 +00:00
|
|
|
|
2016-09-06 03:35:01 +00:00
|
|
|
if (GVAR(enabledFor) == 0) exitWith {}; // 0: disabled
|
|
|
|
if ((GVAR(enabledFor) == 1) && {!isServer} && {hasInterface}) exitWith {}; // 1: Don't Run on non-hc Clients
|
2018-05-08 09:16:12 +00:00
|
|
|
|
2016-09-04 09:25:03 +00:00
|
|
|
["ace_firedNonPlayer", {
|
|
|
|
_unit setVariable [QGVAR(lastFired), CBA_missionTime];
|
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
|
2020-10-29 16:38:24 +00:00
|
|
|
["CAManBase", "Hit", {
|
|
|
|
params ["_unit"];
|
|
|
|
_unit setVariable [QGVAR(lastHit), CBA_missionTime];
|
|
|
|
}] call CBA_fnc_addClassEventHandler;
|
|
|
|
|
2023-06-23 21:59:11 +00:00
|
|
|
["CAManBase", "Suppressed", {
|
|
|
|
params ["_unit"];
|
|
|
|
_unit setVariable [QGVAR(lastSuppressed), CBA_missionTime];
|
|
|
|
}] call CBA_fnc_addClassEventHandler;
|
|
|
|
|
2024-08-05 09:39:35 +00:00
|
|
|
// Add command actions to command AI medics to treat other units
|
|
|
|
call FUNC(addHealingCommandActions);
|
|
|
|
|
2024-07-24 13:04:53 +00:00
|
|
|
if (GVAR(requireItems) == 2) then {
|
|
|
|
["CAManBase", "InitPost", {
|
|
|
|
[{
|
|
|
|
params ["_unit"];
|
|
|
|
if ((!local _unit) || {!alive _unit} || {isPlayer _unit}) exitWith {};
|
|
|
|
TRACE_2("replacing medical items on AI",_unit,typeOf _unit);
|
|
|
|
[_unit] call EFUNC(common,replaceRegisteredItems);
|
|
|
|
}, _this] call CBA_fnc_execNextFrame; // need to delay a frame before modifying items in a backpack
|
|
|
|
}, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler;
|
|
|
|
};
|
|
|
|
|
2023-12-07 03:20:47 +00:00
|
|
|
#include "stateMachine.inc.sqf"
|
2019-07-03 14:59:28 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|