Advanced RyanZ Spawner

This commit is contained in:
He-Man 2020-07-29 23:33:33 +02:00
parent 8954abda75
commit 13134b9675
8 changed files with 436 additions and 0 deletions

View File

@ -0,0 +1 @@
Epoch_RyanZ_Spawner

View File

@ -0,0 +1 @@
Epoch_RyanZ_Spawner

View File

@ -0,0 +1,113 @@
waituntil {uisleep 1; !isnil "Ryanzombiesdamage" && !isnil "Ryanzombieshealth" && !isnil "Ryanzombieslimit" && !isnil "RZ_fnc_zombie_attackHuman" && !isnil "RZ_CrawlerAggressiveArray"};
uisleep 15;
params [
["_Ryanzombiesdamage",0.018],
["_Ryanzombieshealth",0.95],
["_ryanzombiesinfectedchance",0],
["_ryanzombiesinfectedrate",0],
["_ryanzombiesinfectedsymptoms",0],
["_ryanzombiesinfecteddeath",0],
["_ryanzombiesantivirusduration",0],
["_NoZedAreas",[]],
["_MaxOverallZeds",50],
["_BlackListedVehicles",["SHIP","AIR"]],
["_ZedSpawnArr",
[
[0,15,0,2,3],
[2,15,1,2,4],
[4,20,1,3,5],
[6,20,2,4,6],
[8,25,2,4,7],
[10,25,3,5,8],
[15,30,3,6,10],
[20,30,4,7,10],
[25,35,5,7,15]
]
],
["_ZedCheckTimer",50]
];
Ryanzombiesdamage = _Ryanzombiesdamage;
Ryanzombieshealth = _Ryanzombieshealth;
ryanzombiesinfectedchance = _ryanzombiesinfectedchance;
ryanzombiesinfectedrate = _ryanzombiesinfectedrate;
ryanzombiesinfectedsymptoms = _ryanzombiesinfectedsymptoms;
ryanzombiesinfecteddeath = _ryanzombiesinfecteddeath;
ryanzombiesantivirusduration = _ryanzombiesantivirusduration;
NoZedAreas = _NoZedAreas;
MaxOverallZeds = _MaxOverallZeds;
BlackListedVehicles = _BlackListedVehicles;
ZedSpawnArr = _ZedSpawnArr;
ryanzombiesglow = nil; // Do not change it here! Just in the config!
ryanzombiesglowdemondisable = false;
RZ_CrawlerAggressiveArray = RZ_NormalZombieAggressiveArray;
Epoch_ZedAttack = {
_soundEffectFinal = "A3\sounds_f\weapons\silenced\silent-23.wss";
_unit = player;
_soundEffectRange = 0;
playSound3D [_soundEffectFinal, _unit, false, getPosASL _unit, 1, 1, _soundEffectRange];
addCamShake [3,0.5,30];
player setdamage (damage player + Ryanzombiesdamage);
};
reverse ZedSpawnArr;
_ZedSpawnCheckTime = diag_ticktime;
_ZedSpawnCheck = {
params [["_target",objnull]];
_output = [];
if (!isnull _target && alive _target) then {
if (isobjecthidden _target) exitwith {};
if ({vehicle _target iskindof _x} count BlackListedVehicles > 0) exitwith {};
if (speed (vehicle _target) > 25) exitwith {};
if ({_x distance2d _target < 150} count (missionnamespace getvariable ["Epoch_Plotpoles",[]]) > 0) exitwith {};
_OverallZeds = (entities [["EPOCH_RyanZombie_1","RyanZombieCivilian_F"],[],true,false]);
_AliveZeds = _OverallZeds select {alive _x};
if ((count _AliveZeds) <= MaxOverallZeds) then {
_NearHouses = (_target nearObjects ["house", 100]) select {!((_x buildingPos -1) isEqualTo [])};
_housecount = count _NearHouses;
_spawnArray = [0,0,0,0,0];
{
_x params ["_HousesInRange"];
if (_housecount >= _HousesInRange) exitwith {
_spawnArray = _x;
};
} foreach ZedSpawnArr;
_spawnArray params ["_HousesInRange","_SpawnChance","_MinSpawn","_MaxSpawn","_maxZedsInRange"];
_Spawncount = _MinSpawn + (round (random (_MaxSpawn - _MinSpawn)));
if (_SpawnChance > (random 100)) then {
_nearplayer = count ((_target nearEntities 100) select {isplayer _x});
_Spawncount = round (_Spawncount / _nearplayer);
if (_Spawncount > 0) then {
_NearZeds = count (_OverallZeds select {_target distance _x < 200});
if (_NearZeds < _maxZedsInRange) then {
_pos = [_target, 50, 100, 1, 0, 50, 0] call BIS_fnc_findSafePos;
if (count _pos == 2) then {
_Spawncount = (_Spawncount min (_maxZedsInRange - _NearZeds) min (MaxOverallZeds - (count _OverallZeds)));
_output = [_target,_Spawncount,_pos,_NearHouses];
};
};
};
};
};
};
_output
};
if (!isserver && hasinterface) exitwith {
while {true} do {
if (diag_ticktime > _ZedSpawnCheckTime) then {
_output = [player] call _ZedSpawnCheck;
if !(_output isEqualto []) then {
[_output] remoteexec ["Epoch_ZedSpawner",2];
};
_ZedSpawnCheckTime = diag_ticktime + _ZedCheckTimer;
};
uisleep 0.5;
};
};

