Missing Files

This commit is contained in:
icomrade
2016-02-29 00:55:29 -05:00
parent 64c251d95d
commit 84eb6f815a
75 changed files with 6780 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
/*
Selects random items from loot tables defined in bin\config.bin/CfgLoot/Groups
Parameters:
integer Loot group index
integer Number of items to select.
Author:
Foxy
*/
#include "Loot.hpp"
private
[
"_lootGroup",
"_lootNum",
"_result",
"_weighted",
"_def",
"_sub"
];
_lootGroup = _this select 0;
_lootNum = _this select 1;
if (_lootNum < 1 || _lootGroup < 0) exitWith { [] };
//Initialize the result array
_result = [];
_result resize _lootNum;
_weighted = dz_loot_weighted select _lootGroup;
for "_i" from 0 to _lootNum - 1 do
{
_def = dz_loot_definitions select (_weighted select floor random count _weighted);
while {(_def select 0) == Loot_GROUP} do
{
_sub = dz_loot_weighted select (_def select 1);
_def = dz_loot_definitions select (_sub select floor random count _sub);
};
_result set [_i, _def];
};
_result