2017-09-20 14:23:46 +00:00
|
|
|
_spawnChance = ((_playerNuisance + _playerSoiled)/2) max 1;
|
2017-08-30 22:55:39 +00:00
|
|
|
// add more antagonist spawn chances
|
|
|
|
if (random _antagonistRndChance < _spawnChance) then {
|
2017-09-07 16:50:26 +00:00
|
|
|
// selectRandomWeighted arma 1.76 or higher
|
|
|
|
(selectRandomWeighted _antagonistChances) call EPOCH_unitSpawnIncrease;
|
2017-08-30 22:55:39 +00:00
|
|
|
};
|
|
|
|
// diag_log format["DEBUG: _spawnChance %1",_spawnChance];
|
|
|
|
|
|
|
|
_spawnUnits = [];
|
|
|
|
{
|
|
|
|
if (_x > 0) then{
|
|
|
|
_spawnUnits pushBack(EPOCH_spawnIndex select _forEachIndex);
|
|
|
|
};
|
2017-09-26 19:31:39 +00:00
|
|
|
} forEach _playerSpawnArray;
|
2017-08-30 22:55:39 +00:00
|
|
|
|
|
|
|
// test spawning one antagonist every 10 minutes select one unit at random to spawn
|
|
|
|
if !(_spawnUnits isEqualTo[]) then{
|
|
|
|
(selectRandom _spawnUnits) call EPOCH_unitSpawn;
|
|
|
|
};
|