Merge pull request #572 from vbawol/MrZabn2

Small Loot Spawning
This commit is contained in:
Zac Surplice
2013-10-05 16:06:45 -07:00
5 changed files with 860 additions and 42 deletions

View File

@@ -0,0 +1,468 @@
class CfgLootSmall {
trash[] = {
{
"TrashTinCan",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemTrashToiletpaper",
"ItemTrashRazor"
},
{
0.5,
0.05,
0.25,
0.10,
0.1
}
};
civilian[] = {
{
"FoodCanUnlabeled",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"8Rnd_9x18_Makarov",
"7Rnd_45ACP_1911",
"2Rnd_shotgun_74Slug",
"2Rnd_shotgun_74Pellets",
"ItemBandage",
"ItemPainkiller",
"FoodBioMeat",
"8Rnd_9x18_MakarovSD"
},
{
0.07,
0.09,
0.09,
0.1,
0.09,
0.05,
0.05,
0.05,
0.05,
0.07,
0.05,
0.05,
0.05,
0.06,
0.06,
0.01,
0.01
}
};
office2[] = {
{
"FoodCanUnlabeled",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"8Rnd_9x18_Makarov",
"7Rnd_45ACP_1911",
"2Rnd_shotgun_74Slug",
"2Rnd_shotgun_74Pellets",
"ItemBandage",
"ItemPainkiller",
"FoodBioMeat",
"8Rnd_9x18_MakarovSD"
},
{
0.07,
0.09,
0.09,
0.09,
0.09,
0.05,
0.05,
0.05,
0.05,
0.07,
0.05,
0.05,
0.05,
0.06,
0.06,
0.01,
0.01
}
};
food[] = {
{
//trash
"TrashTinCan",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"FoodCanUnlabeled",
// food Bags
"FoodPistachio",
"FoodNutmix"
},
{
//trash
0.09,
0.12,
0.12,
0.09,
0.11,
0.07,
0.07,
0.07,
0.07,
0.1,
// food Bags
0.05,
0.04
}
};
office[] = {
{
"FoodCanUnlabeled",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"TrashJackDaniels",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"ItemWaterbottleUnfilled",
"ItemWaterbottle",
"ItemBandage",
"7Rnd_45ACP_1911",
"5x_22_LR_17_HMR",
"10x_303",
"6Rnd_45ACP",
"2Rnd_shotgun_74Slug",
"2Rnd_shotgun_74Pellets",
"8Rnd_9x18_Makarov",
"15Rnd_W1866_Slug",
"WoodenArrow",
"HandRoadFlare",
"ItemPainkiller",
"HandChemGreen",
"HandChemBlue",
"HandChemRed",
"ItemHeatPack"
},
{
0.06,
0.06,
0.06,
0.04,
0.04,
0.01,
0.01,
0.01,
0.01,
0.01,
0.01,
0.08,
0.03,
0.01,
0.04,
0.04,
0.05,
0.05,
0.09,
0.02,
0.04,
0.07,
0.02,
0.01,
0.03,
0.03,
0.03
}
};
generic[] = {
{
"FoodCanUnlabeled",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"TrashJackDaniels",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"ItemWaterbottleUnfilled",
"ItemWaterbottle",
"ItemBandage",
"7Rnd_45ACP_1911",
"5x_22_LR_17_HMR",
"10x_303",
"6Rnd_45ACP",
"2Rnd_shotgun_74Slug",
"2Rnd_shotgun_74Pellets",
"8Rnd_9x18_Makarov",
"15Rnd_W1866_Slug",
"WoodenArrow",
"HandRoadFlare",
"ItemPainkiller",
"HandChemGreen",
"HandChemBlue",
"HandChemRed",
"ItemHeatPack"
},
{
0.06,
0.06,
0.06,
0.04,
0.04,
0.01,
0.01,
0.01,
0.01,
0.01,
0.01,
0.11,
0.03,
0.01,
0.04,
0.04,
0.05,
0.05,
0.09,
0.02,
0.04,
0.07,
0.02,
0.01,
0.03,
0.03,
0.04
}
};
medical[] = {
{
"ItemBandage",
"ItemPainkiller",
"ItemMorphine",
"ItemEpinephrine",
"ItemAntibiotic",
"ItemHeatPack"
},
{
0.4,
0.15,
0.2,
0.1,
0.1,
0.05
}
};
hospital[] = {
{
"ItemBandage",
"ItemPainkiller",
"ItemMorphine",
"ItemEpinephrine",
"ItemBloodbag",
"ItemAntibiotic"
},
{
0.33,
0.16,
0.13,
0.09,
0.17,
0.12
}
};
military[] = {
{
"FoodCanUnlabeled",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"ItemBandage",
"ItemAntibiotic",
"ItemPainkiller",
"ItemMorphine",
"30Rnd_556x45_Stanag",
"20Rnd_762x51_DMR",
"17Rnd_9x19_glock17",
"15Rnd_9x19_M9SD",
"15Rnd_9x19_M9",
"30Rnd_762x39_AK47",
"30Rnd_545x39_AK",
"5Rnd_762x51_M24",
"5Rnd_86x70_L115A1",
"8Rnd_B_Beneli_74Slug",
"1Rnd_HE_M203",
"FlareWhite_M203",
"FlareGreen_M203",
"1Rnd_Smoke_M203",
"200Rnd_556x45_M249",
"HandGrenade_west",
"HandGrenade_east",
"SmokeShell",
"SmokeShellRed",
"SmokeShellGreen",
"8Rnd_B_Beneli_Pellets",
"30Rnd_556x45_StanagSD",
"30Rnd_9x19_MP5",
"30Rnd_9x19_MP5SD",
"100Rnd_762x51_M240",
"HandChemGreen",
"HandChemBlue",
"HandChemRed",
"ItemHeatPack",
"8Rnd_9x18_MakarovSD",
"20Rnd_B_765x17_Ball",
"30Rnd_9x19_UZI_SD"
},
{
0.09,
0.04,
0.01,
0.01,
0.04,
0.04,
0.04,
0.01,
0.04,
0.04,
0.05,
0.01,
0.02,
0.04,
0.04,
0.01,
0.01,
0.04,
0.01,
0.01,
0.01,
0.01,
0.01,
0.01,
0.01,
0.04,
0.02,
0.02,
0.04,
0.01,
0.02,
0.01,
0.01,
0.02,
0.02,
0.02,
0.04,
0.01,
0.04,
0.01,
}
};
policeman[] = {
{
"ItemBandage",
"7Rnd_45ACP_1911",
"6Rnd_45ACP",
"15Rnd_W1866_Slug",
"8Rnd_B_Beneli_Pellets",
"HandRoadFlare",
"8Rnd_9x18_MakarovSD",
"ItemComboLock",
"SmokeShell",
"ItemHotwireKit"
},
{
0.3,
0.08,
0.08,
0.14,
0.17,
0.08,
0.01,
0.05,
0.04,
0.01
}
};
hunter[] = {
{
"FoodMRE"
},
{
0.01
}
};
worker[] = {
{
"FoodCanUnlabeled",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"ItemBandage",
"ItemPainkiller",
"ItemComboLock",
"ItemSledgeHead"
},
{
0.09,
0.10,
0.10,
0.11,
0.10,
0.06,
0.06,
0.06,
0.06,
0.1,
0.06,
0.04,
0.02
}
};
clothes[] = {
{ },
{ }
};
militaryclothes[] = {
{ },
{ }
};
specialclothes[] = {
{ },
{ }
};
tents[] = {
{ },
{ }
};
backpacks[] = {
{ },
{ }
};
militarybackpacks[] = {
{ },
{ }
};
};