View File

@ -0,0 +1,93 @@
class Epoch_ZedSpawner {
Ryanzombiesdamage = 0.018; // How much damage should one hit by a Zombie do on a Player - default = 0.1
Ryanzombieshealth = 0.95; // Health (Damage) of Zombies on Spawn - Make them easy to kill -> 0.9
ryanzombiesinfectedchance = 0; // Not used here - Default = 50
ryanzombiesinfectedrate = 0; // Not used here - Default = 0.1
ryanzombiesinfectedsymptoms = 0; // Not used here - Default = 1
ryanzombiesinfecteddeath = 0; // Not used here - Default = 1
ryanzombiesantivirusduration = 0; // Not used here - Default = 300
ryanzombiesglow = 1; // Enable / Disable Glowing Eyes for Zombies
Ryanzombieslimit = 200; // Internal check distance for RyanScripts (to engage with Players). Reduced for performance - default = 5000
NoZedAreas[] = { // Array of coords, where no Zeds can Spawn
};
MaxOverallZeds = 50; // Limit for Overall Zeds on the Map
DeleteDistance = 200; // If no Player is within x meters, the Zed will get deleted
StuckOrDeadCheckTime = 180; // Stucked or Dead Zeds will be deleted after about x seconds
BlackListedVehicles[] = { // Players inside these VehicleTypes will not spawn any Zeds. Can be ["Landvehicle","SHIP","AIR","TANK"]
"SHIP",
"AIR"
};
ZedCheckTimer = 50; // Timer, how often the script should check for a ZombieSpawn
ZedSpawnArr[] = {
// [HousesInRange, SpawnChance, MinSpawn, MaxSpawn, MaxZedsInRange]
{0, 15, 0, 2, 3 },
{2, 15, 1, 2, 4 },
{4, 20, 1, 3, 5 },
{6, 20, 2, 4, 6 },
{8, 25, 2, 4, 7 },
{10, 25, 3, 5, 8 },
{15, 30, 3, 6, 10 },
{20, 30, 4, 7, 10 },
{25, 35, 5, 7, 15 }
};
ZedClasses[] = {
// Fast RyanZ CIV
/*
"RyanZombieC_man_1","RyanZombieC_man_polo_1_F","RyanZombieC_man_polo_2_F","RyanZombieC_man_polo_4_F","RyanZombieC_man_polo_5_F","RyanZombieC_man_polo_6_F","RyanZombieC_man_p_fugitive_F","RyanZombieC_man_w_worker_F",
"RyanZombieC_scientist_F","RyanZombieC_man_hunter_1_F","RyanZombieC_man_pilot_F","RyanZombieC_journalist_F","RyanZombieC_Orestes","RyanZombieC_Nikos","RyanZombie15","RyanZombie16","RyanZombie17","RyanZombie18",
"RyanZombie19","RyanZombie20","RyanZombie21","RyanZombie22","RyanZombie23","RyanZombie24","RyanZombie25","RyanZombie26","RyanZombie27","RyanZombie28","RyanZombie29","RyanZombie30","RyanZombie31","RyanZombie32",
*/
// Mid RyanZ CIV
/*
"RyanZombieC_man_1medium","RyanZombieC_man_polo_1_Fmedium","RyanZombieC_man_polo_2_Fmedium","RyanZombieC_man_polo_4_Fmedium","RyanZombieC_man_polo_5_Fmedium","RyanZombieC_man_polo_6_Fmedium","RyanZombieC_man_p_fugitive_Fmedium",
"RyanZombieC_man_w_worker_Fmedium","RyanZombieC_scientist_Fmedium","RyanZombieC_man_hunter_1_Fmedium","RyanZombieC_man_pilot_Fmedium","RyanZombieC_journalist_Fmedium","RyanZombieC_Orestesmedium","RyanZombieC_Nikosmedium",
"RyanZombie15medium","RyanZombie16medium","RyanZombie17medium","RyanZombie18medium","RyanZombie19medium","RyanZombie20medium","RyanZombie21medium","RyanZombie22medium","RyanZombie23medium","RyanZombie24medium",
"RyanZombie25medium","RyanZombie26medium","RyanZombie27medium","RyanZombie28medium","RyanZombie29medium","RyanZombie30medium","RyanZombie31medium","RyanZombie32medium",
*/
// Slow RyanZ CIV
"RyanZombieC_man_1slow","RyanZombieC_man_polo_1_Fslow","RyanZombieC_man_polo_2_Fslow","RyanZombieC_man_polo_4_Fslow","RyanZombieC_man_polo_5_Fslow","RyanZombieC_man_polo_6_Fslow","RyanZombieC_man_p_fugitive_Fslow",
"RyanZombieC_man_w_worker_Fslow","RyanZombieC_scientist_Fslow","RyanZombieC_man_hunter_1_Fslow","RyanZombieC_man_pilot_Fslow","RyanZombieC_journalist_Fslow","RyanZombieC_Orestesslow","RyanZombieC_Nikosslow",
"RyanZombie15slow","RyanZombie16slow","RyanZombie17slow","RyanZombie18slow","RyanZombie19slow","RyanZombie20slow","RyanZombie21slow","RyanZombie22slow","RyanZombie23slow","RyanZombie24slow",
"RyanZombie25slow","RyanZombie26slow","RyanZombie27slow","RyanZombie28slow","RyanZombie29slow","RyanZombie30slow","RyanZombie31slow","RyanZombie32slow",
// Walker RyanZ CIV
"RyanZombieC_man_1Walker","RyanZombieC_man_polo_1_FWalker","RyanZombieC_man_polo_2_FWalker","RyanZombieC_man_polo_4_FWalker","RyanZombieC_man_polo_5_FWalker","RyanZombieC_man_polo_6_FWalker",
"RyanZombieC_man_p_fugitive_FWalker","RyanZombieC_man_w_worker_FWalker","RyanZombieC_scientist_FWalker","RyanZombieC_man_hunter_1_FWalker","RyanZombieC_man_pilot_FWalker","RyanZombieC_journalist_FWalker",
"RyanZombieC_OrestesWalker","RyanZombieC_NikosWalker","RyanZombie15walker","RyanZombie16walker","RyanZombie17walker","RyanZombie18walker","RyanZombie19walker","RyanZombie20walker","RyanZombie21walker",
"RyanZombie22walker","RyanZombie23walker","RyanZombie24walker","RyanZombie25walker","RyanZombie26walker","RyanZombie27walker","RyanZombie28walker","RyanZombie29walker","RyanZombie30walker","RyanZombie31walker",
"RyanZombie32walker",
// Spider RyanZ CIV
"RyanZombieSpider1","RyanZombieSpider2","RyanZombieSpider3","RyanZombieSpider4","RyanZombieSpider5","RyanZombieSpider6","RyanZombieSpider7","RyanZombieSpider8","RyanZombieSpider9","RyanZombieSpider10",
"RyanZombieSpider11","RyanZombieSpider12","RyanZombieSpider13","RyanZombieSpider14","RyanZombieSpider15","RyanZombieSpider16","RyanZombieSpider17","RyanZombieSpider18","RyanZombieSpider19","RyanZombieSpider20",
"RyanZombieSpider21","RyanZombieSpider22","RyanZombieSpider23","RyanZombieSpider24","RyanZombieSpider25","RyanZombieSpider26","RyanZombieSpider27","RyanZombieSpider28","RyanZombieSpider29","RyanZombieSpider30",
"RyanZombieSpider31","RyanZombieSpider32",
// Crawler RyanZ CIV
"RyanZombieCrawler1","RyanZombieCrawler2","RyanZombieCrawler3","RyanZombieCrawler4","RyanZombieCrawler5","RyanZombieCrawler6","RyanZombieCrawler7","RyanZombieCrawler8","RyanZombieCrawler9","RyanZombieCrawler10",
"RyanZombieCrawler11","RyanZombieCrawler12","RyanZombieCrawler13","RyanZombieCrawler14","RyanZombieCrawler15","RyanZombieCrawler16","RyanZombieCrawler17","RyanZombieCrawler18","RyanZombieCrawler19","RyanZombieCrawler20",
"RyanZombieCrawler21","RyanZombieCrawler22","RyanZombieCrawler23","RyanZombieCrawler24","RyanZombieCrawler25","RyanZombieCrawler26","RyanZombieCrawler27","RyanZombieCrawler28","RyanZombieCrawler29","RyanZombieCrawler30",
"RyanZombieCrawler31","RyanZombieCrawler32",
// Epoch RyanZ
/*
"EPOCH_RyanZombie_1","EPOCH_RyanZombie_2","EPOCH_RyanZombie_3","EPOCH_RyanZombie_4","EPOCH_RyanZombie_5",
"EPOCH_RyanZombie_1_C","EPOCH_RyanZombie_2_C","EPOCH_RyanZombie_3_C","EPOCH_RyanZombie_4_C","EPOCH_RyanZombie_5_C",
"EPOCH_RyanZombie_1_Sp","EPOCH_RyanZombie_2_Sp","EPOCH_RyanZombie_3_Sp","EPOCH_RyanZombie_4_Sp","EPOCH_RyanZombie_5_Sp",
"EPOCH_RyanZombie_1_B","EPOCH_RyanZombie_2_B","EPOCH_RyanZombie_3_B","EPOCH_RyanZombie_4_B","EPOCH_RyanZombie_5_B",
"EPOCH_RyanZombie_1_W","EPOCH_RyanZombie_2_W","EPOCH_RyanZombie_3_W","EPOCH_RyanZombie_4_W","EPOCH_RyanZombie_5_W",
"EPOCH_RyanZombie_1_S","EPOCH_RyanZombie_2_S","EPOCH_RyanZombie_3_S","EPOCH_RyanZombie_4_S","EPOCH_RyanZombie_5_S",
"EPOCH_RyanZombie_1_M","EPOCH_RyanZombie_2_M","EPOCH_RyanZombie_3_M","EPOCH_RyanZombie_4_M","EPOCH_RyanZombie_5_M",
"EPOCH_RyanZombie_1","EPOCH_RyanZombie_2","EPOCH_RyanZombie_3","EPOCH_RyanZombie_4","EPOCH_RyanZombie_5",
"EPOCH_RyanZombie_1_C","EPOCH_RyanZombie_2_C","EPOCH_RyanZombie_3_C","EPOCH_RyanZombie_4_C","EPOCH_RyanZombie_5_C",
"EPOCH_RyanZombie_1_Sp","EPOCH_RyanZombie_2_Sp","EPOCH_RyanZombie_3_Sp","EPOCH_RyanZombie_4_Sp","EPOCH_RyanZombie_5_Sp",
"EPOCH_RyanZombie_1_W","EPOCH_RyanZombie_2_W","EPOCH_RyanZombie_3_W","EPOCH_RyanZombie_4_W","EPOCH_RyanZombie_5_W",
"EPOCH_RyanZombie_1_S","EPOCH_RyanZombie_2_S","EPOCH_RyanZombie_3_S","EPOCH_RyanZombie_4_S","EPOCH_RyanZombie_5_S"
*/
};
};

