/*
 * Author: Hizumi
 *
 * Create Ammo resupply box for the 17th Battalion
 *
 * Arguments:
 * 0: Vehicle - <OBJECT>
 * 1: Position - <ARRAY>
 *
 * Return Value:
 * Function executed <BOOL>
 *
 * Example:
 * [box] call milsim_fnc_createMedicalBox; 			// create ammo box via init line of editor object
 * [objNull, pos] call milsim_fnc_createMedicalBox		// create ammo box via zeus module
 *
 * Public: Yes
 */


params [
	["_box", objNull, [objNull]],
	["_pos", [0,0,0], [[]], 3]
];

if (isNull _box) then {
	_box = "ACE_medicalSupplyCrate_advanced" createVehicle _pos;
};

clearBackpackCargoGlobal _box;
clearItemCargoGlobal _box;
clearMagazineCargoGlobal _box;
clearWeaponCargoGlobal _box;

_packs = [];

_items = [
	["ACE_packingBandage",100],
	["ACE_elasticBandage",100],
	["ACE_tourniquet",48],
	["ACE_splint",48],
	["ACE_morphine",50],
	["ACE_epinephrine",50],
	["ACE_bloodIV",75],
	["ACE_bloodIV_500",50],
	["ACE_bloodIV_250",25],
	["ACE_quikclot",75],
	["ACE_personalAidKit", 5],
	["ACE_surgicalKit", 5]
];

_magazines = [];

_weapons = [];

{
	_x params ["_class", "_qty"];
	
	_box addBackpackCargoGlobal [_class, _qty]
	
} foreach _packs;

{
	_x params ["_class", "_qty"];
	
	_box addItemCargoGlobal [_class, _qty]
	
} foreach _items;

{
	_x params ["_class", "_qty"];
	
	_box addMagazineCargoGlobal [_class, _qty]
	
} foreach _magazines;

{
	_x params ["_class", "_qty"];
	
	_box addWeaponCargoGlobal [_class, _qty]
	
} foreach _weapons;

[_box,1] call ace_cargo_fnc_setSize;

true;