A3XAI-Final/A3XAI/compile/A3XAI_generateLootPool.sqf
Snark Industries c4a7084754 A3XAI Final Release (April 17, 2016 version)
Releasing previously unreleased version. Completely unsupported with no guarantee of functionality. Use at own risk.
2017-07-19 21:20:00 -04:00

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