From c055d44dcdb87e8db49fb23e632fc086aa44cce6 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:53:22 +0300 Subject: init --- Client/Module/Arty/ARTY_HandleILLUM.sqf | 26 + Client/Module/Arty/ARTY_HandleSADARM.sqf | 108 +++ Client/Module/Arty/ARTY_mobileMissionFinish.sqf | 12 + Client/Module/Arty/ARTY_mobileMissionPrep.sqf | 10 + Client/Module/CM/CM_Countermeasures.sqf | 22 + Client/Module/CM/CM_Flares.sqf | 46 + Client/Module/CM/CM_Init.sqf | 9 + Client/Module/CM/CM_Spoofing.sqf | 18 + Client/Module/CoIn/coin_interface.sqf | 950 +++++++++++++++++++++ Client/Module/EASA/EASA_Equip.sqf | 45 + Client/Module/EASA/EASA_Init.sqf | 378 ++++++++ Client/Module/EASA/EASA_RemoveLoadout.sqf | 13 + Client/Module/ISIS/ISIS_Action.sqf | 1 + Client/Module/ISIS/ISIS_Clientfx.sqf | 63 ++ Client/Module/ISIS/ISIS_Heal.sqf | 76 ++ Client/Module/ISIS/ISIS_Wound.sqf | 62 ++ Client/Module/ISIS/ISIS_Wounded.sqf | 51 ++ Client/Module/Nuke/damage.sqf | 30 + Client/Module/Nuke/nuke.sqf | 146 ++++ Client/Module/Nuke/nukeincoming.sqf | 59 ++ Client/Module/Nuke/radzone.sqf | 20 + .../Module/Skill/Actions/Officer_Undeploy_MASH.sqf | 22 + Client/Module/Skill/Skill_Apply.sqf | 66 ++ Client/Module/Skill/Skill_Engineer.sqf | 32 + Client/Module/Skill/Skill_Init.sqf | 41 + Client/Module/Skill/Skill_Officer.sqf | 32 + Client/Module/Skill/Skill_Sniper.sqf | 31 + Client/Module/Skill/Skill_SpecOps.sqf | 52 ++ Client/Module/UAV/uav.sqf | 136 +++ Client/Module/UAV/uav_interface.sqf | 304 +++++++ Client/Module/UAV/uav_interface_oa.sqf | 162 ++++ Client/Module/UAV/uav_spotter.sqf | 28 + Client/Module/ZetaCargo/Zeta_Hook.sqf | 40 + Client/Module/ZetaCargo/Zeta_Init.sqf | 12 + Client/Module/ZetaCargo/Zeta_Unhook.sqf | 21 + 35 files changed, 3124 insertions(+) create mode 100644 Client/Module/Arty/ARTY_HandleILLUM.sqf create mode 100644 Client/Module/Arty/ARTY_HandleSADARM.sqf create mode 100644 Client/Module/Arty/ARTY_mobileMissionFinish.sqf create mode 100644 Client/Module/Arty/ARTY_mobileMissionPrep.sqf create mode 100644 Client/Module/CM/CM_Countermeasures.sqf create mode 100644 Client/Module/CM/CM_Flares.sqf create mode 100644 Client/Module/CM/CM_Init.sqf create mode 100644 Client/Module/CM/CM_Spoofing.sqf create mode 100644 Client/Module/CoIn/coin_interface.sqf create mode 100644 Client/Module/EASA/EASA_Equip.sqf create mode 100644 Client/Module/EASA/EASA_Init.sqf create mode 100644 Client/Module/EASA/EASA_RemoveLoadout.sqf create mode 100644 Client/Module/ISIS/ISIS_Action.sqf create mode 100644 Client/Module/ISIS/ISIS_Clientfx.sqf create mode 100644 Client/Module/ISIS/ISIS_Heal.sqf create mode 100644 Client/Module/ISIS/ISIS_Wound.sqf create mode 100644 Client/Module/ISIS/ISIS_Wounded.sqf create mode 100644 Client/Module/Nuke/damage.sqf create mode 100644 Client/Module/Nuke/nuke.sqf create mode 100644 Client/Module/Nuke/nukeincoming.sqf create mode 100644 Client/Module/Nuke/radzone.sqf create mode 100644 Client/Module/Skill/Actions/Officer_Undeploy_MASH.sqf create mode 100644 Client/Module/Skill/Skill_Apply.sqf create mode 100644 Client/Module/Skill/Skill_Engineer.sqf create mode 100644 Client/Module/Skill/Skill_Init.sqf create mode 100644 Client/Module/Skill/Skill_Officer.sqf create mode 100644 Client/Module/Skill/Skill_Sniper.sqf create mode 100644 Client/Module/Skill/Skill_SpecOps.sqf create mode 100644 Client/Module/UAV/uav.sqf create mode 100644 Client/Module/UAV/uav_interface.sqf create mode 100644 Client/Module/UAV/uav_interface_oa.sqf create mode 100644 Client/Module/UAV/uav_spotter.sqf create mode 100644 Client/Module/ZetaCargo/Zeta_Hook.sqf create mode 100644 Client/Module/ZetaCargo/Zeta_Init.sqf create mode 100644 Client/Module/ZetaCargo/Zeta_Unhook.sqf (limited to 'Client/Module') 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; diff --git a/Client/Module/CM/CM_Countermeasures.sqf b/Client/Module/CM/CM_Countermeasures.sqf new file mode 100644 index 0000000..795108b --- /dev/null +++ b/Client/Module/CM/CM_Countermeasures.sqf @@ -0,0 +1,22 @@ +Private ["_flarecount","_i","_isActive","_missile","_type","_vehicle"]; +_vehicle = _this select 0; +_missile = _this select 1; + +if (alive _vehicle && (getPos _vehicle) select 2 > 5) then { + _isActive = _vehicle getvariable "FlareActive"; + _type = getNumber (configFile >> "CfgAmmo" >> _missile >> "AirLock"); + if ((_type == 1) && (! _isActive)) then { + private ["_flarecount"]; + _vehicle setVariable ["FlareActive", true]; + if ((driver _vehicle) == player) then {_vehicle vehicleChat "WARNING: incomming missile!"}; + _flarecount = _vehicle getVariable "FlareCount"; + if (_flarecount > 0) then { + _this Spawn CM_Spoofing; + for [{_i=0}, {_i<8}, {_i=_i+1}] do { + [_vehicle] Call CM_Flares; + sleep 0.3; + }; + }; + _vehicle setVariable ["FlareActive", false]; + }; +}; \ No newline at end of file diff --git a/Client/Module/CM/CM_Flares.sqf b/Client/Module/CM/CM_Flares.sqf new file mode 100644 index 0000000..5d616d8 --- /dev/null +++ b/Client/Module/CM/CM_Flares.sqf @@ -0,0 +1,46 @@ +//--- ArmA 2 countermeasures, by Maddmatt. +Private ["_dirpos","_div","_emmiters","_flare","_flarecount","_flares","_flarevel","_i","_launchercount","_li","_muzzzlevel","_relpos","_sm","_sp","_vehicle","_vvel"]; +_vehicle = _this select 0; +_flares = []; +_emmiters = []; +_muzzzlevel = 25; +if (_vehicle isKindOf "Plane") then {_muzzzlevel = 150}; +_launchercount = 0; +while {([0,0,0] distance (_vehicle selectionPosition (format ["flare_launcher%1",_launchercount+1]))) != 0} do {_launchercount = _launchercount+1}; + +for "_i" from 1 to (_launchercount) do { + _flarecount = (_vehicle getVariable "FlareCount") - 1; + _vehicle setVariable ["FlareCount", _flarecount]; + _relpos = _vehicle modelToWorld (_vehicle selectionPosition format["flare_launcher%1",_i]); + _dirpos = _vehicle modelToWorld (_vehicle selectionPosition format["flare_launcher%1_dir",_i]); + _flare = "FlareCountermeasure" createVehicleLocal _relpos; + _dirpos = [(_dirpos select 0) - (_relpos select 0),(_dirpos select 1) - (_relpos select 1),(_dirpos select 2) - (_relpos select 2)]; + _div = (abs (_dirpos select 0)) + (abs (_dirpos select 1)) + (abs (_dirpos select 2)); + _flarevel = [(_dirpos select 0)/_div*_muzzzlevel,(_dirpos select 1)/_div*_muzzzlevel,(_dirpos select 2)/_div*_muzzzlevel]; + _vvel = velocity _vehicle; + + _flare setVelocity [(_flarevel select 0) + (_vvel select 0),(_flarevel select 1) + (_vvel select 1),(_flarevel select 2) + (_vvel select 2)]; + _flares = _flares + [_flare]; + + _sm = "#particlesource" createVehicleLocal getpos _flare; + _sm setParticleRandom [0.5, [0.3, 0.3, 0.3], [0.5, 0.5, 0.5], 0, 0.3, [0, 0, 0, 0], 0, 0,360]; + _sm setParticleParams [["\ca\Data\ParticleEffects\Universal\Universal", 16, 12, 8,0],"", "Billboard", 1, 3, [0, 0, 0],[0,0,0], 1, 1, 0.80, 0.5, [1.3,4],[[0.9,0.9,0.9,0.6], [1,1,1,0.3], [1,1,1,0]],[1],0.1,0.1,"","",_flare]; + _sm setDropInterval 0.02; + + _sp = "#particlesource" createVehicleLocal getpos _flare; + _sp setParticleRandom [0.03, [0.3, 0.3, 0.3], [1, 1, 1], 0, 0.2, [0, 0, 0, 0], 0, 0,360]; + _sp setParticleParams [["\ca\Data\ParticleEffects\Universal\Universal", 16, 13, 2,0],"", "Billboard", 1, 0.1, [0, 0, 0],[0,0,0], 1, 1, 0.80, 0.5, [1.5,0],[[1,1,1,-4], [1,1,1,-4], [1,1,1,-2],[1,1,1,0]],[1000],0.1,0.1,"","",_flare,360]; + _sp setDropInterval 0.001; + + _li = "#lightpoint" createVehicleLocal getpos _flare; + _li setLightBrightness 0.1; + _li setLightAmbient [0.8, 0.6, 0.2]; + _li setLightColor [1, 0.5, 0.2]; + _li lightAttachObject [_flare, [0,0,0]]; + _emmiters = _emmiters + [_sm,_sp,_li]; +}; + +(_emmiters + _flares) spawn { + sleep 4.5 + random 1; + {deletevehicle _x} forEach _this; +}; \ No newline at end of file diff --git a/Client/Module/CM/CM_Init.sqf b/Client/Module/CM/CM_Init.sqf new file mode 100644 index 0000000..d1a119b --- /dev/null +++ b/Client/Module/CM/CM_Init.sqf @@ -0,0 +1,9 @@ +Private ["_amount","_vehicle"]; +_vehicle = _this select 0; + +if (isNull _vehicle) exitWith {}; +waitUntil {commonInitComplete}; +sleep 2; +_amount = if (_vehicle isKindOf "Plane") then {'WFBE_COUNTERMEASUREPLANES' Call GetNamespace} else {'WFBE_COUNTERMEASURECHOPPERS' Call GetNamespace}; +_vehicle setVariable ["FlareCount", _amount]; +_vehicle setVariable ["FlareActive", false]; diff --git a/Client/Module/CM/CM_Spoofing.sqf b/Client/Module/CM/CM_Spoofing.sqf new file mode 100644 index 0000000..25bb764 --- /dev/null +++ b/Client/Module/CM/CM_Spoofing.sqf @@ -0,0 +1,18 @@ +Private ["_ammo","_chance","_enemy","_prob","_missile","_vehicle"]; +_vehicle = _this select 0; +_ammo = _this select 1; +_enemy = _this select 2; +_missile = objnull; + +if ((alive _vehicle) && (isEngineOn _vehicle)) then { + _missile = nearestObject [_enemy,_ammo]; + waitUntil {(_missile distance _vehicle) < ((speed _vehicle) * 1.5)}; + _prob = 25 + (random 75); + _chance = random 100; + if (_prob > _chance) then { + while {alive _missile} do { + _missile setDir ((getDir _missile) + ((random 20) - 10)); + sleep 0.1; + }; + }; +}; \ No newline at end of file diff --git a/Client/Module/CoIn/coin_interface.sqf b/Client/Module/CoIn/coin_interface.sqf new file mode 100644 index 0000000..d8fa437 --- /dev/null +++ b/Client/Module/CoIn/coin_interface.sqf @@ -0,0 +1,950 @@ + +private ["_tooFar","_nearLog","_startpos","_camera","_logicGrp","_logicASL","_nvgstate","_loaded","_localtime", +"_player","_preview","_get","_border","_itemcash","_itemcost","_a","_b","_funds","_itemclass_preview","_mhq", +"_structuresCosts","_supply","_distance","_direction","_npos","_helper","_array","_hqDeployed","_index","_gdir", +"_new","_color","_fundsRemaining","_isFlat","_colorGUI","_tooltip","_tooltipType","_pos","_dir","_colorGreen","_colorRed", +"_colorGray","_itemclass","_itemcategory","_itemFunds","_itemname","_fileIcon","_filePicture","_textHeader", +"_textPicture","_type","_text1","_status","_text2","_text3","_textHint","_textControls","_cashValues","_cashValuesOld", +"_cashValue","_cashDescription","_cashText","_cashLines","_categories","_categoriesMenu","_limit","_buildLimit","_buildings", +"_checks","_canAfford","_canAffordCount","_text","_arrayNames","_arrayNamesLong","_arrayEnable","_arrayParams", +"_find","_category","_cashValuesCount","_cashSize","_cashPos","_upgrades","_items","_canAffordCountOld", +"_params","_selected","_oldTooltip","_fundsDescription","_restart","_logic", +"_mode","_areasize","_limitH","_limitV","_limitHOld","_limitVOld","_oldMenu","_source", +"_bns","_greenList","_buildingsNames","_buildingsType","_createBorder","_createBorderScope","_maxGrad","_minDist"]; + +_logic = _this select 3; +_startPos = _this select 4; +_source = _this select 5; + +if !(alive _source) exitWith {}; + +//--- Area limits. +_root = "REPAIR"; +_hq = (sideJoined) Call GetSideHQ; +if (_source == _hq) then {_root = "HQ"}; + +_tooFar = false; +if (paramBaseArea) then { + if (_source == _hq) then { + if (count(WF_Logic getVariable Format ['%1Area',SideJoinedText]) >= ('WFBE_BASEAREAMAX' Call GetNamespace)) then { + _nearLog = [_startPos,WF_Logic getVariable Format ['%1Area',SideJoinedText]] Call SortByDistance; + _startpos = position (_nearLog select 0); + if (_source distance _startpos > ('WFBE_MHQBUILDINGRANGE' Call GetNamespace)) exitWith { + _tooFar = true; + }; + }; + }; +}; + +if (isNil 'WFBE_COIN_Root') then {WFBE_COIN_Root = ""}; +if (WFBE_COIN_Root != _root) then {lastBuilt = []}; +WFBE_COIN_Root = _root; + +if (_tooFar) exitWith {hint (localize 'STR_WF_INFO_BaseArea_Reached')};//--- Base area reached. + +//--- Call in the construction interface. +112200 cutrsc ["WFBE_ConstructionInterface","plain"]; //---added-MrNiceGuy +uiNamespace setVariable ["COIN_displayMain",finddisplay 46]; + +//--- Terminate of system is already running +if !(isNil {player getVariable "bis_coin_logic"}) exitWith {}; +player setVariable ["bis_coin_logic",_logic]; +bis_coin_player = player; + +_camera = BIS_CONTROL_CAM; +if (isNil "BIS_CONTROL_CAM") then { + _camera = "camconstruct" camCreate [position player select 0,position player select 1,15]; + _camera cameraEffect ["internal","back"]; + _camera camPrepareFov 0.900; + _camera camPrepareFocus [-1,-1]; + _camera camCommitPrepared 0; + cameraEffectEnableHUD true; + _camera setdir direction player; + [_camera,-30,0] call BIS_fnc_setPitchBank; + _camera camConstuctionSetParams ([_startPos] + (_logic getVariable "BIS_COIN_areasize")); +}; +BIS_CONTROL_CAM = _camera; +BIS_CONTROL_CAM_LMB = false; +BIS_CONTROL_CAM_RMB = false; +showCinemaBorder false; + +1122 cutrsc ["constructioninterface","plain"]; + +//--- Prevent uikey override for other mods. +WF_COIN_DEH1 = (uiNamespace getVariable "COIN_displayMain") displayAddEventHandler ["KeyDown", "if !(isNil 'BIS_CONTROL_CAM_Handler') then {BIS_temp = ['keydown',_this,commandingMenu] spawn BIS_CONTROL_CAM_Handler; BIS_temp = nil;}"]; +WF_COIN_DEH2 = (uiNamespace getVariable "COIN_displayMain") displayAddEventHandler ["KeyUp", "if !(isNil 'BIS_CONTROL_CAM_Handler') then {BIS_temp = ['keyup',_this] spawn BIS_CONTROL_CAM_Handler; BIS_temp = nil;}"]; +WF_COIN_DEH3 = (uiNamespace getVariable "COIN_displayMain") displayAddEventHandler ["MouseButtonDown", "if !(isNil 'BIS_CONTROL_CAM_Handler') then {BIS_temp = ['mousedown',_this,commandingMenu] spawn BIS_CONTROL_CAM_Handler; BIS_temp = nil; BIS_CONTROL_CAM_onMouseButtonDown = _this; if (_this select 1 == 1) then {BIS_CONTROL_CAM_RMB = true}; if (_this select 1 == 0) then {BIS_CONTROL_CAM_LMB = true};}"]; +WF_COIN_DEH4 = (uiNamespace getVariable "COIN_displayMain") displayAddEventHandler ["MouseButtonUp", "if !(isNil 'BIS_CONTROL_CAM_Handler') then {BIS_CONTROL_CAM_RMB = false; BIS_CONTROL_CAM_LMB = false;}"]; + +BIS_CONTROL_CAM_keys = []; + +if (isNil "BIS_CONTROL_CAM_ASL") then { + createCenter sideLogic; + _logicGrp = createGroup sidelogic; + _logicASL = _logicGrp createUnit ["Logic",position player,[],0,"none"]; + BIS_CONTROL_CAM_ASL = _logicASL; +}; + +_logic setVariable ["BIS_COIN_selected",objNull]; +_logic setVariable ["BIS_COIN_params",[]]; +_logic setVariable ["BIS_COIN_tooltip",""]; +_logic setVariable ["BIS_COIN_menu","#USER:BIS_Coin_categories_0"]; +_logic setVariable ["BIS_COIN_restart",true]; +_logic setVariable ["WF_RequestUpdate",false]; +_get = _logic getVariable 'WF_NVGPersistent'; +_nvgstate = true; +if (isNil '_get') then { + _nvgstate = if (daytime > 18.5 || daytime < 5.5) then {true} else {false}; + _logic setVariable ['WF_NVGPersistent',_nvgstate]; +} else { + _nvgstate = _logic getVariable 'WF_NVGPersistent'; +}; +camUseNVG _nvgstate; +_logic setVariable ["BIS_COIN_nvg",_nvgstate]; + +_bns = Format["WFBE_%1STRUCTURENAMES",sideJoinedText] Call GetNamespace; +_greenList = [WESTBAR,WESTLVF,WESTHEAVY,WESTAIR,EASTBAR,EASTLVF,EASTHEAVY,EASTAIR]; +//--- Building Limit Init. +_buildingsNames = _bns; +_buildingsNames = _buildingsNames - [_buildingsNames select 0]; +_buildingsType = Format["WFBE_%1STRUCTURES",sideJoinedText] Call GetNamespace; +_buildingsType = _buildingsType - [_buildingsType select 0]; + +//--- Open menu +_logic spawn { + +private ["_params","_logic"]; +_logic = _this; + waitUntil {!isNil {_this getVariable "BIS_COIN_fundsOld"}}; + while {!isNil "BIS_CONTROL_CAM"} do { + waitUntil { + _params = _logic getVariable "BIS_COIN_params"; + if (isNil "_params") then {_params = []}; + (commandingMenu == "" && count _params == 0 && !BIS_CONTROL_CAM_RMB) || isNil "BIS_CONTROL_CAM" + }; + if (isNil "BIS_CONTROL_CAM") exitWith {}; + showCommandingMenu "#USER:BIS_Coin_categories_0"; + sleep 0.01; + }; +}; + +//--- Border - temporary solution //TODO: move border if position of logic changes (eg. by placing hq) +_createBorder = { + + private ["_dir","_xpos","_ypos","_zpos","_a","_border","_logic","_startpos","_oldBorder","_center","_size","_width","_pi","_perimeter","_wallcount","_total"]; + _logic = _this select 0; + _startpos = _this select 1; + _oldBorder = missionNamespace getVariable "BIS_COIN_border"; + if (!isNil "_oldBorder") then { + {deleteVehicle _x} forEach _oldBorder; + }; + missionNamespace setVariable ["BIS_COIN_border",nil]; + + _border = []; + _center = _startpos; + _size = (_logic getVariable "BIS_COIN_areasize") select 0; + _width = 9.998; //200/126 + _width = 9.996; //150/96 + _width = 9.992; //100/64 + _width = 9.967; //50/32 + _width = 9.917; //30/20 + _width = 9.83; //20/14 + _width = 9.48; //10/8 + _width = 10 - (0.1/(_size * 0.2)); + _width = 10; + + _pi = 3.14159265358979323846; + _perimeter = (_size * _pi); + _perimeter = _perimeter + _width - (_perimeter % _width); + _size = (_perimeter / _pi); + _wallcount = _perimeter / _width * 2; + _total = _wallcount; + + for "_i" from 1 to _total do { + _dir = (360 / _total) * _i; + _xpos = (_center select 0) + (sin _dir) * _size; + _ypos = (_center select 1) + (cos _dir) * _size; + _zpos = (_center select 2); + + _a = "transparentwall" createVehicleLocal [_xpos,_ypos,_zpos]; + _a setposasl [_xpos,_ypos,0]; + _a setdir (_dir + 90); + _border = _border + [_a]; + }; + missionNamespace setVariable ["BIS_COIN_border",_border]; +}; +_createBorderScope = [_logic,_startpos] spawn _createBorder; + +//--- This block is pretty important +if !(isNil "BIS_CONTROL_CAM_Handler") exitWith {endLoadingScreen}; + +BIS_CONTROL_CAM_Handler = { + private ["_terminate","_key","_NVGstate","_currentCash","_price","_closest","_closestType","_get","_targeting","_near","_preview", + "_ctrl","_menu","_player","_border","_mode","_input", + "_logic","_keysCancel","_keysBanned","_keyNightVision"]; + _mode = _this select 0; + _input = _this select 1; + _logic = bis_coin_player getVariable "bis_coin_logic"; + _terminate = false; + + if (isNil "_logic") exitWith {}; + + _keysCancel = actionKeys "MenuBack"; + + _keysBanned = [1]; + _keyNightVision = actionKeys "NightVision"; + + //--- Mouse DOWN + if (_mode == "mousedown") then { + _key = _input select 1; + if (_key == 1 && 65665 in (actionkeys "MenuBack")) then {_terminate = true}; + }; + + //--- Key DOWN + if (_mode == "keydown") then { + + _key = _input select 1; + _ctrl = _input select 3; + if !(_key in (BIS_CONTROL_CAM_keys + _keysBanned)) then {BIS_CONTROL_CAM_keys = BIS_CONTROL_CAM_keys + [_key]}; + + //--- Terminate CoIn + if (_key in _keysCancel && isNil "BIS_Coin_noExit") then {_terminate = true}; + + //--- Start NVG + if (_key in _keyNightVision) then { + _NVGstate = !(_logic getVariable "BIS_COIN_nvg"); + _logic setVariable ["BIS_COIN_nvg",_NVGstate]; + _logic setVariable ['WF_NVGPersistent',_NVGstate]; + camUseNVG _NVGstate; + }; + + //--- Last Built Defense (Custom Action #1). + if ((_key in (actionKeys "User15")) && count lastBuilt > 0) then { + _deployed = true; + if (WFBE_COIN_Root == "HQ") then {_deployed = (sideJoinedText) Call GetSideHQDeployed}; + _currentCash = Call GetPlayerFunds; + if (_currentCash > (lastBuilt select 2) select 1 && _deployed) then { + showCommandingMenu ''; + _logic setVariable ["BIS_COIN_params",lastBuilt]; + }; + }; + + //--- Manning Defense (Custom Action #2). + if ((_key in (actionKeys "User16")) && (('WFBE_AIDEFENSE' Call GetNamespace) > 0)) then { + if (manningDefense) then {manningDefense = false} else {manningDefense = true}; + _status = if (manningDefense) then {localize "STR_WF_On"} else {localize "STR_WF_Off"}; + _logic setVariable ["WF_RequestUpdate",true]; + }; + + //--- Sell Defense. (Commander only) (Custom Action #3). + if ((_key in (actionKeys "User17")) && !isNull(commanderTeam)) then { + if(commanderTeam == clientTeam) then { + _preview = _logic getVariable "BIS_COIN_preview"; + if (isNil "_preview") then {//--- Proceed when there is no preview. + _targeting = screenToWorld [0.5,0.5]; + _near = nearestObjects [_targeting,Format["WFBE_%1DEFENSENAMES",sideJoinedText] Call GetNamespace,25]; + if (count _near > 0) then { + _closest = _near select 0; + _sold = _closest getVariable 'sold'; + _closestType = typeOf (_closest); + _get = _closestType Call GetNamespace; + if (!isNil '_get' && isNil '_sold') then { + _closest setVariable ['sold',true]; + _price = _get select QUERYUNITPRICE; + round(_price/2) Call ChangePlayerFunds; + deleteVehicle _closest; + }; + }; + }; + }; + }; + }; + //--- Key UP + if (_mode == "keyup") then { + _key = _input select 1; + if (_key in BIS_CONTROL_CAM_keys) then {BIS_CONTROL_CAM_keys = BIS_CONTROL_CAM_keys - [_key]}; + }; + + //--- Deselect or Close + if (_terminate) then { + _menu = _this select 2; + + //--- Close + if (isNil "BIS_Coin_noExit") then { + if (_menu == "#USER:BIS_Coin_categories_0") then { + BIS_CONTROL_CAM cameraEffect ["terminate","back"]; + camDestroy BIS_CONTROL_CAM; + BIS_CONTROL_CAM = nil; + } else { + _preview = _logic getVariable "BIS_COIN_preview"; + if !(isNil "_preview") then {deleteVehicle _preview}; + _logic setVariable ["BIS_COIN_preview",nil]; + _logic setVariable ["BIS_COIN_params",[]]; + _get = _logic getVariable 'WFBE_Helper'; + if !(isNil '_get') then { + deleteVehicle _get; + _logic setVariable ['WFBE_Helper',nil]; + }; + }; + }; + }; + + //--- Camera no longer exists - terminate and start cleanup + if (isNil "BIS_CONTROL_CAM" || player != bis_coin_player || !isNil "BIS_COIN_QUIT") exitWith { + if !(isNil "BIS_CONTROL_CAM") then {BIS_CONTROL_CAM cameraEffect ["terminate","back"];camDestroy BIS_CONTROL_CAM;}; + BIS_CONTROL_CAM = nil; + BIS_CONTROL_CAM_Handler = nil; + 1122 cuttext ["","plain"]; + _player = bis_coin_player; + _player setVariable ["bis_coin_logic",nil]; + bis_coin_player = objNull; + _preview = _logic getVariable "BIS_COIN_preview"; + if !(isNil "_preview") then {deleteVehicle _preview}; + _logic setVariable ["BIS_COIN_preview",nil]; + _get = _logic getVariable 'WFBE_Helper'; + if !(isNil '_get') then { + deleteVehicle _get; + _logic setVariable ['WFBE_Helper',nil]; + }; + _logic setVariable ["BIS_COIN_selected",nil]; + _logic setVariable ["BIS_COIN_params",nil]; + _logic setVariable ["BIS_COIN_lastdir",nil]; + _logic setVariable ["BIS_COIN_tooltip",nil]; + _logic setVariable ["BIS_COIN_fundsOld",nil]; + _logic setVariable ["BIS_COIN_restart",nil]; + _logic setVariable ["BIS_COIN_nvg",nil]; + _logic setVariable ["WF_RequestUpdate",nil]; + showCommandingMenu ""; + + //_display = finddisplay 46; + (uiNamespace getVariable "COIN_displayMain") displayRemoveEventHandler ["KeyDown",WF_COIN_DEH1]; + (uiNamespace getVariable "COIN_displayMain") displayRemoveEventHandler ["KeyUp",WF_COIN_DEH2]; + (uiNamespace getVariable "COIN_displayMain") displayRemoveEventHandler ["MouseButtonDown",WF_COIN_DEH3]; + (uiNamespace getVariable "COIN_displayMain") displayRemoveEventHandler ["MouseButtonUp",WF_COIN_DEH4]; + + //--- Behold the placeholders + BIS_COIN_QUIT = nil; + _border = missionNamespace getVariable "BIS_COIN_border"; + {deleteVehicle _x} forEach _border; + missionNamespace setVariable ["BIS_COIN_border",nil]; + }; +}; + +waitUntil {scriptDone _createBorderScope}; +endLoadingScreen; + + +///*** LOOOP **** +_canAffordCount = 0; +_canAffordCountOld = 0; +_oldMenu = commandingMenu; +_limitHOld = -1; +_limitVOld = -1; +_loaded = false; +_localtime = time; + +_maxGrad = 'WFBE_COINMAXGRADIENT' Call GetNamespace; +_minDist = 'WFBE_COINMINDISTANCE' Call GetNamespace; + +while {!isNil "BIS_CONTROL_CAM"} do { + //if (isnull (uiNamespace getVariable 'BIS_CONTROL_CAM_DISPLAY') && !_loaded) then { + if (isnull (uiNamespace getVariable 'wfbe_title_coin') && !_loaded) then { //---TEST MrNiceGuy + cameraEffectEnableHUD true; + 1122 cutrsc ["constructioninterface","plain"]; + _loaded = true; + _logic setVariable ["BIS_COIN_restart",true]; + _localtime = time; + }; + if ((time - _localtime) >= 1 && _loaded) then {_loaded = false}; + _logic = bis_coin_player getVariable "bis_coin_logic"; + + _mode = "mousemoving"; + _camera = BIS_CONTROL_CAM; + + if (isNil "_logic") exitWith {}; + + //--- Player dies on construction mode or the source die. + if (!alive player || !alive _source) exitWith { + startLoadingScreen [localize "str_coin_exit" + " " + localize "str_coin_name","RscDisplayLoadMission"]; + + if !(isNil "BIS_CONTROL_CAM") then {BIS_CONTROL_CAM cameraEffect ["terminate","back"];camDestroy BIS_CONTROL_CAM;}; + BIS_CONTROL_CAM = nil; + BIS_CONTROL_CAM_Handler = nil; + 1122 cuttext ["","plain"]; + _player = bis_coin_player; + _player setVariable ["bis_coin_logic",nil]; + bis_coin_player = objNull; + _preview = _logic getVariable "BIS_COIN_preview"; + if !(isNil "_preview") then {deleteVehicle _preview}; + _logic setVariable ["BIS_COIN_preview",nil]; + _get = _logic getVariable 'WFBE_Helper'; + if !(isNil '_get') then { + deleteVehicle _get; + _logic setVariable ['WFBE_Helper',nil]; + }; + _logic setVariable ["BIS_COIN_selected",nil]; + _logic setVariable ["BIS_COIN_params",nil]; + _logic setVariable ["BIS_COIN_lastdir",nil]; + _logic setVariable ["BIS_COIN_tooltip",nil]; + _logic setVariable ["BIS_COIN_fundsOld",nil]; + _logic setVariable ["BIS_COIN_restart",nil]; + _logic setVariable ["BIS_COIN_nvg",nil]; + _logic setVariable ["WF_RequestUpdate",nil]; + showCommandingMenu ""; + + (uiNamespace getVariable "COIN_displayMain") displayRemoveEventHandler ["KeyDown",WF_COIN_DEH1]; + (uiNamespace getVariable "COIN_displayMain") displayRemoveEventHandler ["KeyUp",WF_COIN_DEH2]; + (uiNamespace getVariable "COIN_displayMain") displayRemoveEventHandler ["MouseButtonDown",WF_COIN_DEH3]; + (uiNamespace getVariable "COIN_displayMain") displayRemoveEventHandler ["MouseButtonUp",WF_COIN_DEH4]; + + //--- Behold the placeholders + BIS_COIN_QUIT = nil; + WF_COIN_DEH1 = nil; + WF_COIN_DEH2 = nil; + WF_COIN_DEH3 = nil; + WF_COIN_DEH4 = nil; + _border = missionNamespace getVariable "BIS_COIN_border"; + {deleteVehicle _x} forEach _border; + missionNamespace setVariable ["BIS_COIN_border",nil]; + + endLoadingScreen; + }; + + _areasize = (_logic getVariable "BIS_COIN_areasize"); + _limitH = _areasize select 0; + _limitV = _areasize select 1; + + if (_limitH != _limitHOld || _limitV != _limitVOld) then { + [_logic,_startpos] spawn _createBorder; + BIS_CONTROL_CAM camConstuctionSetParams ([_startPos] + (_logic getVariable "BIS_COIN_areasize")); + }; + _limitHOld = _limitH; + _limitVOld = _limitV; + + //--- Mouse moving or holding + if (_mode in ["mousemoving","mouseholding"]) then { + //--- Check pressed keys + _keys = BIS_CONTROL_CAM_keys; + _ctrl = (29 in _keys) || (157 in _keys); + _shift = (42 in _keys) || (54 in _keys); + _alt = (56 in _keys); + + //--- Construction or Selection + _params = _logic getVariable "BIS_COIN_params"; + _tooltip = "empty"; + _tooltipType = "empty"; + _selected = objNull; + if (count _params > 0) then { + //--- Basic colors + _colorGreen = "#(argb,8,8,3)color(0,1,0,0.3,ca)"; + _colorRed = "#(argb,8,8,3)color(1,0,0,0.3,ca)"; + _colorGray = "#(argb,8,8,3)color(1,1,1,0.1,ca)"; + _colorGray = "#(argb,8,8,3)color(0,0,0,0.25,ca)"; + _color = _colorGreen; + + //--- Class, Category, Cost, (preview class), (display name) + _itemclass = _params select 0; + _itemcategory = _params select 1; + _itemcost = _params select 2; + _itemcash = 0; + if (typename _itemcost == "ARRAY") then {_itemcash = _itemcost select 0; _itemcost = _itemcost select 1}; + _funds = _logic getVariable "BIS_COIN_funds"; + if (typename _funds == "ARRAY") then { + _a = (sideJoined) Call GetSideSupply; + _b = Call GetPlayerFunds; + _funds = [_a]+[_b]; + } else { + _funds = [Call GetPlayerFunds]; + }; + _itemFunds = _funds select _itemcash; + _itemname = if (count _params > 3) then {_params select 3} else {getText (configFile >> "CfgVehicles" >> _itemclass >> "displayName")}; + _itemclass_preview = getText (configFile >> "CfgVehicles" >> _itemclass >> "ghostpreview"); + if (_itemclass_preview == "") then {_itemclass_preview = _itemclass}; + + //--- Preview building + _preview = camtarget BIS_CONTROL_CAM; + _new = false; + if (typeof _preview != _itemclass_preview) then { + //--- No preview + deleteVehicle _preview; + if !(isNil {_logic getVariable "BIS_COIN_preview"}) then {deleteVehicle (_logic getVariable "BIS_COIN_preview")}; //--- Serialization hack + _get = _logic getVariable 'WFBE_Helper'; + if !(isNil '_get') then { + deleteVehicle _get; + _logic setVariable ['WFBE_Helper',nil]; + }; + _hqDeployed = (sideJoinedText) Call GetSideHQDeployed; + _index = _bns find _itemclass; + if (_index == 0 && _hqDeployed) exitWith { + _mhq = (sideJoinedText) Call GetSideHQ; + (_mhq) Spawn HandleHQAction; + + WFBE_RequestStructure = ['SRVFNCREQUESTSTRUCTURE',[sideJoined,_itemclass,[0,0,0],0]]; + publicVariable 'WFBE_RequestStructure'; + if (isHostedServer) then {['SRVFNCREQUESTSTRUCTURE',[sideJoined,_itemclass,[0,0,0],0]] Spawn HandleSPVF}; + + ['WFBE_AREAHQUNDEPLOYED' Call GetNamespace,false,MCoin] Call Compile preprocessFile "Client\Init\Init_Coin.sqf"; + + _structuresCosts = Format["WFBE_%1STRUCTURECOSTS",sideJoinedText] Call GetNamespace; + if !(paramMoneyOnly) then { + [sideJoined,-(_structuresCosts select _index)] Call ChangeSideSupply; + } else { + -(_structuresCosts select _index) Call ChangePlayerFunds; + }; + + ////////////////////////////////////////////////// + startLoadingScreen [localize "str_coin_exit" + " " + localize "str_coin_name","RscDisplayLoadMission"]; + ////////////////////////////////////////////////// + + if !(isNil "BIS_CONTROL_CAM") then {BIS_CONTROL_CAM cameraEffect ["terminate","back"];camDestroy BIS_CONTROL_CAM;}; + BIS_CONTROL_CAM = nil; + BIS_CONTROL_CAM_Handler = nil; + 1122 cuttext ["","plain"]; + _player = bis_coin_player; + _player setVariable ["bis_coin_logic",nil]; + bis_coin_player = objNull; + _preview = _logic getVariable "BIS_COIN_preview"; + if !(isNil "_preview") then {deleteVehicle _preview}; + _logic setVariable ["BIS_COIN_preview",nil]; + _logic setVariable ["BIS_COIN_selected",nil]; + _logic setVariable ["BIS_COIN_params",nil]; + _logic setVariable ["BIS_COIN_lastdir",nil]; + _logic setVariable ["BIS_COIN_tooltip",nil]; + _logic setVariable ["BIS_COIN_fundsOld",nil]; + _logic setVariable ["BIS_COIN_restart",nil]; + _logic setVariable ["BIS_COIN_nvg",nil]; + _logic setVariable ["WF_RequestUpdate",nil]; + showCommandingMenu ""; + + (uiNamespace getVariable "COIN_displayMain") displayRemoveEventHandler ["KeyDown",WF_COIN_DEH1]; + (uiNamespace getVariable "COIN_displayMain") displayRemoveEventHandler ["KeyUp",WF_COIN_DEH2]; + (uiNamespace getVariable "COIN_displayMain") displayRemoveEventHandler ["MouseButtonDown",WF_COIN_DEH2]; + (uiNamespace getVariable "COIN_displayMain") displayRemoveEventHandler ["MouseButtonUp",WF_COIN_DEH3]; + + //--- Behold the placeholders + BIS_COIN_QUIT = nil; + WF_COIN_DEH1 = nil; + WF_COIN_DEH2 = nil; + WF_COIN_DEH3 = nil; + WF_COIN_DEH4 = nil; + _border = missionNamespace getVariable "BIS_COIN_border"; + {deleteVehicle _x} forEach _border; + missionNamespace setVariable ["BIS_COIN_border",nil]; + + [] Spawn { + + private ["_mhq","_start"]; + _start = time; + waitUntil {!((sideJoinedText) Call GetSideHQDeployed) || time - _start > 15}; + if (time - _start < 15) then { + sleep 2; + _mhq = (sideJoinedText) Call GetSideHQ; + if (alive _mhq) then { + _mhq addAction [localize "STR_WF_Unlock_MHQ","Client\Action\Action_ToggleLock.sqf", [], 95, false, true, '', 'alive _target && locked _target']; + _mhq addAction [localize "STR_WF_Lock_MHQ","Client\Action\Action_ToggleLock.sqf", [], 94, false, true, '', 'alive _target && !(locked _target)']; + }; + }; + }; + + endLoadingScreen; + }; + + _preview = _itemclass_preview createVehicleLocal (screenToWorld [0.5,0.5]); + _gdir = _logic getVariable 'BIS_COIN_lastdir'; + if !(isNil '_gdir') then {_preview setDir _gdir}; + BIS_CONTROL_CAM camSetTarget _preview; + BIS_CONTROL_CAM camCommit 0; + _logic setVariable ["BIS_COIN_preview",_preview]; + _new = true; + + //--- Preview Helper. + if (_itemclass in _greenList && _index != -1) then { + _distance = (Format ["WFBE_%1STRUCTUREDISTANCES",sideJoinedText] Call GetNamespace) select _index; + _direction = (Format ["WFBE_%1STRUCTUREDIRECTIONS",sideJoinedText] Call GetNamespace) select _index; + _npos = [getPos _preview,_distance,getDir _preview + _direction] Call GetPositionFrom; + _helper = "Sign_Danger" createVehicleLocal _npos; + _helper setPos _npos; + _helper setDir (_direction+65); + + _array = _preview worldToModel (getPos _helper); + _array set [2,0]; + _helper attachTo [_preview,_array]; + + _logic setVariable ['WFBE_Helper',_helper]; + }; + + _preview setObjectTexture [0,_colorGray]; + _preview setVariable ["BIS_COIN_color",_colorGray]; + + //--- Exception - preview not created + if (isnull _preview) then { + deleteVehicle _preview; + _logic setVariable ["BIS_COIN_preview",nil]; + _logic setVariable ["BIS_COIN_params",[]]; + _get = _logic getVariable 'WFBE_Helper'; + if !(isNil '_get') then { + deleteVehicle _get; + _logic setVariable ['WFBE_Helper',nil]; + }; + }; + + } else { + //--- Check zone + if ( + ([position _preview,_startPos] call BIS_fnc_distance2D) > _limitH + ) then { + _color = _colorGray + } else { + + //--- No money + _funds = 0; + call compile format ["_funds = %1;",_itemFunds]; + _fundsRemaining = _funds - _itemcost; + if (_fundsRemaining < 0) then {_color = _colorRed}; + + _skipFlat = false; + if !(paramDefenseCollide) then { + if !(_itemcategory == 0) then {_skipFlat = true}; + if (surfaceIsWater(position _preview)) then {_color = _colorRed}; + if (_color != _colorRed) then { + //--- Prevent Wall'in. + if (count((position _preview) nearEntities [['Man','Car','Motorcycle','Tank','Air','Ship'],10]) > 0) then {_color = _colorRed}; + }; + }; + + if (typeOf _preview == "Concrete_Wall_EP1") then {_skipFlat = true}; + + //--- Do not control the flatness with strategic & fortifications. + if (!_skipFlat) then { + _isFlat = (position _preview) isFlatEmpty [ + (sizeof typeof _preview) / _minDist, //--- Minimal distance from another object + 0, //--- If 0, just check position. If >0, select new one + _maxGrad, //--- Max gradient + (sizeof typeof _preview), //--- Gradient area + 0, //--- 0 for restricted water, 2 for required water, + false, //--- True if some water can be in 25m radius + _preview //--- Ignored object + ]; + + //--- Unable to Place due to the land. + if (count _isFlat == 0 || count (((position _preview) nearEntities 10) - [_preview]) > 0) then {_color = _colorRed}; + }; + }; + _preview setObjectTexture [0,_color]; + _preview setVariable ["BIS_COIN_color",_color]; + + _tooltip = _itemclass; + _tooltipType = "preview"; + + //--- Temporary solution + _colorGUI = [1,1,1,0.1]; + if (_color == _colorGreen) then {_colorGUI = [0.3,1,0.3,0.3]}; + if (_color == _colorRed) then {_colorGUI = [1,0.2,0.2,0.4]}; + + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112201) ctrlSetTextColor _colorGUI; + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112201) ctrlCommit 0; + }; + + //--- Place + if (!_new && !isnull _preview && ((BIS_CONTROL_CAM_LMB && 65536 in (actionKeys "DefaultAction")) || {_x in (actionKeys "DefaultAction")} count BIS_CONTROL_CAM_keys > 0) && _color == _colorGreen) then { + _pos = position _preview; + _dir = direction _preview; + deleteVehicle _preview; + _logic setVariable ["BIS_COIN_preview",nil]; + _logic setVariable ["BIS_COIN_params",[]]; + _get = _logic getVariable 'WFBE_Helper'; + if !(isNil '_get') then { + deleteVehicle _get; + _logic setVariable ['WFBE_Helper',nil]; + }; + + //--- Remove funds + //call compile format ["%1 = %1 - _itemcost;",_itemFunds]; + + //--- Execute designer defined code + [_logic,_itemclass,_pos,_dir,_params] spawn { + + private ["_hqDeployed","_structures","_get","_logic","_itemclass","_pos","_dir","_par"]; + _logic = _this select 0; + _itemclass = _this select 1; + _pos = _this select 2; + _dir = _this select 3; + _par = _this select 4; + + //--- Define the last direction used. + _logic setVariable ["BIS_COIN_lastdir",_dir]; + + //--- On Purchase. + [_logic,_itemclass] call { + Private["_cash","_class","_costs","_index","_logic","_price"]; + _logic = _this select 0; + _class = _this select 1; + _structures = Format["WFBE_%1STRUCTURENAMES",sideJoinedText] Call GetNamespace; + _costs = Format["WFBE_%1STRUCTURECOSTS",sideJoinedText] Call GetNamespace; + + //--- Structures. + _index = _structures find _class; + if (_index != -1) then { + _price = _costs select _index; + if !(paramMoneyOnly) then { + [sideJoined, -_price] Call ChangeSideSupply; + } else { + -(_price) Call ChangePlayerFunds; + }; + if (_index == 0) then { + _hqDeployed = (sideJoinedText) Call GetSideHQDeployed; + if (_hqDeployed) then { + ['WFBE_AREAHQUNDEPLOYED' Call GetNamespace,false,MCoin] Call Compile preprocessFile "Client\Init\Init_Coin.sqf"; + } else { + ['WFBE_AREAHQDEPLOYED' Call GetNamespace,true,MCoin] Call Compile preprocessFile "Client\Init\Init_Coin.sqf"; + }; + _logic setVariable ["BIS_COIN_restart",true]; + } else { + WFBE_RequestChangeScore = ['SRVFNCREQUESTCHANGESCORE',[player,score player + ('WFBE_COMMANDERBUILDSCORE' Call GetNamespace)]]; + publicVariable 'WFBE_RequestChangeScore'; + if (isHostedServer) then {['SRVFNCREQUESTCHANGESCORE',[player,score player + ('WFBE_COMMANDERBUILDSCORE' Call GetNamespace)]] Spawn HandleSPVF}; + }; + }; + + //--- Defense. + _get = _class Call GetNamespace; + if !(isNil '_get') then { + _price = _get select QUERYUNITPRICE; + -(_price) Call ChangePlayerFunds; + }; + }; + + //--- Execute designer defined code On Construct + [_logic,_itemclass,_pos,_dir,_par] call { + private ["_class","_defenses","_deployed","_dir",'_find',"_logic","_par","_pos","_structures"]; + _logic = _this select 0; + _class = _this select 1; + _pos = _this select 2; + _dir = _this select 3; + _par = _this select 4; + _structures = Format["WFBE_%1STRUCTURENAMES",sideJoinedText] Call GetNamespace; + _defenses = Format["WFBE_%1DEFENSENAMES",sideJoinedText] Call GetNamespace; + + _find = _structures find _class; + if (_find != -1) then { + //--- Increment the buildings. + if ((_find - 1) > -1) then { + _current = Call Compile Format ['%1BuildingsCurrent',sideJoinedText]; + _current set [_find - 1, (_current select (_find-1)) + 1]; + Call Compile Format ['%1BuildingsCurrent = _current',sideJoinedText]; + publicVariable Format ['%1BuildingsCurrent',sideJoinedText]; + }; + + WFBE_RequestStructure = ['SRVFNCREQUESTSTRUCTURE',[sideJoined,_class,_pos,_dir]]; + publicVariable 'WFBE_RequestStructure'; + if (isHostedServer) then {['SRVFNCREQUESTSTRUCTURE',[sideJoined,_class,_pos,_dir]] Spawn HandleSPVF}; + }; + + if (_class in _defenses) then { + WFBE_RequestDefense = ['SRVFNCREQUESTDEFENSE',[sideJoined,_class,_pos,_dir,manningDefense]]; + publicVariable 'WFBE_RequestDefense'; + if (isHostedServer) then {['SRVFNCREQUESTDEFENSE',[sideJoined,_class,_pos,_dir,manningDefense]] Spawn HandleSPVF}; + lastBuilt = _par; + }; + }; + }; + + //--- Temporary solution + _colorGUI = [1,1,1,0.1]; + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112201) ctrlSetTextColor _colorGUI; + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112201) ctrlCommit 0; + }; + } else { + _colorGUI = [1,1,1,0.1]; + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112201) ctrlSetTextColor _colorGUI; + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112201) ctrlCommit 0; + }; + + _oldTooltip = _logic getVariable "BIS_COIN_tooltip"; + if ((_tooltipType + _tooltip) != _oldTooltip || commandingMenu != _oldMenu || _logic getVariable "WF_RequestUpdate") then { + _logic setVariable ["WF_RequestUpdate",false]; + + //--- Description + _type = _tooltip; + + //--- Header & preview picture + _textHeader = "
"; + _textPicture = "


