From dee52083d359434fc3ac51a871c1b836d092d2ac Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:55:41 +0300 Subject: init --- Server/Support/Support_ParaAmmo.sqf | 107 ++++++++++++++++++++++++++++++++ Server/Support/Support_ParaVehicles.sqf | 89 ++++++++++++++++++++++++++ Server/Support/Support_Paratroopers.sqf | 79 +++++++++++++++++++++++ Server/Support/Support_UAV.sqf | 20 ++++++ 4 files changed, 295 insertions(+) create mode 100644 Server/Support/Support_ParaAmmo.sqf create mode 100644 Server/Support/Support_ParaVehicles.sqf create mode 100644 Server/Support/Support_Paratroopers.sqf create mode 100644 Server/Support/Support_UAV.sqf (limited to 'Server/Support') diff --git a/Server/Support/Support_ParaAmmo.sqf b/Server/Support/Support_ParaAmmo.sqf new file mode 100644 index 0000000..2176b72 --- /dev/null +++ b/Server/Support/Support_ParaAmmo.sqf @@ -0,0 +1,107 @@ +Private['_args','_bd','_cargo','_grp','_pilot','_playerTeam','_positionCoord','_ran','_ranDir','_ranPos','_side','_timeStart','_vehicle','_vehicleCoord']; + +_args = _this; +_side = _args select 1; + +_playerTeam = (_args select 3); +diag_log Format["[WFBE (INFORMATION)][frameno:%4 | ticktime:%5] Server_HandleSpecial: The %1 %2 Team (Leader: %3) has called an Ammunition Paradroping",str _side,_playerTeam,name (leader _playerTeam),diag_frameno,diag_tickTime]; +_ranPos = []; +_ranDir = []; + +_bd = 'WFBE_BOUNDARIESXY' Call GetNamespace; +if !(isNil '_bd') then { + _ranPos = [ + [0+random(200),0+random(200),400+random(200)], + [0+random(200),_bd-random(200),400+random(200)], + [_bd-random(200),_bd-random(200),400+random(200)], + [_bd-random(200),0+random(200),400+random(200)] + ]; + _ranDir = [45,145,225,315]; +} else { + _ranPos = [[0+random(200),0+random(200),400+random(200)],[15000+random(200),0+random(200),400+random(200)]]; + _ranDir = [45,315]; +}; + +_timeStart = time; +_ran = round(random((count _ranPos)-1)); +_grp = createGroup _side; +_vehicle = createVehicle [Format ["WFBE_%1PARAVEHI",str _side] Call GetNamespace,(_ranPos select _ran), [], (_ranDir select _ran), "FLY"]; +_pilot = [Format ["WFBE_%1PILOT",str _side] Call GetNamespace,_grp,[100,12000,0],_side] Call CreateMan; +[str _side,'VehiclesCreated',1] Call UpdateStatistics; +[str _side,'UnitsCreated',1] Call UpdateStatistics; +_pilot moveInDriver _vehicle; +_grp setBehaviour 'CARELESS'; +_grp setCombatMode 'STEALTH'; +_pilot disableAI 'AUTOTARGET'; +_pilot disableAI 'TARGET'; +[_grp,(_args select 2),"MOVE",10] Call AIMoveTo; +Call Compile Format ["_vehicle addEventHandler ['Killed',{[_this select 0,_this select 1,%1] Spawn UnitKilled}]",_side]; +_vehicle setVehicleInit Format["[this,%1] ExecVM 'Common\Common_InitUnit.sqf';",_side]; +processInitCommands; +_vehicle flyInHeight (200 + random(20)); +_cargo = (crew _vehicle) - [driver _vehicle, gunner _vehicle, commander _vehicle]; + +while {true} do { + sleep 1; + if (!alive _pilot || !alive _vehicle || isNull _vehicle || isNull _pilot) exitWith {}; + if (!(isPlayer (leader _playerTeam)) || time - _timeStart > 500) exitWith {{_x setDammage 1} forEach (_cargo+[_pilot,_vehicle]);deleteGroup _grp}; + _vehicleCoord = [getPos _pilot select 0,getpos _pilot select 1]; + _positionCoord = [(_args select 2) select 0,(_args select 2) select 1]; + if (_vehicleCoord distance _positionCoord < 100) exitWith {}; +}; + +[_vehicle,_side] Spawn { + Private ['_ammo','_ammos','_chopper','_chute','_side']; + _chopper = _this select 0; + _side = _this select 1; + + _ammos = Format["WFBE_%1PARAAMMO",_side] Call GetNamespace; + if (typeName _ammos != 'ARRAY') exitWith {diag_log Format["[WFBE (INFORMATION)] Server_HandleSpecial: Expected array, given %1 for ammunitions.",typeName _ammos]}; + + { + _ammo = _x createVehicle [0,0,0]; + + [_chopper,_ammo,_side] Spawn { + Private ['_ammo','_chopper','_chute','_pos','_side','_type']; + _chopper = _this select 0; + _ammo = _this select 1; + _side = _this select 2; + + _chute = (Format['WFBE_%1PARACHUTE',str _side] Call GetNamespace) createVehicle [0,0,20]; + _chute setPos [getPos _chopper select 0, getPos _chopper select 1, (getPos _chopper select 2) - 11]; + _chute setDir (getDir _chopper); + + _ammo setPos getPos _chute; + _ammo attachTo [_chute,[0,0,0]]; + waitUntil {getPos _ammo select 2 < 3}; + detach _ammo; + + _type = typeOf _ammo; + _pos = getPos _ammo; + deleteVehicle _ammo; + _ammo = _type createVehicle _pos; + + Call Compile Format ["_ammo addEventHandler ['Killed',{[_this select 0,_this select 1,%1] Spawn UnitKilled}]",_side]; + + sleep 5; + + deleteVehicle _chute; + }; + + sleep 0.8; + } forEach _ammos; +}; + +[_grp,(_ranPos select _ran),"MOVE",10] Call AIMoveTo; + +while {true} do { + sleep 1; + if (!alive _pilot || !alive _vehicle || isNull _vehicle || isNull _pilot) exitWith {}; + _vehicleCoord = [getPos _pilot select 0,getpos _pilot select 1]; + _positionCoord = [(_ranPos select _ran) select 0,(_ranPos select _ran) select 1]; + if (_vehicleCoord distance _positionCoord < 200) exitWith {}; +}; + +deleteVehicle _pilot; +deleteVehicle _vehicle; +deleteGroup _grp; \ No newline at end of file diff --git a/Server/Support/Support_ParaVehicles.sqf b/Server/Support/Support_ParaVehicles.sqf new file mode 100644 index 0000000..837d97e --- /dev/null +++ b/Server/Support/Support_ParaVehicles.sqf @@ -0,0 +1,89 @@ +Private['_args','_bd','_cargo','_cargoVehicle','_grp','_pilot','_playerTeam','_positionCoord','_ran','_ranDir','_ranPos','_side','_timeStart','_vehicle','_vehicleCoord']; + +_args = _this; +_side = _args select 1; + +_playerTeam = (_args select 3); +diag_log Format["[WFBE (INFORMATION)][frameno:%4 | ticktime:%5] Server_HandleSpecial: The %1 %2 Team (Leader: %3) has called a Vehicle Paradroping",str _side,_playerTeam,name (leader _playerTeam),diag_frameno,diag_tickTime]; +_ranPos = []; +_ranDir = []; + +_bd = 'WFBE_BOUNDARIESXY' Call GetNamespace; +if !(isNil '_bd') then { + _ranPos = [ + [0+random(200),0+random(200),400+random(200)], + [0+random(200),_bd-random(200),400+random(200)], + [_bd-random(200),_bd-random(200),400+random(200)], + [_bd-random(200),0+random(200),400+random(200)] + ]; + _ranDir = [45,145,225,315]; +} else { + _ranPos = [[0+random(200),0+random(200),400+random(200)],[15000+random(200),0+random(200),400+random(200)]]; + _ranDir = [45,315]; +}; + +_timeStart = time; +_ran = round(random((count _ranPos)-1)); +_grp = createGroup _side; +_vehicle = createVehicle [Format ["WFBE_%1PARAVEHI",str _side] Call GetNamespace,(_ranPos select _ran), [], (_ranDir select _ran), "FLY"]; +[str _side,'VehiclesCreated',1] Call UpdateStatistics; +[str _side,'UnitsCreated',1] Call UpdateStatistics; +_pilot = [Format ["WFBE_%1PILOT",str _side] Call GetNamespace,_grp,[100,12000,0],_side] Call CreateMan; +_pilot moveInDriver _vehicle; +_pilot doMove (_args select 2); +_grp setBehaviour 'CARELESS'; +_grp setCombatMode 'STEALTH'; +_pilot disableAI 'AUTOTARGET'; +_pilot disableAI 'TARGET'; +[_grp,(_args select 2),"MOVE",10] Call AIMoveTo; +Call Compile Format ["_vehicle addEventHandler ['Killed',{[_this select 0,_this select 1,%1] Spawn UnitKilled}]",_side]; +_vehicle setVehicleInit Format["[this,%1] ExecVM 'Common\Common_InitUnit.sqf';",_side]; +processInitCommands; +_vehicle flyInHeight (300 + random(75)); +_cargo = (crew _vehicle) - [driver _vehicle, gunner _vehicle, commander _vehicle]; +_cargoVehicle = [Format ["WFBE_%1PARAVEHICARGO",str _side] Call GetNamespace,[0,0,50],_side,false] Call CreateVehi; +_cargoVehicle attachTo [_vehicle,[0,0,-3]]; + +emptyQueu = emptyQueu + [_cargoVehicle]; +_cargoVehicle Spawn HandleEmptyVehicle; + +while {true} do { + sleep 1; + if (!alive _pilot || !alive _vehicle || isNull _vehicle || isNull _pilot || !alive _cargoVehicle) exitWith {}; + if (!(isPlayer (leader _playerTeam)) || time - _timeStart > 500) exitWith {{_x setDammage 1} forEach (_cargo+[_pilot,_vehicle,_cargoVehicle]);deleteGroup _grp}; + _vehicleCoord = [getPos _pilot select 0,getpos _pilot select 1]; + _positionCoord = [(_args select 2) select 0,(_args select 2) select 1]; + if (_vehicleCoord distance _positionCoord < 100) exitWith {}; +}; + +detach _cargoVehicle; + +[_cargoVehicle,_side] Spawn { + Private ['_chute','_side','_vehicle']; + _vehicle = _this select 0; + _side = _this select 1; + sleep 2; + if (!alive _vehicle) exitWith {}; + _chute = (Format['WFBE_%1PARACHUTE',str _side] Call GetNamespace) createVehicle [0,0,20]; + _chute setPos [getPos _vehicle select 0, getPos _vehicle select 1, (getPos _vehicle select 2) - 11]; + _chute setDir (getDir _vehicle); + _vehicle attachTo [_chute,[0,0,0]]; + waitUntil {getPos _vehicle select 2 < 10 || !alive _vehicle}; + detach _vehicle; + sleep 10; + deleteVehicle _chute; +}; + +[_grp,(_ranPos select _ran),"MOVE",10] Call AIMoveTo; + +while {true} do { + sleep 1; + if (!alive _pilot || !alive _vehicle || isNull _vehicle || isNull _pilot) exitWith {}; + _vehicleCoord = [getPos _pilot select 0,getpos _pilot select 1]; + _positionCoord = [(_ranPos select _ran) select 0,(_ranPos select _ran) select 1]; + if (_vehicleCoord distance _positionCoord < 200) exitWith {}; +}; + +deleteVehicle _pilot; +deleteVehicle _vehicle; +deleteGroup _grp; \ No newline at end of file diff --git a/Server/Support/Support_Paratroopers.sqf b/Server/Support/Support_Paratroopers.sqf new file mode 100644 index 0000000..684e233 --- /dev/null +++ b/Server/Support/Support_Paratroopers.sqf @@ -0,0 +1,79 @@ +Private['_args','_bd','_built','_cargo','_currentLevel','_currentUpgrades','_delay','_grp','_pilot','_playerTeam','_positionCoord','_ran','_ranDir','_ranPos','_side','_timeStart','_unit','_units','_vehicle','_vehicleCoord']; + +_args = _this; +_side = _args select 1; + +_playerTeam = (_args select 3); +diag_log Format["[WFBE (INFORMATION)][frameno:%4 | ticktime:%5] Server_HandleSpecial: The %1 %2 Team (Leader: %3) has called a Paratroops Reinforcement",str _side,_playerTeam,name (leader _playerTeam),diag_frameno,diag_tickTime]; +_ranPos = []; +_ranDir = []; + +_bd = 'WFBE_BOUNDARIESXY' Call GetNamespace; +if !(isNil '_bd') then { + _ranPos = [ + [0+random(200),0+random(200),400+random(200)], + [0+random(200),_bd-random(200),400+random(200)], + [_bd-random(200),_bd-random(200),400+random(200)], + [_bd-random(200),0+random(200),400+random(200)] + ]; + _ranDir = [45,145,225,315]; +} else { + _ranPos = [[0+random(200),0+random(200),400+random(200)],[15000+random(200),0+random(200),400+random(200)]]; + _ranDir = [45,315]; +}; + +_timeStart = time; +_ran = round(random((count _ranPos)-1)); +_grp = createGroup _side; +_vehicle = createVehicle [Format ["WFBE_%1PARACARGO",str _side] Call GetNamespace,(_ranPos select _ran), [], (_ranDir select _ran), "FLY"]; +[str _side,'VehiclesCreated',1] Call UpdateStatistics; +_pilot = [Format ["WFBE_%1PILOT",str _side] Call GetNamespace,_grp,[100,12000,0],_side] Call CreateMan; +_pilot moveInDriver _vehicle; +_pilot doMove (_args select 2); +_grp setBehaviour 'CARELESS'; +_grp setCombatMode 'STEALTH'; +_pilot disableAI 'AUTOTARGET'; +_pilot disableAI 'TARGET'; +_built = 1; +[_grp,(_args select 2),"MOVE",10] Call AIMoveTo; +Call Compile Format ["_vehicle addEventHandler ['Killed',{[_this select 0,_this select 1,%1] Spawn UnitKilled}]",_side]; +_vehicle setVehicleInit Format["[this,%1] ExecVM 'Common\Common_InitUnit.sqf';",_side]; +processInitCommands; +_vehicle flyInHeight (300 + random(75)); +_currentUpgrades = (str _side) Call GetSideUpgrades; +_currentLevel = _currentUpgrades select 4; +_units = Format ["WFBE_%1PARACHUTELEVEL%2",Str _side,_currentLevel] Call GetNamespace; +{ + _unit = [_x,_grp,[100,12000,0],_side] Call CreateMan; + _unit moveInCargo _vehicle; + _built = _built + 1; +} forEach _units; + +[str _side,'UnitsCreated',_built] Call UpdateStatistics; +_cargo = (crew _vehicle) - [driver _vehicle, gunner _vehicle, commander _vehicle]; + +while {true} do { + sleep 1; + if (!alive _pilot || !alive _vehicle || isNull _vehicle || isNull _pilot) exitWith {}; + if (!(isPlayer (leader _playerTeam)) || time - _timeStart > 500) exitWith {{_x setDammage 1} forEach (_cargo+[_pilot,_vehicle]);deleteGroup _grp}; + _vehicleCoord = [getPos _pilot select 0,getpos _pilot select 1]; + _positionCoord = [(_args select 2) select 0,(_args select 2) select 1]; + if (_vehicleCoord distance _positionCoord < 200) exitWith {}; +}; + +_delay = 1; +if (_side == WEST) then {_delay = 0.3}; +{_x action ["EJECT",_vehicle];sleep _delay;[_x] join (leader _playerTeam)} forEach _cargo; +[_grp,(_ranPos select _ran),"MOVE",10] Call AIMoveTo; + +while {true} do { + sleep 1; + if (!alive _pilot || !alive _vehicle || isNull _vehicle || isNull _pilot) exitWith {}; + _vehicleCoord = [getPos _pilot select 0,getpos _pilot select 1]; + _positionCoord = [(_ranPos select _ran) select 0,(_ranPos select _ran) select 1]; + if (_vehicleCoord distance _positionCoord < 200) exitWith {}; +}; + +deleteVehicle _pilot; +deleteVehicle _vehicle; +deleteGroup _grp; \ No newline at end of file diff --git a/Server/Support/Support_UAV.sqf b/Server/Support/Support_UAV.sqf new file mode 100644 index 0000000..aded9a0 --- /dev/null +++ b/Server/Support/Support_UAV.sqf @@ -0,0 +1,20 @@ +Private["_args","_driver","_gunner","_playerTeam","_side","_uav"]; + +_args = _this; +_side = _args select 1; + +_uav = (_args select 2); +_driver = driver _uav; +_gunner = gunner _uav; +_playerTeam = (_args select 3); + +diag_log Format["[WFBE (INFORMATION)][frameno:%4 | ticktime:%5] Server_HandleSpecial: The %1 %2 Team (Leader: %3) has called an UAV",str _side,_playerTeam,name (leader _playerTeam),diag_frameno,diag_tickTime]; + +while {true} do { + sleep 5; + if (!(isPlayer (leader _playerTeam)) || !alive _uav) exitWith {}; +}; + +if (!isNull _driver) then {if (alive _driver) then {_driver setDammage 1};if (!(_driver in trashQueu)) then {trashQueu = trashQueu + [_driver];_driver Spawn TrashObject}}; +if (!isNull _gunner) then {if (alive _gunner) then {_gunner setDammage 1};if (!(_gunner in trashQueu)) then { trashQueu = trashQueu + [_gunner];_gunner Spawn TrashObject}}; +if (!isNull _uav) then {if (alive _uav) then {_uav setDammage 1};if (!(_uav in trashQueu)) then { trashQueu = trashQueu + [_uav];_uav Spawn TrashObject}}; \ No newline at end of file -- cgit v1.3.1