From 13134b9675cbebdcf483b498a470e5a43e833b64 Mon Sep 17 00:00:00 2001 From: He-Man Date: Wed, 29 Jul 2020 23:33:33 +0200 Subject: [PATCH] Advanced RyanZ Spawner --- .../addons/Epoch_server_RyanZ_Spawner.pbo | Bin 0 -> 20851 bytes Sources/Epoch_server_RyanZ_Spawner/$PREFIX$ | 1 + .../Epoch_server_RyanZ_Spawner/PboPrefix.txt | 1 + .../ZedSpawner/Epoch_ZombieSpawn.sqf | 113 ++++++++++ .../ZedSpawner/Epoch_ZombieSpawnConfig.hpp | 93 +++++++++ Sources/Epoch_server_RyanZ_Spawner/config.cpp | 28 +++ .../Epoch_server_RyanZ_Spawner/fn_init.sqf | 196 ++++++++++++++++++ .../epoch_config/Configs/CfgRemoteExec.hpp | 4 + 8 files changed, 436 insertions(+) create mode 100644 Server_Install_Pack/@epochhive/addons/Epoch_server_RyanZ_Spawner.pbo create mode 100644 Sources/Epoch_server_RyanZ_Spawner/$PREFIX$ create mode 100644 Sources/Epoch_server_RyanZ_Spawner/PboPrefix.txt create mode 100644 Sources/Epoch_server_RyanZ_Spawner/ZedSpawner/Epoch_ZombieSpawn.sqf create mode 100644 Sources/Epoch_server_RyanZ_Spawner/ZedSpawner/Epoch_ZombieSpawnConfig.hpp create mode 100644 Sources/Epoch_server_RyanZ_Spawner/config.cpp create mode 100644 Sources/Epoch_server_RyanZ_Spawner/fn_init.sqf diff --git a/Server_Install_Pack/@epochhive/addons/Epoch_server_RyanZ_Spawner.pbo b/Server_Install_Pack/@epochhive/addons/Epoch_server_RyanZ_Spawner.pbo new file mode 100644 index 0000000000000000000000000000000000000000..077aafa90aca59139bd49d18f2315dbf297fde9c GIT binary patch literal 20851 zcmeHPPj4GZc6X2y4H!A(7$7M#z%DgQ+hkLeZFoF@Mv`MCwrp6=7%)d@w8^H}Ym&|F zZd%f6eMqiB@(FSca>}O&kaI5iAUS0NBtd@fy{hi2?jrqX_p-pwjAioGt5@%Ty;oJ5 z8+jK0aHICmDvPJd<&C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JJ;}{k>FTBm>@6%mK4Fj2i)}meNqKJsREx=flsQyC)L0w)nJoUgHkFIm;RvWJ6)kS-W+K% z>=up!b8A|GxrMF3-0D_fZiy=}x6T!qTkHzVt#}3Imc0V&qxh|vRS)>2>HEa#`{e2S z1gfDX(`PGc zRJ>BvS{5N8jZ5jl`hCIX%|iayDXxC>B-iR1=;}uUUHxdFs~-(?t*(Ktel*avx(2%X z(Lj$gn-Q;EHFq|+Udd_>ZE(G^)%s+E>y@tN)CSippU15=e$B59)N8oFD__mE4F#`! zHRm?CUioV7ZE(Hvc^q8h*F4-nAzxVx@pX#0_pO_{EB9XcH-Mz229T800Frw*fKU-f zWn-Wp9{BJBKX~8=@A|<*0&iOObmd>y4jw`Byg^#; zqCVij2mF2PByqSscD!yG_}%h%#);)jr@Z^V@o#^3{U3kZ8UFLX-uthA_^132|MBI& IpZv}L1D46 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; + }; +}; diff --git a/Sources/Epoch_server_RyanZ_Spawner/ZedSpawner/Epoch_ZombieSpawnConfig.hpp b/Sources/Epoch_server_RyanZ_Spawner/ZedSpawner/Epoch_ZombieSpawnConfig.hpp new file mode 100644 index 00000000..4f6e8d52 --- /dev/null +++ b/Sources/Epoch_server_RyanZ_Spawner/ZedSpawner/Epoch_ZombieSpawnConfig.hpp @@ -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" +*/ + }; +}; diff --git a/Sources/Epoch_server_RyanZ_Spawner/config.cpp b/Sources/Epoch_server_RyanZ_Spawner/config.cpp new file mode 100644 index 00000000..6bfa71e0 --- /dev/null +++ b/Sources/Epoch_server_RyanZ_Spawner/config.cpp @@ -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" diff --git a/Sources/Epoch_server_RyanZ_Spawner/fn_init.sqf b/Sources/Epoch_server_RyanZ_Spawner/fn_init.sqf new file mode 100644 index 00000000..0f983dcf --- /dev/null +++ b/Sources/Epoch_server_RyanZ_Spawner/fn_init.sqf @@ -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; + }; + }; +}; \ No newline at end of file diff --git a/Sources/epoch_config/Configs/CfgRemoteExec.hpp b/Sources/epoch_config/Configs/CfgRemoteExec.hpp index 2647e4e7..801c9fe5 100644 --- a/Sources/epoch_config/Configs/CfgRemoteExec.hpp +++ b/Sources/epoch_config/Configs/CfgRemoteExec.hpp @@ -26,6 +26,10 @@ class CfgRemoteExec { mode = 1; jip = 0; + class Epoch_ZedSpawner { + allowedTargets=2; + jip = 0; + }; class EPOCH_server_spawnLoot { allowedTargets=2;