2015-02-21 22:14:21 +00:00
|
|
|
/*
|
2015-02-28 19:46:36 +00:00
|
|
|
* Author: KoffeinFlummi, Glowbal
|
2015-02-21 22:14:21 +00:00
|
|
|
* Callback when the treatment is completed
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The medic <OBJECT>
|
|
|
|
* 1: The patient <OBJECT>
|
|
|
|
* 2: SelectionName <STRING>
|
|
|
|
* 3: Treatment classname <STRING>
|
2015-02-28 21:10:20 +00:00
|
|
|
* 4: Items available <ARRAY<STRING>>
|
2015-02-21 22:14:21 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* nil
|
|
|
|
*
|
2015-02-28 19:46:36 +00:00
|
|
|
* Public: No
|
2015-02-21 22:14:21 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-04-30 06:17:26 +00:00
|
|
|
private ["_args", "_caller", "_target","_selectionName","_className","_config","_callback", "_weaponSelect"];
|
2015-02-28 21:10:20 +00:00
|
|
|
_args = _this select 0;
|
|
|
|
_caller = _args select 0;
|
|
|
|
_target = _args select 1;
|
|
|
|
_selectionName = _args select 2;
|
|
|
|
_className = _args select 3;
|
2015-02-21 22:14:21 +00:00
|
|
|
|
|
|
|
if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
|
|
|
|
_caller removeWeapon "ACE_FakePrimaryWeapon";
|
|
|
|
};
|
2015-04-05 11:03:09 +00:00
|
|
|
if (vehicle _caller == _caller) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
[_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation);
|
2015-04-05 11:03:09 +00:00
|
|
|
};
|
2015-02-28 21:10:20 +00:00
|
|
|
_caller setvariable [QGVAR(treatmentPrevAnimCaller), nil];
|
2015-02-28 19:46:36 +00:00
|
|
|
|
2015-04-17 19:07:09 +00:00
|
|
|
_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), ""]);
|
|
|
|
if (_weaponSelect != "") then {
|
2015-04-20 20:08:31 +00:00
|
|
|
_caller selectWeapon _weaponSelect;
|
2015-04-17 19:07:09 +00:00
|
|
|
} else {
|
2015-04-20 20:08:31 +00:00
|
|
|
_caller action ["SwitchWeapon", _caller, _caller, 99];
|
2015-04-17 19:07:09 +00:00
|
|
|
};
|
|
|
|
|
2015-02-28 19:46:36 +00:00
|
|
|
// Record specific callback
|
|
|
|
_config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className);
|
2015-03-06 21:54:44 +00:00
|
|
|
if (GVAR(level) >= 2) then {
|
2015-02-28 19:46:36 +00:00
|
|
|
_config = (configFile >> "ACE_Medical_Actions" >> "Advanced" >> _className);
|
|
|
|
};
|
|
|
|
|
|
|
|
_callback = getText (_config >> "callbackSuccess");
|
2015-02-28 21:10:20 +00:00
|
|
|
if (isNil _callback) then {
|
|
|
|
_callback = compile _callback;
|
|
|
|
} else {
|
|
|
|
_callback = missionNamespace getvariable _callback;
|
|
|
|
};
|
2015-02-28 19:46:36 +00:00
|
|
|
|
2015-04-04 18:20:29 +00:00
|
|
|
_args call FUNC(createLitter);
|
2015-04-03 23:42:13 +00:00
|
|
|
|
2015-04-04 18:20:29 +00:00
|
|
|
_args call _callback;
|