mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
25b8fd6d54
* Medical AI - Add setting to require items for treatment * all ivs * invert setting * Update addons/medical_ai/stringtable.xml Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * move item hash to preStart --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
35 lines
715 B
Plaintext
35 lines
715 B
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: PabstMirror
|
|
* Checks if AI healer has items
|
|
*
|
|
* Arguments:
|
|
* 0: Healer <OBJECT>
|
|
* 1: Treatment Type <STRING>
|
|
*
|
|
* Return Value:
|
|
* 0: Has Item <BOOL>
|
|
* 1: Item Classname <STRING> (Optional)
|
|
* 2: Treatment <STRING> (Optional)
|
|
*
|
|
* Example:
|
|
* [cursorObject, "@bandage"] call ACE_medical_ai_fnc_itemCheck
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
if (!GVAR(requireItems)) exitWith { [true] };
|
|
|
|
params ["_healer", "_treatementType"];
|
|
|
|
private _return = [false];
|
|
private _items = _healer call EFUNC(common,uniqueItems);
|
|
private _treatment = GVAR(itemHash) get _treatementType;
|
|
{
|
|
if (_x in _items) exitWith {
|
|
_return = [true, _x, _y];
|
|
};
|
|
} forEach _treatment;
|
|
|
|
_return
|