View File

@ -0,0 +1,28 @@
class CfgPatches
{
class Epoch_RyanZ_Spawner
{
requiredVersion = 0.1;
requiredAddons[] = {};
units[] = {};
weapons[] = {};
magazines[] = {};
ammo[] = {};
author[]= {"He-Man"};
};
};
class CfgFunctions
{
class Epoch_RyanZ_Spawner
{
class main {
file = "Epoch_RyanZ_Spawner";
class init {
preInit = 1;
};
};
};
};
#include "ZedSpawner\Epoch_ZombieSpawnConfig.hpp"

View File

@ -0,0 +1,196 @@
if !(isclass (configFile >> "CfgPatches" >> "Ryanzombies")) exitwith {};
[] spawn {
waituntil {uisleep 1; !isnil "Ryanzombiesdamage" && !isnil "Ryanzombieshealth" && !isnil "Ryanzombieslimit" && !isnil "RZ_fnc_zombie_attackHuman" && !isnil "RZ_CrawlerAggressiveArray"};
uisleep 15;
RZ_fnc_zombie_attackHuman = {
params ["_zombie","_target"];
_dir = _zombie getDir _target;
_zombie setdir _dir;
[_zombie, "AwopPercMstpSgthWnonDnon_throw"] remoteExecCall ["fnc_RyanZombies_SwitchMove"];
_attackSound = selectRandom ([_zombie,"attack"] call RZ_fnc_zombie_getZombieSoundArray);
playsound3d [_attackSound, _zombie, false, getPosASL _zombie, 1, pitch _zombie];
_target allowfleeing 1;
sleep 0.3;
_attackSpeed = [Ryanzombiesattackspeed,0.3] select (_zombie getVariable "RZ_isDemon");
if ([_zombie,_target] call RZ_fnc_zombie_canAttackHuman) then {
_hitSound = selectRandom ([_zombie,"hit"] call RZ_fnc_zombie_getZombieSoundArray);
playsound3d [_hitSound, _target, false, getPosASL _target, 1, pitch _zombie];
if (isnil "ryanzombiesdisablebleeding") then {
[_target, 10] remoteExecCall ["fnc_RyanZombies_Bleeding"];
};
_scream = selectRandom RZ_HumanScreamArray;
[_target, _scream] remoteExecCall ["say3d"];
_vel = velocity _target;
_dir = direction _zombie;
_strength = _zombie call RZ_fnc_zombie_getHumanVelocityStrength;
[_target, [(_vel select 0) + (sin _dir * _strength), (_vel select 1) + (cos _dir * _strength), (_vel select 2) + random 1]] remoteExecCall ["fnc_RyanZombies_Velocity"];
};
[] remoteexec ['Epoch_ZedAttack',_target];
sleep _attackSpeed;
};
RZ_fnc_zombie_checkForNewTarget =
{
private _zombie = _this;
private _civilians = [];
if !(isnil "ryanzombiescivilianattacks") then
{
_civilians = nearestobjects [_zombie, ["Civilian"], 100 min Ryanzombieslimit];
_civsToDelete = [];
{
if (!alive _x || _x getvariable ["ace_medical_inReviveState",false] || lifeState _x == "INCAPACITATED") then
{
_civsToDelete pushback _x;
};
} foreach _civilians;
_civilians = _civilians - _civsToDelete;
};
private _target = _zombie findNearestEnemy _zombie;
if (count _civilians != 0) then
{
_civiliantarget = _civilians select 0;
if (!isNull _target && ((_target distance _zombie) < (_civiliantarget distance _zombie))) exitwith {};
if (_zombie knowsabout _civiliantarget > 0.5) then
{
_target = _civiliantarget;
};
};
if(!isNull _target) then
{
if(_zombie distance _target > Ryanzombieslimit) exitWith { _target = objNull; };
};
_zombie setVariable ["RZ_Target",_target];
_target
};
RZ_fnc_zombie_canAttackHuman =
{
params ["_zombie","_target"];
if(!alive _zombie || !alive _target || _target getvariable ["ace_medical_inReviveState",false] || lifeState _target == "INCAPACITATED") exitWith { false };
_maxAttackDistance = _zombie call RZ_fnc_zombie_maxAttackDistanceToHuman;
((_zombie distance _target) < _maxAttackDistance && !(lineIntersects [eyepos _zombie, eyepos _target,_zombie,_target]))
};
MyZeds = [];
Epoch_ZedSpawner = {
params [["_output",[]]];
if !(_output isequalto []) then {
_output params ["_target","_Spawncount","_pos","_NearHouses"];
_group = creategroup [RESISTANCE,true];
for "_i" from 1 to _Spawncount do {
_randomPos = [_pos,random 15,random 360] call BIS_fnc_relPos;
_Zed = _group createUnit [selectrandom ZedClasses, _randomPos, [], 5, "NONE"];
if (Epoch_ryanzombiesglow isEqualTo 1) then {
_Zed setface (selectrandom RZ_FaceArray);
};
MyZeds pushback _Zed;
uisleep 0.15;
};
_FirstWp = [_target, 10, 50, 1, 0, 50, 0] call BIS_fnc_findSafePos;
if (count _FirstWp == 2) then {
_FirstWp pushback 0;
_wp = _group addwaypoint [_FirstWp,5];
_wp setWaypointSpeed "LIMITED";
{
_x domove _FirstWp;
} foreach (units _group);
};
_NearHouses = _NearHouses call Bis_fnc_ArrayShuffle;
{
if (!isnull _x) then {
_wp = _group addwaypoint [_x,5];
_wp setWaypointSpeed "LIMITED";
};
} foreach _NearHouses;
if (count (waypoints _group) < 20) then {
for "_1" from 1 to 20 do {
_randomPos = [_pos,60,random 360] call BIS_fnc_relPos;
_wp = _group addwaypoint [_randomPos,5];
_wp setWaypointSpeed "LIMITED";
};
};
_group setCurrentWaypoint [_group, 1];
};
};
[] spawn {
_Ryanzombiesdamage = getnumber (configfile >> "Epoch_ZedSpawner" >> "Ryanzombiesdamage");
_Ryanzombieshealth = getnumber (configfile >> "Epoch_ZedSpawner" >> "Ryanzombieshealth");
_ryanzombiesinfectedchance = getnumber (configfile >> "Epoch_ZedSpawner" >> "ryanzombiesinfectedchance");
_ryanzombiesinfectedrate = getnumber (configfile >> "Epoch_ZedSpawner" >> "ryanzombiesinfectedrate");
_ryanzombiesinfectedsymptoms = getnumber (configfile >> "Epoch_ZedSpawner" >> "ryanzombiesinfectedsymptoms");
_ryanzombiesinfecteddeath = getnumber (configfile >> "Epoch_ZedSpawner" >> "ryanzombiesinfecteddeath");
_ryanzombiesantivirusduration = getnumber (configfile >> "Epoch_ZedSpawner" >> "ryanzombiesantivirusduration");
_ryanzombiesglow = getnumber (configfile >> "Epoch_ZedSpawner" >> "ryanzombiesglow");
_Ryanzombieslimit = getnumber (configfile >> "Epoch_ZedSpawner" >> "Ryanzombieslimit");
_NoZedAreas = getarray (configfile >> "Epoch_ZedSpawner" >> "NoZedAreas");
_MaxOverallZeds = getnumber (configfile >> "Epoch_ZedSpawner" >> "MaxOverallZeds");
_DeleteDistance = getnumber (configfile >> "Epoch_ZedSpawner" >> "DeleteDistance");
_StuckOrDeadCheckTime = getnumber (configfile >> "Epoch_ZedSpawner" >> "StuckOrDeadCheckTime");
_BlackListedVehicles = getarray (configfile >> "Epoch_ZedSpawner" >> "BlackListedVehicles");
_ZedSpawnArr = getarray (configfile >> "Epoch_ZedSpawner" >> "ZedSpawnArr");
_ZedClasses = getarray (configfile >> "Epoch_ZedSpawner" >> "ZedClasses");
_ZedCheckTimer = getnumber (configfile >> "Epoch_ZedSpawner" >> "ZedCheckTimer");
_params = [
_Ryanzombiesdamage,
_Ryanzombieshealth,
_ryanzombiesinfectedchance,
_ryanzombiesinfectedrate,
_ryanzombiesinfectedsymptoms,
_ryanzombiesinfecteddeath,
_ryanzombiesantivirusduration,
_NoZedAreas,
_MaxOverallZeds,
_BlackListedVehicles,
_ZedSpawnArr,
_ZedCheckTimer
];
Epoch_ryanzombiesglow = _ryanzombiesglow;
Ryanzombieslimit = _Ryanzombieslimit;
ZedClasses = _ZedClasses;
RZ_FaceArray = ["RyanZombieFace1_Glowing","RyanZombieFace2_Glowing","RyanZombieFace3_Glowing","RyanZombieFace4_Glowing","RyanZombieFace5_Glowing","RyanZombieFace6_Glowing"];
_ZombieSpawn = compilefinal preprocessfilelinenumbers "Epoch_RyanZ_Spawner\ZedSpawner\Epoch_ZombieSpawn.sqf";
[_params,_ZombieSpawn] remoteExec ["BIS_fnc_spawn", -2, "Epoch_ZedSpawner"];
[] spawn _ZombieSpawn;
_ZedCleanup = {
params [["_target",objnull]];
if !(MyZeds isEqualto []) then {
_Zed = MyZeds deleteat 0;
_del = (_Zed nearEntities _DeleteDistance) select {isplayer _x} isEqualto [];
if !(_del) then {
_Checktime = _Zed getvariable ["Epoch_RyanZ_StuckCheck",0];
if (diag_ticktime > _Checktime) then {
_LastPos = _Zed getvariable ["Epoch_RyanZ_LastPos",[0,0,0]];
if ((getposATL _Zed) distance _lastpos < 2) exitwith {
_del = true;
};
_Zed setvariable ["Epoch_RyanZ_StuckCheck",diag_ticktime + _StuckOrDeadCheckTime];
};
if (_del) exitwith {};
{
if (_Zed distance2d _x < 150) exitwith {
_del = true;
};
} foreach (missionnamespace getvariable ["Epoch_PlotPoles",[]]);
_Zed setvariable ["Epoch_RyanZ_LastPos",getposATL _Zed];
};
if (_del) then {
deletevehicle _Zed;
}
else {
MyZeds pushback _Zed;
};
};
};
_run2sec = diag_ticktime;
while {true} do {
if (diag_ticktime > _run2sec) then {
[objnull] call _ZedCleanup;
_run2sec = diag_ticktime + 2;
};
uisleep 0.5;
};
};
};

View File

@ -26,6 +26,10 @@ class CfgRemoteExec
{
mode = 1;
jip = 0;
class Epoch_ZedSpawner {
allowedTargets=2;
jip = 0;
};
class EPOCH_server_spawnLoot
{
allowedTargets=2;