mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Zeds and loot should not spawn in trader cities by default, regardless
of whether the server uses safe zones.
For servers that do not use safezones, the only other things affected
are salvage and instant kill for vehicle explosions in trader cities.
Neither is a significant issue. Most servers use safezones anyway.
Following d750f57, changed to exitWith so the check is only called once
instead of multiple times. Also no need to call again in
zombie_generate, since that function is only called by
building_spawnZombies which already checks it.
43 lines
1.2 KiB
Plaintext
43 lines
1.2 KiB
Plaintext
private["_position","_doLoiter","_unitTypes","_isNoone","_loot","_array","_agent","_type","_radius","_method","_nearByPlayer","_attempt","_myDest","_newDest","_lootType"];
|
|
_player = _this select 0;
|
|
_amount = _this select 1;
|
|
|
|
_counter = 0;
|
|
_agent = objNull;
|
|
|
|
if ([_player] call DZE_SafeZonePosCheck) exitWith {};
|
|
|
|
while {_counter < _amount} do {
|
|
|
|
//Create the Group and populate it
|
|
_type = "swarm_newBase"; //"_unitTypes call BIS_fnc_selectRandom;
|
|
//_type = "Pastor";
|
|
_position = [position _player,50,100,0] call fn_selectRandomLocation;
|
|
|
|
_agent = createAgent [_type, _position, [], 0, "NONE"];
|
|
|
|
_agent setVariable["agentObjectSwarm",_agent,true];
|
|
_agent setUnitPos "Middle";
|
|
|
|
dayz_swarmSpawnZombies = dayz_swarmSpawnZombies + 1;
|
|
dayz_spawnZombies = dayz_spawnZombies + 1;
|
|
|
|
if (isNull _agent) exitWith {
|
|
dayz_spawnZombies = dayz_spawnZombies - 1;
|
|
dayz_swarmSpawnZombies = dayz_swarmSpawnZombies - 1;
|
|
};
|
|
|
|
_isAlive = alive _agent;
|
|
|
|
//counter
|
|
_counter = _counter + 1;
|
|
|
|
//debug
|
|
//diag_log (format["Agent: %1, Type: %2,To spawn: %3/%4",_agent,_type,_amount,_counter]);
|
|
|
|
//Move
|
|
//[_agent, _position] call zombie_loiter;
|
|
|
|
//Start behavior
|
|
_id = [_position,_agent,player] execFSM "\z\AddOns\dayz_code\system\fn_swarmagent.fsm";
|
|
}; |