mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-15 12:42:57 +03:00
Finish updating loot system to 1.8 with custom epoch features
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user