Finish updating loot system to 1.8 with custom epoch features

This commit is contained in:
[VB]AWOL
2014-05-09 14:23:09 -05:00
parent feec3e19f5
commit 9b52797f84
8 changed files with 585 additions and 367 deletions

View File

@@ -525,6 +525,7 @@ if (!isDedicated) then {
world_isDay = {if ((daytime < (24 - dayz_sunRise)) and (daytime > dayz_sunRise)) then {true} else {false}};
player_humanityChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf";
spawn_loot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot.sqf";
spawn_loot_small = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot_small.sqf";
// player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf";
local_setFuel = {

View File

@@ -23,7 +23,7 @@ for "_i" from 0 to ((count _config) - 1) do {
_weighted = [];
_j = 0;
for "_l" from 0 to (_itemCount - 1) do {
_weight = round (((_itemChances select _l) select 2) * 100);
_weight = round (((_itemChances select _l) select 2) * 100);
for "_k" from 0 to (_weight - 1) do
{
_weighted set [_j + _k, _l];
@@ -38,18 +38,21 @@ for "_i" from 0 to ((count _config) - 1) do {
dayz_CBLBase set [count dayz_CBLBase, _classname];
};
_itemChancesSmall = [] + getArray (_config >> _classname >> "ItemChanceSmall");
_itemChancesSmall = [] + getArray (_config >> _classname >> "lootTypeSmall");
_itemCountSmall = count _itemChancesSmall;
diag_log format["loot_init.sqf %1", _itemChancesSmall];
if (_itemCountSmall > 0) then {
if (dayzE_CBLSBase find _classname < 0) then {
_weighted = [];
_j = 0;
for "_l" from 0 to ((count _itemChancesSmall) - 1) do
{
_weight = round (((_itemChancesSmall select _l) select 2) * 100);
for "_k" from 0 to _weight - 1 do
for "_l" from 0 to(_itemCountSmall - 1) do {
_weight = round(((_itemChancesSmall select _l) select 2) * 100);
for "_k" from 0 to(_weight - 1) do
{
_weighted set [_j + _k, _l];
_weighted set[_j + _k, _l];
};
_j = _j + _weight;
};