This commit is contained in:
Skaronator
2014-03-01 19:01:51 +01:00
parent 9d453ec7a0
commit 4e35d15b14
3 changed files with 18 additions and 23 deletions

View File

@@ -74,24 +74,22 @@ if (_spawnRoll <= _spawnChance) then {
_crash setvariable ["fadeFire",_fadeFire,true]; _crash setvariable ["fadeFire",_fadeFire,true];
}; };
_config = configFile >> "CfgBuildingLoot" >> _lootTable; if (DZE_MissionLootTable) then {
if (DZE_MissionLootTable) then { _itemTypes = [] + getArray (missionConfigFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
_config = missionConfigFile >> "CfgBuildingLoot" >> _lootTable;; } else {
_itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
}; };
_itemTypes = [] + getArray (_config >> "itemType"); _CBLBase = dayz_CBLBase find _lootTable;
_index = dayz_CBLBase find toLower(_lootTable); _weights = dayz_CBLChances select _CBLBase;
_weights = dayz_CBLChances select _index;
_cntWeights = count _weights; _cntWeights = count _weights;
for "_x" from 1 to _num do { for "_x" from 1 to _num do {
//create loot //create loot
_index = floor(random _cntWeights); _index1 = floor(random _cntWeights);
_index = _weights select _index; _index2 = _weights select _index1;
_itemType = _itemTypes select _index; _itemType = _itemTypes select _index2;
[_itemType select 0, _itemType select 1, _position, 5] call spawn_loot; [_itemType select 0, _itemType select 1, _position, 5] call spawn_loot;
//diag_log(format["CRASHSPAWNER: Loot spawn at '%1' with loot table '%2'", _crashName, _lootTable]);
}; };
// ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items. // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items.
_nearby = _position nearObjects ["ReammoBox", sizeOf(_crashModel)]; _nearby = _position nearObjects ["ReammoBox", sizeOf(_crashModel)];
{ {

View File

@@ -1,3 +0,0 @@
// Sample Hello World
[nil,nil,"per",rTITLETEXT,"Welcome to DayzEpoch","PLAIN DOWN"] call RE;

View File

@@ -40,20 +40,20 @@ if (_spawnRoll <= _spawnChance) then {
_num = (round(random _randomizedLoot)) + _guaranteedLoot; _num = (round(random _randomizedLoot)) + _guaranteedLoot;
_config = configFile >> "CfgBuildingLoot" >> _lootTable; if (DZE_MissionLootTable) then {
if (DZE_MissionLootTable) then { _itemTypes = [] + getArray (missionConfigFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
_config = missionConfigFile >> "CfgBuildingLoot" >> _lootTable;; } else {
_itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
}; };
_itemTypes = [] + getArray (_config >> "itemType"); _CBLBase = dayz_CBLBase find _lootTable;
_index = dayz_CBLBase find toLower(_lootTable); _weights = dayz_CBLChances select _CBLBase;
_weights = dayz_CBLChances select _index;
_cntWeights = count _weights; _cntWeights = count _weights;
for "_x" from 1 to _num do { for "_x" from 1 to _num do {
//create loot //create loot
_index = floor(random _cntWeights); _index1 = floor(random _cntWeights);
_index = _weights select _index; _index2 = _weights select _index1;
_itemType = _itemTypes select _index; _itemType = _itemTypes select _index2;
[_itemType select 0, _itemType select 1, _position, 5] call spawn_loot; [_itemType select 0, _itemType select 1, _position, 5] call spawn_loot;
}; };