2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-10-12 21:20:22 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Kills a local unit.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The unit <OBJECT>
|
|
|
|
* 1: Reason for death <STRING>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Return Value:
|
2016-10-12 21:20:22 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_unit", ["_reason", "unknown"]];
|
|
|
|
|
2018-08-25 15:40:22 +00:00
|
|
|
// No heart rate or blood pressure to measure when dead
|
|
|
|
_unit setVariable [VAR_HEART_RATE, 0, true];
|
|
|
|
_unit setVariable [VAR_BLOOD_PRESS, [0, 0], true];
|
|
|
|
|
|
|
|
// Kill the unit without changing visual apperance
|
|
|
|
[_unit, 1] call EFUNC(medical_engine,setStructuralDamage);
|
2016-10-12 21:20:22 +00:00
|
|
|
|
2019-04-27 19:04:31 +00:00
|
|
|
private _lastShooter = _unit getVariable [QEGVAR(medical,lastDamageSource), objNull];
|
|
|
|
private _lastInstigator = _unit getVariable [QEGVAR(medical,lastInstigator), objNull];
|
2016-10-12 21:20:22 +00:00
|
|
|
|
|
|
|
["ace_killed", [_unit, _reason, _lastShooter, _lastInstigator]] call CBA_fnc_globalEvent;
|