summaryrefslogtreecommitdiffstats
path: root/Client/Module/Arty
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:04 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:04 +0300
commitb06990293397d4b6d0374097f09d1cc5679216e3 (patch)
tree5719922562e317a8083250c178f24376b6692569 /Client/Module/Arty
downloada2wf_saralite-b06990293397d4b6d0374097f09d1cc5679216e3.tar.gz
a2wf_saralite-b06990293397d4b6d0374097f09d1cc5679216e3.tar.bz2
a2wf_saralite-b06990293397d4b6d0374097f09d1cc5679216e3.zip
init
Diffstat (limited to '')
-rw-r--r--Client/Module/Arty/ARTY_HandleILLUM.sqf26
-rw-r--r--Client/Module/Arty/ARTY_HandleSADARM.sqf108
-rw-r--r--Client/Module/Arty/ARTY_mobileMissionFinish.sqf12
-rw-r--r--Client/Module/Arty/ARTY_mobileMissionPrep.sqf10
4 files changed, 156 insertions, 0 deletions
diff --git a/Client/Module/Arty/ARTY_HandleILLUM.sqf b/Client/Module/Arty/ARTY_HandleILLUM.sqf
new file mode 100644
index 0000000..e6a4d43
--- /dev/null
+++ b/Client/Module/Arty/ARTY_HandleILLUM.sqf
@@ -0,0 +1,26 @@
+/* ILLUM Handler, Battlefield light bringer */
+Private ['_deployPos','_destination','_flare','_force','_shell','_targetToHit','_velocity'];
+_shell = _this select 0;
+_destination = _this select 1;
+_velocity = _this select 2;
+
+//--- 1KM Above.
+_destination set [2, 1000];
+
+//--- Positionate the shell in the air.
+_shell setPos _destination;
+_targetToHit = objNull;
+
+//--- Fall straigh.
+_shell setVelocity [0,0,-_velocity];
+
+//--- Wait before deploying.
+waitUntil {(getPos _shell select 2) < 310};
+
+//--- Retrieve the shell position.
+_deployPos = getPos _shell;
+deleteVehicle _shell;
+
+//--- Deploy a Flare.
+_flare = "ARTY_Flare_Medium" createVehicle _deployPos;
+_flare setPos _deployPos; \ No newline at end of file
diff --git a/Client/Module/Arty/ARTY_HandleSADARM.sqf b/Client/Module/Arty/ARTY_HandleSADARM.sqf
new file mode 100644
index 0000000..f6be193
--- /dev/null
+++ b/Client/Module/Arty/ARTY_HandleSADARM.sqf
@@ -0,0 +1,108 @@
+/* SADARM Handler, Armor Killer */
+Private ['_altitude','_barrel','_burst','_chuteModel','_deployPos','_destination','_dir','_dx','_dy','_dz','_force','_hmag','_mag','_parachute','_projectile','_px','_py','_pz','_shell','_targetFound','_targets','_targetToHit','_ux','_uy','_uz','_v1','_velocity','_xoff','_yoff','_zcomp','_zoff'];
+_shell = _this select 0;
+_destination = _this select 1;
+_velocity = _this select 2;
+
+//--- 1KM Above.
+_destination set [2, 1000];
+
+//--- Positionate the shell in the air.
+_shell setPos _destination;
+_targetToHit = objNull;
+
+//--- Fall straigh.
+_shell setVelocity [0,0,-_velocity];
+
+//--- Wait before deploying.
+waitUntil {(getPos _shell select 2) < 600};
+
+//--- Retrieve the shell position.
+_deployPos = getPos _shell;
+deleteVehicle _shell;
+
+//--- Deploy the model.
+_chuteModel = if (sideJoined == west) then {'WFBE_WESTPARACHUTE' Call GetNamespace} else {'WFBE_EASTPARACHUTE' Call GetNamespace};
+_parachute = _chuteModel createVehicle _deployPos;
+_parachute setPos _deployPos;
+_barrel = "Barrel4" createVehicle _deployPos;
+_barrel attachTo [_parachute,[0,0,0]];
+
+//--- Free Fall Simulation with stabilization.
+waitUntil
+{
+ _altitude = getPos _parachute select 2;
+ _v1 = velocity _parachute;
+ _parachute setVelocity [_v1 select 0, _v1 select 1, -_velocity];
+ (_altitude < 400);
+};
+
+//--- Using BIS SADARM Script, improved.
+_targetFound = 0;
+
+//--- Wait until either way the device find no target and fall bellow 10 meters or it find one or more targets.
+waitUntil
+{
+ _deployPos = getPos _barrel;
+ _px = _deployPos select 0;
+ _py = _deployPos select 1;
+ _pz = _deployPos select 2;
+
+ //--- Awaits for the altitude.
+ if (_pz < 275 and _pz > 75) then {
+ //--- Retrieve an potential target list.
+ _targets = _barrel nearEntities [["Car","Motorcycle","Tank","Ship","StaticCannon"], 'WFBE_ARTILLERYAMMOSADARMRANGE' Call GetNamespace];
+ if (count _targets > 0) then {
+ _targetToHit = _targets select floor(random(count _targets));
+ sleep random(3);
+ _targetFound=1;
+ };
+ };
+
+ sleep 0.2;
+
+ (_pz < 10 or _targetFound==1);
+};
+
+// Deploy attack munition if a target was found.
+if (_targetFound==1 && alive _barrel) then {
+ _deployPos = getPos _barrel;
+ _px = _deployPos select 0;
+ _py = _deployPos select 1;
+ _pz = _deployPos select 2;
+
+ deleteVehicle _barrel;
+ deleteVehicle _parachute;
+
+ // Create burst.
+ _burst = "ARTY_SADARM_BURST" createVehicleLocal [_px, _py, _pz + 5];
+ _burst setPos [_px, _py, _pz + 5];
+
+ // Create projectile
+ _projectile = "ARTY_SADARM_PROJO" createVehicleLocal [_px, _py, _pz + 5];
+ _projectile setPos [_px, _py, _pz + 5];
+
+ // Calculate direction
+ _xoff = (getPos _targetToHit select 0) - _px;
+ _yoff = (getPos _targetToHit select 1) - _py;
+ _zoff = - _pz;
+ _mag = sqrt(_xoff*_xoff + _yoff*_yoff + _zoff*_zoff);
+ _dir = [_xoff/_mag, _yoff/_mag, _zoff/_mag];
+ _dx = _dir select 0;
+ _dy = _dir select 1;
+ _dz = _dir select 2;
+ _hmag = sqrt(_dx*_dx + _dy*_dy);
+ _zcomp = -_dz/_hmag;
+ _ux = _zcomp*_dx;
+ _uy = _zcomp*_dy;
+ _uz = _hmag;
+
+ //--- Positionate the projectile.
+ _projectile setVectorDir _dir;
+ _projectile setVectorUp [_ux,_uy,_uz];
+ _projectile setVelocity [(_dir select 0) * 300, (_dir select 1) * 300, (_dir select 2) * 300];
+};
+
+//--- Delete the model.
+deleteVehicle _barrel;
+if !(isNull _parachute) then {deleteVehicle _parachute}; \ No newline at end of file
diff --git a/Client/Module/Arty/ARTY_mobileMissionFinish.sqf b/Client/Module/Arty/ARTY_mobileMissionFinish.sqf
new file mode 100644
index 0000000..9b560c4
--- /dev/null
+++ b/Client/Module/Arty/ARTY_mobileMissionFinish.sqf
@@ -0,0 +1,12 @@
+Private ["_lookPos","_vehicle"];
+
+_vehicle = _this select 0;
+
+// Lower gun/missile racks.
+_lookPos = [(getPos _vehicle select 0) + (sin (getDir _vehicle))*20,
+(getPos _vehicle select 1) + (cos (getDir _vehicle))*20,
+ (getPos _vehicle select 2) - 5];
+
+(driver _vehicle) enableAI "MOVE";
+(driver _vehicle) enableAI "TARGET";
+(gunner _vehicle) lookAt _lookPos; \ No newline at end of file
diff --git a/Client/Module/Arty/ARTY_mobileMissionPrep.sqf b/Client/Module/Arty/ARTY_mobileMissionPrep.sqf
new file mode 100644
index 0000000..9922b0d
--- /dev/null
+++ b/Client/Module/Arty/ARTY_mobileMissionPrep.sqf
@@ -0,0 +1,10 @@
+Private ['_vehicle'];
+
+_vehicle = _this select 0;
+
+(driver _vehicle) action ["engineOff", _vehicle];
+(driver _vehicle) disableAI "MOVE";
+(driver _vehicle) disableAI "TARGET";
+waitUntil {speed _vehicle < 1};
+
+sleep 3;