mirror of
https://github.com/SnarkIndustries/A3XAI-Final.git
synced 2024-08-30 17:22:13 +00:00
Releasing previously unreleased version. Completely unsupported with no guarantee of functionality. Use at own risk.
59 lines
1.6 KiB
Plaintext
59 lines
1.6 KiB
Plaintext
#include "\A3XAI\globaldefines.hpp"
|
|
|
|
private ["_unitGroup","_lootPool","_groupSize"];
|
|
|
|
_unitGroup = _this;
|
|
|
|
_lootPool = _unitGroup getVariable ["LootPool",[]];
|
|
_groupSize = _unitGroup getVariable ["GroupSize",0];
|
|
_unitType = _unitGroup getVariable ["unitType",""];
|
|
|
|
if (_unitType != "dynamic") then {
|
|
for "_j" from 1 to _groupSize do {
|
|
for "_i" from 1 to A3XAI_medicalLootCount do {
|
|
// _lootPool pushBack FIRST_AID_ITEM_PLAYER;
|
|
_lootPool pushBack (A3XAI_medicalLoot call A3XAI_selectRandom);
|
|
};
|
|
|
|
//Add food to loot list
|
|
for "_i" from 1 to A3XAI_foodLootCount do {
|
|
_lootPool pushBack (A3XAI_foodLoot call A3XAI_selectRandom);
|
|
};
|
|
|
|
//Add items to loot list
|
|
for "_i" from 1 to A3XAI_miscLootCount do {
|
|
_lootPool pushBack (A3XAI_MiscLoot call A3XAI_selectRandom);
|
|
};
|
|
|
|
sleep 0.25;
|
|
};
|
|
} else {
|
|
for "_j" from 1 to _groupSize do {
|
|
for "_i" from 1 to A3XAI_medicalLootCount do {
|
|
_lootUnit = (units _unitGroup) call A3XAI_selectRandom;
|
|
_lootItem = (A3XAI_medicalLoot call A3XAI_selectRandom);
|
|
[_lootUnit,_lootItem] call A3XAI_addItem;
|
|
};
|
|
|
|
//Add food to randomly chosen unit
|
|
for "_i" from 1 to A3XAI_foodLootCount do {
|
|
_lootUnit = (units _unitGroup) call A3XAI_selectRandom;
|
|
_lootItem = (A3XAI_foodLoot call A3XAI_selectRandom);
|
|
[_lootUnit,_lootItem] call A3XAI_addItem;
|
|
};
|
|
|
|
//Add items to randomly chosen unit
|
|
for "_i" from 1 to A3XAI_miscLootCount do {
|
|
_lootUnit = (units _unitGroup) call A3XAI_selectRandom;
|
|
_lootItem = (A3XAI_MiscLoot call A3XAI_selectRandom);
|
|
[_lootUnit,_lootItem] call A3XAI_addItem;
|
|
};
|
|
|
|
sleep 0.25;
|
|
};
|
|
};
|
|
|
|
//Update local group loot pool
|
|
_unitGroup setVariable ["LootPool",_lootPool];
|
|
|
|
true |