diff --git a/CHANGE LOG 1.0.4.txt b/CHANGE LOG 1.0.4.txt index c2112fa1b..f7126a3e4 100644 --- a/CHANGE LOG 1.0.4.txt +++ b/CHANGE LOG 1.0.4.txt @@ -1,5 +1,6 @@ [NEW] Modular building spawning now ahead on server start, vehicles spawning after it. @Skaronator @zabn +[ADDED] Provide option to have loot tables loaded from mission file. DZE_MissionLootTable = true will look for loot configs via missionConfigFile. @vbawol [ADDED] Added Craftable/Buildable Wood Crate Storage. Recipe 6 x PartWoodLumber = ItemWoodCrateKit. @Mochnant [ADDED] BAF_Merlin_DZE - transportMaxWeapons 15, transportMaxMagazines 150, transportmaxbackpacks 5. @Skaronator [ADDED] Added back BAF_AS50_scoped_DZ configs, still not on traders or loot tables. @vbawol diff --git a/SQF/dayz_code/compile/spawn_loot.sqf b/SQF/dayz_code/compile/spawn_loot.sqf index 94b168c0e..7a20b6126 100644 --- a/SQF/dayz_code/compile/spawn_loot.sqf +++ b/SQF/dayz_code/compile/spawn_loot.sqf @@ -12,8 +12,12 @@ switch (_iClass) do { //Item is food, add random quantity of cans along with an item (if exists) _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; - - _itemTypes = [] + ((getArray (configFile >> "cfgLoot" >> _iClass)) select 0); + _itemTypes = []; + if (DZE_MissionLootTable) then { + _itemTypes = ((getArray (missionConfigFile >> "cfgLoot" >> _iClass)) select 0); + } else { + _itemTypes = ((getArray (configFile >> "cfgLoot" >> _iClass)) select 0); + }; _index = dayz_CLBase find _iClass; _weights = dayz_CLChances select _index; _cntWeights = count _weights; @@ -37,8 +41,12 @@ switch (_iClass) do { //Item is sigle, add 1 item from cfgloot _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; - - _itemTypes = [] + ((getArray (configFile >> "cfgLoot" >> _iItem)) select 0); + _itemTypes = []; + if (DZE_MissionLootTable) then { + _itemTypes = ((getArray (missionConfigFile >> "cfgLoot" >> _iItem)) select 0); + } else { + _itemTypes = ((getArray (configFile >> "cfgLoot" >> _iItem)) select 0); + }; _index = dayz_CLBase find _iItem; _weights = dayz_CLChances select _index; _cntWeights = count _weights; @@ -51,7 +59,11 @@ switch (_iClass) do case "backpack": { //Item is single backpack - _itemTypes = [] + ((getArray (configFile >> "cfgLoot" >> _iItem)) select 0); + if (DZE_MissionLootTable) then { + _itemTypes = ((getArray (missionConfigFile >> "cfgLoot" >> _iItem)) select 0); + } else { + _itemTypes = ((getArray (configFile >> "cfgLoot" >> _iItem)) select 0); + }; _index = dayz_CLBase find _iItem; _weights = dayz_CLChances select _index; _cntWeights = count _weights; @@ -63,7 +75,11 @@ switch (_iClass) do }; case "cfglootweapon": { - _itemTypes = [] + ((getArray (configFile >> "cfgLoot" >> _iItem)) select 0); + if (DZE_MissionLootTable) then { + _itemTypes = ((getArray (missionConfigFile >> "cfgLoot" >> _iItem)) select 0); + } else { + _itemTypes = ((getArray (configFile >> "cfgLoot" >> _iItem)) select 0); + }; _index = dayz_CLBase find _iItem; _weights = dayz_CLChances select _index; _cntWeights = count _weights; diff --git a/SQF/dayz_code/compile/spawn_loot_small.sqf b/SQF/dayz_code/compile/spawn_loot_small.sqf index 048c51a5a..46c7d5c55 100644 --- a/SQF/dayz_code/compile/spawn_loot_small.sqf +++ b/SQF/dayz_code/compile/spawn_loot_small.sqf @@ -13,8 +13,12 @@ switch (_iClass) do { //Item is sigle, add 1 item from CfgLootSmall _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; - - _itemTypes = [] + ((getArray (configFile >> "CfgLootSmall" >> _iClass)) select 0); + _itemTypes = []; + if (DZE_MissionLootTable) then { + _itemTypes = ((getArray (missionConfigFile >> "CfgLootSmall" >> _iClass)) select 0); + } else { + _itemTypes = ((getArray (configFile >> "CfgLootSmall" >> _iClass)) select 0); + }; _index = dayzE_CLSBase find _iClass; _weights = dayzE_CLSChances select _index; @@ -30,7 +34,12 @@ switch (_iClass) do //Item is sigle, add 1 item from CfgLootSmall _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; - _itemTypes = [] + ((getArray (configFile >> "CfgLootSmall" >> _iItem)) select 0); + _itemTypes = []; + if (DZE_MissionLootTable) then { + _itemTypes = ((getArray (missionConfigFile >> "CfgLootSmall" >> _iItem)) select 0); + } else { + _itemTypes = ((getArray (configFile >> "CfgLootSmall" >> _iItem)) select 0); + }; _index = dayzE_CLSBase find _iItem; _weights = dayzE_CLSChances select _index; _cntWeights = count _weights; @@ -45,7 +54,12 @@ switch (_iClass) do //Item is sigle, add 1 item from cfgloot _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; - _itemTypes = [] + ((getArray (configFile >> "cfgLoot" >> _iItem)) select 0); + _itemTypes = []; + if (DZE_MissionLootTable) then { + _itemTypes = ((getArray (missionConfigFile >> "CfgLootSmall" >> _iItem)) select 0); + } else { + _itemTypes = ((getArray (configFile >> "CfgLootSmall" >> _iItem)) select 0); + }; _index = dayz_CLBase find _iItem; _weights = dayz_CLChances select _index; _cntWeights = count _weights; diff --git a/SQF/dayz_code/compile/wild_spawnZombies.sqf b/SQF/dayz_code/compile/wild_spawnZombies.sqf index c6018df06..e902c4c5c 100644 --- a/SQF/dayz_code/compile/wild_spawnZombies.sqf +++ b/SQF/dayz_code/compile/wild_spawnZombies.sqf @@ -46,7 +46,14 @@ _rnd = random 1; if (_rnd > 0.3) then { _lootType = configFile >> "CfgVehicles" >> _type >> "zombieLoot"; if (isText _lootType) then { - _array = []+ getArray (configFile >> "cfgLoot" >> getText(_lootType)); + + _array = []; + if (DZE_MissionLootTable) then { + _array = getArray (missionConfigFile >> "cfgLoot" >> getText(_lootType)); + } else { + _array = getArray (configFile >> "cfgLoot" >> getText(_lootType)); + }; + if (count _array > 0) then { _loot = _array call BIS_fnc_selectRandomWeighted; if(!isNil "_array") then { diff --git a/SQF/dayz_code/compile/zombie_generate.sqf b/SQF/dayz_code/compile/zombie_generate.sqf index bb7367807..d0f01f0f4 100644 --- a/SQF/dayz_code/compile/zombie_generate.sqf +++ b/SQF/dayz_code/compile/zombie_generate.sqf @@ -95,7 +95,13 @@ _rnd = random 1; if (_rnd > 0.3) then { _lootType = configFile >> "CfgVehicles" >> _type >> "zombieLoot"; if (isText _lootType) then { - _array = []+ getArray (configFile >> "cfgLoot" >> getText(_lootType)); + + _array = []; + if (DZE_MissionLootTable) then { + _array = getArray (missionConfigFile >> "cfgLoot" >> getText(_lootType)); + } else { + _array = getArray (configFile >> "cfgLoot" >> getText(_lootType)); + }; if (count _array > 0) then { _loot = _array call BIS_fnc_selectRandomWeighted; if(!isNil "_array") then { diff --git a/SQF/dayz_code/init/loot_init.sqf b/SQF/dayz_code/init/loot_init.sqf index c1c3dc9b8..e5d5fbf01 100644 --- a/SQF/dayz_code/init/loot_init.sqf +++ b/SQF/dayz_code/init/loot_init.sqf @@ -5,7 +5,13 @@ dayz_CBLBase = []; dayzE_CBLSChances = []; dayzE_CBLSBase = []; -_config = configFile >> "CfgBuildingLoot"; +_config = []; +if (DZE_MissionLootTable) then { + _config = missionConfigFile >> "CfgBuildingLoot"; +} else { + _config = configFile >> "CfgBuildingLoot"; +}; + for "_i" from 0 to ((count _config) - 1) do { _classname = toLower(configName (_config select _i)); _itemChances = [] + getArray (_config >> _classname >> "ItemChance"); @@ -53,7 +59,14 @@ for "_i" from 0 to ((count _config) - 1) do { dayz_CLChances = []; dayz_CLBase = []; -_config = configFile >> "cfgLoot"; + +_config = []; +if (DZE_MissionLootTable) then { + _config = missionConfigFile >> "cfgLoot"; +} else { + _config = configFile >> "cfgLoot"; +}; + for "_i" from 0 to ((count (_config)) - 1) do { _itemChances = (getArray (_config select _i)) select 1; _weighted = []; @@ -71,7 +84,14 @@ for "_i" from 0 to ((count (_config)) - 1) do { dayzE_CLSChances = []; dayzE_CLSBase = []; -_config = configFile >> "cfgLootSmall"; + +_config = []; +if (DZE_MissionLootTable) then { + _config = missionConfigFile >> "cfgLootSmall"; +} else { + _config = configFile >> "cfgLootSmall"; +}; + for "_i" from 0 to ((count (_config)) - 1) do { _itemChances = (getArray (_config select _i)) select 1; _weighted = []; diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 201282c4b..ea094815d 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -473,6 +473,9 @@ if(isNil "DZE_FriendlySaving") then { if(isNil "DZE_BuildOnRoads") then { DZE_BuildOnRoads = false; }; +if(isNil "DZE_MissionLootTable") then { + DZE_MissionLootTable = false; +}; DZE_REPLACE_WEAPONS = [["Crossbow","ItemMatchbox","ItemHatchet"],["Crossbow_DZ","ItemMatchbox_DZE","ItemHatchet_DZE"]]; diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index 2cfc5a2ad..ac4ef909d 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -327,7 +327,13 @@ spawn_vehicles = { for "_x" from 1 to _num do { _iClass = _allCfgLoots call BIS_fnc_selectRandom; - _itemTypes = [] + ((getArray (configFile >> "cfgLoot" >> _iClass)) select 0); + _itemTypes = []; + if (DZE_MissionLootTable) then { + _itemTypes = ((getArray (missionConfigFile >> "cfgLoot" >> _iClass)) select 0); + } else { + _itemTypes = ((getArray (configFile >> "cfgLoot" >> _iClass)) select 0); + }; + _index = dayz_CLBase find _iClass; _weights = dayz_CLChances select _index; _cntWeights = count _weights; diff --git a/Server Files/@DayZ_Epoch_Server/addons/dayz_server.pbo b/Server Files/@DayZ_Epoch_Server/addons/dayz_server.pbo index 833c0882b..751a8367d 100644 Binary files a/Server Files/@DayZ_Epoch_Server/addons/dayz_server.pbo and b/Server Files/@DayZ_Epoch_Server/addons/dayz_server.pbo differ