"; + _fileIcon = getText (configFile >> "cfgvehicles" >> _type >> "icon"); + if (str(configFile >> "CfgVehicleIcons" >> _fileIcon) != "") then {_fileIcon = getText (configFile >> "CfgVehicleIcons" >> _fileIcon)}; + _filePicture = getText (configFile >> "cfgvehicles" >> _type >> "picture"); + if (str(configFile >> "CfgVehicleIcons" >> _filePicture) != "") then {_filePicture = getText (configFile >> "CfgVehicleIcons" >> _filePicture)}; + + if (_tooltipType != "empty") then { + _textHeader = format [" %1
", + getText (configFile >> "cfgvehicles" >> _type >> "displayname"), + if (isnull _selected) then {""} else {str round ((1 - damage _selected) * 100) + "%"} + ]; + _textPicture = format [" ",_filePicture]; + }; + + _text1 = if (count _params > 0) then {"" + localize "str_coin_rotate" + "" + call compile (keyname 29) + "
"} else {"
"}; + + _status = if (manningDefense) then {localize "STR_WF_On"} else {localize "STR_WF_Off"}; + _text2 = if (count _params > 0) then {"" + localize "str_coin_build" + "" + call compile (actionKeysNames ["DefaultAction",1]) + "
"} else {"" + localize "STR_WF_AutoDefense" + ":" + _status + "
"}; + + _text3 = if (commandingMenu != "#USER:BIS_Coin_categories_0") then { + //--- Back hint + if (isNil "BIS_Coin_noExit") then { + "" + localize "str_coin_back" + "" + call compile (actionKeysNames ["MenuBack",1]) + ""; + } else {""}; + } else { + //--- Exit hint + if (isNil "BIS_Coin_noExit") then { + "" + localize "str_coin_exit" + "" + call compile (actionKeysNames ["MenuBack",1]) + ""; + } else {""}; + }; + + //--- Compose text + _textHint = ( + _textPicture + + _textHeader + + "" + ); + + _textControls = ( + _text1 + + _text2 + + _text3 + + "" + ); + + //--- Set box + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112211) ctrlShow true; + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112211) ctrlCommit 0; + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112214) ctrlSetStructuredText (parseText _textHint); + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112214) ctrlShow true; + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112214) ctrlCommit 0; + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112215) ctrlSetStructuredText (parseText _textControls); + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112215) ctrlShow true; + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112215) ctrlCommit 0; + }; + + //--- Amount of funds changed + _funds = _logic getVariable "BIS_COIN_funds"; + if (typename _funds == "ARRAY") then { + _a = (sideJoined) Call GetSideSupply; + _b = Call GetPlayerFunds; + _funds = [_a]+[_b]; + } else { + _funds = [Call GetPlayerFunds]; + }; + _fundsDescription = _logic getVariable "BIS_COIN_fundsDescription"; + _cashValues = []; + {_cashValues = _cashValues + [_x]} forEach _funds; + _cashValuesOld = _logic getVariable "BIS_COIN_fundsOld"; + if (isNil "_cashValuesOld") then {_cashValuesOld = []; _cashValuesOld set [count _cashValues - 1,-1]}; + _restart = _logic getVariable "BIS_COIN_restart"; + if (!([_cashValues,_cashValuesOld] call bis_fnc_arraycompare) || _restart) then { + _cashValuesCount = count _cashValues; + _cashSize = if (_cashValuesCount <= 1) then {2} else {2.8 / _cashValuesCount}; + _cashText = format ["",_cashSize]; + _cashLines = 0; + for "_i" from 0 to (count _funds - 1) do { + _cashValue = _cashValues select _i; + _cashDescription = if (count _fundsDescription > _i) then {_fundsDescription select _i} else {"?"}; + _cashText = _cashText + format ["%1 %2
",_cashDescription,round _cashValue]; + _cashLines = _cashLines + 0.05; + }; + _cashText = _cashText + "
"; + _cashPos = ctrlPosition ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112224); + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112224) ctrlSetStructuredText (parseText _cashText); + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112224) ctrlSetPosition [_cashPos select 0,_cashPos select 1,_cashPos select 2,(_cashPos select 3)/*0.1*/ + _cashLines]; + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112224) ctrlShow true; + ((uiNamespace getVariable "wfbe_title_coin") displayCtrl 112224) ctrlCommit 0; + + //--- Categories menu + _categories = +(_logic getVariable "BIS_COIN_categories"); + _categoriesMenu = []; + //--- Ammo Upgrade. + _upgrades = (sideJoinedText) Call GetSideUpgrades; + if (_upgrades select 14 < 1) then {_categories = _categories - [localize 'STR_WF_Ammo']}; + + for "_i" from 0 to (count _categories - 1) do { + _categoriesMenu = _categoriesMenu + [_i]; + }; + + [["Categories",true],"BIS_Coin_categories",[_categoriesMenu,_categories],"#USER:BIS_Coin_%1_items_0","",""] call BIS_fnc_createmenu; + + //--- Items menu + _items = _logic getVariable "BIS_COIN_items"; + _canAffordCountOld = _canAffordCount; + _canAffordCount = 0; + for "_i" from 0 to (count _categories - 1) do { + _category = _categories select _i; + _arrayNames = []; + _arrayNamesLong = []; + _arrayEnable = []; + _arrayParams = []; + { + _itemclass = _x select 0; + _itemcategory = _x select 1; + if (typename _itemcategory == typename "") then {//--- Backward compatibility + _itemcategory = _categories find _itemcategory; + } else {100}; + + if (_itemcategory < count _categories) then { + _itemcost = _x select 2; + _itemcash = 0; + if (typename _itemcost == "ARRAY") then {_itemcash = _itemcost select 0; _itemcost = _itemcost select 1}; + _cashValue = _cashValues select _itemcash; + _cashDescription = if (count _fundsDescription > _itemcash) then {_fundsDescription select _itemcash} else {"?"}; + _itemname = if (count _x > 3) then {_x select 3} else {getText (configFile >> "CfgVehicles" >> _itemclass >> "displayName")}; + //--- Build Limit reached? + _buildLimit = false; + _find = _buildingsNames find _itemclass; + if (_find != -1) then { + _current = Call Compile Format ['%1BuildingsCurrent',sideJoinedText]; + _limit = (Format['WFBE_BUILDINGMAX%1',(_buildingsType select _find)]) Call GetNamespace; + if (isNil '_limit') then {_limit = 4}; //--- Default. + if ((_current select _find) >= _limit) then {_buildLimit = true}; + }; + if (_itemcategory == _i/*_category*/) then { + _canAfford = if (_cashValue - _itemcost >= 0 && !_buildLimit) then {1} else {0}; + _canAffordCount = _canAffordCount + _canAfford; + // _text = _itemname + " - " + _cashDescription + str _itemcost; + // _arrayNamesLong = _arrayNamesLong + [_text + " "]; + _text = parseText(Format ['%1 %2 %3',_itemname,_cashDescription,_itemcost] + " "); + _arrayNames = _arrayNames + [_text]; + _arrayNamesLong = _arrayNamesLong + [_text]; + _arrayEnable = _arrayEnable + [_canAfford]; + _arrayParams = _arrayParams + [[_logic getVariable "BIS_COIN_ID"] + [_x,_i]]; + }; + }; + } forEach _items; + + [[_category,true],format ["BIS_Coin_%1_items",_i],[_arrayNames,_arrayNamesLong,_arrayEnable],""," + BIS_CONTROL_CAM_LMB = false; + scopename 'main'; + _item = '%1'; + _id = %2; + _array = (call compile '%3') select _id; + _logic = call compile ('BIS_COIN_'+ str (_array select 0)); + + _params = _array select 1; + _logic setVariable ['BIS_COIN_params',_params]; + _logic setVariable ['BIS_COIN_menu',commandingMenu]; + showCommandingMenu ''; + + ",_arrayParams] call BIS_fnc_createmenu; + }; + + if (_canAffordCount != _canAffordCountOld) then {showCommandingMenu (commandingMenu)}; //<-- Open menu again to show disabled items + }; + _logic setVariable ["BIS_COIN_fundsOld",_cashValues]; + _logic setVariable ["BIS_COIN_tooltip",_tooltipType + _tooltip]; + + if (_restart) then { + _logic setVariable ["BIS_COIN_restart",false]; + }; + }; + _oldMenu = commandingMenu; + sleep 0.01; +}; +112200 cuttext ["","plain"]; //---added-MrNiceGuy +showCommandingMenu ''; diff --git a/Client/Module/EASA/EASA_Equip.sqf b/Client/Module/EASA/EASA_Equip.sqf new file mode 100644 index 0000000..8bed693 --- /dev/null +++ b/Client/Module/EASA/EASA_Equip.sqf @@ -0,0 +1,45 @@ +Private ['_data','_get','_i','_index','_j','_old','_override','_tar','_tindex','_type','_vehicle','_z']; +_vehicle = _this select 0; +_index = _this select 1; +_tindex = _index; +_override = if (count _this > 2) then {_this select 2} else {false}; + +if (typeName _vehicle != 'OBJECT') exitWith {diag_log Format['[WFBE (ERROR)][frameno:%2 | ticktime:%3] EASA_Equip: Invalid Parameter (_vehicle), expected object instead of %1',_vehicle,diag_frameno,diag_tickTime]}; + +_type = ('WFBE_EASA_Vehicles' Call GetNamespace) find (typeOf _vehicle); +if (_type != -1) then { + _get = _vehicle getVariable 'WFBE_EASA_Setup'; + //--- Vehicle Loadout check. + if (isNil '_get') then { + [_vehicle,('WFBE_EASA_Default' Call GetNamespace) select _type] Call EASA_RemoveLoadout; + } else { + //--- Override the index?. + _tindex = if (_override) then {_index} else {(_get select 1)}; + + //--- Grab the old loadout. + _old = (('WFBE_EASA_Loadouts' Call GetNamespace) select (_get select 0)) select (_get select 1); + _tar = []; + for [{_i = 2},{_i < count(_old)},{_i = _i + 1}] do { + _tar = _tar + [_old select _i]; + }; + _old = _tar; + + [_vehicle,('WFBE_EASA_Default' Call GetNamespace) select _type] Call EASA_RemoveLoadout; + [_vehicle,_old] Call EASA_RemoveLoadout; + }; + + _data = (('WFBE_EASA_Loadouts' Call GetNamespace) select _type) select _tindex; + + for [{_j = 2},{_j < count(_data)},{_j = _j + 1}] do { + _z = _data select _j; + for [{_i = count(_z)-1},{_i >= 0},{_i = _i - 1}] do { + if (_i > 0) then { + _vehicle addMagazine (_z select _i); + } else { + _vehicle addWeapon (_z select _i); + }; + }; + }; + + _vehicle setVariable ['WFBE_EASA_Setup',[_type,_tindex],true]; +}; \ No newline at end of file diff --git a/Client/Module/EASA/EASA_Init.sqf b/Client/Module/EASA/EASA_Init.sqf new file mode 100644 index 0000000..8e35a00 --- /dev/null +++ b/Client/Module/EASA/EASA_Init.sqf @@ -0,0 +1,378 @@ +Private ['_easaDefault','_easaLoadout','_easaVehi','_vehicle']; + +EASA_Equip = Compile preProcessFile 'Client\Module\EASA\EASA_Equip.sqf'; +EASA_RemoveLoadout = Compile preProcessFile 'Client\Module\EASA\EASA_RemoveLoadout.sqf'; + +_easaDefault = []; +_easaLoadout = []; +_easaVehi = []; + +/* [[Price], [Description], [Weapon, Ammos], [Weapon, Ammos]...] */ +_easaVehi = _easaVehi + ['Su25_TK_EP1']; +_easaDefault = _easaDefault + [[['AirBombLauncher','4Rnd_FAB_250'],['R73Launcher_2','2Rnd_R73']]]; +_easaLoadout = _easaLoadout + [ +if (WF_A2_Arrowhead) then { + [ + [[1200],['R-73 (6)'],['R73Launcher_2','2Rnd_R73','2Rnd_R73','2Rnd_R73']], + [[1400],['R-73 (4) | FAB-250 (2)'],['R73Launcher_2','2Rnd_R73','2Rnd_R73'],['AirBombLauncher','2Rnd_FAB_250']], + [[1600],['R-73 (2) | FAB-250 (4)'],['R73Launcher_2','2Rnd_R73'],['AirBombLauncher','4Rnd_FAB_250']], + [[1900],['FAB-250 (6)'],['AirBombLauncher','4Rnd_FAB_250','2Rnd_FAB_250']] + ] +} else { + [ + [[0],['KAB-500 KR (6)'],['ACE_KAB500KRLauncher','ACE_6Rnd_KAB500KR']], + [[0],['Kh-29 (6)'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['Kh-29 (4) | KAB-500 L (2)'],['Ch29Launcher_Su34','4Rnd_Ch29'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['Kh-29 (4) | R-73 (2)'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_2Rnd_R73']], + [[0],['R-73 (6)'],['ACE_R73Launcher','ACE_6Rnd_R73']], + [[0],['R-73 (4) | KAB-500 KR (2)'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR']], + [[0],['KAB-500 KR (4) | Kh-29 (2)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_Kh29Launcher','ACE_2Rnd_Kh29']], + [[0],['FAB-500 (4) | Kh-29 (2)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_2Rnd_Kh29']], + [[0],['FAB-500 (4) | R-73 (2)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_R73Launcher','ACE_2Rnd_R73']], + [[0],['FAB-500 (6)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62']], + [[0],['R-73 (2) | FAB-250 (4)'],['ACE_R73Launcher','ACE_2Rnd_R73'],['AirBombLauncher','4Rnd_FAB_250']], + [[0],['R-73 (2) | KAB-500 KR (4)'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR']] + ] +} +]; + +_easaVehi = _easaVehi + ['Su25_Ins']; +_easaDefault = _easaDefault + [[['AirBombLauncher','4Rnd_FAB_250'],['R73Launcher_2','2Rnd_R73']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['KAB-500 KR (6)'],['ACE_KAB500KRLauncher','ACE_6Rnd_KAB500KR']], + [[0],['Kh-29 (6)'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['Kh-29 (4) | KAB-500 L (2)'],['Ch29Launcher_Su34','4Rnd_Ch29'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['Kh-29 (4) | R-73 (2)'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_2Rnd_R73']], + [[0],['R-73 (6)'],['ACE_R73Launcher','ACE_6Rnd_R73']], + [[0],['R-73 (4) | KAB-500 KR (2)'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR']], + [[0],['KAB-500 KR (4) | Kh-29 (2)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_Kh29Launcher','ACE_2Rnd_Kh29']], + [[0],['FAB-500 (4) | Kh-29 (2)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_2Rnd_Kh29']], + [[0],['FAB-500 (4) | R-73 (2)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_R73Launcher','ACE_2Rnd_R73']], + [[0],['FAB-500 (6)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62']], + [[0],['R-73 (2) | FAB-250 (4)'],['ACE_R73Launcher','ACE_2Rnd_R73'],['AirBombLauncher','4Rnd_FAB_250']], + [[0],['R-73 (2) | KAB-500 KR (4)'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR']] + ] +]; + +_easaVehi = _easaVehi + ['Su39']; +_easaDefault = _easaDefault + [[['Ch29Launcher','4Rnd_Ch29'],['R73Launcher_2','2Rnd_R73']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['KAB-500 KR (6)'],['ACE_KAB500KRLauncher','ACE_6Rnd_KAB500KR']], + [[0],['Kh-29 (6)'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['Kh-29 (4) | KAB-500 L (2)'],['Ch29Launcher_Su34','4Rnd_Ch29'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['Kh-29 (4) | R-73 (2)'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_2Rnd_R73']], + [[0],['R-73 (6)'],['ACE_R73Launcher','ACE_6Rnd_R73']], + [[0],['R-73 (4) | KAB-500 KR (2)'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR']], + [[0],['KAB-500 KR (4) | Kh-29 (2)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_Kh29Launcher','ACE_2Rnd_Kh29']], + [[0],['FAB-500 (4) | Kh-29 (2)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_2Rnd_Kh29']], + [[0],['FAB-500 (4) | R-73 (2)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_R73Launcher','ACE_2Rnd_R73']], + [[0],['FAB-500 (6)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62']], + [[0],['R-73 (2) | FAB-250 (4)'],['ACE_R73Launcher','ACE_2Rnd_R73'],['AirBombLauncher','4Rnd_FAB_250']], + [[0],['R-73 (2) | KAB-500 KR (4)'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR']] + ] +]; + + +_easaVehi = _easaVehi + ['Su34']; +_easaDefault = _easaDefault + [[['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['KAB-500 KR (6) | KAB-500 L (6)'],['ACE_KAB500KRLauncher','ACE_6Rnd_KAB500KR'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['KAB-500 L (6) | R-73 (4) | R-27 (2)'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27']], + [[0],['KAB-500 L (6) | KAB-500 KR (4) | R-73 (2)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['KAB-500 L (6) | Kh-29 (4) | R-73 (2)'],['ACE_KAB500KRLauncher','ACE_6Rnd_KAB500KR'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_2Rnd_R73']], + [[0],['KAB-500 KR (4) | Kh-29 (4) | R-73 (4)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_4Rnd_R73']], + [[0],['KAB-500 KR (4) | R-73 (6)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['R73Launcher_2','2Rnd_R73'],['R73Launcher','4Rnd_R73']], + [[0],['KAB-500 KR (4) | Kh-29 (6)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['KAB-500 KR (2) | R-73 (8)'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR'],['R73Launcher','4Rnd_R73','4Rnd_R73']], + [[0],['KAB-500 KR (2) | R-73 (4) | Ch-29 (6)'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['KAB-500 KR (4) | R-73 (2) | Ch-29 (6)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['R-73 (8) | R-27 (4)'],['ACE_R73Launcher','ACE_6Rnd_R73','ACE_2Rnd_R73'],['ACE_R27Launcher','ACE_4Rnd_R27']], + [[0],['R-73 (6) | R-27 (6)'],['ACE_R73Launcher','ACE_6Rnd_R73'],['ACE_R27Launcher','ACE_6Rnd_R27']], + [[0],['Kh-29 (6) | R-73 (4) |KAB-500 KR (2)'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR']], + [[0],['Kh-29 (6) | R-73 (4) | R-27(2)'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['Kh-29 (12)'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29','ACE_6Rnd_Kh29']], + [[0],['R-27 (2) | R-73 (4) | KAB-500 KR (2) | KAB-500 L (2) | FAB-500 (2)'],['ACE_R27Launcher','ACE_2Rnd_R27'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_FAB500M62Launcher','ACE_2Rnd_FAB500M62'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR'],['ACE_KAB500LLauncher','ACE_2Rnd_KAB500L']], + [[0],['FAB-500 (6) | KAB-500 L (6)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['FAB-500 (6) | R-73 (4) | R-27 (2)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27']], + [[0],['FAB-500 (6) | KAB-500 KR (4) | R-73 (2)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR']], + [[0],['FAB-500 (6) | Kh-29 (4) | R-73 (2)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_2Rnd_R73']], + [[0],['FAB-500 (4) | Kh-29 (4) | R-73 (4)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_4Rnd_R73']], + [[0],['FAB-500 (4) | R-73 (6)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['R73Launcher_2','2Rnd_R73'],['R73Launcher','4Rnd_R73']], + [[0],['FAB-500 (4) | Kh-29 (6)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']] + ] +]; + +_easaVehi = _easaVehi + ['ACE_Su30']; +_easaDefault = _easaDefault + [[['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['KAB-500 KR (6) | KAB-500 L (6)'],['ACE_KAB500KRLauncher','ACE_6Rnd_KAB500KR'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['KAB-500 L (6) | R-73 (4) | R-27 (2)'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27']], + [[0],['KAB-500 L (6) | KAB-500 KR (4) | R-73 (2)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['KAB-500 L (6) | Kh-29 (4) | R-73 (2)'],['ACE_KAB500KRLauncher','ACE_6Rnd_KAB500KR'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_2Rnd_R73']], + [[0],['KAB-500 KR (4) | Kh-29 (4) | R-73 (4)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_4Rnd_R73']], + [[0],['KAB-500 KR (4) | R-73 (6)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['R73Launcher_2','2Rnd_R73'],['R73Launcher','4Rnd_R73']], + [[0],['KAB-500 KR (4) | Kh-29 (6)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['KAB-500 KR (2) | R-73 (8)'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR'],['R73Launcher','4Rnd_R73','4Rnd_R73']], + [[0],['KAB-500 KR (2) | R-73 (4) | Ch-29 (6)'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['KAB-500 KR (4) | R-73 (2) | Ch-29 (6)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['R-73 (8) | R-27 (4)'],['ACE_R73Launcher','ACE_6Rnd_R73','ACE_2Rnd_R73'],['ACE_R27Launcher','ACE_4Rnd_R27']], + [[0],['R-73 (6) | R-27 (6)'],['ACE_R73Launcher','ACE_6Rnd_R73'],['ACE_R27Launcher','ACE_6Rnd_R27']], + [[0],['Kh-29 (6) | R-73 (4) |KAB-500 KR (2)'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR']], + [[0],['Kh-29 (6) | R-73 (4) | R-27(2)'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['Kh-29 (12)'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29','ACE_6Rnd_Kh29']], + [[0],['R-27 (2) | R-73 (4) | KAB-500 KR (2) | KAB-500 L (2) | FAB-500 (2)'],['ACE_R27Launcher','ACE_2Rnd_R27'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_FAB500M62Launcher','ACE_2Rnd_FAB500M62'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR'],['ACE_KAB500LLauncher','ACE_2Rnd_KAB500L']], + [[0],['FAB-500 (6) | KAB-500 L (6)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['FAB-500 (6) | R-73 (4) | R-27 (2)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27']], + [[0],['FAB-500 (6) | KAB-500 KR (4) | R-73 (2)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR']], + [[0],['FAB-500 (6) | Kh-29 (4) | R-73 (2)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_2Rnd_R73']], + [[0],['FAB-500 (4) | Kh-29 (4) | R-73 (4)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_4Rnd_R73']], + [[0],['FAB-500 (4) | R-73 (6)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['R73Launcher_2','2Rnd_R73'],['R73Launcher','4Rnd_R73']], + [[0],['FAB-500 (4) | Kh-29 (6)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']] + ] +]; + +_easaVehi = _easaVehi + ['ACE_Su30_des']; +_easaDefault = _easaDefault + [[['ACE_R27Launcher','ACE_2Rnd_R27'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_FAB500M62Launcher','ACE_2Rnd_FAB500M62'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR'],['ACE_KAB500LLauncher','ACE_2Rnd_KAB500L']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['KAB-500 KR (6) | KAB-500 L (6)'],['ACE_KAB500KRLauncher','ACE_6Rnd_KAB500KR'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['KAB-500 L (6) | R-73 (4) | R-27 (2)'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27']], + [[0],['KAB-500 L (6) | KAB-500 KR (4) | R-73 (2)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['KAB-500 L (6) | Kh-29 (4) | R-73 (2)'],['ACE_KAB500KRLauncher','ACE_6Rnd_KAB500KR'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_2Rnd_R73']], + [[0],['KAB-500 KR (4) | Kh-29 (4) | R-73 (4)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_4Rnd_R73']], + [[0],['KAB-500 KR (4) | R-73 (6)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['R73Launcher_2','2Rnd_R73'],['R73Launcher','4Rnd_R73']], + [[0],['KAB-500 KR (4) | Kh-29 (6)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['KAB-500 KR (2) | R-73 (8)'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR'],['R73Launcher','4Rnd_R73','4Rnd_R73']], + [[0],['KAB-500 KR (2) | R-73 (4) | Ch-29 (6)'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['KAB-500 KR (4) | R-73 (2) | Ch-29 (6)'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['R-73 (8) | R-27 (4)'],['ACE_R73Launcher','ACE_6Rnd_R73','ACE_2Rnd_R73'],['ACE_R27Launcher','ACE_4Rnd_R27']], + [[0],['R-73 (6) | R-27 (6)'],['ACE_R73Launcher','ACE_6Rnd_R73'],['ACE_R27Launcher','ACE_6Rnd_R27']], + [[0],['Kh-29 (6) | R-73 (4) |KAB-500 KR (2)'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR']], + [[0],['Kh-29 (6) | R-73 (4) | R-27(2)'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['Kh-29 (12)'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29','ACE_6Rnd_Kh29']], + [[0],['R-27 (2) | R-73 (4) | KAB-500 KR (2) | KAB-500 L (2) | FAB-500 (2)'],['ACE_R27Launcher','ACE_2Rnd_R27'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_FAB500M62Launcher','ACE_2Rnd_FAB500M62'],['ACE_KAB500KRLauncher','ACE_2Rnd_KAB500KR'],['ACE_KAB500LLauncher','ACE_2Rnd_KAB500L']], + [[0],['FAB-500 (6) | KAB-500 L (6)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['FAB-500 (6) | R-73 (4) | R-27 (2)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27']], + [[0],['FAB-500 (6) | KAB-500 KR (4) | R-73 (2)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62'],['ACE_R73Launcher','ACE_2Rnd_R73'],['ACE_KAB500KRLauncher','ACE_4Rnd_KAB500KR']], + [[0],['FAB-500 (6) | Kh-29 (4) | R-73 (2)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_2Rnd_R73']], + [[0],['FAB-500 (4) | Kh-29 (4) | R-73 (4)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29'],['ACE_R73Launcher','ACE_4Rnd_R73']], + [[0],['FAB-500 (4) | R-73 (6)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['R73Launcher_2','2Rnd_R73'],['R73Launcher','4Rnd_R73']], + [[0],['FAB-500 (4) | Kh-29 (6)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']] + ] +]; + + + +_easaVehi = _easaVehi + ['ACE_Su27_CAS']; +_easaDefault = _easaDefault + [[['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['KAB-500 L (6)'],['ACE_KAB500LLauncher','ACE_6Rnd_KAB500L']], + [[0],['KAB-500 L (2) | R-73 (4)'],['ACE_KAB500LLauncher','ACE_2Rnd_KAB500L'],['ACE_R73Launcher','ACE_4Rnd_R73']], + [[0],['KAB-500 L (4) | Kh-29 (2)'],['ACE_KAB500LLauncher','ACE_4Rnd_KAB500L'],['ACE_Kh29Launcher','ACE_2Rnd_Kh29']], + [[0],['R-73 (6)'],['ACE_R73Launcher','ACE_6Rnd_R73']], + [[0],['R-73 (4) | R-27 (2)'],['ACE_R73Launcher','ACE_4Rnd_R73'],['ACE_R27Launcher','ACE_2Rnd_R27']], + [[0],['Kh-29 (6)'],['ACE_Kh29Launcher','ACE_6Rnd_Kh29']], + [[0],['Kh-29 (4) | R-27(2)'],['ACE_R27Launcher','ACE_2Rnd_R27'],['ACE_Kh29Launcher','ACE_4Rnd_Kh29']], + [[0],['Kh-29 (2)| R-73 (4)'],['ACE_Kh29Launcher','ACE_2Rnd_Kh29'],['ACE_R73Launcher','ACE_4Rnd_R73']], + [[0],['FAB-500 (6)'],['ACE_FAB500M62Launcher','ACE_6Rnd_FAB500M62']], + [[0],['FAB-500 (4) | Kh-29 (2)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_Kh29Launcher','ACE_2Rnd_Kh29']], + [[0],['FAB-500 (4) | R-73 (2)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['R73Launcher_2','2Rnd_R73']], + [[0],['FAB-500 (4) | R-27 (2)'],['ACE_FAB500M62Launcher','ACE_4Rnd_FAB500M62'],['ACE_R27Launcher','ACE_2Rnd_R27']] + ] +]; + + +_easaVehi = _easaVehi + ['Mi24_P']; +_easaDefault = _easaDefault + [[['HeliBombLauncher','2Rnd_FAB_250']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['FAB-250 (2)'],['HeliBombLauncher','2Rnd_FAB_250']], + [[0],['R-73 (2)'],['R73Launcher_2','2Rnd_R73']] + ] +]; + +_easaVehi = _easaVehi + ['Ka52']; +_easaDefault = _easaDefault + [[['VikhrLauncher','12Rnd_Vikhr_KA50']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['Vikhr (12)'],['VikhrLauncher','12Rnd_Vikhr_KA50']], + [[0],['R-73 (12)'],['ACE_R73Launcher','ACE_6Rnd_R73','ACE_6Rnd_R73']] + ] +]; + +_easaVehi = _easaVehi + ['Ka52Black']; +_easaDefault = _easaDefault + [[['VikhrLauncher','12Rnd_Vikhr_KA50']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['Vikhr (12)'],['VikhrLauncher','12Rnd_Vikhr_KA50']], + [[0],['R-73 (12)'],['ACE_R73Launcher','ACE_6Rnd_R73','ACE_6Rnd_R73']] + ] +]; + +_easaVehi = _easaVehi + ['F35B']; +_easaDefault = _easaDefault + [[['BombLauncherF35','2Rnd_GBU12'],['SidewinderLaucher_F35','2Rnd_Sidewinder_F35']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['GBU-12 (4)'],['BombLauncherA10','4Rnd_GBU12']], + [[0],['GBU-12 (2) | AIM-9L (2)'],['BombLauncherF35','2Rnd_GBU12'],['SidewinderLaucher_F35','2Rnd_Sidewinder_F35']], + [[0],['GBU-12 (2) | AGM-65 (2)'],['BombLauncherF35','2Rnd_GBU12'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['AGM-65 (4)'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['AIM-9L (4)'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B']] + ] +]; + +_easaVehi = _easaVehi + ['AV8B']; +_easaDefault = _easaDefault + [[['BombLauncher','6Rnd_GBU12_AV8B']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['Mk82 (6)'],['Mk82BombLauncher_6','6Rnd_Mk82']], + [[0],['GBU-12 (6)'],['BombLauncher','6Rnd_GBU12_AV8B']], + [[0],['GBU-12 (4) | AIM-9L (2)'],['BombLauncherA10','4Rnd_GBU12'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['GBU-12 (4) | AGM-65 (2)'],['BombLauncherA10','4Rnd_GBU12'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['GBU-12 (2) | AIM-9L (4)'],['ACE_BombLauncher','ACE_1Rnd_GBU12','ACE_1Rnd_GBU12'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B']], + [[0],['GBU-12 (2) | AIM-9L (2) | AGM-65 (2)'],['ACE_BombLauncher','ACE_1Rnd_GBU12','ACE_1Rnd_GBU12'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['CBU-87 (6)'],['ACE_CBU87_Bomblauncher','ACE_6Rnd_CBU87']], + [[0],['CBU-87 (4) | AIM-9L (2)'],['ACE_CBU87_Bomblauncher','ACE_4Rnd_CBU87'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['CBU-87 (4) | AGM-65 (2)'],['ACE_CBU87_Bomblauncher','ACE_4Rnd_CBU87'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['CBU-87 (2) | AIM-9L (4)'],['ACE_CBU87_Bomblauncher','ACE_2Rnd_CBU87'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B']], + [[0],['CBU-87 (2) | AIM-9L (2) | AGM-65 (2)'],['ACE_CBU87_Bomblauncher','ACE_2Rnd_CBU87'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['AIM-9L (6)'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['AGM-65 (6)'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10']] + ] +]; + +_easaVehi = _easaVehi + ['AV8B2']; +_easaDefault = _easaDefault + [[['Mk82BombLauncher_6','6Rnd_Mk82'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['GBU-12 (8)'],['BombLauncherA10','4Rnd_GBU12','4Rnd_GBU12']], + [[0],['GBU-12 (6) | AGM-65 (2)'],['BombLauncher','6Rnd_GBU12_AV8B'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['GBU-12 (6) | AIM-9L (2)'],['BombLauncher','6Rnd_GBU12_AV8B'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['GBU-12 (4) | AGM-65 (4)'],['BombLauncherA10','4Rnd_GBU12'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['GBU-12 (4) | AIM-9L (4)'],['BombLauncherA10','4Rnd_GBU12'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B']], + [[0],['GBU-12 (4) | AIM-9L (2) | AGM-65 (2)'],['BombLauncherA10','4Rnd_GBU12'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['GBU-12 (2) | AIM-9L (4) | AGM-65 (2)'],['ACE_BombLauncher','ACE_1Rnd_GBU12','ACE_1Rnd_GBU12'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['GBU-12 (2) | AIM-9L (2) | AGM-65 (4)'],['ACE_BombLauncher','ACE_1Rnd_GBU12','ACE_1Rnd_GBU12'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['GBU-12 (2) | AIM-9L (6)'],['ACE_BombLauncher','ACE_1Rnd_GBU12','ACE_1Rnd_GBU12'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['GBU-12 (2) | AGM-65 (6)'],['ACE_BombLauncher','ACE_1Rnd_GBU12','ACE_1Rnd_GBU12'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['Mk82 (6) | AIM-9L (2)'],['Mk82BombLauncher_6','6Rnd_Mk82'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['Mk82 (6) | AGM-65 (2)'],['Mk82BombLauncher_6','6Rnd_Mk82'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['Mk82 (6) | GBU-12 (2)'],['Mk82BombLauncher_6','6Rnd_Mk82'],['ACE_BombLauncher','ACE_1Rnd_GBU12','ACE_1Rnd_GBU12']], + [[0],['AGM-65 (8)'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['AGM-65 (4) | AIM-9L (4)'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B']], + [[0],['AGM-65 (6) | AIM-9L (2)'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['CBU-87 (8)'],['ACE_CBU87_Bomblauncher','ACE_8Rnd_CBU87']], + [[0],['CBU-87 (6) | AGM-65 (2)'],['ACE_CBU87_Bomblauncher','ACE_6Rnd_CBU87'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['CBU-87 (6) | AIM-9L (2)'],['ACE_CBU87_Bomblauncher','ACE_6Rnd_CBU87'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['CBU-87 (4) | AGM-65 (4)'],['ACE_CBU87_Bomblauncher','ACE_4Rnd_CBU87'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['CBU-87 (4) | AIM-9L (4)'],['ACE_CBU87_Bomblauncher','ACE_4Rnd_CBU87'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B']], + [[0],['CBU-87 (4) | AIM-9L (2) | AGM-65 (2)'],['ACE_CBU87_Bomblauncher','ACE_4Rnd_CBU87'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['CBU-87 (2) | AIM-9L (4) | AGM-65 (2)'],['ACE_CBU87_Bomblauncher','ACE_2Rnd_CBU87'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['CBU-87 (2) | AIM-9L (2) | AGM-65 (4)'],['ACE_CBU87_Bomblauncher','ACE_2Rnd_CBU87'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['CBU-87 (2) | AIM-9L (6)'],['ACE_CBU87_Bomblauncher','ACE_2Rnd_CBU87'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['CBU-87 (2) | AGM-65 (6)'],['ACE_CBU87_Bomblauncher','ACE_2Rnd_CBU87'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['AIM-9L (8)'],['SidewinderLaucher_AH64','8Rnd_Sidewinder_AH64']], + [[0],['AIM-9L (6) | AGM-65 (2)'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10']] + ] +]; + +_easaVehi = _easaVehi + ['ACE_A10_CBU87']; +_easaDefault = _easaDefault + [[['ACE_CBU87_Bomblauncher','ACE_4Rnd_CBU87'],['MaverickLauncher','2Rnd_Maverick_A10'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']]]; +_easaLoadout = _easaLoadout + [ +if (WF_A2_Arrowhead) then { + [ + [[0],['GBU-12 (8)'],['BombLauncherA10','4Rnd_GBU12','4Rnd_GBU12']], + [[0],['GBU-12 (4) | AGM-65 (4)'],['BombLauncherA10','4Rnd_GBU12'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['GBU-12 (4) | AIM-9L (4)'],['BombLauncherA10','4Rnd_GBU12'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['GBU-12 (4) | AIM-9L (2) | AGM-65 (2)'],['BombLauncherA10','4Rnd_GBU12'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['AGM-65 (8)'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['AGM-65 (4) | AIM-9L (4)'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['AGM-65 (6) | AIM-9L (2)'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['AGM-114 (8)'],['HellfireLauncher','8Rnd_Hellfire']], + [[0],['AIM-9L (8)'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z','2Rnd_Sidewinder_AH1Z','2Rnd_Sidewinder_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['AIM-9L (6) | AGM-65 (2)'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z','2Rnd_Sidewinder_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10']] + ] +} else { + [ + [[0],['GBU-12 (8)'],['BombLauncherA10','4Rnd_GBU12','4Rnd_GBU12']], + [[0],['GBU-12 (6) | AGM-65 (2)'],['BombLauncher','6Rnd_GBU12_AV8B'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['GBU-12 (6) | AIM-9L (2)'],['BombLauncher','6Rnd_GBU12_AV8B'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['GBU-12 (4) | AGM-65 (4)'],['BombLauncherA10','4Rnd_GBU12'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['GBU-12 (4) | AIM-9L (4)'],['BombLauncherA10','4Rnd_GBU12'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B']], + [[0],['GBU-12 (4) | AIM-9L (2) | AGM-65 (2)'],['BombLauncherA10','4Rnd_GBU12'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['GBU-12 (2) | AIM-9L (4) | AGM-65 (2)'],['ACE_BombLauncher','ACE_1Rnd_GBU12','ACE_1Rnd_GBU12'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['GBU-12 (2) | AIM-9L (2) | AGM-65 (4)'],['ACE_BombLauncher','ACE_1Rnd_GBU12','ACE_1Rnd_GBU12'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['GBU-12 (2) | AIM-9L (6)'],['ACE_BombLauncher','ACE_1Rnd_GBU12','ACE_1Rnd_GBU12'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['GBU-12 (2) | AGM-65 (6)'],['ACE_BombLauncher','ACE_1Rnd_GBU12','ACE_1Rnd_GBU12'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['Mk82 (6) | AIM-9L (2)'],['Mk82BombLauncher_6','6Rnd_Mk82'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['Mk82 (6) | AGM-65 (2)'],['Mk82BombLauncher_6','6Rnd_Mk82'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['Mk82 (6) | GBU-12 (2)'],['Mk82BombLauncher_6','6Rnd_Mk82'],['ACE_BombLauncher','ACE_1Rnd_GBU12','ACE_1Rnd_GBU12']], + [[0],['AGM-65 (8)'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['AGM-65 (4) | AIM-9L (4)'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B']], + [[0],['AGM-65 (6) | AIM-9L (2)'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['CBU-87 (4) | AIM-9L (2) | AGM-65 (2)'],['ACE_CBU87_Bomblauncher','ACE_4Rnd_CBU87'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['CBU-87 (8)'],['ACE_CBU87_Bomblauncher','ACE_8Rnd_CBU87']], + [[0],['CBU-87 (6) | AGM-65 (2)'],['ACE_CBU87_Bomblauncher','ACE_6Rnd_CBU87'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['CBU-87 (6) | AIM-9L (2)'],['ACE_CBU87_Bomblauncher','ACE_6Rnd_CBU87'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['CBU-87 (4) | AGM-65 (4)'],['ACE_CBU87_Bomblauncher','ACE_4Rnd_CBU87'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['CBU-87 (4) | AIM-9L (4)'],['ACE_CBU87_Bomblauncher','ACE_4Rnd_CBU87'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B']], + [[0],['CBU-87 (2) | AIM-9L (4) | AGM-65 (2)'],['ACE_CBU87_Bomblauncher','ACE_2Rnd_CBU87'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B'],['MaverickLauncher','2Rnd_Maverick_A10']], + [[0],['CBU-87 (2) | AIM-9L (2) | AGM-65 (4)'],['ACE_CBU87_Bomblauncher','ACE_2Rnd_CBU87'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['CBU-87 (2) | AIM-9L (6)'],['ACE_CBU87_Bomblauncher','ACE_2Rnd_CBU87'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z']], + [[0],['CBU-87 (2) | AGM-65 (6)'],['ACE_CBU87_Bomblauncher','ACE_2Rnd_CBU87'],['MaverickLauncher','2Rnd_Maverick_A10','2Rnd_Maverick_A10','2Rnd_Maverick_A10']], + [[0],['AIM-9L (8)'],['SidewinderLaucher_AH64','8Rnd_Sidewinder_AH64']], + [[0],['AIM-9L (6) | AGM-65 (2)'],['SidewinderLaucher','4Rnd_Sidewinder_AV8B'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z'],['MaverickLauncher','2Rnd_Maverick_A10']] + ] +} +]; + +_easaVehi = _easaVehi + ['AH64D_EP1']; +_easaDefault = _easaDefault + [[['HellfireLauncher','ACE_4Rnd_Hellfire'],['ACE_HellfireLauncher_Apache','ACE_4Rnd_Hellfire_L']]]; +_easaLoadout = _easaLoadout + [ +if (WF_A2_Arrowhead) then { + [ + [[0],['AGM-114 (8)'],['HellfireLauncher','8Rnd_Hellfire']], + [[0],['AIM-9L (8)'],['SidewinderLaucher_AH1Z','2Rnd_Sidewinder_AH1Z','2Rnd_Sidewinder_AH1Z','2Rnd_Sidewinder_AH1Z','2Rnd_Sidewinder_AH1Z']] + ] +} else { + [ + [[0],['AGM-114K (8)'],['ACE_HellfireLauncher','8Rnd_Hellfire']], + [[0],['AGM-114L (8)'],['ACE_HellfireLauncher_Apache','ACE_8Rnd_Hellfire_L']], + [[0],['AGM-114K (4) | AGM-114L (4)'],['HellfireLauncher','ACE_4Rnd_Hellfire'],['ACE_HellfireLauncher_Apache','ACE_4Rnd_Hellfire_L']], + [[0],['AIM-9L (8)'],['SidewinderLaucher_AH64','8Rnd_Sidewinder_AH64']] + ] +} +]; + +_easaVehi = _easaVehi + ['AH1Z']; +_easaDefault = _easaDefault + [[['ACE_HellfireLauncher','8Rnd_Hellfire']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['AGM-114K (8)'],['ACE_HellfireLauncher','8Rnd_Hellfire']], + [[0],['AGM-114L (8)'],['ACE_HellfireLauncher_Apache','ACE_8Rnd_Hellfire_L']], + [[0],['AGM-114K (4) | AGM-114L (4)'],['HellfireLauncher','ACE_4Rnd_Hellfire'],['ACE_HellfireLauncher_Apache','ACE_4Rnd_Hellfire_L']], + [[0],['AIM-9L (8)'],['SidewinderLaucher_AH64','8Rnd_Sidewinder_AH64']] + ] +]; + +_easaVehi = _easaVehi + ['ACE_AH1Z_AGM_AGM_W']; +_easaDefault = _easaDefault + [[['ACE_HellfireLauncher','ACE_16Rnd_Hellfire']]]; +_easaLoadout = _easaLoadout + [ + [ + [[0],['AGM-114K (16)'],['ACE_HellfireLauncher','ACE_16Rnd_Hellfire']], + [[0],['AGM-114L (16)'],['ACE_HellfireLauncher_Apache','ACE_16Rnd_Hellfire_L']], + [[0],['AGM-114K (8) | AGM-114L (8)'],['HellfireLauncher','ACE_8Rnd_Hellfire'],['ACE_HellfireLauncher_Apache','ACE_8Rnd_Hellfire_L']], + [[0],['AIM-9L (8) | AGM-114K (8)'],['SidewinderLaucher_AH64','8Rnd_Sidewinder_AH64'],['ACE_HellfireLauncher','ACE_8Rnd_Hellfire']], + [[0],['AIM-9L (8) | AGM-114L (8)'],['SidewinderLaucher_AH64','8Rnd_Sidewinder_AH64'],['ACE_HellfireLauncher_Apache','ACE_8Rnd_Hellfire_L']], + [[0],['AIM-9L (16)'],['SidewinderLaucher_AH64','8Rnd_Sidewinder_AH64','8Rnd_Sidewinder_AH64']] + ] +]; + +['WFBE_EASA_Vehicles',_easaVehi,true] Call SetNamespace; +['WFBE_EASA_Loadouts',_easaLoadout,true] Call SetNamespace; +['WFBE_EASA_Default',_easaDefault,true] Call SetNamespace; \ No newline at end of file diff --git a/Client/Module/EASA/EASA_RemoveLoadout.sqf b/Client/Module/EASA/EASA_RemoveLoadout.sqf new file mode 100644 index 0000000..53b37da --- /dev/null +++ b/Client/Module/EASA/EASA_RemoveLoadout.sqf @@ -0,0 +1,13 @@ +Private ['_i','_loadout','_vehicle']; +_vehicle = _this select 0; +_loadout = _this select 1; + +{ + for [{_i = count(_x)-1},{_i >= 0},{_i = _i - 1}] do { + if (_i > 0) then { + _vehicle removeMagazine (_x select _i); + } else { + _vehicle removeWeapon (_x select _i); + }; + }; +} forEach _loadout; \ No newline at end of file diff --git a/Client/Module/ISIS/ISIS_Action.sqf b/Client/Module/ISIS/ISIS_Action.sqf new file mode 100644 index 0000000..6d40ba5 --- /dev/null +++ b/Client/Module/ISIS/ISIS_Action.sqf @@ -0,0 +1 @@ +_this Spawn ISIS_Heal; \ No newline at end of file diff --git a/Client/Module/ISIS/ISIS_Clientfx.sqf b/Client/Module/ISIS/ISIS_Clientfx.sqf new file mode 100644 index 0000000..496747d --- /dev/null +++ b/Client/Module/ISIS/ISIS_Clientfx.sqf @@ -0,0 +1,63 @@ +Private ["_camera","_nu","_ran","_stunned","_unit"]; + +_unit = _this select 0; + +titleCut["","BLACK FADED",0]; +titleCut["","BLACK IN",2]; + +"dynamicBlur" ppEffectEnable true; +"dynamicBlur" ppEffectAdjust [1]; +"dynamicBlur" ppEffectCommit 0.1; + +"colorCorrections" ppEffectCommit 0.1; +"colorCorrections" ppEffectEnable true; +"colorCorrections" ppEffectAdjust [1, 1, 0, [0.1, 0.0, 0.0, 0.5], [0, 0.5, 0.5, 0.5], [0.199, 0.187, 0.114, 0.0]]; +"colorCorrections" ppEffectCommit 0.3; + +_camera = "camera" camCreate (getPos player); + +showCinemaBorder true; + +_camera camSetDir 0; +_camera camSetFov 0.200; +_camera cameraEffect["Internal","back"]; +_camera camSetTarget player; +_camera camSetRelPos [2,2,3]; +_camera camCommit 0; + +_nu = [_camera] Spawn { + private ["_camera","_rx","_ry","_rz","_shout","_shoutTrsl","_ran"]; + _camera = _this select 0; + _shout = ["ImHitE","ImBleedingE","SomebodyHelpMeE","GetMeACorpsmanNowE","CorpsmanE","TheyGotMeE","NeedHelpE","WoundedE"]; + _shoutTrsl = ["I'm hit!","I'm bleeding!","Somebody help me!","Get me a corpsman now!","Corpsman!","They got me!","Need help!","Wounded!"]; + while {true} do { + _rx = 1 + random 7; + _ry = 1 + random 7; + _rz = 1 + random 7; + + _camera camSetRelPos [_rx,_ry,_rz]; + _camera camCommit 10; + waitUntil{camCommitted _camera}; + if (random 100 < 20) then { + _ran = round(random((count _shout)-1)); + player kbTell [sideHQ, WFBE_V_HQTopicSide, "simple",["1","",(_shoutTrsl select _ran),[(_shout select _ran)]],true]; + }; + }; +}; + +while {true} do { + sleep 1; + _stunned = _unit getVariable "stunned"; + if (isNil '_stunned') exitWith {}; + if (!alive _unit || !(_unit getVariable "stunned")) exitWith {}; +}; + +terminate _nu; +showCinemaBorder false; + +if (!playerDead) then { + "dynamicBlur" ppEffectEnable false; + "colorCorrections" ppEffectEnable false; + _camera cameraEffect["TERMINATE","BACK"]; + camDestroy _camera; +}; \ No newline at end of file diff --git a/Client/Module/ISIS/ISIS_Heal.sqf b/Client/Module/ISIS/ISIS_Heal.sqf new file mode 100644 index 0000000..79d447c --- /dev/null +++ b/Client/Module/ISIS/ISIS_Heal.sqf @@ -0,0 +1,76 @@ +Private ['_anim','_anims','_canBePlaceAt','_dy','_dx','_fPos','_healer','_healTime','_injured','_near','_nearA','_nearB','_placeAtA','_posA','_posB','_posh','_posi','_relPosA','_relPosB','_success']; + +_injured = _this select 0; +_healer = _this select 1; + +_posA = [0.75,0.15,0]; +_posB = [-0.75,0.1,0]; + +_relPosA = _injured modelToWorld [((_injured worldToModel (getPos _injured)) select 0) +(0.75),((_injured worldToModel (getPos _injured)) select 1) + (0.15),0]; +_relPosB = _injured modelToWorld [((_injured worldToModel (getPos _injured)) select 0) -(0.75),((_injured worldToModel (getPos _injured)) select 1) + (0.1),0]; + +_placeAtA = objNull; +_near = ((getPos _injured) nearEntities ["Man",10]) - [_healer,_injured]; +_nearA = 0; +_nearB = 0; +if (count _near > 0) then { + { + _nearA = if (_x distance _relPosA < 1) then {1 + _nearA} else {0 + _nearA}; + _nearB = if (_x distance _relPosB < 1) then {1 + _nearB} else {0 + _nearB}; + } forEach _near; +}; + +if (_nearA > 0 && _nearB > 0) exitWith {}; + +_placeAtA = objNull; +if (_nearA == 0 && _nearB == 0) then { + _placeAtA = if (_healer distance _relPosA < _healer distance _relPosB) then {true} else {false}; +} else { + if (_nearA > 0 && _nearB == 0) then {_placeAtA = false} else {true}; + if (_nearB > 0 && _nearA == 0) then {_placeAtA = true} else {false}; +}; + +_fPos = if (_placeAtA) then {_posA} else {_posB}; + +_healer playAction "medicStartRightSide"; +_healer attachTo [_injured, _fPos]; +sleep 0.01; + +_posh = _healer modelToWorld [0,0,0]; +_posi = _injured modelToWorld [0,+0.08,0]; +_dy = (_posh select 1) - (_posi select 1); _dx = (_posh select 0) - (_posi select 0); +_healer setDir (270- (_dy atan2 _dx) - direction _injured); + +_healTime = time; +_anims = [ +"ainvpknlmstpsnonwrfldnon_medic", +"ainvpknlmstpsnonwrfldnon_medic0s", +"ainvpknlmstpsnonwrfldnon_medic0", +"ainvpknlmstpsnonwrfldnon_medic1", +"ainvpknlmstpsnonwrfldnon_medic2", +"ainvpknlmstpsnonwrfldnon_medic3", +"ainvpknlmstpsnonwrfldnon_medic4", +"ainvpknlmstpsnonwrfldnon_medic5", +"ainvpknlmstpsnonwrfldr_medic0s", +"ainvpknlmstpsnonwrfldr_medic0", +"ainvpknlmstpsnonwrfldr_medic1", +"ainvpknlmstpsnonwrfldr_medic2", +"ainvpknlmstpsnonwrfldr_medic3", +"ainvpknlmstpsnonwrfldr_medic4", +"ainvpknlmstpsnonwrfldr_medic5", +"amovppnemstpsraswrfldnon_amovpknlmstpsraswrfldnon", +"ainvpknlmstpsnonwrfldnon_ainvpknlmstpsnonwrfldnon_medic" +]; + +sleep 2; + +while {true} do { + sleep 0.5; + _anim = animationState _healer; + if !(_anim in _anims) exitWith {diag_log Format["%1",animationState _healer]}; + if (!alive _injured || !(_injured getVariable "stunned")) exitWith {_healer playActionNow "medicStop"}; + if (time - _healTime > 40) exitWith {_healer playActionNow "medicStop";_injured setVariable ["stunned",false,true]}; + if !(alive _healer) exitWith {}; +}; + +detach _healer; \ No newline at end of file diff --git a/Client/Module/ISIS/ISIS_Wound.sqf b/Client/Module/ISIS/ISIS_Wound.sqf new file mode 100644 index 0000000..3638718 --- /dev/null +++ b/Client/Module/ISIS/ISIS_Wound.sqf @@ -0,0 +1,62 @@ +Private ["_damage","_damages","_isStuned","_lastWound","_type","_unit"]; + +_unit = _this select 0; +_type = _this select 1; +_damages = _this select 2; + +if (vehicle _unit == _unit) then { + _isStuned = _unit getVariable "stunned"; + _lastWound = _unit getVariable "lastWound"; + if (isNil "_isStuned") then {_isStuned = false}; + if (isNil "_lastWound") then {_lastWound = round(time)}; + if (_isStuned) exitWith { + if (time - _lastWound > 3) then {_damages} else {false} + }; + + _unit setVariable ["lastWound",round time]; + _damage = true; + + switch (_type) do { + case "head_hit": { + if (_damages > 0.4 && _damages < 1) then { + if (random 100 > 40) then {_unit setVariable ['stunned',true,true];_isStuned = true}; + }; + if (_damages >= 1 && _damages < 5) then { + if (random 100 > 40) then {_unit setVariable ['stunned',true,true];_isStuned = true;_damage = false}; + }; + }; + case "body": { + if (_damages > 0.65 && _damages < 1) then { + if (random 100 > 50) then {_unit setVariable ['stunned',true,true];_isStuned = true}; + }; + if (_damages >= 1 && _damages < 20) then { + if (random 100 > 40) then {_unit setVariable ['stunned',true,true];_isStuned = true;_damage = false}; + }; + }; + case "hands": { + if (_damages > 0.76 && _damages < 1) then { + if (random 100 > 50) then {_unit setVariable ['stunned',true,true];_isStuned = true}; + }; + if (_damages >= 1 && _damages < 20) then { + if (random 100 > 50) then {_unit setVariable ['stunned',true,true];_isStuned = true;_damage = false}; + }; + }; + case "legs": { + if (_damages > 0.68 && _damages < 1) then { + if (random 100 > 50) then {_unit setVariable ['stunned',true,true];_isStuned = true}; + }; + if (_damages >= 1 && _damages < 20) then { + if (random 100 > 50) then {_unit setVariable ['stunned',true,true];_isStuned = true;_damage = false}; + }; + }; + case "": { + _damage = false; + }; + }; + + if (_isStuned) then {[_unit] Spawn ISIS_Wounded}; + + if (_damage) then {_damages} else {false}; +} else { + _damages +}; \ No newline at end of file diff --git a/Client/Module/ISIS/ISIS_Wounded.sqf b/Client/Module/ISIS/ISIS_Wounded.sqf new file mode 100644 index 0000000..f474f68 --- /dev/null +++ b/Client/Module/ISIS/ISIS_Wounded.sqf @@ -0,0 +1,51 @@ +Private ["_han","_hasAction","_start","_state","_status","_unit"]; +_unit = _this select 0; +_start = time; +_state = ""; + +if (isPlayer _unit) then { + [_unit] Spawn ISIS_Effects; +}; + +_han = [nil, _unit, rPLAYACTION, "agonyStart"] call RE; +sleep 3; +_han = [nil, _unit, rPLAYACTION, "GestureNod"] call RE; + +//--- Add action to west or east units. +if (side _unit == west || side _unit == east) then { + _hasAction = _unit getVariable 'hasAction'; + if (isNil '_hasAction') then {_hasAction = false}; + if !(_hasAction) then { + WFBE_ISIS_AddAction = [(side _unit),'CLTFNCISIS_ADDACTION',_unit]; + publicVariable 'WFBE_ISIS_AddAction'; + if (isHostedServer || local player) then {[(side _unit),'CLTFNCISIS_ADDACTION',_unit] Spawn HandlePVF}; + }; +}; + +while {true} do { + sleep 0.7; + + _status = _unit getVariable "stunned"; + if (isNil '_status' || !(alive _unit)) exitWith {_unit removeAllEventHandlers "handleDamage"}; + if !(_status) exitWith { + _han = [nil, _unit, rPLAYACTION, "GestureNod"] call RE; + }; + + if ((time - _start > 15 || _state != animationState _unit)) then { + _start = time; + if (((animationState _unit) == "AinjPpneMstpSnonWnonDnon") || ((animationState _unit) == "AinjPpneMstpSnonWrflDnon")) then { + _han = [nil, _unit, rPLAYACTION, "GestureNod"] call RE; + _state = animationState _unit; + _han = [nil, _unit, rPLAYACTION, ("GestureSpasm"+ (str floor random 7))] call RE; + }; + if (((animationState _unit) == "AinjPpneMstpSnonWrflDnon_injuredHealed") || ((animationState _unit) == "AinjPpneMstpSnonWnonDnon_injuredHealed")) then { + _han = [nil, _unit, rPLAYACTION, "GestureNod"] call RE; + _state = animationState _unit; + _han = [nil, _unit, rPLAYACTION, ("GestureSpasm"+ (str floor random 7))] call RE; + }; + }; + + _unit setDamage (getDammage _unit + 0.002); +}; + +_han = [nil, _unit, rPLAYACTION, "agonyStop"] call RE; diff --git a/Client/Module/Nuke/damage.sqf b/Client/Module/Nuke/damage.sqf new file mode 100644 index 0000000..0b72bce --- /dev/null +++ b/Client/Module/Nuke/damage.sqf @@ -0,0 +1,30 @@ +//--- Nuke destruction. +Private ["_array","_blackListed","_bo","_destroy","_target","_z"]; + +private ["_destroy","_bo","_target","_array","_blackListed"]; +_target = _this select 0; +_array = _target nearObjects ["All", 700]; +_blackListed = WFDEPOT + WFCAMP + ["land_nav_pier_c","land_nav_pier_c2","land_nav_pier_c2_end","land_nav_pier_c_270","land_nav_pier_c_90","land_nav_pier_c_big","land_nav_pier_C_L","land_nav_pier_C_L10","land_nav_pier_C_L30","land_nav_pier_C_R","land_nav_pier_C_R10","land_nav_pier_C_R30","land_nav_pier_c_t15","land_nav_pier_c_t20","land_nav_pier_F_17","land_nav_pier_F_23","land_nav_pier_m","land_nav_pier_m_1","land_nav_pier_m_end","land_nav_pier_M_fuel","land_nav_pier_pneu","land_nav_pier_uvaz"]; +_destroy = _array; +{if ((typeOf _x) in _blackListed) then {_destroy = _destroy - [_x]}} forEach _array; +{_bo = "BO_GBU12_LGB" createVehicle [random 1000,random 1000,500];_bo setPos [getPos _x select 0, getPos _x select 1, getPos _x select 2]} forEach _destroy; + +[_target] Spawn { + Private ["_array","_dammageable","_dammages","_range","_target"]; + _target = _this select 0; + _dammageable = ["Man","Car","Motorcycle","Tank","Ship","Air","StaticWeapon"]; + _range = 800; + _dammages = 1; + for [{_z = 0},{_z < 4},{_z = _z + 1}] do { + _array = _target nearEntities [_dammageable, _range]; + { + _x setDammage (getDammage _x + _dammages); + {_x setDammage (getDammage _x + _dammages)} forEach crew _x; + } forEach _array; + _range = _range + 300; + _dammages = _dammages - 0.2; + sleep 3; + }; + //--- Radiations. + [_target] Spawn NukeRadiation; +}; \ No newline at end of file diff --git a/Client/Module/Nuke/nuke.sqf b/Client/Module/Nuke/nuke.sqf new file mode 100644 index 0000000..425272c --- /dev/null +++ b/Client/Module/Nuke/nuke.sqf @@ -0,0 +1,146 @@ +//--- Nuke blast. +Private ['_Cone','_light','_smoke','_smoke2','_target','_top','_top2','_top3','_top4','_top5','_Wave','_xHandle']; + +_target = _this select 0; +if (player distance _target < 4000) then { + "dynamicBlur" ppEffectEnable true; + "dynamicBlur" ppEffectAdjust [1]; + "dynamicBlur" ppEffectCommit 1; +}; + +_Cone = "#particlesource" createVehicleLocal getPos _target; +_Cone setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 7, 48], "", "Billboard", 1, 10, [0, 0, 0], + [0, 0, 0], 0, 1.275, 1, 0, [40,80], [[0.25, 0.25, 0.25, 0], [0.25, 0.25, 0.25, 0.5], + [0.25, 0.25, 0.25, 0.5], [0.25, 0.25, 0.25, 0.05], [0.25, 0.25, 0.25, 0]], [0.25], 0.1, 1, "", "", _target]; +_Cone setParticleRandom [2, [1, 1, 30], [1, 1, 30], 0, 0, [0, 0, 0, 0.1], 0, 0]; +_Cone setParticleCircle [10, [-10, -10, 20]]; +_Cone setDropInterval 0.005; + +_top = "#particlesource" createVehicleLocal getPos _target; +_top setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 3, 48, 0], "", "Billboard", 1, 20, [0, 0, 0], + [0, 0, 80], 0, 1.7, 1, 0, [180,150,180], [[1, 1, 1, -10],[1, 1, 1, -7],[1, 1, 1, -4],[1, 1, 1, -0.5],[1, 1, 1, 0]], [0.05], 1, 1, "", "", _target]; +_top setParticleRandom [0, [75, 75, 15], [17, 17, 10], 0, 0, [0, 0, 0, 0], 0, 0, 360]; +_top setDropInterval 0.001; + +_top2 = "#particlesource" createVehicleLocal getPos _target; +_top2 setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 3, 112, 0], "", "Billboard", 1, 20, [0, 0, 0], + [0, 0, 20], 0, 1.7, 1, 0, [80,80,100], [[1, 1, 1, 0.5],[1, 1, 1, 0]], [0.07], 1, 1, "", "", _target]; +_top2 setParticleRandom [0, [75, 75, 15], [17, 17, 10], 0, 0, [0, 0, 0, 0], 0, 0, 360]; +_top2 setDropInterval 0.002; + +_smoke = "#particlesource" createVehicleLocal getPos _target; +_smoke setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 7, 48, 1], "", "Billboard", 1, 25, [0, 0, 0], + [0, 0, 80], 0, 1.7, 1, 0, [40,50,60], + [[1, 1, 1, 0.2],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0]] + , [0.5, 0.1], 1, 1, "", "", _target]; +_smoke setParticleRandom [0, [10, 10, 15], [15, 15, 7], 0, 0, [0, 0, 0, 0], 0, 0, 360]; +_smoke setDropInterval 0.002; + +_Wave = "#particlesource" createVehicleLocal getPos _target; +_Wave setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 7, 48], "", "Billboard", 1, 20, [0, 0, 0], + [0, 0, 0], 0, 1.5, 1, 0, [50, 100], [[0.1, 0.1, 0.1, 0.5], + [0.5, 0.5, 0.5, 0.5], [1, 1, 1, 0.3], [1, 1, 1, 0]], [1,0.5], 0.1, 1, "", "", _target]; +_Wave setParticleRandom [2, [20, 20, 20], [5, 5, 0], 0, 0, [0, 0, 0, 0.1], 0, 0]; +_Wave setParticleCircle [50, [-80, -80, 2.5]]; +_Wave setDropInterval 0.0002; + +_light = "#lightpoint" createVehicleLocal [((getPos _target select 0)),(getPos _target select 1),((getPos _target select 2)+500)]; +_light setLightAmbient[1500, 1200, 1000]; +_light setLightColor[1500, 1200, 1000]; +_light setLightBrightness 100000.0; + +if (player distance _target < 4000) then { + "colorCorrections" ppEffectEnable true; + "colorCorrections" ppEffectAdjust [0.8, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.0, 0.6, 2],[0.3, 0.3, 0.3, 0.1]];"colorCorrections" ppEffectCommit 0.4; + + "dynamicBlur" ppEffectAdjust [0.5]; + "dynamicBlur" ppEffectCommit 3; + + sleep 0.1; + + _null = [] Spawn + { + Sleep 4; + "colorCorrections" ppEffectAdjust [1.0, 0.5, 0, [0.5, 0.5, 0.5, 0], [1.0, 1.0, 0.8, 0.4],[0.3, 0.3, 0.3, 0.1]]; + "colorCorrections" ppEffectCommit 7; + }; + + "dynamicBlur" ppEffectAdjust [2]; + "dynamicBlur" ppEffectCommit 1; + + "dynamicBlur" ppEffectAdjust [0.5]; + "dynamicBlur" ppEffectCommit 4; +}; +_light setLightBrightness 100000.0; + +sleep 3.5; + +_Wave setDropInterval 0.001; +deleteVehicle _top; +deleteVehicle _top2; +sleep 7; +_top3 = "#particlesource" createVehicleLocal getPos _target; +_top3 setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 3, 48, 0], "", "Billboard", 1, 20, [0, 0, 500], + [0, 0, 65], 0, 1.7, 1, 0, [200,200,200], [[1, 1, 1, -10],[1, 1, 1, -7],[1, 1, 1, -4],[1, 1, 1, -0.5],[1, 1, 1, 0]], [0.05], 1, 1, "", "", _target]; +_top3 setParticleRandom [0, [75, 75, 15], [17, 17, 10], 0, 0, [0, 0, 0, 0], 0, 0, 360]; +_top3 setDropInterval 0.001; + +sleep 0.6; +deleteVehicle _top3; + +sleep 3; + +if (player distance _target < 4000) then { + "colorCorrections" ppEffectAdjust [1, 1, 0, [0.5, 0.5, 0.5, 0], [1.0, 1.0, 0.8, 0.4],[0.3, 0.3, 0.3, 0.1]];"colorCorrections" ppEffectCommit 1; "colorCorrections" ppEffectEnable TRUE; + "dynamicBlur" ppEffectAdjust [0]; + "dynamicBlur" ppEffectCommit 1; +}; + +_top4 = "#particlesource" createVehicleLocal getPos _target; +_top4 setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 3, 48, 0], "", "Billboard", 1, 20, [0, 0, 800], + [0, 0, 55], 0, 1.7, 1, 0, [200,200,200], [[1, 1, 1, -10],[1, 1, 1, -7],[1, 1, 1, -4],[1, 1, 1, -0.5],[1, 1, 1, 0]], [0.05], 1, 1, "", "", _target]; +_top4 setParticleRandom [0, [75, 75, 15], [17, 17, 10], 0, 0, [0, 0, 0, 0], 0, 0, 360]; +_top4 setDropInterval 0.001; + +sleep 0.6; +deleteVehicle _light; +deleteVehicle _top4; +sleep 4; + +_top5 = "#particlesource" createVehicleLocal getPos _target; +_top5 setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 3, 48, 0], "", "Billboard", 1, 20, [0, 0, 1000], + [0, 0, 20], 0, 1.7, 1, 0, [250,280,250], [[1, 1, 1, -10],[1, 1, 1, -7],[1, 1, 1, -4],[1, 1, 1, -0.5],[1, 1, 1, 0]], [0.05], 1, 1, "", "", _target]; +_top5 setParticleRandom [0, [75, 75, 15], [17, 17, 10], 0, 0, [0, 0, 0, 0], 0, 0, 360]; +_top5 setDropInterval 0.001; + +_Cone setDropInterval 0.01; +_Wave setDropInterval 0.001; + +_smoke setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 7, 48, 1], "", "Billboard", 1, 25, [0, 0, 0], + [0, 0, 80], 0, 1.7, 1, 0, [150,150,150], + [[1, 1, 1, 0.2],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0]] + , [0.5, 0.1], 1, 1, "", "", _target]; +_smoke setDropInterval 0.01; + +_smoke2 = "#particlesource" createVehicleLocal getPos _target; +_smoke2 setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 7, 48, 1], "", "Billboard", 1, 25, [0, 0, 900], + [0, 0, 25], 0, 1.7, 1, 0, [160,180,170], + [[1, 1, 1, 0.2],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0.3],[1, 1, 1, 0]] + , [0.5, 0.1], 1, 1, "", "", _target]; +_smoke2 setParticleRandom [0, [10, 10, 15], [15, 15, 7], 0, 0, [0, 0, 0, 0], 0, 0, 360]; +_smoke2 setDropInterval 0.01; + +sleep 5; +deleteVehicle _top5; +_Cone setDropInterval 0.02; +_Wave setDropInterval 0.01; + +sleep 5; +deleteVehicle _smoke2; +sleep 10; +deleteVehicle _Wave; +deleteVehicle _cone; +deleteVehicle _smoke; +sleep 20; +if (player distance _target < 4000) then {"colorCorrections" ppEffectEnable false}; +[currentFX] Spawn FX; \ No newline at end of file diff --git a/Client/Module/Nuke/nukeincoming.sqf b/Client/Module/Nuke/nukeincoming.sqf new file mode 100644 index 0000000..e2a92f9 --- /dev/null +++ b/Client/Module/Nuke/nukeincoming.sqf @@ -0,0 +1,59 @@ +//--- Nuke launching. +Private ['_cruise','_dropPosition','_dropPosX','_dropPosY','_dropPosZ','_misFlare','_nukeMarker','_path','_pathS','_planespawnpos','_target','_type']; +_target = _this select 0; +_nukeMarker = _this select 1; + +WFBE_LocalizeMessage = [nil,'CLTFNCLOCALIZEMESSAGE',['TacticalLaunch']]; +publicVariable 'WFBE_LocalizeMessage'; +if (isHostedServer || local player) then {[nil,'CLTFNCLOCALIZEMESSAGE',['TacticalLaunch']] Spawn HandlePVF}; + +sleep 300; + +_path = "\ca\air2\cruisemissile\"; //"; +_pathS = _path + "data\scripts\"; //"; + +_dropPosition = getpos _target; +_type = if (WF_A2_Vanilla || WF_A2_CombinedOps) then {'Chukar'} else {'Chukar_EP1'}; +_cruise = createVehicle [_type,_dropPosition,[], 0, "FLY"]; +_cruise setVectorDir [ 0.1,- 1,+ 0.5]; +_cruise setPos [(getPos _cruise select 0),(getPos _cruise select 1),570]; +_cruise setVelocity [0,2,0]; +_cruise flyInHeight 570; +_cruise setSpeedMode "FULL"; + +WFBE_RequestSpecial = ['SRVFNCREQUESTSPECIAL',["ICBM",sideJoined,_target,_cruise,clientTeam]]; +publicVariable 'WFBE_RequestSpecial'; +if (isHostedServer) then {['SRVFNCREQUESTSPECIAL',["ICBM",sideJoined,_target,_cruise,clientTeam]] Spawn HandleSPVF}; + +sleep 1.5; + +WFBE_DisplayICBM = [sideJoined,'CLTFNCDISPLAYICBM',[_target,_cruise]]; +publicVariable 'WFBE_DisplayICBM'; +if (isHostedServer || local player) then {[sideJoined,'CLTFNCDISPLAYICBM',[_target,_cruise]] Spawn HandlePVF}; + +_misFlare = objNull; +if (WF_A2_Vanilla || WF_A2_CombinedOps) then { + _dropPosX = _dropPosition select 0; + _dropPosY = _dropPosition select 1; + _dropPosZ = _dropPosition select 2; + + _planespawnpos = [_dropPosX , _dropPosY , _dropPosZ + 600]; + + _misFlare = createVehicle ["cruiseMissileFlare1",_planespawnpos,[], 0, "NONE"]; + _misFlare inflame true; + _cruise setVariable ["cruisemissile_level", false]; + [_cruise, _misFlare] execVM (_pathS + "cruisemissileflare.sqf"); + _cruise setObjectTexture [0, _path + "data\exhaust_flame_ca"]; + [_cruise] execVM (_pathS + "exhaust1.sqf"); +}; + +sleep 7; + +waitUntil {!alive _cruise}; + +sleep 5; +if (WF_A2_Vanilla || WF_A2_CombinedOps) then {deleteVehicle _misFlare}; +deleteVehicle _cruise; + +sleep 50; +deleteMarkerLocal _nukeMarker; diff --git a/Client/Module/Nuke/radzone.sqf b/Client/Module/Nuke/radzone.sqf new file mode 100644 index 0000000..084b66f --- /dev/null +++ b/Client/Module/Nuke/radzone.sqf @@ -0,0 +1,20 @@ +//--- Radiation +Private ['_target','_z']; + + +private ["_target"]; +_target = _this select 0; +[_target] Spawn { + Private ["_array","_dammageable","_target"]; + _target = _this select 0; + _dammageable = ["Man","Car","Motorcycle","Tank","Ship","Air","StaticWeapon"]; + for [{_z = 0},{_z < 300},{_z = _z + 1}] do { + _array = _target nearEntities [_dammageable, 1000]; + { + _x setDammage (getDammage _x + 0.03); + {_x setDammage (getDammage _x + 0.05)} forEach crew _x; + } forEach _array; + sleep (3 + random 3); + }; + deleteVehicle _target; +}; \ No newline at end of file diff --git a/Client/Module/Skill/Actions/Officer_Undeploy_MASH.sqf b/Client/Module/Skill/Actions/Officer_Undeploy_MASH.sqf new file mode 100644 index 0000000..99b92e8 --- /dev/null +++ b/Client/Module/Skill/Actions/Officer_Undeploy_MASH.sqf @@ -0,0 +1,22 @@ +/* + Script: Officer Skill MASH Undeploy + Description: Undeploy the MASH +*/ + +Private ["_MASH"]; + +_MASH = _this select 0; + +_skip = false; +for '_z' from 0 to 3 do { + sleep 0.5; + player playMove "AinvPknlMstpSlayWrflDnon_medic"; + sleep 0.5; + waitUntil {animationState player == "ainvpknlmstpslaywrfldnon_amovpknlmstpsraswrfldnon" || !alive player || vehicle player != player}; + if (!alive player || vehicle player != player) exitWith {_skip = true}; +}; + +if (!_skip) then { + deleteVehicle _MASH; + WFBE_SK_V_LastUse_MASH = -2000; +}; \ No newline at end of file diff --git a/Client/Module/Skill/Skill_Apply.sqf b/Client/Module/Skill/Skill_Apply.sqf new file mode 100644 index 0000000..ddd8f20 --- /dev/null +++ b/Client/Module/Skill/Skill_Apply.sqf @@ -0,0 +1,66 @@ +/* + Script: Skill Application System by Benny. + Description: Skill Application. +*/ + +Private ["_unit"]; + +_unit = _this; + +switch (WFBE_SK_V_Type) do { + case 'Engineer': { + /* Repair Ability */ + _unit addAction [ + ("" + localize 'STR_WF_ACTION_Repair'+ ""), + (WFBE_SK_V_Root + 'Engineer' + '.sqf'), + [], + 80, + false, + true, + "", + "time - WFBE_SK_V_LastUse_Repair > WFBE_SK_V_Reload_Repair" + ]; + }; + case 'Officer': { + /* MASH Ability require that the MASH parameter is enabled */ + if (paramRespawnMASH) then { + /* MASH Ability */ + _unit addAction [ + ("" + localize 'STR_WF_ACTION_DeployMASH'+ ""), + (WFBE_SK_V_Root + 'Officer' + '.sqf'), + [], + 80, + false, + true, + "", + "time - WFBE_SK_V_LastUse_MASH > WFBE_SK_V_Reload_MASH" + ]; + }; + }; + case 'SpecOps': { + /* Lockpicking Ability */ + _unit addAction [ + ("" + localize 'STR_WF_ACTION_Lockpick'+ ""), + (WFBE_SK_V_Root + 'SpecOps' + '.sqf'), + [], + 80, + false, + true, + "", + "time - WFBE_SK_V_LastUse_Lockpick > WFBE_SK_V_Reload_Lockpick" + ]; + }; + case 'Spotter': { + /* Spotting Ability */ + _unit addAction [ + ("" + localize 'STR_WF_ACTION_Spot'+ ""), + (WFBE_SK_V_Root + 'Sniper' + '.sqf'), + [], + 80, + false, + true, + "", + "time - WFBE_SK_V_LastUse_Spot > WFBE_SK_V_Reload_Spot" + ]; + }; +}; \ No newline at end of file diff --git a/Client/Module/Skill/Skill_Engineer.sqf b/Client/Module/Skill/Skill_Engineer.sqf new file mode 100644 index 0000000..ec65cde --- /dev/null +++ b/Client/Module/Skill/Skill_Engineer.sqf @@ -0,0 +1,32 @@ +/* + Script: Engineer Skill System by Benny. + Description: Add special skills to the defined engineer. +*/ +Private ['_dammages','_skip','_sorted','_vehicle','_vehicles','_z']; + + +private ["_x","_skip","_dammages","_vehicles","_sorted","_vehicle"]; +_vehicles = player nearEntities [["Car","Motorcycle","Tank","Ship","Air","StaticWeapon"],5]; +if (count _vehicles < 1) exitWith {}; + +_sorted = [player,_vehicles] Call SortByDistance; +_vehicle = _sorted select 0; + +_dammages = getDammage _vehicle; +if (_dammages <= 0) exitWith {}; +WFBE_SK_V_LastUse_Repair = time; + +_skip = false; +for [{_z = 0},{_z < 5},{_z = _z + 1}] do { + sleep 0.5; + player playMove "AinvPknlMstpSlayWrflDnon_medic"; + sleep 0.5; + waitUntil {animationState player == "ainvpknlmstpslaywrfldnon_amovpknlmstpsraswrfldnon" || !alive player || vehicle player != player || !alive _vehicle || _vehicle distance player > 5}; + if (!alive player || vehicle player != player || !alive _vehicle || _vehicle distance player > 5) exitWith {_skip = true}; +}; + +if (!_skip) then { + _dammages = _dammages - 0.15; + if (_dammages < 0) then {_dammages = 0}; + _vehicle setDammage _dammages; +}; \ No newline at end of file diff --git a/Client/Module/Skill/Skill_Init.sqf b/Client/Module/Skill/Skill_Init.sqf new file mode 100644 index 0000000..6318bfe --- /dev/null +++ b/Client/Module/Skill/Skill_Init.sqf @@ -0,0 +1,41 @@ +/* + Script: Skill System by Benny. + Description: Skill Initialization. +*/ + +/* Skills Root */ +WFBE_SK_V_Root = 'Client\Module\Skill\Skill_'; + +/* Functions */ +WFBE_SK_FNC_Apply = Compile preprocessFile "Client\Module\Skill\Skill_Apply.sqf"; + +/* Define which classname belong to which skill group */ +WFBE_SK_V_Engineers = ['USMC_SoldierS_Engineer','MVD_Soldier_TL','US_Soldier_Engineer_EP1','TK_Soldier_Engineer_EP1','CDF_Soldier_Engineer','Ins_Soldier_Sapper']; +WFBE_SK_V_Officers = ['FR_Commander','RUS_Commander','US_Soldier_SL_EP1','TK_Soldier_SL_EP1','CDF_Soldier_Officer','Ins_Commander']; +WFBE_SK_V_Soldiers = ['FR_R','RUS_Soldier1','US_Delta_Force_EP1','TK_Special_Forces_EP1','CDF_Soldier','Ins_Soldier_1']; +WFBE_SK_V_SpecsOps = ['FR_TL','RUS_Soldier_TL','US_Delta_Force_TL_EP1','TK_Special_Forces_TL_EP1','CDF_Soldier_TL','Ins_Soldier_2']; +WFBE_SK_V_Spotters = ['USMC_SoldierS_Sniper','RU_Soldier_Sniper','US_Soldier_Sniper_EP1','TK_Soldier_Sniper_EP1','CDF_Soldier_Sniper','Ins_Soldier_Sniper']; + +/* Skills Variables */ +WFBE_SK_V_LastUse_Repair = -1200; +WFBE_SK_V_LastUse_MASH = -1200; +WFBE_SK_V_LastUse_Lockpick = -1200; +WFBE_SK_V_LastUse_Spot = -1200; + +/* Skills Timeout */ +WFBE_SK_V_Reload_Repair = 65; +WFBE_SK_V_Reload_MASH = 600; +WFBE_SK_V_Reload_Lockpick = 25; +WFBE_SK_V_Reload_Spot = 8; + +/* Find the player type */ +WFBE_SK_V_Type = ""; +if (playerType in WFBE_SK_V_Engineers) then {WFBE_SK_V_Type = "Engineer"}; +if (playerType in WFBE_SK_V_Officers) then {WFBE_SK_V_Type = "Officer"}; +if (playerType in WFBE_SK_V_Soldiers) then {WFBE_SK_V_Type = "Soldier"}; +if (playerType in WFBE_SK_V_SpecsOps) then {WFBE_SK_V_Type = "SpecOps"}; +if (playerType in WFBE_SK_V_Spotters) then {WFBE_SK_V_Type = "Spotter"}; + +/* Special one time init */ +/* The soldier can hire more units than the others leader */ +if (WFBE_SK_V_Type == 'Soldier') then {['WFBE_MAXGROUPSIZE',('WFBE_MAXGROUPSIZE' Call GetNameSpace) + ('WFBE_MAXGZBONUSSKILL' Call GetNamespace),true] Call SetNamespace}; \ No newline at end of file diff --git a/Client/Module/Skill/Skill_Officer.sqf b/Client/Module/Skill/Skill_Officer.sqf new file mode 100644 index 0000000..3048459 --- /dev/null +++ b/Client/Module/Skill/Skill_Officer.sqf @@ -0,0 +1,32 @@ +/* + Script: Officer Skill System by Benny. + Description: Add special skills to the defined officer. +*/ +Private ['_array','_exist','_skip','_tent','_toWorld','_type','_z']; + + +private ["_x","_skip","_array","_toWorld","_tent","_type","_exist"]; +_type = Format ["WFBE_%1FARP",sideJoinedText] Call GetNamespace; +_exist = WF_Logic getVariable Format ["%1MASH",sideJoinedText]; +if !(isNull _exist) then {deleteVehicle _exist}; + +WFBE_SK_V_LastUse_MASH = time; + +_skip = false; +for [{_z = 0},{_z < 7},{_z = _z + 1}] do { + sleep 0.5; + player playMove "AinvPknlMstpSlayWrflDnon_medic"; + sleep 0.5; + waitUntil {animationState player == "ainvpknlmstpslaywrfldnon_amovpknlmstpsraswrfldnon" || !alive player || vehicle player != player}; + if (!alive player || vehicle player != player) exitWith {_skip = true}; +}; + +if (!_skip) then { + _array = [((player worldToModel (getPos player)) select 0),((player worldToModel (getPos player)) select 1) + 10]; + _toWorld = player modelToWorld _array; + _tent = _type createVehicle _toWorld; + WF_Logic setVariable [Format["%1MASH",sideJoinedText],_tent,true]; + _tent addAction ["" + localize 'STR_WF_ACTION_UndeployMASH'+ "", "Client\Module\Skill\Actions\Officer_Undeploy_MASH.sqf", [], 75, false, true, "", "alive _target && time - WFBE_SK_V_LastUse_MASH > 240"]; +} else { + WF_Logic setVariable [Format["%1MASH",sideJoinedText],objNull,true]; +}; \ No newline at end of file diff --git a/Client/Module/Skill/Skill_Sniper.sqf b/Client/Module/Skill/Skill_Sniper.sqf new file mode 100644 index 0000000..19bbfb1 --- /dev/null +++ b/Client/Module/Skill/Skill_Sniper.sqf @@ -0,0 +1,31 @@ +/* + Script: Sniper Skill System by Benny. + Description: Add special skills to the defined sniper. +*/ +Private ['_binoculars','_markerName','_markertime','_screenPos']; + + +private ["_binoculars","_screenPos","_markerName","_markertime"]; +_binoculars = 'WFBE_BINOCULARS' Call GetNamespace; +if !((currentWeapon player) in _binoculars) exitWith {hint (localize "STR_WF_INFO_Spot_Info")}; + +if (isNil "markerID") then {markerID = 1}; +_screenPos = screenToWorld [0.5,0.5]; + +_markerName = Format ["Spot%1",markerID]; +createMarkerLocal [_markerName,_screenPos]; +_markertime = [daytime] call bis_fnc_timetostring; +_markerName setMarkerText Format ['SPOTTED: %1',_markertime]; +_markerName setMarkerTypeLocal "mil_destroy"; +_markerName setMarkerColorLocal "ColorRed"; +_markerName setMarkerSizeLocal [0.5,0.5]; +markerID = markerID + 1; + +WFBE_SK_V_LastUse_Spot = time; + +[_markerName] Spawn { + Private ["_marker"]; + _marker = _this select 0; + sleep 180; + deleteMarkerLocal _marker; +}; \ No newline at end of file diff --git a/Client/Module/Skill/Skill_SpecOps.sqf b/Client/Module/Skill/Skill_SpecOps.sqf new file mode 100644 index 0000000..4456815 --- /dev/null +++ b/Client/Module/Skill/Skill_SpecOps.sqf @@ -0,0 +1,52 @@ +/* + Script: Spec Ops Skill System by Benny. + Description: Add special skills to the defined spec ops unit. +*/ +Private ['_min','_ran','_skip','_sorted','_vehicle','_vehicles','_z']; + + +private ["_x","_skip","_min","_ran","_vehicles","_sorted","_vehicle"]; +_vehicles = player nearEntities [["Car","Motorcycle","Tank","Ship","Air"],5]; +if (count _vehicles < 1) exitWith {}; + +if (isNil "WFBE_SK_V_LockpickChance") then {WFBE_SK_V_LockpickChance = 0}; + +_sorted = [player,_vehicles] Call SortByDistance; +_vehicle = _sorted select 0; + +if (!locked _vehicle) exitWith {}; + +WFBE_SK_V_LastUse_Lockpick = time; + +_skip = false; +for [{_z = 0},{_z < 2},{_z = _z + 1}] do { + sleep 0.5; + player playMove "AinvPknlMstpSlayWrflDnon_medic"; + sleep 0.5; + waitUntil {animationState player == "ainvpknlmstpslaywrfldnon_amovpknlmstpsraswrfldnon" || !alive player || vehicle player != player || !alive _vehicle || _vehicle distance player > 5}; + if (!alive player || vehicle player != player || !alive _vehicle || _vehicle distance player > 5) exitWith {_skip = true}; +}; + +if (!locked _vehicle) exitWith {}; + +if (!_skip) then { + _min = 30; + switch (typeOf _vehicle) do { + case "Motorcycle": {_min = 40}; + case "Car": {_min = 30}; + case "Tank": {_min = 20}; + case "Ship": {_min = 25}; + case "Air": {_min = 15}; + }; + _ran = ((random 100)-WFBE_SK_V_LockpickChance); + if (_ran <= _min) then { + //--- Unlocked, gain experience. + if (WFBE_SK_V_LockpickChance > -51) then {WFBE_SK_V_LockpickChance = WFBE_SK_V_LockpickChance - 1}; + WFBE_RequestVehicleLock = ['SRVFNCREQUESTVEHICLELOCK',[_vehicle,false]]; + publicVariable 'WFBE_RequestVehicleLock'; + if (isHostedServer) then {['SRVFNCREQUESTVEHICLELOCK',[_vehicle,false]] Spawn HandleSPVF}; + hint (localize "STR_WF_INFO_Lockpick_Succeed"); + } else { + hint (localize "STR_WF_INFO_Lockpick_Failed"); + }; +}; diff --git a/Client/Module/UAV/uav.sqf b/Client/Module/UAV/uav.sqf new file mode 100644 index 0000000..840ffbe --- /dev/null +++ b/Client/Module/UAV/uav.sqf @@ -0,0 +1,136 @@ +Private ['_add','_buildings','_built','_checks','_closest','_cw','_d','_dir','_driver','_group','_gunner','_id','_lastWP','_lastWPpos','_logic','_logicMARTA','_pos','_radius','_sorted','_spawn','_step','_uav','_varname','_waypoints','_wp','_wpcount']; +_logic = UAVL; + +if (!isNull playerUAV) then {if (!alive playerUAV) then {playerUAV = objNull}}; +if (!isNull playerUAV) exitWith { + if (WF_A2_Vanilla) then { + ExecVM "Client\Module\UAV\uav_interface.sqf"; + } else { + ExecVM "Client\Module\UAV\uav_interface_oa.sqf"; + }; +}; + +//--- Logic ID +if (isnil "BIS_uavlastID") then {BIS_uav_lastID = -1}; +BIS_uav_lastID = BIS_uav_lastID + 1; +_id = BIS_uav_lastID; +_varname = ""; +call compile format ["BIS_uav_%1 = _logic; _logic setvehiclevarname 'BIS_uav_%1'; _varname = 'BIS_uav_%1'; publicvariable 'BIS_uav_%1'",BIS_uav_lastID]; +_logic setVariable ["ID",BIS_uav_lastID]; + +//--- First call +if (BIS_uav_lastID == 0) then { + //--- Execute MARTA + if (isnil "bis_marta_mainscope") then { + (group _logic) createunit ["MartaManager",position player,[],0,"none"]; + }; +}; + +_buildings = (sideJoinedText) Call GetSideStructures; +_checks = [sideJoined,Format ["WFBE_%1COMMANDCENTERTYPE",sideJoinedText] Call GetNamespace,_buildings] Call GetFactories; +_closest = objNull; +if (count _checks > 0) then { + _sorted = [player,_checks] Call SortByDistance; + _closest = _sorted select 0; +}; + +if (isNull _closest) exitWith {}; + +_uav = createVehicle [Format ["WFBE_%1UAV",sideJoinedText] Call GetNamespace,getPos _closest, [], 0, "FLY"]; +playerUAV = _uav; +Call Compile Format ["_uav addEventHandler ['Killed',{[_this select 0,_this select 1,%1] Spawn UnitKilled}]",sideJoined]; +_uav SetVehicleInit Format["[this,%1] ExecVM 'Common\Common_InitUnit.sqf';",sideJoined]; +processInitCommands; + +//--- Remove weapons if air restriction is enabled. +if (('WFBE_RESTRICTIONADVAIR' Call GetNamespace) == 2) then {removeAllWeapons _uav}; + +_group = createGroup sideJoined; +_driver = [Format ["WFBE_%1SOLDIER",sideJoinedText] Call GetNamespace,_group,getPos _uav,sideJoined] Call CreateMan; +_driver MoveInDriver _uav; + +_built = 1; +//--- OPFOR Uav has no gunner slot. +if (sideJoined == west) then { + _gunner = [Format ["WFBE_%1SOLDIER",sideJoinedText] Call GetNamespace,_group,getPos _uav,sideJoined] Call CreateMan; + _gunner MoveInGunner _uav; + _built = _built + 1; +}; +[sideJoinedText,'UnitsCreated',_built] Call UpdateStatistics; +[sideJoinedText,'VehiclesCreated',1] Call UpdateStatistics; + +-12500 Call ChangePlayerFunds; + +WFBE_RequestSpecial = ['SRVFNCREQUESTSPECIAL',["uav",sideJoined,_uav,clientTeam]]; +publicVariable 'WFBE_RequestSpecial'; +if (isHostedServer) then {['SRVFNCREQUESTSPECIAL',["uav",sideJoined,_uav,clientTeam]] Spawn HandleSPVF}; + +sleep 0.02; + +if ((count units _uav) > 1) then {[driver _uav] join grpnull}; + +_radius = 1000; +_wpcount = 4; +_step = 360 / _wpcount; +_add = 0; +_cw = true; +_dir = 0; +if !(isNil "_lastWP") then {deletewaypoint _lastWP}; + +//--- No need to preprocess those. +if (WF_A2_Vanilla) then { + ExecVM "Client\Module\UAV\uav_interface.sqf"; +} else { + ExecVM "Client\Module\UAV\uav_interface_oa.sqf"; +}; +[_uav] ExecVM 'Client\Module\UAV\uav_spotter.sqf'; + +_spawn = [] spawn {}; //--- Empty spawn +while {alive _uav} do { + waituntil {waypointdescription [group _uav,currentwaypoint group _uav] != ' ' || !alive _uav}; + terminate _spawn; //--- Terminate spawn from previous loop + if (!(alive _uav)||isNull _uav) exitwith {}; + + _waypoints = waypoints _uav; + _lastWP = _waypoints select (count _waypoints - 1); + _lastWPpos = waypointposition _lastWP; + deletewaypoint _lastWP; + for "_d" from 0 to (360-_step) step _step do + { + _add = _d; + if !(_cw) then {_add = -_d}; + _pos = [_lastWPpos, _radius, _dir+_add] call bis_fnc_relPos; + _wp = (group _uav) addwaypoint [_pos,0]; + _wp setWaypointType "MOVE"; + _wp setwaypointdescription ' '; + _wp setwaypointcompletionradius (1000/_wpcount); + }; + + _spawn = [_uav,_add,_step,_lastWPpos,_radius,_dir] spawn { + Private ['_add','_currentWP','_dir','_lastWPpos','_pos','_radius','_step','_uav','_wp']; + scriptname "UAV Route planning"; + _uav = _this select 0; + _add = _this select 1; + _step = _this select 2; + _lastWPpos = _this select 3; + _radius = _this select 4; + _dir = _this select 5; + _currentWP = currentwaypoint group _uav; + while {alive _uav} do { + waituntil {_currentWP != currentwaypoint group _uav}; + sleep .01; + _add = _add + _step; + if !(_cw) then {_add = -_add}; + _pos = [_lastWPpos, _radius, _dir+_add] call bis_fnc_relPos; + _wp = (group _uav) addwaypoint [_pos,0]; + _wp setWaypointType "MOVE"; + _wp setwaypointdescription ' '; + _wp setwaypointcompletionradius (1000/_wpcount); + _currentWP = currentwaypoint group _uav; + }; + }; + + _wpcount = count waypoints _uav; + waituntil {waypointdescription [group _uav,currentwaypoint group _uav] == ' ' || _wpcount != count waypoints _uav || !alive _uav}; + if (!(alive _uav)||isNull _uav) exitwith {}; +}; diff --git a/Client/Module/UAV/uav_interface.sqf b/Client/Module/UAV/uav_interface.sqf new file mode 100644 index 0000000..873b026 --- /dev/null +++ b/Client/Module/UAV/uav_interface.sqf @@ -0,0 +1,304 @@ +Private ['_IGUI_update','_alt','_defaultTeamswitch','_defaultvalue','_displayEH_keydown','_displayEH_mousebuttondown','_displayEH_mousezchanged','_locked','_logic','_mapEH_mousebttondown','_newalt','_newspeed','_ppBlur','_ppColor','_ppGrain','_ppInversion','_speed','_uav']; +_defaultTeamswitch = teamswitchenabled; + +startLoadingScreen ["UAV","RscDisplayLoadMission"]; + +_uav = playerUAV; + +//--- UAV destroyed +if (isnull _uav) exitwith {endLoadingScreen;hintc format [localize "strwfbasestructuredestroyed",localize "str_uav_action"]}; + +//--- Switch view +gunner _uav removeweapon "nvgoggles"; +_uav switchcamera "internal"; +player remoteControl gunner _uav; +_locked = locked _uav; +_uav lock true; +_uav selectweapon (weapons _uav select 0); +enableteamswitch false; +titletext ["","black in"]; +BIS_UAV_TIME = 0; +BIS_UAV_PLANE = _uav; +_ppInversion = 0; + +//--- Disable HC +hcshowbar false; + +//--- Show MARTA icons +if (isnil "BIS_UAV_visible") then {BIS_UAV_visible = groupiconsvisible}; +setGroupIconsVisible [true,true]; +(group _uav) setvariable ["MARTA_waypoint",[true,[-1,-1,-1,-1]]]; + +//--- Postprocess effects +_ppColor = ppEffectCreate ["ColorCorrections", 1999]; +_ppColor ppEffectEnable true; +_ppColor ppEffectAdjust [1, 1, 0, [1, 1, 1, 0], [1, 1, 1, 0.0], [1, 1, 1, 1.0]]; +_ppColor ppEffectCommit 0; +_ppBlur = ppEffectCreate ["dynamicBlur", 505]; +_ppBlur ppEffectEnable true; +_ppBlur ppEffectAdjust [.5]; +_ppBlur ppEffectCommit 0; +_ppGrain = ppEffectCreate ["filmGrain", 2005]; +_ppGrain ppEffectEnable true; +_ppGrain ppEffectAdjust [0.02, 1, 1, 0, 1]; +_ppGrain ppEffectCommit 0; + +//--- RSC +1124 cutrsc ["RscUnitInfoUAV","plain"]; +waituntil {!isnil {uinamespace getvariable "BIS_UAV_DISPLAY"}}; +progressLoadingScreen 0.5; + +//--- Minimap update +((uinamespace getvariable "BIS_UAV_DISPLAY") displayctrl 112410) mapcenteroncamera true; + +//--- Default aperture +if (isnil {BIS_UAV_PLANE getvariable 'BIS_UAV_aperture'}) then { + _defaultvalue = if (daytime > 5 && daytime < 19) then {24} else {0.07}; + BIS_UAV_PLANE setvariable ['BIS_UAV_aperture',_defaultValue]; + setaperture _defaultvalue; +} else { + setaperture (BIS_UAV_PLANE getvariable 'BIS_UAV_aperture'); +}; + +//--- Default height +_newalt = BIS_UAV_PLANE getvariable 'BIS_UAV_height'; +if (isnil "_newalt") then { + _alt = position _uav select 2; + _newalt = (round (_alt / 50)) * 50; + if (_newalt < 100) then {_newalt = 100}; + _uav flyinheight _newalt; + _uav setvariable ['BIS_UAV_height',_newalt]; +}; +((uinamespace getvariable 'BIS_UAV_DISPLAY') displayctrl 112413) ctrlsettext str (_newalt); +((uinamespace getvariable 'BIS_UAV_DISPLAY') displayctrl 112413) ctrlcommit 0; + +//--- Default speed +_newspeed = BIS_UAV_PLANE getvariable 'BIS_UAV_speed'; +if (isnil "_newspeed") then { + _speed = speed _uav; + _newspeed = (round (_speed / 50)) * 50; + if (_newalt < 200) then {_newalt = 200}; + driver _uav forcespeed _newspeed;; + _uav setvariable ['BIS_UAV_speed',_newspeed]; +}; +((uinamespace getvariable 'BIS_UAV_DISPLAY') displayctrl 112412) ctrlsettext str (_newspeed); +((uinamespace getvariable 'BIS_UAV_DISPLAY') displayctrl 112412) ctrlcommit 0; + +BIS_UAV_GUIinit = { +private ["_control","_display","_controls","_controlHint"]; +scriptName "UAV\data\scripts\uav_interface.sqf: GUI Init"; + disableserialization; + Private ['_control','_controlHint','_controls','_display']; + _display = uinamespace getvariable "BIS_UAV_DISPLAY"; + _controls = [112401,112402,112403,112404]; + { + _control = _display displayctrl _x; + _control ctrlshow false; + _control ctrlcommit 0; + } foreach _controls; + _controlHint = _display displayctrl 112414; + _controlHint ctrlsettext ( + localize "str_coin_exit" + " " + localize "str_input_device_mouse_1" + "\n\n" + + localize "str_disp_opt_bright" + " " + localize "str_input_device_mouse_axis_z" + "\n" + + localize "str_arcmark_title1" + ": " + call compile actionkeysnames ["Binocular",2] + ); + _controlHint ctrlcommit 0; +}; +[] spawn BIS_UAV_GUIinit; + +_IGUI_update = [] spawn {scriptName "UAV\data\scripts\uav_interface.sqf: IGUI Update"; + Private ['_uav']; + _uav = BIS_UAV_PLANE; + while {cameraon == BIS_UAV_PLANE} do { + if (isnull (uinamespace getvariable "BIS_UAV_DISPLAY")) then {bis_uav_terminate = true; + ExecVM "ca\modules\uav\data\scripts\uav_interface.sqf"; + }; + if (visiblemap) then { + if (ctrlshown ((uinamespace getvariable "BIS_UAV_DISPLAY") displayctrl 112411)) then { + { + ((uinamespace getvariable "BIS_UAV_DISPLAY") displayctrl _x) ctrlshow false; + ((uinamespace getvariable "BIS_UAV_DISPLAY") displayctrl _x) ctrlcommit 0; + } foreach [112410,112411,112412,112413,112414]; + }; + } else { + if !(ctrlshown ((uinamespace getvariable "BIS_UAV_DISPLAY") displayctrl 112411)) then { + { + ((uinamespace getvariable "BIS_UAV_DISPLAY") displayctrl _x) ctrlshow true; + ((uinamespace getvariable "BIS_UAV_DISPLAY") displayctrl _x) ctrlcommit 0; + } foreach [112410,112411,112412,112413,112414]; + }; + }; + ((uinamespace getvariable "BIS_UAV_DISPLAY") displayctrl 112411) ctrlsettext str (round speed _uav); + ((uinamespace getvariable "BIS_UAV_DISPLAY") displayctrl 112411) ctrlcommit 0; + sleep 0.01; + }; +}; + +//--- Detect pressed keys (temporary solution) +_displayEH_keydown = (finddisplay 46) displayaddeventhandler ["keydown"," + Private ['_id','_key','_level','_marker','_markertime','_ppInversion','_uav','_worldpos']; + _key = _this select 1; + + comment '--- END'; + if (_key in (actionkeys 'menuback')) then {bis_uav_terminate = true}; + + comment '--- NVG'; + if (_key in (actionkeys 'NightVision')) then { + _uav = BIS_UAV_PLANE; + if (isnil {_uav getvariable 'BIS_UAV_pp_NVG'}) then { + _ppInversion = ppEffectCreate ['colorInversion', 2555]; + _ppInversion ppEffectEnable true; + _ppInversion ppEffectAdjust [1,1,1]; + _ppInversion ppEffectCommit 0; + _uav setvariable ['BIS_UAV_pp_NVG',_ppInversion]; + } else { + ppEffectDestroy (_uav getvariable 'BIS_UAV_pp_NVG'); + _uav setvariable ['BIS_UAV_pp_NVG',nil]; + }; + }; + + comment '--- MARKER'; + if (_key in (actionkeys 'binocular') && !visiblemap) then { + _id = 1; + while {markertype format ['_user_defined_UAV_MARKER_%1',_id] != ''} do { + _id = _id + 1; + }; + _worldpos = screentoworld [0.5,0.5]; + _marker = createmarker [format ['_user_defined_UAV_MARKER_%1',_id],_worldpos]; + _marker setmarkertype 'mil_destroy'; + _marker setmarkercolor 'colorred'; + _marker setmarkersize [0.5,0.5]; + _markertime = [daytime] call bis_fnc_timetostring; + _marker setmarkertext format ['UAV %1: %2',_id,_markertime]; + }; + + comment '--- UP'; + if (_key in (actionkeys 'HeliUp')) then { + _uav = BIS_UAV_PLANE; + _level = _uav getvariable 'BIS_UAV_height'; + _level = _level + 50; + if (_level > 1000) then {_level = 1000}; + _uav flyinheight _level; + _uav setvariable ['BIS_UAV_height',_level]; + ((uinamespace getvariable 'BIS_UAV_DISPLAY') displayctrl 112413) ctrlsettext str (_level); + ((uinamespace getvariable 'BIS_UAV_DISPLAY') displayctrl 112413) ctrlcommit 0; + }; + + comment '--- DOWN'; + if (_key in (actionkeys 'HeliDown')) then { + _uav = BIS_UAV_PLANE; + _level = _uav getvariable 'BIS_UAV_height'; + _level = _level - 50; + if (_level < 100) then {_level = 100}; + _uav flyinheight _level; + _uav setvariable ['BIS_UAV_height',_level]; + ((uinamespace getvariable 'BIS_UAV_DISPLAY') displayctrl 112413) ctrlsettext str (_level); + ((uinamespace getvariable 'BIS_UAV_DISPLAY') displayctrl 112413) ctrlcommit 0; + }; + + comment '--- FORWARD'; + if (_key in (actionkeys 'HeliForward')) then { + _uav = BIS_UAV_PLANE; + _level = _uav getvariable 'BIS_UAV_speed'; + _level = _level + 50; + if (_level > 500) then {_level = 500}; + if (_level < 200) then {_level = 200}; + driver _uav forcespeed (_level / 3.6); + _uav setvariable ['BIS_UAV_speed',_level]; + ((uinamespace getvariable 'BIS_UAV_DISPLAY') displayctrl 112412) ctrlsettext str (_level); + ((uinamespace getvariable 'BIS_UAV_DISPLAY') displayctrl 112412) ctrlcommit 0; + }; + + comment '--- BACK'; + if (_key in (actionkeys 'HeliBack')) then { + _uav = BIS_UAV_PLANE; + _level = _uav getvariable 'BIS_UAV_speed'; + _level = _level - 50; + if (_level > 500) then {_level = 500}; + if (_level < 200) then {_level = 200}; + driver _uav forcespeed (_level / 3.6); + _uav setvariable ['BIS_UAV_speed',_level]; + ((uinamespace getvariable 'BIS_UAV_DISPLAY') displayctrl 112412) ctrlsettext str (_level); + ((uinamespace getvariable 'BIS_UAV_DISPLAY') displayctrl 112412) ctrlcommit 0; + }; +"]; + +//--- Detect pressed mouse buttons +_displayEH_mousebuttondown = (finddisplay 46) displayaddeventhandler ["mousebuttondown"," + disableserialization; + Private ['_button','_control','_controls','_display']; + _button = _this select 1; + if (_button == 007 && !visiblemap) then {comment 'DISABLED'; + _display = uinamespace getvariable 'BIS_UAV_DISPLAY'; + _controls = [112401,112402,112403,112404]; + { + _control = _display displayctrl _x; + _control ctrlshow !(ctrlshown _control); + _control ctrlcommit 0; + } foreach _controls; + }; + if (_button == 1 && !visiblemap && 65665 in (actionkeys 'menuback')) then {bis_uav_terminate = true}; +"]; + +//--- Detect mouse wheel rotation +_displayEH_mousezchanged = (finddisplay 46) displayaddeventhandler ["mousezchanged"," + Private ['_aperture','_oldAperture','_zChangeFinal','_zchange']; + _zchange = _this select 1; + _oldAperture = BIS_UAV_PLANE getvariable 'BIS_UAV_aperture'; + _zChangeFinal = _zChange / 2; + if (_oldAperture <= 1.0) then {_zChangeFinal = _zChange / 10}; + if (_oldAperture <= 0.1) then {_zChangeFinal = _zChange / 1000}; + _aperture = _oldAperture + _zchangeFinal; + if (_oldaperture > 1.0 && _aperture < 1.0) then {_aperture = 1.0}; + if (_oldaperture > 0.1 && _aperture < 0.1) then {_aperture = 0.1}; + if (_aperture < 0.001) then {_aperture = 0.001}; + BIS_UAV_PLANE setvariable ['BIS_UAV_aperture',_aperture]; + setaperture _aperture; +"]; + +_mapEH_mousebttondown = ((findDisplay 12) displayCtrl 51) ctrladdeventhandler ["mousebuttondown", " + Private ['_button','_uav','_worldpos','_wp']; + _button = _this select 1; + if (_button == 0) then { + _uav = BIS_UAV_PLANE; + + while {count (waypoints _uav) > 0} do {deletewaypoint ((waypoints _uav) select 0)}; + + _worldpos = (_this select 0) posscreentoworld [_this select 2,_this select 3]; + _wp = (group _uav) addwaypoint [_worldpos,0]; + _wp setWaypointType 'MOVE'; + (group _uav) setcurrentwaypoint _wp; + }; +"]; + +endLoadingScreen; + +//--- TERMINATE +waituntil {!isnil "bis_uav_terminate" || !alive _uav || !alive player}; +if (!alive _uav) then { + hintc format [localize "strwfbasestructuredestroyed",localize "str_uav_action"]; +}; +_uav lock _locked; +titletext ["","black in"]; +bis_uav_terminate = nil; +BIS_UAV_TIME = nil; +BIS_UAV_PLANE = nil; +objnull remoteControl gunner _uav; +player switchcamera "internal"; +enableteamswitch _defaultTeamswitch; + +setGroupIconsVisible BIS_UAV_visible; +BIS_UAV_visible = nil; +(group _uav) setvariable ["MARTA_waypoint",[false,[-1,-1,-1,-1]]]; + +setaperture -1; +ppEffectDestroy _ppColor; +ppEffectDestroy _ppBlur; +ppEffectDestroy (_uav getvariable 'BIS_UAV_pp_NVG'); //--- Color Invert Fix. +ppEffectDestroy _ppGrain; + +1124 cuttext ["","plain"]; +(finddisplay 46) displayremoveeventhandler ["keydown",_displayEH_keydown]; +(finddisplay 46) displayremoveeventhandler ["mousebuttondown",_displayEH_mousebuttondown]; +(finddisplay 46) displayremoveeventhandler ["mousezchanged",_displayEH_mousezchanged]; +((findDisplay 12) displayCtrl 51) ctrlremoveeventhandler ["mousebuttondown",_mapEH_mousebttondown]; \ No newline at end of file diff --git a/Client/Module/UAV/uav_interface_oa.sqf b/Client/Module/UAV/uav_interface_oa.sqf new file mode 100644 index 0000000..5c4e229 --- /dev/null +++ b/Client/Module/UAV/uav_interface_oa.sqf @@ -0,0 +1,162 @@ +Private ['_action_leave','_defaultTeamswitch','_displayEH_keydown','_displayEH_mousebuttondown','_locked','_logic','_mapEH_mousebttondown','_ppColor','_uav']; +_defaultTeamswitch = teamswitchenabled; + +startLoadingScreen ["UAV","RscDisplayLoadMission"]; + +_uav = playerUAV; + +//--- UAV destroyed +if (isnull _uav) exitwith {endLoadingScreen;hint format [localize "strwfbasestructuredestroyed",localize "str_uav_action"]}; + +//--- Switch view +gunner _uav removeweapon "nvgoggles"; +_uav switchcamera "internal"; +player remoteControl gunner _uav; +_locked = locked _uav; +_uav lock true; +_uav selectweapon (weapons _uav select 0); +enableteamswitch false; +titletext ["","black in"]; +BIS_UAV_TIME = 0; +BIS_UAV_PLANE = _uav; + +//--- Action! +_action_leave = _uav addaction [ + localize "STR_EP1_UAV_action_exit", + "ca\modules_e\uav\data\scripts\uav_actionCommit.sqf", + [0], + 1, + false, + true, + "PersonView", + "isnil 'BIS_UAV_noExit'" +]; + +//--- Disable HC +if (hcShownBar) then {hcshowbar false}; + +//--- Show MARTA icons +if (isnil "BIS_UAV_visible") then {BIS_UAV_visible = groupiconsvisible}; +setGroupIconsVisible [true,true]; +(group _uav) setvariable ["MARTA_waypoint",[true,[-1,-1,-1,-1]]]; + +//--- Prostprocess effects +//setaperture 24; +_ppColor = ppEffectCreate ["ColorCorrections", 1999]; +_ppColor ppEffectEnable true; +_ppColor ppEffectAdjust [1, 1, 0, [1, 1, 1, 0], [1, 1, 1, 0.0], [0.2, 0.2, 0.2, 0]]; +_ppColor ppEffectCommit 0; + + +//--- RSC +progressLoadingScreen 0.5; + +//--- Detect pressed keys (temporary solution) +BIS_UAV_HELI_keydown = { + Private ['_id','_key','_marker','_markertime','_newHeight','_uav','_worldpos']; + _key = _this select 1; + _uav = BIS_UAV_PLANE; + + //--- END + //if (_key in (actionkeys 'menuback') && isnil 'BIS_UAV_noExit') then {bis_uav_terminate = true}; + + //--- MARKER + if (_key in (actionkeys 'binocular') && !visiblemap) then { + _id = 1; + while {markertype format ['_user_defined_UAV_MARKER_%1',_id] != ''} do { + _id = _id + 1; + }; + _worldpos = screentoworld [0.5,0.5]; + _marker = createmarker [format ['_user_defined_UAV_MARKER_%1',_id],_worldpos]; + _marker setmarkertype 'mil_destroy'; + _marker setmarkercolor 'colorred'; + _marker setmarkersize [0.5,0.5]; + _markertime = [daytime] call bis_fnc_timetostring; + _marker setmarkertext format ['UAV %1: %2',_id,_markertime]; + }; + + //--- UP + if (_key in (actionkeys 'HeliUp')) then { + _newHeight = (position _uav select 2) + 50; + if (_newHeight > 1000) then {_newHeight = 1000}; + if (speed _uav < 1) then {_uav domove position _uav;}; + _uav land 'none'; + _uav flyinheight _newHeight; + }; + + //--- DOWN + if (_key in (actionkeys 'HeliDown')) then { + _newHeight = (position _uav select 2) - 50; + if (_newHeight < 100) then {_newHeight = 100}; + _uav land 'none'; + _uav flyinheight _newHeight; + }; +}; +_displayEH_keydown = (finddisplay 46) displayaddeventhandler ["keydown","Private['_sqf']; _sqf = _this spawn BIS_UAV_HELI_keydown"]; + +//--- Detect pressed mouse buttons +_displayEH_mousebuttondown = (finddisplay 46) displayaddeventhandler ["mousebuttondown"," + disableserialization; + Private ['_button','_control','_controls','_display']; + _button = _this select 1; + if (_button == 007 && !visiblemap) then {comment 'DISABLED'; + _display = uinamespace getvariable 'BIS_UAV_DISPLAY'; + _controls = [112401,112402,112403,112404]; + { + _control = _display displayctrl _x; + _control ctrlshow !(ctrlshown _control); + _control ctrlcommit 0; + } foreach _controls; + }; +"]; + + +//_display = findDisplay 12; +//_map = _display displayCtrl 51; +_mapEH_mousebttondown = ((findDisplay 12) displayCtrl 51) ctrladdeventhandler ["mousebuttondown", " + Private ['_button','_uav','_worldpos','_wp']; + _button = _this select 1; + if (_button == 0) then { + _uav = BIS_UAV_PLANE; + + while {count (waypoints _uav) > 0} do {deletewaypoint ((waypoints _uav) select 0)}; + + _worldpos = (_this select 0) posscreentoworld [_this select 2,_this select 3]; + _wp = (group _uav) addwaypoint [_worldpos,0]; + _wp setWaypointType 'MOVE'; + (group _uav) setcurrentwaypoint _wp; + }; +"]; + +////////////////////////////////////////////////// +endLoadingScreen; +////////////////////////////////////////////////// + + +//--- TERMINATE +waituntil {!isnil "bis_uav_terminate" || !alive _uav || !alive player}; +if (!alive _uav) then { + hint format [localize "strwfbasestructuredestroyed",localize "str_uav_action"]; +}; +_uav lock _locked; +titletext ["","black in"]; +bis_uav_terminate = nil; +BIS_UAV_TIME = nil; +BIS_UAV_PLANE = nil; +objnull remoteControl gunner _uav; +player switchcamera "internal"; +enableteamswitch _defaultTeamswitch; + +_uav removeaction _action_leave; + +setGroupIconsVisible BIS_UAV_visible; +BIS_UAV_visible = nil; +(group _uav) setvariable ["MARTA_waypoint",[false,[-1,-1,-1,-1]]]; + +ppEffectDestroy _ppColor; + +//1124 cuttext ["","plain"]; +(finddisplay 46) displayremoveeventhandler ["keydown",_displayEH_keydown]; +(finddisplay 46) displayremoveeventhandler ["mousebuttondown",_displayEH_mousebuttondown]; +//(finddisplay 46) displayremoveeventhandler ["mousezchanged",_displayEH_mousezchanged]; +((findDisplay 12) displayCtrl 51) ctrlremoveeventhandler ["mousebuttondown",_mapEH_mousebttondown]; \ No newline at end of file diff --git a/Client/Module/UAV/uav_spotter.sqf b/Client/Module/UAV/uav_spotter.sqf new file mode 100644 index 0000000..b1b0b17 --- /dev/null +++ b/Client/Module/UAV/uav_spotter.sqf @@ -0,0 +1,28 @@ +/* + Author: Benny + Name: uav_spotter.sqf + Parameters: + 0 - UAV + Description: + This file handle the UAV 'spotting' ability. If the UAV knows about an hostile unit, it'll reveal it's average location on the map. +*/ + +Private ['_delay','_range','_sensitivity','_uav']; +_uav = _this select 0; +_delay = 'WFBE_UAVSPOTTINGDELAY' Call GetNamespace; +_range = 'WFBE_UAVSPOTTINGRANGE' Call GetNamespace; +_sensitivity = 'WFBE_UAVSPOTTINGDETECTION' Call GetNamespace; + +while {true} do { + sleep _delay; + if (!alive _uav || isNull _uav) exitWith {}; + + { + if (_uav knowsAbout _x > _sensitivity && side _x != sideJoined && side _x != civilian) then { + sleep (0.05 + random 0.05); + WFBE_UAV_Reveal = [sideJoined,'CLTFNCUAV_REVEAL',[_uav,_x]]; + publicVariable 'WFBE_UAV_Reveal'; + if (isHostedServer) then {[sideJoined,'CLTFNCUAV_REVEAL',[_uav,_x]] Spawn HandlePVF}; + }; + } forEach (_uav nearEntities _range); +}; diff --git a/Client/Module/ZetaCargo/Zeta_Hook.sqf b/Client/Module/ZetaCargo/Zeta_Hook.sqf new file mode 100644 index 0000000..653ecaa --- /dev/null +++ b/Client/Module/ZetaCargo/Zeta_Hook.sqf @@ -0,0 +1,40 @@ +Private ["_action","_actionID","_caller","_index","_isAttached","_lifter","_position","_sorted","_type","_vehicle","_vehicles"]; + +_lifter = _this select 0; +_caller = _this select 1; +_actionID = _this select 2; + +if (_caller != driver _lifter) exitWith {}; +if ((typeOf _lifter) in Zeta_Special) then { + if (speed _lifter > 20) exitWith {}; +} else { + if ((speed _lifter > 20)||((getpos _lifter select 2)<2)) exitWith {}; +}; +//--- nearEntities handle living units. +_vehicles = _lifter nearEntities [Zeta_Types, 10]; +if (count _vehicles < 1) exitWith {}; + +_sorted = [_lifter,_vehicles] Call SortByDistance; +_vehicle = _sorted select 0; +_type = typeOf _lifter; +_position = Zeta_DefaultPos; +_index = Zeta_Special find _type; +if (_index != -1) then {_position = Zeta_SpecialPosition select _index}; + +if (count crew(_vehicle) > 0) exitWith {hint (localize 'STR_WF_INFO_Hook_Manned')}; + +_vehicle attachTo [_lifter,_position]; +_lifter setVariable ["Attached",true,false]; +_lifter removeAction _actionID; + +_action = _lifter addAction [localize "STR_WF_Lift_Detach","Client\Module\ZetaCargo\Zeta_Unhook.sqf"]; + +while {!gameOver} do { + sleep 2; + _isAttached = _lifter getVariable "Attached"; + if ((getDammage _lifter > 0.3)||!_isAttached||isNull (driver _lifter)) exitWith { + detach _vehicle; + _lifter removeAction _action; + if (alive _lifter) then {_lifter addAction [localize "STR_WF_Lift","Client\Module\ZetaCargo\Zeta_Hook.sqf"]}; + }; +}; \ No newline at end of file diff --git a/Client/Module/ZetaCargo/Zeta_Init.sqf b/Client/Module/ZetaCargo/Zeta_Init.sqf new file mode 100644 index 0000000..29dcac0 --- /dev/null +++ b/Client/Module/ZetaCargo/Zeta_Init.sqf @@ -0,0 +1,12 @@ +//--- Zeta Cargo by Benny. + +//--- Unit allowed to hook. +Zeta_Lifter = ["MH60S","MV22","C130J","Mi17_Ins","Mi17_medevac_RU","UH60M_EP1","UH60M_MEV_EP1","CH_47F_EP1","C130J_US_EP1","Mi17_TK_EP1","BAF_Merlin_HC3_D","CH_47F_BAF"]; +//--- Zeta Cargo can lift these types. +Zeta_Types = ["Car","Motorcycle","Tank","Ship"]; +//--- Zeta Cargo default Position. +Zeta_DefaultPos = [0,0,-4]; + +//--- Special vehicle with special position. +Zeta_Special = ["C130J","C130J_US_EP1"]; +Zeta_SpecialPosition = [[0,0,-2]]; \ No newline at end of file diff --git a/Client/Module/ZetaCargo/Zeta_Unhook.sqf b/Client/Module/ZetaCargo/Zeta_Unhook.sqf new file mode 100644 index 0000000..3e06b0f --- /dev/null +++ b/Client/Module/ZetaCargo/Zeta_Unhook.sqf @@ -0,0 +1,21 @@ +private ["_actionID","_caller","_lifter","_param","_vehicle"]; + +_lifter = _this select 0; +_caller = _this select 1; +_actionID = _this select 2; +_param = _this select 3; +_vehicle = _param select 0; + +_lifter setVariable ["Attached",false]; +detach _vehicle; +if ((typeOf _lifter) in Zeta_Special) then { + _vehicle setPos [(getPos _lifter select 0) - (15 * sin (getDir _vehicle)), (getPos _lifter select 1) - (15 * cos (getDir _vehicle)), getPos _lifter select 2]; +}; + +_vehicle setVelocity (velocity _lifter); + +_lifter removeAction _actionID; + +sleep 1; + +if ((getPos _vehicle) select 2 < 0) then {_vehicle setPos [(getPos _vehicle) select 0,(getPos _vehicle) select 1,0];_vehicle setVelocity [0,0,-0.1]}; \ No newline at end of file -- cgit v1.3.1