more DZE_MissionLootTable fixes #1028

This commit is contained in:
[VB]AWOL
2014-01-29 11:41:54 -06:00
parent 51b8fdff05
commit 4573e9b5c0
11 changed files with 63 additions and 10 deletions

View File

@@ -7,7 +7,13 @@ _obj = _this select 0;
_type = toLower(typeOf _obj);
//diag_log format["Spawning loot for: %1", _type];
_config = configFile >> "CfgBuildingLoot" >> _type;
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "CfgBuildingLoot" >> _type;
};
_positions = [] + getArray (_config >> "lootPos");
_itemTypes = [] + getArray (_config >> "itemType");
_lootChance = getNumber (_config >> "lootChance");

View File

@@ -8,6 +8,9 @@ if (dayz_spawnZombies > dayz_maxLocalZombies) exitwith {};
_obj = _this select 0;
_type = typeOf _obj;
_config = configFile >> "CfgBuildingLoot" >> _type;
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "CfgBuildingLoot" >> _type;
};
_canLoot = isClass (_config);
if (_canLoot) then {

View File

@@ -98,6 +98,9 @@ if (_nearbyCount < 1) exitwith
{
_type = typeOf _x;
_config = configFile >> "CfgBuildingLoot" >> _type;
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "CfgBuildingLoot" >> _type;
};
_canLoot = isClass (_config);
if(_canLoot) then {

View File

@@ -1,6 +1,12 @@
private ["_position","_doLoiter","_unitTypes","_loot","_array","_agent","_type","_radius","_method","_myDest","_newDest","_lootType","_player","_isAlive","_rnd","_id"];
_player = _this select 0;
_unitTypes = []+ getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
_unitTypes = [];
if (DZE_MissionLootTable) then {
_unitTypes = []+ getArray (missionConfigFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
} else {
_unitTypes = []+ getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
};
_doLoiter = true;
_loot = "";

View File

@@ -16,7 +16,12 @@ _agent = objNull;
if (!_isNoone) exitWith {};
if (count _unitTypes == 0) then {
_unitTypes = []+ getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
if (DZE_MissionLootTable) then {
_unitTypes = []+ getArray (missionConfigFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
} else {
_unitTypes = []+ getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
};
};
_type = _unitTypes call BIS_fnc_selectRandom;

View File

@@ -110,8 +110,16 @@ for "_i" from 0 to ((count (_config)) - 1) do {
private["_i","_type","_config","_canZombie","_canLoot"];
dayz_ZombieBuildings = [];
dayz_LootBuildings = [];
for "_i" from 0 to (count (configFile >> "CfgBuildingLoot") - 1) do {
_type = (configFile >> "CfgBuildingLoot") select _i;
_config = [];
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "CfgBuildingLoot";
} else {
_config = configFile >> "CfgBuildingLoot";
};
for "_i" from 0 to (count (_config) - 1) do {
_type = _config select _i;
_canZombie = getNumber (_type >> "zombieChance") > 0;
_canLoot = getNumber (_type >> "lootChance") > 0;
if(_canZombie) then {

View File

@@ -593,7 +593,12 @@ if(!isDedicated) then {
zeroPreviousWeather = [0,0,[0,0],0];
zeroCurrentWeather = [0,0,[0,0],0];
dayz_baseTypes = getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
if (DZE_MissionLootTable) then {
dayz_baseTypes = getArray (missionConfigFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
} else {
dayz_baseTypes = getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
};
//temperature variables
dayz_temperatur = 36; //TeeChange

View File

@@ -96,9 +96,11 @@ while {true} do {
_crash setvariable ["fadeFire",_fadeFire,true];
};
_config = configFile >> "CfgBuildingLoot" >> _lootTable;
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "CfgBuildingLoot" >> _lootTable;
};
_itemTypes = [] + getArray (_config >> "itemType");
_index = dayz_CBLBase find toLower(_lootTable);
_weights = dayz_CBLChances select _index;

View File

@@ -223,10 +223,19 @@ RoadList = MarkerPosition nearRoads DynamicVehicleArea;
// Very taxing !!! but only on first startup
BuildingList = [];
{
if (isClass (configFile >> "CfgBuildingLoot" >> (typeOf _x))) then
{
BuildingList set [count BuildingList,_x];
if (DZE_MissionLootTable) then {
if (isClass (missionConfigFile >> "CfgBuildingLoot" >> (typeOf _x))) then
{
BuildingList set [count BuildingList,_x];
};
} else {
if (isClass (configFile >> "CfgBuildingLoot" >> (typeOf _x))) then
{
BuildingList set [count BuildingList,_x];
};
};
} forEach (MarkerPosition nearObjects ["building",DynamicVehicleArea]);
spawn_vehicles = {

View File

@@ -75,6 +75,9 @@ if (_spawnRoll <= _spawnChance) then {
};
_config = configFile >> "CfgBuildingLoot" >> _lootTable;
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "CfgBuildingLoot" >> _lootTable;;
};
_itemTypes = [] + getArray (_config >> "itemType");
_index = dayz_CBLBase find toLower(_lootTable);
_weights = dayz_CBLChances select _index;

View File

@@ -41,6 +41,9 @@ if (_spawnRoll <= _spawnChance) then {
_num = (round(random _randomizedLoot)) + _guaranteedLoot;
_config = configFile >> "CfgBuildingLoot" >> _lootTable;
if (DZE_MissionLootTable) then {
_config = missionConfigFile >> "CfgBuildingLoot" >> _lootTable;;
};
_itemTypes = [] + getArray (_config >> "itemType");
_index = dayz_CBLBase find toLower(_lootTable);
_weights = dayz_CBLChances select _index;