mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-09 09:42:52 +03:00
0.981 + 1.7.6.1 CE
+ Increased raise horde distance to 65m. + decreased raise horde action timer to 7 seconds. + sync with 1.7.6.1 CE
This commit is contained in:
@@ -1,43 +1,47 @@
|
||||
private["_obj","_type","_config","_canLoot","_originalPos","_unitTypes","_min","_max","_num","_clean","_positions","_zombieChance","_rnd","_iPos","_nearBy","_nearByPlayer"];_obj = _this select 0;
|
||||
private["_obj","_type","_config","_canLoot","_unitTypes","_min","_max","_num","_zombieChance","_rnd","_noPlayerNear","_position","_clean","_positions","_iPos","_nearBy","_nearByPlayer"];
|
||||
_obj = _this select 0;
|
||||
_type = typeOf _obj;
|
||||
_config = configFile >> "CfgBuildingLoot" >> _type;
|
||||
_canLoot = isClass (_config);
|
||||
_originalPos = getPosATL _obj;
|
||||
|
||||
if (_canLoot and placevault) then {
|
||||
if (dayz_maxCurrentZeds > dayz_maxZeds) exitwith {};
|
||||
if (dayz_CurrentZombies > dayz_maxGlobalZombies) exitwith {};
|
||||
if (dayz_spawnZombies > dayz_maxLocalZombies) exitwith {};
|
||||
|
||||
if (_canLoot) then {
|
||||
//Get zombie class
|
||||
_unitTypes = getArray (_config >> "zombieClass");
|
||||
_min = getNumber (_config >> "minRoaming");
|
||||
_max = getNumber (_config >> "maxRoaming");
|
||||
//Walking Zombies
|
||||
_num = round(random _max) min _min;
|
||||
//Walking Zombies
|
||||
//_num = round(random _max) min _min;
|
||||
_num = round(random _max) max _min;
|
||||
_config = configFile >> "CfgBuildingLoot" >> _type;
|
||||
//Get zombie class
|
||||
//Get zombie class
|
||||
_zombieChance = getNumber (_config >> "zombieChance");
|
||||
_rnd = random 0.5;
|
||||
_chance = round(random 20);
|
||||
_rnd = random 1;
|
||||
|
||||
//if (_rnd < _zombieChance) then {
|
||||
if ((_chance % 2) == 0) then {
|
||||
|
||||
|
||||
_noPlayerNear = (count ((getPosATL _obj) nearEntities ["CAManBase",30])) == 0;
|
||||
|
||||
|
||||
if (_noPlayerNear) then {
|
||||
|
||||
_position = _obj buildingExit 0;
|
||||
if ((_position select 0) == 0) then {
|
||||
|
||||
//_position = _obj buildingExit 0;
|
||||
//if ((_position select 0) == 0) then {
|
||||
_position = getPosATL _obj;
|
||||
};
|
||||
|
||||
//diag_log ("Class: " + _type + " / Zombies: " + str(_unitTypes) + " / Walking: " + str(_num));
|
||||
//};
|
||||
|
||||
//diag_log ("Class: " + _type + " / Zombies: " + str(_unitTypes) + " / Walking: " + str(_num));
|
||||
for "_i" from 1 to _num do
|
||||
{
|
||||
[_position,_unitTypes] call zombie_generate;
|
||||
[_position,true,_unitTypes] call zombie_generate;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
//};
|
||||
|
||||
|
||||
//Add Internal Zombies
|
||||
_clean = {alive _x} count ((getPosATL _obj) nearEntities ["zZombie_Base",(sizeOf _type)]) == 0;
|
||||
if (_clean) then {
|
||||
@@ -48,13 +52,11 @@ if (_canLoot and placevault) then {
|
||||
_rnd = random 1;
|
||||
if (_rnd < _zombieChance) then {
|
||||
_iPos = _obj modelToWorld _x;
|
||||
|
||||
_nearBy = {alive _x} count nearestObjects [_iPos , ["zZombie_Base"],3] > 0;
|
||||
_nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0;
|
||||
_nearBy = {alive _x} count nearestObjects [_iPos, ["zZombie_Base"],1] > 0;
|
||||
_nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0;
|
||||
//diag_log ("BUILDING: " + _type + " / " + str(_nearBy) + " / " + str(_nearByPlayer));
|
||||
|
||||
if (!_nearByPlayer and !_nearBy) then {
|
||||
[_iPos,_unitTypes] call zombie_generate;
|
||||
[_iPos,true,_unitTypes] call zombie_generate;
|
||||
};
|
||||
};
|
||||
} forEach _positions;
|
||||
|
||||
Reference in New Issue
Block a user