View File

@@ -1,3 +1,5 @@
#include "CfgLootSmall.hpp"
class CfgLoot {
trash[] = {
{

View File

@@ -36,14 +36,14 @@ _positionsSmall = [] + getArray (_config >> "lootPosSmall");
_iPos = _obj modelToWorld _x;
_nearBy = nearestObjects [_iPos, ["ReammoBox","WeaponHolder","WeaponHolderBase"], 1];
if (count _nearBy == 0) then {
_index = dayz_CBLBase find _type;
_index = dayzE_CBLSBase find _type;
//diag_log format["Found %2 at index: %1", _index,_type];
_weights = dayz_CBLChances select _index;
_weights = dayzE_CBLSChances select _index;
_cntWeights = count _weights;
_index = floor(random _cntWeights);
_index = _weights select _index;
_itemType = _itemTypes select _index;
[_itemType select 0, _itemType select 1 , _iPos, 0.0] call spawn_loot_small;
[_itemType select 0, _itemType select 1 , _iPos, 0.0] call spawn_loot_small;
_obj setVariable ["created",(DateToNumber date),true];
};
};

View File

@@ -508,6 +508,8 @@ class CfgBuildingLoot {
lootPosZombie[] = {};
itemType[] = {};
itemChance[] = {};
itemTypeSmall[] = {};
itemChanceSmall[] = {};
hangPos[] = {};
vehPos[] = {};
};
@@ -526,34 +528,34 @@ class CfgBuildingLoot {
lootChance = 0.4;
lootPos[] = {};
itemType[] = {
{ "ItemSodaMdew","magazine" },
{ "ItemSodaRbull","magazine" },
{ "ItemSodaOrangeSherbet","magazine" },
{ "ItemWatch","generic" },
{ "ItemCompass","generic" },
{ "ItemMap","weapon" },
{ "Makarov","weapon" },
{ "MakarovSD","weapon" },
{ "Colt1911","weapon" },
{ "ItemFlashlight","generic" },
{ "ItemKnife","generic" },
{ "ItemMatchbox","generic" },
{ "","generic" },
{ "LeeEnfield","weapon" },
{ "revolver_EP1","weapon" },
{ "backpacks","backpack" },
{ "Winchester1866","weapon" },
{ "tents","single" },
{ "","military" },
{ "","trash" },
{ "Crossbow_DZ","weapon" },
{ "Binocular","weapon" },
{ "PartPlywoodPack","magazine" },
{ "clothes","single" },
{ "specialclothes","single" },
{ "WeaponHolder_MeleeCrowbar","object" },
{"MR43","weapon"},
};
{ "ItemSodaMdew","magazine" },
{ "ItemSodaRbull","magazine" },
{ "ItemSodaOrangeSherbet","magazine" },
{ "ItemWatch","generic" },
{ "ItemCompass","generic" },
{ "ItemMap","weapon" },
{ "Makarov","weapon" },
{ "MakarovSD","weapon" },
{ "Colt1911","weapon" },
{ "ItemFlashlight","generic" },
{ "ItemKnife","generic" },
{ "ItemMatchbox","generic" },
{ "","generic" },
{ "LeeEnfield","weapon" },
{ "revolver_EP1","weapon" },
{ "backpacks","backpack" },
{ "Winchester1866","weapon" },
{ "tents","single" },
{ "","military" },
{ "","trash" },
{ "Crossbow_DZ","weapon" },
{ "Binocular","weapon" },
{ "PartPlywoodPack","magazine" },
{ "clothes","single" },
{ "specialclothes","single" },
{ "WeaponHolder_MeleeCrowbar","object" },
{"MR43","weapon"},
};
itemChance[] = {
0.01,
0.01,
@@ -582,6 +584,52 @@ class CfgBuildingLoot {
0.01,
0.03,
0.01
};
itemTypeSmall[] = {
{ "ItemSodaMdew","magazine" },
{ "ItemSodaRbull","magazine" },
{ "ItemSodaOrangeSherbet","magazine" },
{ "ItemWatch","generic" },
{ "ItemCompass","generic" },
{ "ItemMap","weapon" },
{ "Makarov","weapon" },
{ "MakarovSD","weapon" },
{ "Colt1911","weapon" },
{ "ItemFlashlight","generic" },
{ "ItemKnife","generic" },
{ "ItemMatchbox","generic" },
{ "","generic" },
{ "revolver_EP1","weapon" },
{ "backpacks","backpack" },
{ "tents","single" },
{ "","military" },
{ "","trash" },
{ "Binocular","weapon" },
{ "clothes","single" },
{ "specialclothes","single" },
};
itemChanceSmall[] = {
0.01,
0.01,
0.01,
0.04,
0.03,
0.02,
0.05,
0.01,
0.02,
0.01,
0.04,
0.01,
0.36,
0.02,
0.04,
0.01,
0.02,
0.14,
0.02,
0.01,
0.01
};
};
class Office: Default {
@@ -618,7 +666,7 @@ class CfgBuildingLoot {
{ "specialclothes","single" },
{ "WeaponHolder_MeleeCrowbar","object" },
{ "ItemBriefcaseEmpty","magazine" },
};
};
itemChance[] = {
0.01,
0.01,
@@ -648,6 +696,52 @@ class CfgBuildingLoot {
0.03,
0.01
};
itemTypeSmall[] = {
{ "ItemSodaMdew","magazine" },
{ "ItemSodaRbull","magazine" },
{ "ItemSodaOrangeSherbet","magazine" },
{ "ItemWatch","generic" },
{ "ItemCompass","generic" },
{ "ItemMap","weapon" },
{ "Makarov","weapon" },
{ "MakarovSD","weapon" },
{ "Colt1911","weapon" },
{ "ItemFlashlight","generic" },
{ "ItemKnife","generic" },
{ "ItemMatchbox","generic" },
{ "","generic" },
{ "revolver_EP1","weapon" },
{ "backpacks","backpack" },
{ "tents","single" },
{ "","military" },
{ "","trash" },
{ "Binocular","weapon" },
{ "clothes","single" },
{ "specialclothes","single" },
};
itemChanceSmall[] = {
0.01,
0.01,
0.01,
0.04,
0.03,
0.02,
0.06,
0.01,
0.02,
0.01,
0.04,
0.01,
0.31,
0.02,
0.04,
0.01,
0.02,
0.18,
0.02,
0.01,
0.01
};
};
class Industrial: Default {
zombieChance = 0.4;
@@ -677,7 +771,7 @@ class CfgBuildingLoot {
{"ItemKeyKit","weapon"},
{"CinderBlocks","magazine"},
{"MortarBucket","magazine"}
};
};
itemChance[] = {
0.01,
0.01,
@@ -701,6 +795,20 @@ class CfgBuildingLoot {
0.03,
0.01
};
itemTypeSmall[] = {
{ "","generic" },
{ "","trash" },
{ "","military" },
{ "ItemKnife","military" },
{"ItemKeyKit","weapon"}
};
itemChanceSmall[] = {
0.16,
0.25,
0.04,
0.07,
0.01
};
};
class IndustrialFuel: Default {
zombieChance = 0.4;
@@ -727,7 +835,7 @@ class CfgBuildingLoot {
{ "ItemWire","magazine" },
{"ItemTankTrap","magazine"},
{"ItemKeyKit","weapon"}
};
};
itemChance[] = {
0.01,
0.01,
@@ -748,6 +856,20 @@ class CfgBuildingLoot {
0.04,
0.01
};
itemTypeSmall[] = {
{ "","generic" },
{ "","trash" },
{ "","military" },
{ "ItemKnife","military" },
{"ItemKeyKit","weapon"}
};
itemChanceSmall[] = {
0.18,
0.28,
0.04,
0.07,
0.01
};
};
class Farm: Default {
zombieChance = 0.3;
@@ -771,7 +893,7 @@ class CfgBuildingLoot {
{ "ItemFishingPole","weapon" },
{ "ItemLightBulb","magazine"},
{ "ItemSledgeHandle","magazine"}
};
};
itemChance[] = {
0.05,
0.3,
@@ -789,6 +911,16 @@ class CfgBuildingLoot {
0.02,
0.01
};
itemTypeSmall[] = {
{ "","generic" },
{ "","trash" },
{ "ItemSledgeHandle","magazine"}
};
itemChanceSmall[] = {
0.3,
0.26,
0.01
};
};
class Supermarket: Default {
lootChance = 0.6;
@@ -820,7 +952,7 @@ class CfgBuildingLoot {
{ "Binocular","weapon" },
{ "PartPlywoodPack","magazine" },
{"MR43","weapon"}
};
};
itemChance[] = {
0.01,
0.01,
@@ -846,6 +978,46 @@ class CfgBuildingLoot {
0.02,
0.01
};
itemTypeSmall[] = {
{ "ItemSodaMdew","magazine" },
{ "ItemSodaRbull","magazine" },
{ "ItemSodaOrangeSherbet","magazine" },
{ "ItemWatch","generic" },
{ "ItemCompass","generic" },
{ "ItemMap","weapon" },
{ "Makarov","weapon" },
{ "Colt1911","weapon" },
{ "ItemFlashlight","generic" },
{ "ItemKnife","generic" },
{ "ItemMatchbox","generic" },
{ "","generic" },
{ "revolver_EP1","weapon" },
{ "backpacks","backpack" },
{ "tents","single" },
{ "","food" },
{ "","trash" },
{ "Binocular","weapon" },
};
itemChanceSmall[] = {
0.01,
0.01,
0.01,
0.07,
0.02,
0.04,
0.02,
0.01,
0.01,
0.02,
0.04,
0.04,
0.01,
0.07,
0.01,
0.30,
0.20,
0.05
};
};
class HeliCrash: Default {
zombieChance = 0.4;
@@ -972,7 +1144,7 @@ class HeliCrash_No50s: Default {
0.01,
0.01,
0.01,
0.01,
0.01
};
};
class Hospital: Default {
@@ -986,12 +1158,20 @@ class HeliCrash_No50s: Default {
{ "","trash" },
{ "","hospital" },
{"MedBox0","object"}
};
};
itemChance[] = {
0.1,
0.7,
0.2
};
itemTypeSmall[] = {
{ "","trash" },
{ "","hospital" }
};
itemChanceSmall[] = {
0.1,
0.9
};
};
class Military: Default {
zombieChance = 0.3;
@@ -1036,7 +1216,7 @@ class HeliCrash_No50s: Default {
{"Sa58P_EP1","weapon"},
{"Sa58V_EP1","weapon"},
{"BAF_L85A2_RIS_Holo","weapon"}
};
};
itemChance[] = {
0.01,
0.01,
@@ -1075,6 +1255,38 @@ class HeliCrash_No50s: Default {
0.02,
0.01
};
itemTypeSmall[] = {
{ "M9","weapon" },
{ "M9SD","weapon" },
{ "glock17_EP1","weapon" },
{ "Binocular","weapon" },
{ "ItemFlashlightRed","military" },
{ "ItemKnife","military" },
{ "ItemGPS","weapon" },
{ "ItemMap","military" },
{ "militarybackpacks","backpack" },
{ "","medical" },
{ "","generic" },
{ "","military" },
{ "UZI_SD_EP1","weapon"},
{ "ItemEtool","weapon" }
};
itemChanceSmall[] = {
0.01,
0.01,
0.02,
0.03,
0.04,
0.01,
0.01,
0.02,
0.05,
0.03,
0.1,
0.35,
0.01,
0.02
};
};
class MilitaryIndustrial: Default {
zombieChance = 0.3;
@@ -1121,8 +1333,7 @@ class HeliCrash_No50s: Default {
{"BAF_L85A2_RIS_Holo","weapon"},
{"ItemFuelBarrel","magazine"},
{"ItemFuelPump","magazine"}
};
};
itemChance[] = {
0.01,
0.01,
@@ -1163,6 +1374,38 @@ class HeliCrash_No50s: Default {
0.01,
0.01
};
itemTypeSmall[] = {
{ "M9","weapon" },
{ "M9SD","weapon" },
{ "UZI_EP1","weapon" },
{ "glock17_EP1","weapon" },
{ "Binocular","weapon" },
{ "ItemFlashlightRed","military" },
{ "ItemKnife","military" },
{ "ItemGPS","weapon" },
{ "militarybackpacks","backpack" },
{ "","medical" },
{ "","generic" },
{ "","military" },
{ "UZI_SD_EP1","weapon"},
{ "ItemEtool","weapon" }
};
itemChanceSmall[] = {
0.01,
0.01,
0.02,
0.02,
0.03,
0.04,
0.01,
0.01,
0.05,
0.03,
0.06,
0.35,
0.01,
0.02
};
};
class MilitarySpecial: Default {
zombieChance = 0.4;
@@ -1273,7 +1516,55 @@ class HeliCrash_No50s: Default {
0.01,
0.01,
0.01,
0.01
};
itemTypeSmall[] = {
{ "M9SD","weapon" },
{ "glock17_EP1","weapon" },
{ "AmmoBoxSmall_556","object" },
{ "AmmoBoxSmall_762","object" },
{ "Binocular","weapon" },
{ "ItemFlashlightRed","military" },
{ "ItemKnife","military" },
{ "ItemGPS","weapon" },
{ "ItemMap","military" },
{ "Binocular_Vector","military" },
{ "militarybackpacks","backpack" },
{ "","medical" },
{ "","generic" },
{ "","military" },
{"100Rnd_762x54_PK","magazine"},
{ "militaryclothes","single" },
{"NVGoggles","weapon"},
{"2000Rnd_762x51_M134","magazine"},
{"29Rnd_30mm_AGS30","magazine"},
{"50Rnd_127x107_DSHKM","magazine"},
{"48Rnd_40mm_MK19","magazine"},
{"100Rnd_127x99_M2","magazine"},
};
itemChanceSmall[] = {
0.04,
0.04,
0.02,
0.02,
0.02,
0.01,
0.03,
0.04,
0.03,
0.03,
0.05,
0.03,
0.09,
0.32,
0.03,
0.03,
0.03,
0.02,
0.03,
0.03,
0.03,
0.03
};
};
class Hunting: Default {
@@ -1305,6 +1596,22 @@ class HeliCrash_No50s: Default {
0.02,
0.5
};
itemTypeSmall[] = {
{"ItemMap","weapon"},
{"ItemFlashlight","generic"},
{"ItemKnife","generic"},
{"ItemMatchbox","generic"},
{"","military"},
{"","hunter"}
};
itemChanceSmall[] = {
0.02,
0.02,
0.02,
0.04,
0.4,
0.5
};
};
class Church: Residential {
minRoaming = 1;

View File

@@ -2,11 +2,13 @@ private["_cfgCount","_config","_i","_itemChances","_itemCount","_weighted","_j",
dayz_CBLChances = [];
dayz_CBLBase = [];
dayzE_CBLSChances = [];
dayzE_CBLSBase = [];
_config = configFile >> "CfgBuildingLoot";
for "_i" from 0 to ((count _config) - 1) do {
_classname = toLower(configName (_config select _i));
_itemChances = [] + getArray (_config >> _classname >> "ItemChance");
_itemChancesSmall = [] + getArray (_config >> _classname >> "ItemChanceSmall");
_itemCount = count _itemChances;
if (_itemCount > 0) then {
if (dayz_CBLBase find _classname < 0) then {
@@ -26,6 +28,27 @@ for "_i" from 0 to ((count _config) - 1) do {
dayz_CBLChances set [count dayz_CBLChances, [0]];
dayz_CBLBase set [count dayz_CBLBase, _classname];
};
_itemChancesSmall = [] + getArray (_config >> _classname >> "ItemChanceSmall");
_itemCountSmall = count _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) * 100);
for "_k" from 0 to _weight - 1 do {
_weighted set [_j + _k, _l];
};
_j = _j + _weight;
};
dayzE_CBLSChances set [count dayzE_CBLSChances, _weighted];
dayzE_CBLSBase set [count dayzE_CBLSBase, _classname];
};
} else {
dayzE_CBLSChances set [count dayzE_CBLSChances, [0]];
dayzE_CBLSBase set [count dayzE_CBLSBase, _classname];
};
};
dayz_CLChances = [];
@@ -46,6 +69,24 @@ for "_i" from 0 to ((count (_config)) - 1) do {
dayz_CLChances set [count dayz_CLChances, _weighted];
};
dayzE_CLSChances = [];
dayzE_CLSBase = [];
_config = configFile >> "cfgLootSmall";
for "_i" from 0 to ((count (_config)) - 1) do {
_itemChances = (getArray (_config select _i)) select 1;
_weighted = [];
_j = 0;
for "_l" from 0 to ((count _itemChances) - 1) do {
_weight = round ((_itemChances select _l) * 100);
for "_k" from 0 to _weight - 1 do {
_weighted set [_j + _k, _l];
};
_j = _j + _weight;
};
dayzE_CLSBase set [count dayzE_CLSBase, configName (_config select _i)];
dayzE_CLSChances set [count dayzE_CLSChances, _weighted];
};
private["_i","_type","_config","_canZombie","_canLoot"];
dayz_ZombieBuildings = [];
dayz_LootBuildings = [];