From 55ce5e67e244a14b58aedb06dc20dc6de9845892 Mon Sep 17 00:00:00 2001 From: worldwidesorrow Date: Thu, 21 Apr 2022 02:04:18 -0500 Subject: [PATCH] EVR server-side files --- .../system/scheduler/sched_evr.sqf | 57 +++++++++++++++++++ .../system/scheduler/sched_init.sqf | 6 ++ 2 files changed, 63 insertions(+) create mode 100644 SQF/dayz_server/system/scheduler/sched_evr.sqf diff --git a/SQF/dayz_server/system/scheduler/sched_evr.sqf b/SQF/dayz_server/system/scheduler/sched_evr.sqf new file mode 100644 index 000000000..f7922e7e6 --- /dev/null +++ b/SQF/dayz_server/system/scheduler/sched_evr.sqf @@ -0,0 +1,57 @@ +/* + EVR Storms AKA "Blowouts" Server Scheduler Functions by JasonTM. + The EVR storms are rolled out in stages for JIP players. + The server controls the EVR timing to keep the clients in sync so players have the same experience. +*/ + +evr_storm = { + PVDZE_EVR = "Stage1"; + publicVariable "PVDZE_EVR"; + uiSleep 60; + + PVDZE_EVR = "Stage2"; + publicVariable "PVDZE_EVR"; + uiSleep 50; + + PVDZE_EVR = "Stage3"; + publicVariable "PVDZE_EVR"; + uiSleep 40; + + PVDZE_EVR = "Stage4"; + publicVariable "PVDZE_EVR"; + uiSleep 30; + + PVDZE_EVR = "Stage5"; + publicVariable "PVDZE_EVR"; + uiSleep 20; + + PVDZE_EVR = "Stage6"; + publicVariable "PVDZE_EVR"; + uiSleep 10; + + PVDZE_EVR = "Stage7"; + publicVariable "PVDZE_EVR"; + uiSleep 180; + EVR_Lockout = false; +}; + +sched_evr_init = { + diag_log "EVR STORMS ENABLED"; + EVR_Lockout = false; // Prevents the server from starting an EVR storm while one is running. + [diag_tickTime, (((DZE_EVRFirstTime select 0) max (random (DZE_EVRFirstTime select 1))) * 60)] +}; + +sched_evr = { + local _time = _this select 0; + local _timer = _this select 1; + + if (!EVR_Lockout && {diag_tickTime - _time >= _timer}) then { + [] spawn evr_storm; + EVR_Lockout = true; + _time = diag_tickTime; + _timer = ((DZE_EVRTimer select 0) max (random (DZE_EVRTimer select 1))) * 60; + diag_log format ["EVR Storm Started: Next storm in %1 minutes", round(_timer / 60)]; + }; + + [_time, _timer] +}; \ No newline at end of file diff --git a/SQF/dayz_server/system/scheduler/sched_init.sqf b/SQF/dayz_server/system/scheduler/sched_init.sqf index 6e4b4d6b2..9825da8da 100644 --- a/SQF/dayz_server/system/scheduler/sched_init.sqf +++ b/SQF/dayz_server/system/scheduler/sched_init.sqf @@ -9,6 +9,9 @@ call compile preprocessFileLineNumbers (PATH+"sched_traps.sqf"); if (DZE_Bury_Body || DZE_Butcher_Body) then { call compile preprocessFileLineNumbers (PATH+"sched_lootCrates.sqf"); }; +if (DZE_EVR) then { + call compile preprocessFileLineNumbers (PATH+"sched_evr.sqf"); +}; local _list = [ // period offset code <-> ctx init code ->ctx @@ -24,6 +27,9 @@ local _list = [ if (DZE_Bury_Body || DZE_Butcher_Body) then { _list set [count _list, [ 60, 240, sched_lootCrates ]]; +}; +if (DZE_EVR) then { + _list set [count _list, [ 60, 180, sched_evr, sched_evr_init ]]; }; _list execFSM ("\z\addons\dayz_code\system\scheduler\scheduler.fsm");