mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Update loot and zombie spawn, change some count/foreach
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "\z\addons\dayz_code\loot\Loot.hpp"
|
||||
|
||||
private ["_radius","_isWreck","_position","_unitTypes","_agent","_doLoiter","_type","_favStance","_lootGroup"];
|
||||
private ["_isWreck","_position","_unitTypes","_agent","_doLoiter","_type","_favStance","_lootGroup"];
|
||||
|
||||
_position = _this select 0;
|
||||
_doLoiter = _this select 1; // wander around
|
||||
@@ -9,27 +9,27 @@ _isWreck = _this select 3;
|
||||
|
||||
if (surfaceIsWater _position) exitWith { diag_log "Zombie_Generate: Location is in Water Abort"; };
|
||||
|
||||
if (_isWreck || {([_position, 15, 10, 70] call fnc_fieldOfView)}) then {
|
||||
|
||||
if (([_position, 15, 10, 70] call fnc_fieldOfView) || {_isWreck}) then {
|
||||
|
||||
if (count _unitTypes == 0) then {
|
||||
_unitTypes = getArray (missionConfigFile >> "CfgLoot" >> "Buildings" >> "Default" >> "zombieClass");
|
||||
};
|
||||
|
||||
|
||||
// Create zombie
|
||||
_type = _unitTypes call BIS_fnc_selectRandom;
|
||||
_agent = createAgent [_type, _position, [], 0, "CAN_COLLIDE"];
|
||||
_agent setDir (random 360);
|
||||
_agent setPosATL _position;
|
||||
_favStance = if (ceil(random 3) == 2) then {"middle"} else {"Up"};
|
||||
_favStance = ["Up","middle"] select (ceil(random 3) == 2);
|
||||
_agent setUnitPos _favStance;
|
||||
_agent setVariable ["stance", _favStance];
|
||||
_agent setVariable ["doLoiter", _doLoiter]; // true: Z will be wandering, false: stay still
|
||||
|
||||
|
||||
// Add to global counters
|
||||
dayz_spawnZombies = dayz_spawnZombies + 1;
|
||||
dayz_CurrentNearByZombies = dayz_CurrentNearByZombies + 1;
|
||||
dayz_currentGlobalZombies = dayz_currentGlobalZombies + 1;
|
||||
|
||||
|
||||
//Add some loot
|
||||
if (0.3 > random 1) then {
|
||||
_lootGroup = configFile >> "CfgVehicles" >> _type >> "zombieLoot";
|
||||
|
||||
Reference in New Issue
Block a user