diff --git a/A3A/addons/core/CfgFunctions.hpp b/A3A/addons/core/CfgFunctions.hpp index ea8586914a..a033ddb153 100644 --- a/A3A/addons/core/CfgFunctions.hpp +++ b/A3A/addons/core/CfgFunctions.hpp @@ -41,6 +41,7 @@ class CfgFunctions class interrogate {}; class isBuildingPosition {}; class landThreatEval {}; + class liberateDeserter {}; class liberaterefugee {}; class liberatePOW {}; class liberateFlee {}; @@ -140,6 +141,7 @@ class CfgFunctions class vehicleBoxRestore {}; class initPetros {}; class isFrontline {}; + class isFrontlineNoFIA {}; class arePositionsConnected {}; class joinMultipleGroups {}; class localizar {}; @@ -396,6 +398,7 @@ class CfgFunctions class AS_Zombies {}; class CON_Outpost_Zombies {}; class CON_Outpost {}; + class CON_Outpost_Compet {}; class CON_MilAdmin {}; class convoy {}; class DES_Antenna {}; @@ -412,6 +415,7 @@ class CfgFunctions class LOG_Helicrash {};; class missionRequest {}; class REP_Antenna {}; + class RES_Deserters {}; class RES_Prisoners {}; class RES_Refugees {}; class RES_Informer {}; @@ -420,6 +424,7 @@ class CfgFunctions class RIV_ENC_Rivals {}; class RIV_ATT_Cell {}; class RIV_ATT_Hideout {}; + class RIV_ATT_Transfer {}; class RIV_AS_Traitor {}; class RIV_SUPP_Salvage {}; class RIV_RES_Prisoners {}; @@ -526,6 +531,8 @@ class CfgFunctions class garrisonDialog {}; class postmortem {}; class reDress {}; + class reDressInv {}; + class reDressOcc {}; class reinfPlayer {}; class spawnHCGroup {}; class vehiclePrice {}; @@ -654,6 +661,9 @@ class CfgFunctions class SUP_SAM {}; class SUP_SAMAvailable {}; class SUP_SAMRoutine {}; + class SUP_tank {}; + class SUP_tankAvailable {}; + class SUP_tankRoutine {}; class SUP_UAV {}; class SUP_UAVRoutine {}; class SUP_QRFVehAirdrop {}; diff --git a/A3A/addons/core/CfgVehicles.hpp b/A3A/addons/core/CfgVehicles.hpp index a24417f1cb..4d9059dbcc 100644 --- a/A3A/addons/core/CfgVehicles.hpp +++ b/A3A/addons/core/CfgVehicles.hpp @@ -6,4 +6,45 @@ class CfgVehicles { armor = 2000; }; + + class NATO_Box_Base; + + class A3AU_Build_Box_base: NATO_Box_Base + { + author = AUTHOR; + hiddenSelections[] = + { + "Camo_Signs", + "Camo" + }; + hiddenSelectionsTextures[] = + { + QPATHTOFOLDER(Pictures\items\AmmoBox_signs_CA.paa), + QPATHTOFOLDER(Pictures\items\AmmoBox_black_CO.paa) + }; + }; + + class A3AU_Build_Box_Large_1: A3AU_Build_Box_base + { + mapSize = 2.3399999; + class SimpleObject + { + eden = 1; + animate[] = {}; + hide[] = {}; + verticalOffset = 0.15000001; + verticalOffsetWorld = 0; + init = "''"; + }; + editorPreview = QPATHTOFOLDER(Pictures\items\A3AU_Build_Box_Large_1.jpg); + _generalMacro = "Box_NATO_WpsLaunch_F"; + scope = 2; + displayName = "Build Box (Large)"; + model = "\A3\weapons_F\AmmoBoxes\WpnsBox_long_F"; + icon = "iconCrateLong"; + class TransportMagazines{}; + class TransportWeapons{}; + class TransportItems{}; + class TransportBackpacks{}; + }; }; diff --git a/A3A/addons/core/Pictures/Items/A3AU_Build_Box_Large_1.jpg b/A3A/addons/core/Pictures/Items/A3AU_Build_Box_Large_1.jpg new file mode 100644 index 0000000000..968a08d590 Binary files /dev/null and b/A3A/addons/core/Pictures/Items/A3AU_Build_Box_Large_1.jpg differ diff --git a/A3A/addons/core/Pictures/Items/ammobox_black_co.paa b/A3A/addons/core/Pictures/Items/ammobox_black_co.paa new file mode 100644 index 0000000000..15f2e82a64 Binary files /dev/null and b/A3A/addons/core/Pictures/Items/ammobox_black_co.paa differ diff --git a/A3A/addons/core/Pictures/Items/ammobox_signs_ca.paa b/A3A/addons/core/Pictures/Items/ammobox_signs_ca.paa new file mode 100644 index 0000000000..0e23793478 Binary files /dev/null and b/A3A/addons/core/Pictures/Items/ammobox_signs_ca.paa differ diff --git a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AAF.sqf b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AAF.sqf index 717ff8301e..b65f428201 100644 --- a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AAF.sqf +++ b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AAF.sqf @@ -19,6 +19,8 @@ private _hasContact = "enoch" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["I_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "I_supplyCrate_F"] call _fnc_saveToTemplate; ["surrenderCrate", "Box_IND_Wps_F"] call _fnc_saveToTemplate; ["equipmentBox", "Box_AAF_Equip_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AFRF_Arid.sqf b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AFRF_Arid.sqf index a81892abef..a8dbdc4e75 100644 --- a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AFRF_Arid.sqf +++ b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AFRF_Arid.sqf @@ -21,6 +21,8 @@ private _hasLawsOfWar = "orange" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["O_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "O_R_supplyCrate_F"] call _fnc_saveToTemplate; ["surrenderCrate", "Box_RUS_Wps_F"] call _fnc_saveToTemplate; ["equipmentBox", "Box_RUS_Equip_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AFRF_Temperate.sqf b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AFRF_Temperate.sqf index fd8e2d04c8..47a5e05340 100644 --- a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AFRF_Temperate.sqf +++ b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AFRF_Temperate.sqf @@ -21,6 +21,8 @@ private _hasLawsOfWar = "orange" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["O_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "O_R_supplyCrate_F"] call _fnc_saveToTemplate; ["surrenderCrate", "Box_RUS_Wps_F"] call _fnc_saveToTemplate; ["equipmentBox", "Box_RUS_Equip_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AUKUS_Arid.sqf b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AUKUS_Arid.sqf index 722ce8d03b..fb9819a178 100644 --- a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AUKUS_Arid.sqf +++ b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AUKUS_Arid.sqf @@ -21,6 +21,8 @@ private _hasContact = "enoch" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["B_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; ["surrenderCrate", "Box_NATO_Wps_F"] call _fnc_saveToTemplate; ["equipmentBox", "Box_NATO_Equip_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AUKUS_Temperate.sqf b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AUKUS_Temperate.sqf index 9e4ee99267..2cd55d679b 100644 --- a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AUKUS_Temperate.sqf +++ b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AUKUS_Temperate.sqf @@ -21,6 +21,8 @@ private _hasContact = "enoch" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["B_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; ["surrenderCrate", "Box_NATO_Wps_F"] call _fnc_saveToTemplate; ["equipmentBox", "Box_NATO_Equip_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AUKUS_Tropical.sqf b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AUKUS_Tropical.sqf index 77d8bf5967..953e014c38 100644 --- a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AUKUS_Tropical.sqf +++ b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_AUKUS_Tropical.sqf @@ -21,6 +21,8 @@ private _hasContact = "enoch" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["B_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; ["surrenderCrate", "Box_NATO_Wps_F"] call _fnc_saveToTemplate; ["equipmentBox", "Box_NATO_Equip_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_CSAT_Arid.sqf b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_CSAT_Arid.sqf index b0faa676d2..062e33cf1e 100644 --- a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_CSAT_Arid.sqf +++ b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_CSAT_Arid.sqf @@ -21,6 +21,8 @@ private _hasContact = "enoch" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["O_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; ["surrenderCrate", "Box_East_Wps_F"] call _fnc_saveToTemplate; ["equipmentBox", "Box_CSAT_Equip_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_CSAT_Temperate.sqf b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_CSAT_Temperate.sqf index c65e33ba27..913984bd73 100644 --- a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_CSAT_Temperate.sqf +++ b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_CSAT_Temperate.sqf @@ -21,6 +21,8 @@ private _hasContact = "enoch" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["O_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "O_T_supplyCrate_F"] call _fnc_saveToTemplate; ["surrenderCrate", "Box_T_East_Wps_F"] call _fnc_saveToTemplate; ["equipmentBox", "Box_T_CSAT_Equip_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_NATO_Arid.sqf b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_NATO_Arid.sqf index 8c3cf7d336..958cc224eb 100644 --- a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_NATO_Arid.sqf +++ b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_NATO_Arid.sqf @@ -21,6 +21,8 @@ private _hasContact = "enoch" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["B_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; ["surrenderCrate", "Box_NATO_Wps_F"] call _fnc_saveToTemplate; ["equipmentBox", "Box_NATO_Equip_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_NATO_Temperate.sqf b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_NATO_Temperate.sqf index fc5c88b5d8..d2b3d0f083 100644 --- a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_NATO_Temperate.sqf +++ b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_NATO_Temperate.sqf @@ -21,6 +21,8 @@ private _hasContact = "enoch" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["B_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; ["surrenderCrate", "Box_NATO_Wps_F"] call _fnc_saveToTemplate; ["equipmentBox", "Box_NATO_Equip_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_NATO_Tropical.sqf b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_NATO_Tropical.sqf index 90b76b6f70..3f5d55b72f 100644 --- a/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_NATO_Tropical.sqf +++ b/A3A/addons/core/Templates/Templates/Aegis/Aegis_AI_NATO_Tropical.sqf @@ -21,6 +21,8 @@ private _hasContact = "enoch" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["B_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; ["surrenderCrate", "Box_NATO_Wps_F"] call _fnc_saveToTemplate; ["equipmentBox", "Box_NATO_Equip_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_ClearSky.sqf b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_ClearSky.sqf index 791b13504d..abd2790ff8 100644 --- a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_ClearSky.sqf +++ b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_ClearSky.sqf @@ -15,6 +15,7 @@ // Vehicles // ////////////////////////// +["attributeMoreTrucks", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["attributeLowAir", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_ClearSky_RHS.sqf b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_ClearSky_RHS.sqf index bbe02fb437..bc5fb1abbc 100644 --- a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_ClearSky_RHS.sqf +++ b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_ClearSky_RHS.sqf @@ -15,6 +15,7 @@ // Vehicles // ////////////////////////// +["attributeMoreTrucks", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["attributeLowAir", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Freedom.sqf b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Freedom.sqf index 92aef722f8..cea1779c2a 100644 --- a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Freedom.sqf +++ b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Freedom.sqf @@ -15,6 +15,7 @@ // Vehicles // ////////////////////////// +["attributeMoreTrucks", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["attributeLowAir", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Freedom_RHS.sqf b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Freedom_RHS.sqf index e7556a2364..9ef655ebb4 100644 --- a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Freedom_RHS.sqf +++ b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Freedom_RHS.sqf @@ -15,6 +15,7 @@ // Vehicles // ////////////////////////// +["attributeMoreTrucks", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["attributeLowAir", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Military.sqf b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Military.sqf index f20bda5dd7..590f557a85 100644 --- a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Military.sqf +++ b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Military.sqf @@ -15,6 +15,7 @@ // Vehicles // ////////////////////////// +["attributeMoreTrucks", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["attributeLowAir", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Military_RHS.sqf b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Military_RHS.sqf index 0c21623bf4..4211d5ffe0 100644 --- a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Military_RHS.sqf +++ b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Military_RHS.sqf @@ -15,6 +15,7 @@ // Vehicles // ////////////////////////// +["attributeMoreTrucks", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["attributeLowAir", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Monolith.sqf b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Monolith.sqf index a36f78bca1..3cd8476217 100644 --- a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Monolith.sqf +++ b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Monolith.sqf @@ -15,6 +15,7 @@ // Vehicles // ////////////////////////// +["attributeMoreTrucks", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["attributeLowAir", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Monolith_RHS.sqf b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Monolith_RHS.sqf index 3d79407151..1f73764888 100644 --- a/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Monolith_RHS.sqf +++ b/A3A/addons/core/Templates/Templates/STALKER/STALKER_AI_Monolith_RHS.sqf @@ -15,6 +15,7 @@ // Vehicles // ////////////////////////// +["attributeMoreTrucks", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["attributeLowAir", true] call _fnc_saveToTemplate; // due to emissions in "the zone" and such, you don't want helis and planes flying around all the time ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; diff --git a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_AAF.sqf b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_AAF.sqf index 982a55a789..167380e8e9 100644 --- a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_AAF.sqf +++ b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_AAF.sqf @@ -26,6 +26,8 @@ private _hasRF = "rf" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["I_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "I_supplyCrate_F"] call _fnc_saveToTemplate; //Don't touch or you die a sad and lonely death! ["surrenderCrate", "Box_IND_Wps_F"] call _fnc_saveToTemplate; //Changeing this from default will require you to define logistics attachement offset for the box type ["equipmentBox", "Box_AAF_Equip_F"] call _fnc_saveToTemplate; //Changeing this from default will require you to define logistics attachement offset for the box type diff --git a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_CSAT_Arid.sqf b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_CSAT_Arid.sqf index f22c59fe10..3e64029607 100644 --- a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_CSAT_Arid.sqf +++ b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_CSAT_Arid.sqf @@ -26,8 +26,10 @@ private _hasRF = "rf" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["O_SDV_01_F"]] call _fnc_saveToTemplate; ["vehiclesDropPod", ["Land_Pod_Heli_Transport_04_covered_F"]] call _fnc_saveToTemplate; + ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; //Don't touch or you die a sad and lonely death! ["surrenderCrate", "Box_East_Wps_F"] call _fnc_saveToTemplate; //Changeing this from default will require you to define logistics attachement offset for the box type ["equipmentBox", "Box_CSAT_Equip_F"] call _fnc_saveToTemplate; //Changeing this from default will require you to define logistics attachement offset for the box type diff --git a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_CSAT_Temperate.sqf b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_CSAT_Temperate.sqf index 77d2c22150..3cbb1b2a54 100644 --- a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_CSAT_Temperate.sqf +++ b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_CSAT_Temperate.sqf @@ -26,6 +26,8 @@ private _hasRF = "rf" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["O_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; //Don't touch or you die a sad and lonely death! ["surrenderCrate", "Box_East_Wps_F"] call _fnc_saveToTemplate; //Changeing this from default will require you to define logistics attachement offset for the box type ["equipmentBox", "Box_CSAT_Equip_F"] call _fnc_saveToTemplate; //Changeing this from default will require you to define logistics attachement offset for the box type diff --git a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_LDF.sqf b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_LDF.sqf index 2c67420646..752ffd2489 100644 --- a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_LDF.sqf +++ b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_LDF.sqf @@ -26,6 +26,8 @@ private _hasRF = "rf" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["B_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; ["surrenderCrate", "Box_IND_Wps_F"] call _fnc_saveToTemplate; //Changeing this from default will require you to define logistics attachement offset for the box type ["equipmentBox", "Box_NATO_Equip_F"] call _fnc_saveToTemplate; //Changeing this from default will require you to define logistics attachement offset for the box type diff --git a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_NATO_Arid.sqf b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_NATO_Arid.sqf index e3a31cf8f6..a2c009da6e 100644 --- a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_NATO_Arid.sqf +++ b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_NATO_Arid.sqf @@ -26,6 +26,7 @@ private _hasRF = "rf" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["B_SDV_01_F"]] call _fnc_saveToTemplate; ["vehiclesDropPod", ["SpaceshipCapsule_01_F"]] call _fnc_saveToTemplate; ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; //Don't touch or you die a sad and lonely death! diff --git a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_NATO_Temperate.sqf b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_NATO_Temperate.sqf index 7180228186..c4c0e520b4 100644 --- a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_NATO_Temperate.sqf +++ b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_NATO_Temperate.sqf @@ -26,6 +26,8 @@ private _hasRF = "rf" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["B_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; //Don't touch or you die a sad and lonely death! ["surrenderCrate", "Box_NATO_Wps_F"] call _fnc_saveToTemplate; //Changeing this from default will require you to define logistics attachement offset for the box type ["equipmentBox", "Box_NATO_Equip_F"] call _fnc_saveToTemplate; //Changeing this from default will require you to define logistics attachement offset for the box type diff --git a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_NATO_Tropical.sqf b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_NATO_Tropical.sqf index 242b71e024..39be6bd09c 100644 --- a/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_NATO_Tropical.sqf +++ b/A3A/addons/core/Templates/Templates/Vanilla/Vanilla_AI_NATO_Tropical.sqf @@ -26,6 +26,8 @@ private _hasRF = "rf" in A3A_enabledDLC; // Vehicles // ////////////////////////// +["vehiclesSDV", ["B_SDV_01_F"]] call _fnc_saveToTemplate; + ["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate; //Don't touch or you die a sad and lonely death! ["surrenderCrate", "Box_NATO_Wps_F"] call _fnc_saveToTemplate; //Changeing this from default will require you to define logistics attachement offset for the box type ["equipmentBox", "Box_NATO_Equip_F"] call _fnc_saveToTemplate; //Changeing this from default will require you to define logistics attachement offset for the box type diff --git a/A3A/addons/core/functions/AI/fn_liberatedeserter.sqf b/A3A/addons/core/functions/AI/fn_liberatedeserter.sqf new file mode 100644 index 0000000000..980961d974 --- /dev/null +++ b/A3A/addons/core/functions/AI/fn_liberatedeserter.sqf @@ -0,0 +1,24 @@ +params ["_unit", "_playerX"]; + +if (!alive _unit) exitWith { + [_unit,"remove"] remoteExec ["A3A_fnc_flagaction",[teamPlayer,civilian],_unit]; +}; + +[_unit,"remove"] remoteExec ["A3A_fnc_flagaction",[teamPlayer,civilian],_unit]; + +if (captive _playerX) then { _playerX setCaptive false }; + +_playerX globalChat (localize "STR_chats_loot_flee_player"); +sleep 3; + +[_unit] join group _playerX; +private _timeout = 10; +waituntil {sleep 1; _timeout = _timeout-1; _timeout < 0 or (local _unit and group _unit == group _playerX)}; +if (_timeout < 0) exitWith {}; + +_unit globalChat (localize "STR_chats_loot_flee_response"); +_unit enableAI "MOVE"; +_unit enableAI "AUTOTARGET"; +_unit enableAI "TARGET"; +_unit enableAI "ANIM"; +if (captive _unit) then { _unit setCaptive false }; \ No newline at end of file diff --git a/A3A/addons/core/functions/Base/fn_destroyCity.sqf b/A3A/addons/core/functions/Base/fn_destroyCity.sqf index 6efe63eb35..f6de9102e1 100644 --- a/A3A/addons/core/functions/Base/fn_destroyCity.sqf +++ b/A3A/addons/core/functions/Base/fn_destroyCity.sqf @@ -2,15 +2,17 @@ params ["_markerX"]; private _positionX = getMarkerPos _markerX; private _size = [_markerX] call A3A_fnc_sizeMarker; -private _buildings = _positionX nearobjects ["house",_size]; + +private _buildings = _positionX nearObjects ["house",_size]; { - if (random 100 < 70) then { - for "_i" from 1 to 7 do { - _x setHit [format ["dam%1",_i],1]; - _x setHit [format ["dam %1",_i],1]; - }; - }; + private _hitpoints = getAllHitPointsDamage _x; + if (_hitpoints isEqualTo []) then { continue }; + if (random 100 < 30) then { continue }; + private _building = _x; + { + _building setHit [_x, 1]; + } forEach (_hitpoints # 1 select { _x find "dam" == 0 }); } forEach _buildings; [_markerX,false] spawn A3A_fnc_blackout; \ No newline at end of file diff --git a/A3A/addons/core/functions/Base/fn_flagaction.sqf b/A3A/addons/core/functions/Base/fn_flagaction.sqf index 1bc4e5ad82..0332ef93a8 100644 --- a/A3A/addons/core/functions/Base/fn_flagaction.sqf +++ b/A3A/addons/core/functions/Base/fn_flagaction.sqf @@ -169,6 +169,13 @@ switch _typeX do localize "STR_antistasi_actions_free_prisoner" ], A3A_fnc_liberaterefugee,nil,6,true,true,"","(isPlayer _this) && (_this == _this getVariable ['owner',objNull]) && alive _target",4]; }; + case "deserter": + { + _flag addAction [format [ + " %1", + localize "STR_antistasi_actions_free_prisoner" + ], A3A_fnc_liberateDeserter,nil,6,true,true,"","(isPlayer _this) && (_this == _this getVariable ['owner',objNull]) && alive _target",4]; + }; case "prisonerX": { _flag addAction [format [ diff --git a/A3A/addons/core/functions/Base/fn_getVehiclesGroundSupport.sqf b/A3A/addons/core/functions/Base/fn_getVehiclesGroundSupport.sqf index dce1148d1e..e37e3b7a31 100644 --- a/A3A/addons/core/functions/Base/fn_getVehiclesGroundSupport.sqf +++ b/A3A/addons/core/functions/Base/fn_getVehiclesGroundSupport.sqf @@ -9,7 +9,7 @@ Arguments: Return value: [vehType, weight, vehType2, weight2, ...] */ -params ["_side", "_level"]; +params ["_side", "_level", ["_tanksOnly", false]]; _level = (_level max 1 min 10) - 1; private _faction = [A3A_faction_occ, A3A_faction_inv] select (_side == Invaders); @@ -31,6 +31,10 @@ private _ltankWeight = [ 0, 10, 15, 25, 30, 35, 30, 25, 20, 15] select _lev private _vehAA = (_faction get "vehiclesAA") select { A3A_vehicleResourceCosts get _x >= 100 }; if (_vehAA isEqualTo []) then { _tankWeight = _tankWeight + _aaWeight }; +[_faction get "vehiclesLightTanks", _ltankWeight] call _fnc_addArrayToWeights; +[_faction get "vehiclesTanks", _tankWeight] call _fnc_addArrayToWeights; +if (_tanksOnly) exitWith { _vehWeights }; + // only occupants use militia vehicles? if (_side == Occupants) then { [_faction get "vehiclesMilitiaLightArmed", _milCarWeight] call _fnc_addArrayToWeights; @@ -40,8 +44,6 @@ if (_side == Occupants) then { }; }; [_faction get "vehiclesLightArmed", _carWeight] call _fnc_addArrayToWeights; -[_faction get "vehiclesTanks", _tankWeight] call _fnc_addArrayToWeights; -[_faction get "vehiclesLightTanks", _ltankWeight] call _fnc_addArrayToWeights; [_vehAA, _aaWeight] call _fnc_addArrayToWeights; _vehWeights; diff --git a/A3A/addons/core/functions/Base/fn_getVehiclesGroundTransport.sqf b/A3A/addons/core/functions/Base/fn_getVehiclesGroundTransport.sqf index 502346a73f..938d9d57e8 100644 --- a/A3A/addons/core/functions/Base/fn_getVehiclesGroundTransport.sqf +++ b/A3A/addons/core/functions/Base/fn_getVehiclesGroundTransport.sqf @@ -36,9 +36,20 @@ private _ltankWeight = [ 0, 0, 15, 25, 30, 35, 30, 25, 20, 15] select _level // Assumption is that at least one of APC or battle bus exists if (_faction get "vehiclesTanks" isEqualTo []) then { _tankWeight = _tankWeight + _ltankWeight }; if (_faction get "vehiclesLightTanks" isEqualTo []) then { _ltankWeight = _ltankWeight + _ifvWeight }; -if (_faction get "vehiclesIFVs" isEqualTo []) then { _apcWeight = _apcWeight + _ifvWeight }; -if (_faction get "vehiclesAPCs" isEqualTo []) then { _lapcWeight = _lapcWeight + _apcWeight }; + +if (_faction getOrDefault ["attributeMoreTrucks", false]) then { + _truckWeight = [60, 60, 60, 60, 60, 60, 55, 50, 45, 40] select _level; + _lapcWeight = [10, 15, 20, 20, 20, 20, 20, 20, 20, 20] select _level; + _apcWeight = [ 0, 4, 8, 12, 16, 20, 20, 20, 20, 20] select _level; + _ifvWeight = [ 0, 0, 2, 4, 6, 8, 12, 16, 20, 25] select _level; +}; + if (_faction get "vehiclesLightAPCs" isEqualTo []) then { _apcWeight = _apcWeight + _lapcWeight/2; _truckWeight = _truckWeight + _lapcWeight/2; }; +if (_faction get "vehiclesIFVs" isEqualTo []) then { _apcWeight = _apcWeight + _ifvWeight }; +if (_faction get "vehiclesAPCs" isEqualTo []) then { + if (_faction get "vehiclesLightAPCs" isEqualTo []) exitWith { _ifvWeight = _ifvWeight + _apcWeight }; + _lapcWeight = _lapcWeight + _apcWeight; +}; // only occupants use militia vehicle types? if (_side == Occupants) then { diff --git a/A3A/addons/core/functions/Base/fn_isFrontlineNoFia.sqf b/A3A/addons/core/functions/Base/fn_isFrontlineNoFia.sqf new file mode 100644 index 0000000000..9dee990710 --- /dev/null +++ b/A3A/addons/core/functions/Base/fn_isFrontlineNoFia.sqf @@ -0,0 +1,20 @@ +params ["_markerX"]; + +private ["_positionX","_mrkENY"]; + +private _isFrontier = false; +private _sideX = sidesX getVariable [_markerX,sideUnknown]; +private _sideOpposite = objNull; +if (_sideX == Occupants) then { + _sideOpposite = Invaders; +} else { + _sideOpposite = Occupants; +}; +private _mrkENY = (airportsX + milbases + outposts + seaports + factories + resourcesX) select {sidesX getVariable [_x,sideUnknown] == _sideOpposite}; /// != teamPlayer debetable + +if (count _mrkENY > 0) then { + private _positionX = getMarkerPos _markerX; + _isFrontier = _mrkENY findIf {_positionX distance (getMarkerPos _x) < distanceSPWN*2} != -1; +}; + +_isFrontier \ No newline at end of file diff --git a/A3A/addons/core/functions/Base/fn_moveOutCrew.sqf b/A3A/addons/core/functions/Base/fn_moveOutCrew.sqf index 4a62a12724..83046052c2 100644 --- a/A3A/addons/core/functions/Base/fn_moveOutCrew.sqf +++ b/A3A/addons/core/functions/Base/fn_moveOutCrew.sqf @@ -42,7 +42,7 @@ if (isNull _vehicle) exitWith { [localize "STR_A3A_Base_moveOutCrew_header", localize "STR_A3A_reinf_airstrike_not_looking_at_veh"] remoteExecCall ["SCRT_fnc_misc_deniedHint",_player]; }; _owner = _vehicle getVariable ["ownerX",""]; -if !(_owner isEqualTo "" || {getPlayerUID _player isEqualTo _owner}) exitWith { // crew cannot be moved out if owned by another player. +if (_owner isNotEqualTo "" && {getPlayerUID _player isNotEqualTo _owner}) exitWith { // crew cannot be moved out if owned by another player. [localize "STR_A3A_Base_moveOutCrew_header", localize "STR_A3A_Base_sellVehicle_err2"] remoteExecCall ["SCRT_fnc_misc_deniedHint",_player]; }; @@ -75,4 +75,4 @@ if (unitIsUAV _vehicle) then { [localize "STR_A3A_Base_moveOutCrew_header", localize "STR_A3A_Base_moveOutCrew_success"] remoteExecCall ["A3A_fnc_customHint",_player]; -nil; \ No newline at end of file +nil; diff --git a/A3A/addons/core/functions/Base/fn_mrkWIN.sqf b/A3A/addons/core/functions/Base/fn_mrkWIN.sqf index 01a36a3700..ea45103fc3 100644 --- a/A3A/addons/core/functions/Base/fn_mrkWIN.sqf +++ b/A3A/addons/core/functions/Base/fn_mrkWIN.sqf @@ -30,7 +30,11 @@ if (_caller isNotEqualTo player) exitWith { private _markerX = [airportsX + resourcesX + factories + outposts + seaports + milbases, getPosATL _flagX] call BIS_fnc_nearestPosition; -// private _hideEnemyMarkers = missionNamespace getVariable ["A3U_setting_hideEnemyMarkers",false]; +private _vehicles = _flagX getVariable ["A3U_zoneVehicles", []]; + +{ + [_x, false] call A3U_fnc_setLock; +} forEach _vehicles; if (hideEnemyMarkers) then { "Dum"+_markerX setMarkerAlpha 1; diff --git a/A3A/addons/core/functions/Base/fn_statistics.sqf b/A3A/addons/core/functions/Base/fn_statistics.sqf index d0cf63bff4..c10765cebd 100644 --- a/A3A/addons/core/functions/Base/fn_statistics.sqf +++ b/A3A/addons/core/functions/Base/fn_statistics.sqf @@ -11,8 +11,6 @@ if (isNull (uiNameSpace getVariable "H8erHUD")) exitWith {}; private _display = uiNameSpace getVariable "H8erHUD"; if (isNil "_display") exitWith {}; -waitUntil {sleep 0.5;!(isNil "theBoss")}; - private _textX = nil; private _setText = _display displayCtrl 1001; @@ -65,6 +63,25 @@ switch (gameMode) do { _aggrString = _aggrString + _rivalsActivityTxt; +if (isNil "theBoss") exitWith { + _textX = format [ + "" + (localize "STR_info_bar_final_string_2"), + _rank, + (server getVariable "hr") toFixed 0, + A3A_faction_reb get "name", + (server getVariable "resourcesFIA") toFixed 0, + (_player getVariable "moneyX") toFixed 0, + _aggrString, + tierWar, + _ucovertxt, + _rallytxt, + A3A_faction_civ get "currencySymbol" + ]; + + _setText ctrlSetStructuredText (parseText format ["%1", _textX]); + _setText ctrlCommit 0; +}; + if (_player != theBoss) then { private _nameC = [ localize "STR_generic_commander_none", diff --git a/A3A/addons/core/functions/CREATE/fn_AIVEHinit.sqf b/A3A/addons/core/functions/CREATE/fn_AIVEHinit.sqf index beaa621893..de060f3770 100644 --- a/A3A/addons/core/functions/CREATE/fn_AIVEHinit.sqf +++ b/A3A/addons/core/functions/CREATE/fn_AIVEHinit.sqf @@ -204,6 +204,19 @@ if (_side != teamPlayer) then }]; }; +/* if(_veh isKindOf "Air") then +{ + //Start airspace control script if opposite faction enters + _veh addEventHandler ["GetIn", { + params ["_veh", "_role", "_unit"]; + if((side (group _unit) == Invaders) || (side (group _unit) == Occupants) && {isPlayer _unit}) then + { + // TODO: check this isn't spammed + [_veh] spawn A3A_fnc_airspaceControl; + }; + }]; +}; */ + if(_veh isKindOf "Air") then { //Start airspace control script if rebel player enters diff --git a/A3A/addons/core/functions/CREATE/fn_createAIAirplane.sqf b/A3A/addons/core/functions/CREATE/fn_createAIAirplane.sqf index 2dfb658de0..78f5b53c3a 100644 --- a/A3A/addons/core/functions/CREATE/fn_createAIAirplane.sqf +++ b/A3A/addons/core/functions/CREATE/fn_createAIAirplane.sqf @@ -452,6 +452,11 @@ for "_i" from 0 to (count _array - 1) do { ["locationSpawned", [_markerX, "Airport", true]] call EFUNC(Events,triggerEvent); +{ + [_x, true] call A3U_fnc_setLock; +} forEach _vehiclesX; + +flagX setVariable ["A3U_zoneVehicles", _vehiclesX]; waitUntil {sleep 1; (spawner getVariable _markerX == 2)}; diff --git a/A3A/addons/core/functions/CREATE/fn_createAttackForceLand.sqf b/A3A/addons/core/functions/CREATE/fn_createAttackForceLand.sqf index 9edb19938a..9d9aa481b9 100644 --- a/A3A/addons/core/functions/CREATE/fn_createAttackForceLand.sqf +++ b/A3A/addons/core/functions/CREATE/fn_createAttackForceLand.sqf @@ -13,7 +13,8 @@ Arguments: Total number of vehicles to create Number of attack/support vehicles to create Optional, tier modifier to apply to vehicle selection (Default: 0) - Optional, troop type to use (Default: "Normal") + Optional, true to only use tanks (Default: false) +// Optional, troop type to use (Default: "Normal") Return array: Resources spent @@ -24,7 +25,7 @@ Return array: #include "..\..\script_component.hpp" FIX_LINE_NUMBERS() -params ["_side", "_base", "_target", "_resPool", "_vehCount", "_vehAttackCount", ["_tierMod", 0]]; +params ["_side", "_base", "_target", "_resPool", "_vehCount", "_vehAttackCount", ["_tierMod", 0], ["_tanksOnly", false]]; private _targpos = if (_target isEqualType []) then { _target } else { markerPos _target }; private _transportRatio = 1 - _vehAttackCount / _vehCount; @@ -34,7 +35,7 @@ private _crewGroups = []; private _cargoGroups = []; private _transportPool = [_side, tierWar+_tierMod] call A3A_fnc_getVehiclesGroundTransport; -private _supportPool = [_side, tierWar+_tierMod] call A3A_fnc_getVehiclesGroundSupport; +private _supportPool = [_side, tierWar+_tierMod, _tanksOnly] call A3A_fnc_getVehiclesGroundSupport; private _numTransports = 0; private _isTransport = _vehAttackCount < _vehCount; // normal case, first vehicle should be a transport diff --git a/A3A/addons/core/functions/Missions/fn_CON_MilAdmin.sqf b/A3A/addons/core/functions/Missions/fn_CON_MilAdmin.sqf index 26da72c71c..c0b1ff2217 100644 --- a/A3A/addons/core/functions/Missions/fn_CON_MilAdmin.sqf +++ b/A3A/addons/core/functions/Missions/fn_CON_MilAdmin.sqf @@ -4,7 +4,7 @@ FIX_LINE_NUMBERS() params ["_marker"]; //Mission: Capture military administration -if (!isServer and hasInterface) exitWith{}; +if (isServer and hasInterface) exitWith{}; private _difficultX = if (random 10 < tierWar) then {true} else {false}; private _milAdministrationPos = getMarkerPos _marker; diff --git a/A3A/addons/core/functions/Missions/fn_CON_Outpost.sqf b/A3A/addons/core/functions/Missions/fn_CON_Outpost.sqf index 51d768fe35..b3864bddb4 100644 --- a/A3A/addons/core/functions/Missions/fn_CON_Outpost.sqf +++ b/A3A/addons/core/functions/Missions/fn_CON_Outpost.sqf @@ -1,7 +1,13 @@ params ["_markerX"]; //Mission: Conquer the outpost -if (!isServer and hasInterface) exitWith{}; +if (isServer and hasInterface) exitWith{}; + +private _zones = (outposts + seaports + resourcesX + factories); +private _zonesFrontline = [_zones select {[_x] call A3A_fnc_isFrontlineNoFIA}]; +if (_markerX in _zonesFrontline && !(_markerX in controlsX)) exitWith { + [[_markerX],"A3A_fnc_CON_Outpost_Compet"] remoteExec ["A3A_fnc_scheduler",2]; +}; private _difficultX = if (random 10 < tierWar) then {true} else {false}; private _positionX = getMarkerPos _markerX; diff --git a/A3A/addons/core/functions/Missions/fn_CON_Outpost_Compet.sqf b/A3A/addons/core/functions/Missions/fn_CON_Outpost_Compet.sqf new file mode 100644 index 0000000000..779e50be3b --- /dev/null +++ b/A3A/addons/core/functions/Missions/fn_CON_Outpost_Compet.sqf @@ -0,0 +1,149 @@ +params ["_markerX"]; + +//Mission: Conquer the outpost, before other faction will do it. +if (!isServer and hasInterface) exitWith{}; + +private _difficultX = if (random 10 < tierWar) then {true} else {false}; +private _positionX = getMarkerPos _markerX; + +private _limit = if (_difficultX) then { + 45 call SCRT_fnc_misc_getTimeLimit +} else { + 90 call SCRT_fnc_misc_getTimeLimit +}; +_limit params ["_dateLimitNum", "_displayTime"]; + +private _markerSide = sidesX getVariable [_markerX, sideUnknown]; +private _oppositeside = objNull; +if (_markerSide == Occupants) then { + _oppositeside = Invaders; +} else { + _oppositeside = Occupants; +}; + +private _nameDest = [_markerX] call A3A_fnc_localizar; +private _textX = ""; +private _taskName = ""; + +if ((_oppositeside == Occupants && areOccupantsDefeated) || {(_oppositeside == Invaders && areInvadersDefeated)}) exitWith { + [[_markerX],"A3A_fnc_CON_Outpost"] remoteExec ["A3A_fnc_scheduler",2]; +}; + +switch (true) do { + case (_markerX in resourcesX): { + _textX = format [localize "STR_CON_Outpost_resources_compet_desc", _nameDest, _displayTime, _oppositeside]; ///add stringtables + _taskName = localize "STR_CON_Outpost_resources_compet_task"; + }; + case (_markerX in controlsX): { + _textX = format [localize "STR_CON_Outpost_controls_compet_desc", _nameDest, _displayTime, _oppositeside]; + _taskName = localize "STR_CON_Outpost_controls_compet_task"; + }; + default { + _textX = format [localize "STR_CON_Outpost_outposts_compet_desc", _nameDest, _displayTime, _oppositeside]; + _taskName = localize "STR_CON_Outpost_outposts_compet_task"; + }; +}; + +private _taskId = "CON" + str A3A_taskCount; +[[teamPlayer,civilian],_taskId,[_textX,_taskName,_markerX],_positionX,false,0,true,"Target",true] call BIS_fnc_taskCreate; +[_taskId, "CON", "CREATED"] remoteExecCall ["A3A_fnc_taskUpdate", 2]; + +private _delay = 30 + (round random 20); +private _targPos = markerPos _markerX; + +private _airbase = [_oppositeside, markerPos _markerX] call A3A_fnc_availableBasesAir; +/* private _landbase = [_oppositeside, markerPos _markerX] call A3A_fnc_availableBasesLand; +private _allbases = selectRandom(_airbase + _landbase); */ + +private _vehCount = if (_difficultX) then { + 4; +} else { + 2; +}; +if (_markerX in (airportsX + milbases)) then { + _vehCount = 6; +}; + +//params ["_side", "_airbase", "_target", "_resPool", "_vehCount", "_delay", "_modifiers", "_attackType", "_reveal"]; +/* private _data = [_oppositeside, _airbase, _targPos, "attack", _vehCount, _delay, ["tierboost"]] call A3A_fnc_createAttackForceMixed; +_data params ["_resources", "_vehicles", "_crewGroups", "_cargoGroups"]; */ +[_markerX, _airbase, _vehCount] spawn A3A_fnc_wavedAttack; + +// Prepare despawn conditions +private _endTime = time + 2700; +//private _victory = false; +/* private _soldiers = []; +{ _soldiers append units _x } forEach _cargoGroups; */ + +waitUntil {sleep 1; dateToNumber date > _dateLimitNum or {sidesX getVariable [_markerX,sideUnknown] == teamPlayer} /* || {sidesX getVariable [_markerX,sideUnknown] == _oppositeside} */}; + +/* while {true} do +{ + private _markerSide = sidesX getVariable _markerX; + if(_markerSide == _oppositeside) exitWith { + //diag_log ("Attack to %1 captured the marker, starting despawn routines", _markerX); + _victory = true; + }; + + private _curSoldiers = { !fleeing _x and _x call A3A_fnc_canFight } count _soldiers; + if (_curSoldiers < count _soldiers * 0.25) exitWith { + //diag_log ("Small attack to %1 has been defeated, starting despawn routines", _markerX); + }; + if(_endTime < time) exitWith { + // diag_log ("Small attack to %1 timed out, starting despawn routines", _markerX); + }; + + // Attempt to flip marker + [_markerX, _markerSide] remoteExec ["A3A_fnc_zoneCheck", 2]; + sleep 30; +}; */ + +/* { [_x] spawn A3A_fnc_VEHDespawner } forEach _vehicles; +{ [_x] spawn A3A_fnc_enemyReturnToBase } forEach _crewGroups; +{ + [_x, [nil, _markerX] select _victory] spawn A3A_fnc_enemyReturnToBase; + sleep 10; +} forEach _cargoGroups; */ + +// add a check if all players are dead, in the area of a marker +// Or add a check if possible to determite whenver other faction managed to capture marker, or leave it as is +if (dateToNumber date > _dateLimitNum) then { ///here we need to add check if defenders or players in the area are dead or if there are more attackers then defenders + [_taskId, "CON", "FAILED"] call A3A_fnc_taskSetState; + if (_difficultX) then { + [25,0,_positionX] remoteExec ["A3A_fnc_citySupportChange",2]; + [-1200, _markerSide] remoteExec ["A3A_fnc_timingCA",2]; + [-20,theBoss] call A3A_fnc_addScorePlayer; + //[_oppositeside, _markerX] spawn A3A_fnc_markerChange; + } else { + [5,0,_positionX] remoteExec ["A3A_fnc_citySupportChange",2]; + [-600, _markerSide] remoteExec ["A3A_fnc_timingCA",2]; + [-10,theBoss] call A3A_fnc_addScorePlayer; + //[_oppositeside, _markerX] spawn A3A_fnc_markerChange; + }; +} else { + sleep 10; + [_taskId, "CON", "SUCCEEDED"] call A3A_fnc_taskSetState; + if (_difficultX) then { + [0,800] remoteExec ["A3A_fnc_resourcesFIA",2]; + [-25,0,_positionX] remoteExec ["A3A_fnc_citySupportChange",2]; + [1800, _markerSide] remoteExec ["A3A_fnc_timingCA",2]; + { + [450, _x] call A3A_fnc_addMoneyPlayer; + [30, _x] call A3A_fnc_addScorePlayer; + } forEach (call SCRT_fnc_misc_getRebelPlayers); + [30, theBoss] call A3A_fnc_addScorePlayer; + [300,theBoss, true] call A3A_fnc_addMoneyPlayer; + } else { + [0,600] remoteExec ["A3A_fnc_resourcesFIA",2]; + [-20,0,_positionX] remoteExec ["A3A_fnc_citySupportChange",2]; + [1200, _markerSide] remoteExec ["A3A_fnc_timingCA",2]; + { + [250, _x] call A3A_fnc_addMoneyPlayer; + [20, _x] call A3A_fnc_addScorePlayer; + } forEach (call SCRT_fnc_misc_getRebelPlayers); + [20, theBoss] call A3A_fnc_addScorePlayer; + [200, theBoss, true] call A3A_fnc_addMoneyPlayer; + }; +}; + +[_taskId, "CON", 1200] spawn A3A_fnc_taskDelete; \ No newline at end of file diff --git a/A3A/addons/core/functions/Missions/fn_LOG_Airdrop.sqf b/A3A/addons/core/functions/Missions/fn_LOG_Airdrop.sqf index 8619a07fcb..49c27c522c 100644 --- a/A3A/addons/core/functions/Missions/fn_LOG_Airdrop.sqf +++ b/A3A/addons/core/functions/Missions/fn_LOG_Airdrop.sqf @@ -2,7 +2,7 @@ FIX_LINE_NUMBERS() //Mission: Catch airdrop -if (!isServer and hasInterface) exitWith{}; +if (isServer and hasInterface) exitWith{}; params ["_markerX"]; diff --git a/A3A/addons/core/functions/Missions/fn_LOG_Bank.sqf b/A3A/addons/core/functions/Missions/fn_LOG_Bank.sqf index f898eb4fc0..fff959feb6 100644 --- a/A3A/addons/core/functions/Missions/fn_LOG_Bank.sqf +++ b/A3A/addons/core/functions/Missions/fn_LOG_Bank.sqf @@ -4,7 +4,7 @@ FIX_LINE_NUMBERS() params ["_bank"]; //Mission: Logistics bank mission -if (!isServer and hasInterface) exitWith {}; +if (isServer and hasInterface) exitWith {}; private _markerX = [citiesX,_bank] call BIS_fnc_nearestPosition; diff --git a/A3A/addons/core/functions/Missions/fn_LOG_Salvage.sqf b/A3A/addons/core/functions/Missions/fn_LOG_Salvage.sqf index 415ba9ed07..327bab12c2 100644 --- a/A3A/addons/core/functions/Missions/fn_LOG_Salvage.sqf +++ b/A3A/addons/core/functions/Missions/fn_LOG_Salvage.sqf @@ -14,10 +14,10 @@ private _positionX = getMarkerPos _markerX; private _shipType = "Land_UWreck_FishingBoat_F"; //Select possible locations for sunken treasure -private _firstPos = round (random 100) + 150; -private _mrk1Pos = (selectRandom (selectBestPlaces [_positionX, _firstPos,"waterDepth", 5, 20]) select 0) + [0]; -private _mrk2Pos = (selectRandom (selectBestPlaces [_mrk1Pos, 300,"waterDepth", 5, 20]) select 0) + [0]; -private _mrk3Pos = (selectRandom (selectBestPlaces [_mrk2Pos, 300,"waterDepth", 5, 20]) select 0) + [0]; +private _firstPos = round (random 1000) + 150; +private _mrk1Pos = (selectRandom (selectBestPlaces [_positionX, _firstPos,"waterDepth", 20, 20]) select 0) + [0]; +private _mrk2Pos = (selectRandom (selectBestPlaces [_mrk1Pos, 300,"waterDepth", 20, 20]) select 0) + [0]; +private _mrk3Pos = (selectRandom (selectBestPlaces [_mrk2Pos, 300,"waterDepth", 20, 20]) select 0) + [0]; //Create markers for treasure locations! private _mrk1 = createMarker ["salvageLocation1", _mrk1Pos]; @@ -46,12 +46,13 @@ private _limit = if (_difficultX) then { }; _limit params ["_dateLimitNum", "_displayTime"]; +private _randomMarker = selectRandom [_mrk1, _mrk2, _mrk3]; //Name of seaport marker private _nameDest = [_markerX] call A3A_fnc_localizar; private _title = localize "STR_A3A_Missions_LOG_Salvage_task_header"; private _text = format [localize "STR_A3A_Missions_LOG_Salvage_task_desc", _nameDest, _displayTime]; private _taskId = "LOG" + str A3A_taskCount; -[[teamPlayer, civilian], _taskId, [ _text, _title, [_mrk1, _mrk2, _mrk3]], _positionX, false, 0, true, "rearm", true] call BIS_fnc_taskCreate; +[[teamPlayer, civilian], _taskId, [ _text, _title, [_mrk1, _mrk2, _mrk3]], _randomMarker, false, 0, true, "rearm", true] call BIS_fnc_taskCreate; [_taskId, "LOG", "CREATED"] remoteExecCall ["A3A_fnc_taskUpdate", 2]; //salvageRope action @@ -62,6 +63,7 @@ waitUntil {sleep 1;(dateToNumber date > _dateLimitNum) or ((spawner getVariable Debug("players in spawning range, starting spawning"); private _boxPos = selectRandom [_mrk1Pos, _mrk2Pos, _mrk3Pos]; +private _markers = [_mrk1Pos, _mrk2Pos, _mrk3Pos]; private _shipPos = _boxPos vectorAdd [4, -5, 2]; private _ship = _shipType createVehicle _shipPos; @@ -84,6 +86,46 @@ private _typeVeh = if (_difficultX) then { selectRandom (_faction get "vehiclesG private _typeGroup = if _difficultX then {selectRandom ([_faction, "groupsTierSquads"] call SCRT_fnc_unit_flattenTier)} else {selectRandom ([_faction, "groupsTierMedium"] call SCRT_fnc_unit_flattenTier)}; private _boatSpawnLocation = selectRandom [_mrk1Pos, _mrk2Pos, _mrk3Pos]; +if ("vanilla" in A3A_factionEquipFlags) then { + private _typeSDV = ""; + private _diverType = ""; + private _diversGroup = createGroup _sideX; + private _diversGroup2 = createGroup _sideX; + _typeSDV = selectRandom (_faction get "vehiclesSDV"); + if (_typeSDV == "I_SDV_01_F") then { + _diverType = "I_diver_F"; + }; + if (_typeSDV == "O_SDV_01_F") then { + _diverType = "O_diver_F"; + }; + if (_typeSDV == "B_SDV_01_F") then { + _diverType = "B_diver_F"; + }; + for "_i" from 1 to 2 do { + private _SDVmarker = selectRandom [_mrk1Pos, _mrk2Pos, _mrk3Pos]; + private _vehSDV = createVehicle [_typeSDV, _SDVmarker, [], 30, "NONE"]; + _vehSDV setPos [getPos _vehSDV select 0, getPos _vehSDV select 1, (getPos _vehSDV select 2) - 7]; + [_vehSDV, _sideX] call A3A_fnc_AIVEHinit; + for "_i" from 1 to 2 do { + private _diver = _diversGroup createUnit [_diverType, getPos _vehSDV, [], 10, "NONE"]; + _diver setPos [getPos _diver select 0, getPos _diver select 1, (getPos _diver select 2) - 8]; + [_diver] call A3A_fnc_NATOinit; + }; + for "_i" from 1 to 2 do { + private _diver = _diversGroup2 createUnit [_diverType, getPos _vehSDV, [], 10, "NONE"]; + _diver setPos [getPos _diver select 0, getPos _diver select 1, (getPos _diver select 2) - 8]; + [_diver] call A3A_fnc_NATOinit; + }; + }; + private _diversWaypoint = _diversGroup addWaypoint [selectRandom _markers, 30]; + _diversWaypoint setWaypointType "SAD"; + _diversGroup setCurrentWaypoint _diversWaypoint; + + private _divers2Waypoint = _diversGroup2 addWaypoint [selectRandom _markers, 30]; + _divers2Waypoint setWaypointType "SAD"; + _diversGroup2 setCurrentWaypoint _divers2Waypoint; +}; + private _veh = createVehicle [_typeVeh, _boatSpawnLocation, [], 0, "NONE"]; [_veh, _sideX] call A3A_fnc_AIVEHinit; private _vehCrewGroup = [_positionX,_sideX, _typeGroup] call A3A_fnc_spawnGroup; @@ -109,6 +151,8 @@ _vehCrewGroup addVehicle _veh; }; }; +/// add enemy divers and SVD somewhere + //Disable simulation if we *really* want to Debug("Waiting for salvage mission end"); waitUntil {sleep 1; dateToNumber date > _dateLimitNum or {(_box distance2D posHQ) < 100}}; @@ -147,3 +191,8 @@ deleteVehicle _ship; [_vehCrewGroup] spawn A3A_fnc_groupDespawner; [_veh] spawn A3A_fnc_vehDespawner; +if ("vanilla" in A3A_factionEquipFlags) then { + [_SDVcrewGroup] spawn A3A_fnc_groupDespawner; + [_diversGroup] spawn A3A_fnc_groupDespawner; + [_veh] spawn A3A_fnc_vehDespawner; +}; \ No newline at end of file diff --git a/A3A/addons/core/functions/Missions/fn_RES_Deserters.sqf b/A3A/addons/core/functions/Missions/fn_RES_Deserters.sqf new file mode 100644 index 0000000000..311f3c6d85 --- /dev/null +++ b/A3A/addons/core/functions/Missions/fn_RES_Deserters.sqf @@ -0,0 +1,274 @@ +#include "..\..\script_component.hpp" +FIX_LINE_NUMBERS() + +params ["_markerX"]; + +//Mission: Rescue the prisoners +if (!isServer and hasInterface) exitWith{}; + +private _effects = []; +private _Deserters = []; +private _vehicles = []; +private _groups = []; +private _props = []; + +private _sideX = if (sidesX getVariable [_markerX, sideUnknown] == Occupants) then {Occupants} else {Invaders}; +private _faction = Faction(_sideX); +private _difficultX = random 10 < tierWar; +private _positionX = getMarkerPos _markerX; + +private _limit = if (_difficultX) then { + 45 call SCRT_fnc_misc_getTimeLimit +} else { + 120 call SCRT_fnc_misc_getTimeLimit +}; +_limit params ["_dateLimitNum", "_displayTime"]; + +private _nameDest = [_markerX] call A3A_fnc_localizar; + +private _posHouse = []; +private _countX = 0; +//_houses = nearestObjects [_positionX, ["house"], 50]; +private _houses = (nearestObjects [_positionX, ["house"], 2000]) select {!((typeOf _x) in A3A_buildingBlacklist)}; ///some other way is needed, currently can spawn inside outpost +private _houseX = ""; +private _potentials = []; +private _spawnPos = []; +for "_i" from 0 to (count _houses) - 1 do { + _houseX = (_houses select _i); + _posHouse = [_houseX] call BIS_fnc_buildingPositions; + if (count _posHouse > 1) then {_potentials pushBack _houseX}; +}; + +if (count _potentials > 0) then { + _houseX = selectRandom _potentials; + _spawnPos = _houseX; + _posHouse = [_houseX] call BIS_fnc_buildingPositions; + _countX = (count _posHouse); + if (_countX > 10) then {_countX = 10}; +} else { + _countX = (round random 4) + 3; + _spawnPos = _positionX; + for "_i" from 0 to _countX do { + _postmp = [_positionX, 5, random 360] call BIS_Fnc_relPos; + _posHouse pushBack _postmp; + }; +}; +diag_log _countX; +private _taskId = "RES" + str A3A_taskCount; +if (count _potentials > 0) then { + [[teamPlayer,civilian],_taskId,[format [localize "STR_A3A_Missions_RES_Deserters_task_desc",_nameDest,_displayTime],localize "STR_A3A_Missions_RES_Deserters_task_header",_markerX],_spawnPos,false,0,true,"run",true] call BIS_fnc_taskCreate;///add stringtables + [_taskId, "RES", "CREATED"] remoteExecCall ["A3A_fnc_taskUpdate", 2]; +} else { + [[teamPlayer,civilian],_taskId,[format [localize "STR_A3A_Missions_RES_Deserters_task_desc",_nameDest,_displayTime],localize "STR_A3A_Missions_RES_Deserters_task_header",_markerX],_positionX,false,0,true,"run",true] call BIS_fnc_taskCreate; + [_taskId, "RES", "CREATED"] remoteExecCall ["A3A_fnc_taskUpdate", 2]; +}; +waitUntil { + sleep 1; + (call SCRT_fnc_misc_getRebelPlayers) inAreaArray [_spawnPos, distanceSPWN1, distanceSPWN1] isNotEqualTo [] || {dateToNumber date > _dateLimitNum} +}; ///uncomment later + +private _infantrySquadArray = [ + selectRandom ([_faction, "groupsTierMedium"] call SCRT_fnc_unit_flattenTier), + selectRandom ([_faction, "groupsTierSquads"] call SCRT_fnc_unit_flattenTier) +] select _difficultX; + +private _vehiclePatrol = ""; + +private _stolenVehicle = ""; + +_vehiclePatrolType = selectRandom ((_faction get "vehiclesLightArmed") + (_faction get "vehiclesMilitiaLightArmed") + (_faction get "vehiclesMilitiaAPCs") + (_faction get "vehiclesMilitiaTrucks")); +_stolenVehicleType = if (_difficultX) then { + selectRandom ((_faction get "vehiclesLightAPCs") +(_faction get "vehiclesLightArmed") + (_faction get "vehiclesTrucks")); +} else { + selectRandom ((_faction get "vehiclesLightArmed") + (_faction get "vehiclesTrucks") + (_faction get "vehiclesMilitiaLightArmed") + (_faction get "vehiclesMilitiaCars") + (_faction get "vehiclesMilitiaAPCs") + (_faction get "vehiclesMilitiaTrucks")); +}; + +private _nearbyPos = [_spawnPos, 200, 300, 3, 0, 5, 0] call BIS_fnc_findSafePos; + +private _patrolGroup1 = [_nearbyPos, _sideX, _infantrySquadArray] call A3A_fnc_spawnGroup; +{ + [_x] call A3A_fnc_NATOinit; +} forEach units _patrolGroup1; + +private _PatrolvehData = [_nearbyPos, 0,_vehiclePatrolType, _sideX] call A3A_fnc_spawnVehicle; +private _Patrolveh = _PatrolvehData select 0; +private _vehCrew = _PatrolvehData select 1; +private _patrolVehgroup = _PatrolvehData select 2; +{ + [_x] call A3A_fnc_NATOinit; +} forEach _vehCrew; +[_Patrolveh, _sideX] call A3A_fnc_AIVEHinit; + +private _stolenVehicleSpawnPos = [_spawnPos, 5, 50, 3, 0, 5, 0] call BIS_fnc_findSafePos; +private _stolenVehicle = createVehicle [_stolenVehicleType, _stolenVehicleSpawnPos, [], 0, "NONE"]; +[_stolenVehicle, teamPlayer] call A3A_fnc_AIVEHinit; +//private _stolenVehgroup = group driver _StolenVehGroup;///not sure how to transfer command of units inside vehicle to player, so for now vehicle will stay empty + +private _patrolGroup2 = []; +private _soldersPatrol = []; +if (_difficultX) then { + _nearbyPos = [_spawnPos, 100, 150, 3, 0, 20, 0] call BIS_fnc_findSafePos; + _patrolGroup2 = [_nearbyPos, _sideX, _infantrySquadArray] call A3A_fnc_spawnGroup; + _soldersPatrol append units _patrolGroup2; + { + [_x] call A3A_fnc_NATOinit; + } forEach units _patrolGroup2; +}; +_soldersPatrol append units _patrolGroup1; +_soldersPatrol append units _patrolVehgroup; +waitUntil { + sleep 1; + (call SCRT_fnc_misc_getRebelPlayers) inAreaArray [_spawnPos, 500, 500] isNotEqualTo [] || {dateToNumber date > _dateLimitNum} +}; + +[_patrolGroup1, _stolenVehicleSpawnPos, 15] call bis_fnc_taskPatrol; +[_patrolVehgroup, _stolenVehicleSpawnPos, 15] call bis_fnc_taskPatrol; +if (_difficultX) then { + [_patrolGroup2, _stolenVehicleSpawnPos, 15] call bis_fnc_taskPatrol; +}; + +private _grpDeserters = createGroup teamPlayer; +private _unit = objNull; +private _unitTypes = [(_faction get "unitMilitiaGrunt"),(_faction get "unitMilitiaMarksman"), +(_faction get "unitMilitiaGrenadier"),(_faction get "unitMilitiaSniper"), +(_faction get "unitMilitiaMedic"),(_faction get "unitCrew"),(_faction get "unitPilot"), +"loadouts_occ_militia_Grenadier","loadouts_occ_military_Grenadier","loadouts_occ_elite_Grenadier", +"loadouts_occ_militia_LAT","loadouts_occ_military_LAT","loadouts_occ_elite_LAT", +"loadouts_occ_militia_MachineGunner","loadouts_occ_military_MachineGunner","loadouts_occ_elite_MachineGunner","loadouts_occ_militia_Rifleman","loadouts_occ_military_Rifleman", +"loadouts_occ_elite_Rifleman","loadouts_occ_militia_Marksman","loadouts_occ_military_Marksman","loadouts_occ_elite_Marksman","loadouts_occ_militia_Sniper", +"loadouts_occ_military_Sniper","loadouts_occ_elite_Sniper"]; + +for "_i" from 0 to _countX do { + _unitRandom = selectRandom _unitTypes; + if (_sideX == Occupants) then { + if (count _potentials > 0) then { + + _unit = [_grpDeserters, _unitRandom,_spawnPos, [], 3, "NONE"] call A3A_fnc_createUnit; + [_unit, selectRandom (A3A_faction_occ get "faces"), selectRandom (A3A_faction_occ get "voices")] call A3A_fnc_setIdentity; + } else { + _unit = [_grpDeserters, _unitRandom, (_posHouse select _i), [], 0, "NONE"] call A3A_fnc_createUnit; + [_unit, selectRandom (A3A_faction_occ get "faces"), selectRandom (A3A_faction_occ get "voices")] call A3A_fnc_setIdentity; + }; + } else { + if (count _potentials > 0) then { + _unit = [_grpDeserters, _unitRandom, (_posHouse select _i), [], 0, "NONE"] call A3A_fnc_createUnit; + [_unit, selectRandom (A3A_faction_inv get "faces"), selectRandom (A3A_faction_inv get "voices")] call A3A_fnc_setIdentity; + } else { + _unit = [_grpDeserters, _unitRandom,_spawnPos, [], 3, "NONE"] call A3A_fnc_createUnit; + [_unit, selectRandom (A3A_faction_inv get "faces"), selectRandom (A3A_faction_inv get "voices")] call A3A_fnc_setIdentity; + }; + }; + _unit allowDamage false; + _unit setCaptive true; + _unit disableAI "MOVE"; + _unit disableAI "AUTOTARGET"; + _unit disableAI "TARGET"; + _unit setUnitPos "UP"; + _unit setBehaviour "CARELESS"; + _unit allowFleeing 0; + /* if (_sideX == Occupants) then { + [_unit] call A3A_fnc_reDressOcc; + } else { + [_unit] call A3A_fnc_reDressInv; + }; */ //doesn't work sadly + _Deserters pushBack _unit; + [_unit,"deserter"] remoteExec ["A3A_fnc_flagaction",[teamPlayer,civilian],_unit]; +}; + +sleep 5; + +waitUntil { + sleep 1; + (call SCRT_fnc_misc_getRebelPlayers) inAreaArray [getPos _Patrolveh, 400, 400] isNotEqualTo [] || {dateToNumber date > _dateLimitNum} +}; + +//diag_log _Deserters; +/* private _nearbyPlayer = ((allPlayers - entities "HeadlessClient_F") select {side _x in [civilian, teamPlayer]}) inAreaArray [_spawnPos, 400, 400]; +private _randomPlayer = selectRandom _nearbyPlayer; +diag_log _nearbyPlayer; +[_Deserters] joinSilent (group _randomPlayer); */ +{ +_x setCaptive false; +_x enableAI "MOVE"; +_x enableAI "AUTOTARGET"; +_x enableAI "TARGET"; +_x setUnitPos "UP"; +_x setBehaviour "AWARE"; +} forEach _Deserters; +diag_log count _soldersPatrol; +diag_log count _soldersPatrol; +diag_log count _soldersPatrol; +diag_log count _soldersPatrol; +diag_log count _soldersPatrol; +diag_log count _soldersPatrol; +sleep 30; +{_x allowDamage true;} forEach _Deserters; +//if (dateToNumber date > _dateLimitNum) then { + +if (count _soldersPatrol <= (count (_soldersPatrol))/2) then { ///doesn't work , maybe just send it anyway? + private _reveal = [_spawnPos , _sideX] call A3A_fnc_calculateSupportCallReveal; + [_spawnPos, 4, ["QRF"], _sideX, _reveal] remoteExec ["A3A_fnc_createSupport", 2]; +};//sending QRF if things didn't go well for patrol group + +//}; + +waitUntil {sleep 1; {alive _x} count _Deserters == 0 or {{(alive _x) and (_x distance getMarkerPos respawnTeamPlayer < 50)} count _Deserters > 0}}; + +private _bonus = if (_difficultX) then {2} else {1}; + +if ({alive _x} count _Deserters == 0) then { + [_taskId, "RES", "FAILED"] call A3A_fnc_taskSetState; + {[_x,false] remoteExec ["setCaptive",0,_x]; _x setCaptive false} forEach _Deserters; + [-10*_bonus,theBoss] call A3A_fnc_addScorePlayer; +} else { + sleep 5; + [_taskId, "RES", "SUCCEEDED"] call A3A_fnc_taskSetState; + _countX = {(alive _x) and (_x distance getMarkerPos respawnTeamPlayer < 150)} count _Deserters; + _hr = 2 * (_countX); + _resourcesFIA = 100 * _countX*_bonus; + [_hr,_resourcesFIA] remoteExec ["A3A_fnc_resourcesFIA",2]; + [0,10*_bonus,_positionX] remoteExec ["A3A_fnc_citySupportChange",2]; + [Occupants, -(_countX * 1.5), 90] remoteExec ["A3A_fnc_addAggression",2]; + + { + [_countX, _x] call A3A_fnc_addScorePlayer; + [_countX*10,_x] call A3A_fnc_addMoneyPlayer; + } forEach (call SCRT_fnc_misc_getRebelPlayers); + + for "_i" from 0 to 2 do { + [(getMarkerPos respawnTeamPlayer), 6000, 1200, false] spawn SCRT_fnc_common_recon; + if (hideEnemyMarkers) then { + [(selectRandom [2,3])] call A3U_fnc_revealRandomZones; + }; + uiSleep 60; + }; + + private _bonusAmount = round (_countX*_bonus/2); + [_bonusAmount,theBoss] call A3A_fnc_addScorePlayer; + [(_bonusAmount*10),theBoss, true] call A3A_fnc_addMoneyPlayer; + + {[_x] join _grpDeserters; [_x] orderGetin false} forEach _Deserters; +}; + +sleep 60; + +private _items = []; +private _ammunition = []; +private _weaponsX = []; +{ + private _unit = _x; + if (_unit distance getMarkerPos respawnTeamPlayer < 150) then { + {if (not(([_x] call BIS_fnc_baseWeapon) in unlockedWeapons)) then {_weaponsX pushBack ([_x] call BIS_fnc_baseWeapon)}} forEach weapons _unit; + {if (not(_x in unlockedMagazines)) then {_ammunition pushBack _x}} forEach magazines _unit; + _items = _items + (items _unit) + (primaryWeaponItems _unit) + (assignedItems _unit) + (secondaryWeaponItems _unit); + }; + deleteVehicle _unit; +} forEach _Deserters; + +deleteGroup _grpDeserters; + +{boxX addWeaponCargoGlobal [_x,1]} forEach _weaponsX; +{boxX addMagazineCargoGlobal [_x,1]} forEach _ammunition; +{boxX addItemCargoGlobal [_x,1]} forEach _items;/// add every item deserter have to the box, current system seems doesn't work + +[_taskId, "RES", 1200] spawn A3A_fnc_taskDelete; diff --git a/A3A/addons/core/functions/Missions/fn_RES_Refugees.sqf b/A3A/addons/core/functions/Missions/fn_RES_Refugees.sqf index 62ee9ff2c8..87c03f58a3 100644 --- a/A3A/addons/core/functions/Missions/fn_RES_Refugees.sqf +++ b/A3A/addons/core/functions/Missions/fn_RES_Refugees.sqf @@ -83,8 +83,8 @@ if (_sideX == Invaders) then { if !(_taskId call BIS_fnc_taskCompleted) then { // Needs rework - //private _reveal = [_positionX , Invaders] call A3A_fnc_calculateSupportCallReveal; - //[getPos _house, 4, ["QRF"], Invaders, _reveal] remoteExec ["A3A_fnc_createSupport", 2]; + private _reveal = [_positionX , Invaders] call A3A_fnc_calculateSupportCallReveal; + [getPos _house, 4, ["QRF"], Invaders, _reveal] remoteExec ["A3A_fnc_createSupport", 2]; }; }; } else { diff --git a/A3A/addons/core/functions/Missions/fn_RIV_ATT_Hideout.sqf b/A3A/addons/core/functions/Missions/fn_RIV_ATT_Hideout.sqf index bef58ae2ac..819de8abd0 100644 --- a/A3A/addons/core/functions/Missions/fn_RIV_ATT_Hideout.sqf +++ b/A3A/addons/core/functions/Missions/fn_RIV_ATT_Hideout.sqf @@ -65,7 +65,6 @@ if(!(_radGrad > -0.25 && _radGrad < 0.25) || {isOnRoad _hideoutPosition || {surf [_x, true] remoteExec ["hideObject", 0, true]; } forEach nearestTerrainObjects [_hideoutPosition, [], 50, false, true]; - ////////////////////////////////////////////// // Task // ////////////////////////////////////////////// @@ -189,6 +188,17 @@ if (dateToNumber date < _dateLimitNum) then { _vehicles append [_truck, _lootContainer]; + if (_isDifficult) then { + _truckPosition = position _truck; + private _prizeClass = selectRandom ((A3A_faction_riv get "vehiclesRivalsLightArmed") + (A3A_faction_riv get "vehiclesRivalsCars") + (A3A_faction_riv get "vehiclesRivalsAPCs") + (A3A_faction_riv get "vehiclesRivalsTanks") + (A3A_faction_riv get "vehiclesRivalsHelis")); + private _vehiclePosAndDir = [_truckPosition, _prizeClass, 50, true] call SCRT_fnc_common_findSafePositionForVehicle; + private _prizeVehicle = createVehicle [_prizeClass, (_vehiclePosAndDir select 0), [], 0 , "CAN_COLLIDE"]; + _prizeVehicle setDir (_vehiclePosAndDir select 1); + [_prizeVehicle, Rivals] call A3A_fnc_AIVEHinit; + + _vehicles append [_prizeVehicle]; + }; + Info_1("Loot container on %1 position.", str (position _lootContainer)); { diff --git a/A3A/addons/core/functions/Missions/fn_RIV_ATT_Transfer.sqf b/A3A/addons/core/functions/Missions/fn_RIV_ATT_Transfer.sqf new file mode 100644 index 0000000000..2c34c64a12 --- /dev/null +++ b/A3A/addons/core/functions/Missions/fn_RIV_ATT_Transfer.sqf @@ -0,0 +1,509 @@ +#include "..\..\script_component.hpp" +FIX_LINE_NUMBERS() + +params ["_marker"]; + +//Mission: Prevent transfer of gear and vehicels to Rivals +if (!isServer and hasInterface) exitWith {}; + +private _positionX = getMarkerPos _marker; + +private _hideoutPosition = [ + _positionX, //center + 0, //minimal distance + 300, //maximumDistance + 0, //object distance + 0, //water mode + 0.3, //maximum terrain gradient + 0, //shore mode + [], //blacklist positions + [_positionX, _positionX] //default position +] call BIS_fnc_findSafePos; + +private _radGrad = [_hideoutPosition, 0] call BIS_fnc_terrainGradAngle; + +private _outOfBounds = _hideoutPosition findIf { (_x < 0) || {_x > worldSize}} != -1; + +private _InvBases = (airportsX + milbases + outposts + seaports + factories + resourcesX) select {sidesX getVariable [_x, sideUnknown] == Invaders}; +private _isTooCloseToOutposts = _InvBases findIf { _hideoutPosition distance2d (getMarkerPos _x) < 500 || _hideoutPosition inArea _x } != -1; +private _CloseToOutposts = _InvBases findIf { _hideoutPosition distance2d (getMarkerPos _x) < 1000 || _hideoutPosition inArea _x } != -1; + +private _transferConvoyPossibleSpawnMarkers = _InvBases select {_hideoutPosition distance2d (getMarkerPos _x) < 4000}; // +if (_transferConvoyPossibleSpawnMarkers isEqualTo []) exitWith { + [[_marker],"A3A_fnc_RIV_ATT_Hideout"] remoteExec ["A3A_fnc_scheduler",2]; +}; +private _transferConvoySpawnPosMarker = selectRandom _transferConvoyPossibleSpawnMarkers; +private _transferConvoySpawnPos = getMarkerPos _transferConvoySpawnPosMarker; + +private _fnc_createLight = { + params [["_position", []]]; + if (_position isEqualTo []) exitWith {}; + + private _light = createVehicle ["#lightpoint", _position, [], 0 , "CAN_COLLIDE"]; + [_light, 8.4] remoteExecCall ["setLightBrightness", 0, _light]; + [_light, [0.3, 0.1, 0.05]] remoteExecCall ["setLightAmbient", 0, _light]; + [_light, [0.3, 0.1, 0.05]] remoteExecCall ["setLightColor", 0, _light]; + + _light +}; + +Info_1("Prevent transfer task initialization started, marker: %1.", _marker); +///add fail condition (increase rivals activity) + +private _vehicles = []; +private _groups = []; +private _sideX = Invaders; +private _faction = Faction(_sideX); + + +(90 call SCRT_fnc_misc_getTimeLimit) params ["_dateLimitNum", "_displayTime"]; + +private _isDifficult = if (random 10 < tierWar) then {true} else {false}; + +Info_1("Is difficult: %1.", str _isDifficult); + +//mitigation of negative terrain gradient +if(!(_radGrad > -0.25 && _radGrad < 0.25) || {isOnRoad _hideoutPosition || {surfaceIsWater _hideoutPosition || {_outOfBounds || {_isTooCloseToOutposts}}}}) then { + private _radiusX = 100; + while {true} do { + _hideoutPosition = [ + _positionX, //center + 0, //minimal distance + _radiusX, //maximumDistance + 0, //object distance + 0, //water mode + 0.3, //maximum terrain gradient + 0, //shore mode + [], //blacklist positions + [_positionX, _positionX] //default position + ] call BIS_fnc_findSafePos; + _radGrad = [_hideoutPosition, 0] call BIS_fnc_terrainGradAngle; + _outOfBounds = _hideoutPosition findIf { (_x < 0) || {_x > worldSize}} != -1; + _isTooCloseToOutposts = _InvBases findIf { _hideoutPosition distance2d (getMarkerPos _x) < 300 || _hideoutPosition inArea _x } != -1; + if ((_radGrad > -0.25 && _radGrad < 0.25) && {!(isOnRoad _hideoutPosition) && {!(surfaceIsWater _hideoutPosition) && {!_outOfBounds && {!_isTooCloseToOutposts}}}}) exitWith {}; + _radiusX = _radiusX + 5; + }; +}; + +{ + [_x, true] remoteExec ["hideObject", 0, true]; +} forEach nearestTerrainObjects [_hideoutPosition, [], 50, false, true]; + +private _posOrigin = navGrid select ([_transferConvoySpawnPosMarker] call A3A_fnc_getMarkerNavPoint) select 0; +private _posDest = navGrid select ([_marker] call A3A_fnc_getMarkerNavPoint) select 0; +private _route = [_posOrigin, _posDest] call A3A_fnc_findPath; +private _pathState = []; + +_route = _route apply { _x select 0 }; // reduce to position array +if (_route isEqualTo []) then { _route = [_posOrigin, _posDest] }; + +//private _route = [_transferConvoySpawnPos, _hideoutPosition] call A3A_fnc_findPath; + +////////////////////////////////////////////// +// Task // +////////////////////////////////////////////// +private _taskId = "RIV_ATT" + str A3A_taskCount; + +[ + [teamPlayer,civilian], + _taskId, + [ + format [localize "STR_RIV_ATT_transfer_text", A3A_faction_riv get "name", ([_marker] call A3A_fnc_localizar), _displayTime], + format [localize "STR_RIV_ATT_transfer_header", A3A_faction_riv get "name"], + _marker + ], + _hideoutPosition, + false, + 0, + true, + "destroy",///maybe change the icon + true +] call BIS_fnc_taskCreate; +[_taskId, "RIV_ATT", "CREATED"] remoteExecCall ["A3A_fnc_taskUpdate", 2]; + +waitUntil { + sleep 1; + (call SCRT_fnc_misc_getRebelPlayers) inAreaArray [_hideoutPosition, distanceSPWN1, distanceSPWN1] isNotEqualTo [] || {dateToNumber date > _dateLimitNum} +}; + +private _lootContainer = nil; +private _vehObj = nil; + +if (dateToNumber date < _dateLimitNum) then { + private _tempVeh = "Land_LampShabby_off_F" createVehicleLocal _hideoutPosition; + private _atlPos = getPosATL _tempVeh; + deleteVehicle _tempVeh; + + private _compositionMap = createHashMapFromArray [ + ["COMP1", SCRT_fnc_composition_rivals1], + ["COMP2", SCRT_fnc_composition_rivals2], + ["COMP3", SCRT_fnc_composition_rivals3] + ]; + + private _fnc = _compositionMap get (selectRandom ["COMP1", "COMP2", "COMP3"]); + + private _objects = [_atlPos, (random 360), (call _fnc)] call BIS_fnc_objectsMapper; + {_x setVectorUp surfaceNormal getPos _x} forEach _objects; + + _vehicles append _objects; + + ////////////////////////////////////////////// + // Loot or Vehicle with loot // + ////////////////////////////////////////////// + private _iterations = 0; + private _lootContainerPosition = nil; + + while {true} do { + _lootContainerPosition = [ + _hideoutPosition, //center + 0, //minimal distance + 25, //maximumDistance + 3, //object distance + 0, //water mode + 0.45, //maximum terrain gradient + 0, //shore mode + [], //blacklist positions + [_hideoutPosition, _hideoutPosition] //default position + ] call BIS_fnc_findSafePos; + + if (_iterations isEqualTo 50) exitWith {}; + _iterations = _iterations + 1; + }; + + private _cacheType = A3A_faction_riv get "ammobox"; + private _emptyPos = _lootContainerPosition findEmptyPosition [0, 15, _cacheType]; + if (_emptyPos isNotEqualTo []) then { + _lootContainerPosition = _emptyPos; + }; + + private _direction = random 360; + //fake loot container for findEmptyPosition as it can't work with dynamic objects + _lootContainer = ["Land_PaperBox_closed_F", (AGLToASL _lootContainerPosition)] call BIS_fnc_createSimpleObject; + private _lootContainerPosition = position _lootContainer; + + private _propsCount = round (random [1,2,2]); + private _propsPool = [ + "Land_PaperBox_closed_F", + "Land_PaperBox_open_full_F", + "CargoNet_01_box_F", + "Land_MetalBarrel_F" + ]; + + for "_i" from 0 to _propsCount do { + private _propClass = selectRandom _propsPool; + private _propPosition = _lootContainerPosition findEmptyPosition [2, 10, _propClass]; + + if (_propPosition isEqualTo []) then { + continue; + }; + + private _prop = [_propClass, (AGLToASL _propPosition)] call BIS_fnc_createSimpleObject; + _prop setDir (random 360); + _prop setVectorUp surfaceNormal getPos _prop; + _vehicles pushBack _prop; + }; + + deleteVehicle _lootContainer; + + _lootContainer = createVehicle [_cacheType, _lootContainerPosition, [], 0 , "CAN_COLLIDE"]; + [_lootContainer] spawn A3A_fnc_fillLootCrate; + _lootContainer allowDamage false; + _lootContainer setDir _direction; + _lootContainerPosition = position _lootContainer; + + // Otherwise when destroyed, ammoboxes sink 100m underground and are never cleared up + _lootContainer addEventHandler ["Killed", { [_this#0] spawn { sleep 10; deleteVehicle (_this#0) } }]; + [_lootContainer] call A3A_Logistics_fnc_addLoadAction; + + private _truckClass = selectRandom (A3A_faction_riv get "vehiclesRivalsTrucks"); + private _vehiclePosAndDir = [_lootContainerPosition, _truckClass, 50, true] call SCRT_fnc_common_findSafePositionForVehicle; + private _truck = createVehicle [_truckClass, (_vehiclePosAndDir select 0), [], 0 , "CAN_COLLIDE"]; + _truck setDir (_vehiclePosAndDir select 1); + [_truck, Rivals] call A3A_fnc_AIVEHinit; + + _vehicles append [_truck, _lootContainer]; + + if (_isDifficult) then { + _truckPosition = position _truck; + private _prizeClass = selectRandom ((A3A_faction_riv get "vehiclesRivalsLightArmed") + (A3A_faction_riv get "vehiclesRivalsCars") + (A3A_faction_riv get "vehiclesRivalsAPCs") + (A3A_faction_riv get "vehiclesRivalsTanks") + (A3A_faction_riv get "vehiclesRivalsHelis")); + private _vehiclePosAndDir = [_truckPosition, _prizeClass, 50, true] call SCRT_fnc_common_findSafePositionForVehicle; + private _prizeVehicle = createVehicle [_prizeClass, (_vehiclePosAndDir select 0), [], 0 , "CAN_COLLIDE"]; + _prizeVehicle setDir (_vehiclePosAndDir select 1); + [_prizeVehicle, Rivals] call A3A_fnc_AIVEHinit; + + _vehicles append [_prizeVehicle]; + }; + + Info_1("Loot container on %1 position.", str (position _lootContainer)); + + { + [_x,false] remoteExec ["setCaptive",0,_x]; + } forEach ((call SCRT_fnc_misc_getRebelPlayers) inAreaArray [_hideoutPosition, distanceSPWN1, distanceSPWN1]); + + ////////////////////////////////////////////// + // Patrols // + ////////////////////////////////////////////// + + private _patrolCount = nil; + private _patrolPool = nil; + if (_isDifficult) then { + _patrolCount = 1; + _patrolPool = A3A_faction_riv get "groupsSquad"; + } else { + _patrolCount = 2; + _patrolPool = A3A_faction_riv get "groupsFireteam"; + }; + + for "_i" from 0 to _patrolCount do { + private _position = [ + _hideoutPosition, //center + 0, //minimal distance + 150, //maximumDistance + 5, //object distance + 0, //water mode + 0, //maximum terrain gradient + 0, //shore mode + [], //blacklist positions + [_hideoutPosition, _hideoutPosition] //default position + ] call BIS_fnc_findSafePos; + private _patrolGroup = [_position, Rivals, (selectRandom _patrolPool)] call A3A_fnc_spawnGroup; + {[_x] call A3A_fnc_NATOinit;} forEach (units _patrolGroup); + + [_patrolGroup, "Patrol_Area", 25, 100, 250, true, _positionX, false] call A3A_fnc_patrolLoop; + + _groups pushBack _patrolGroup; + }; + + if (_isDifficult) then { + private _position = [ + _hideoutPosition, //center + 0, //minimal distance + 50, //maximumDistance + 5, //object distance + 0, //water mode + 0, //maximum terrain gradient + 0, //shore mode + [], //blacklist positions + [_hideoutPosition, _hideoutPosition] //default position + ] call BIS_fnc_findSafePos; + private _sentry = [_position, Rivals, (selectRandom (A3A_faction_riv get "groupsSentry"))] call A3A_fnc_spawnGroup; + {[_x] call A3A_fnc_NATOinit} forEach (units _sentry); + [_sentry, _hideoutPosition, 100] call bis_fnc_taskPatrol; + _groups pushBack _sentry; + }; + + ////////////////////////////////////////////// + // Patrol vehicle // + ////////////////////////////////////////////// + private _vehicleClass = if (_isDifficult) then { + selectRandom ((A3A_faction_riv get "vehiclesRivalsLightArmed") + (A3A_faction_riv get "vehiclesRivalsAPCs") + (A3A_faction_riv get "vehiclesRivalsTanks")); + } else { + selectRandom (A3A_faction_riv get "vehiclesRivalsLightArmed"); + }; + + private _vehiclePosAndDir = [_hideoutPosition, _vehicleClass, 250, true] call SCRT_fnc_common_findSafePositionForVehicle; + private _patrolVehicleData = [(_vehiclePosAndDir select 0), 0, _vehicleClass, Rivals] call A3A_fnc_spawnVehicle; + private _patrolVeh = _patrolVehicleData select 0; + _patrolVeh setDir (_vehiclePosAndDir select 1); + private _patrolVehCrew = _patrolVehicleData select 1; + private _patrolVehGroup = _patrolVehicleData select 2; + + {[_x] call A3A_fnc_NATOinit} forEach _patrolVehCrew; + + [_patrolVeh, Rivals] call A3A_fnc_AIVEHinit; + + _groups pushBack _patrolVehGroup; + _vehicles pushBack _patrolVeh; + + [_patrolVehGroup, _hideoutPosition, 250] call bis_fnc_taskPatrol; + + /* _nul = [_hideoutPosition, _lootContainer, _isDifficult] spawn { + params ["_hideoutPosition", "_lootContainer", "_isDifficult"]; + + sleep (random [120, 240, 360]); + + private _chance = if (_isDifficult) then {30} else {15}; + if ((random 100) > _chance && {!isNil "_lootContainer" && {alive _lootContainer && {!(_lootContainer inArea [getMarkerPos respawnTeamPlayer, 50, 50, 0, false])}}}) then { + private _event = selectRandom [200, 300]; + + switch _event do { + case 200: { + [[_hideoutPosition], "SCRT_fnc_rivals_encounter_uavFlyby"] call A3A_fnc_scheduler; + }; + case 300: { + [[_hideoutPosition], "SCRT_fnc_rivals_encounter_rovingMortar"] call A3A_fnc_scheduler; + }; + }; + }; + + terminate _thisScript; + }; */ + + sleep 5; + _lootContainer allowDamage true; + + private _vehicletransfer = if (_isDifficult) then { selectRandom ((_faction get "vehiclesCargoTrucks") + (A3A_faction_riv get "vehiclesRivalsAPCs") + (A3A_faction_riv get "vehiclesRivalsTanks")); + } else { + selectRandom ((_faction get "vehiclesCargoTrucks") + (A3A_faction_riv get "vehiclesRivalsLightArmed")); + }; ///check if vehicle is cargo truck or vehicle to transfer, if cargo truck create or move loot crate to truck. + + private _escortvehicle = if (_isDifficult) then { + selectRandom ((_faction get "vehiclesLightAPCs") + (_faction get "vehiclesAPCs") + (_faction get "vehiclesIFVs") + (_faction get "vehiclesLightArmed") + + (_faction get "vehiclesTrucks")); + } else { + selectRandom ((_faction get "vehiclesLightArmed") + (_faction get "vehiclesTrucks") + (_faction get "vehiclesMilitiaLightArmed") + + (_faction get "vehiclesMilitiaCars") + (_faction get "vehiclesMilitiaAPCs") + (_faction get "vehiclesMilitiaTrucks")); + }; //check if vehicle is truck, if yes create a group and move in + + private _convoylead = if (_isDifficult) then { + selectRandom ((_faction get "vehiclesLightArmed") + (_faction get "vehiclesTrucks")); + } else { + selectRandom ((_faction get "vehiclesLightArmed") + (_faction get "vehiclesTrucks") + (_faction get "vehiclesMilitiaLightArmed") + + (_faction get "vehiclesMilitiaCars") + (_faction get "vehiclesMilitiaTrucks") + (_faction get "vehiclesLightUnarmed")); + }; + + private _vehiclesX = []; + private _markNames = []; + private _soldiers = []; + private _fnc_spawnConvoyVehicle = { + params ["_vehType", "_markName"];//,"" + ServerDebug_1("Spawning vehicle type %1", _vehType); + + // Find location down route + _pathState = [_route, [20, 0] select (count _pathState == 0), _pathState] call A3A_fnc_findPosOnRoute; + while {true} do { + // make sure there are no other vehicles within 10m + if (count (ASLtoAGL (_pathState#0) nearEntities 10) == 0) exitWith {}; + _pathState = [_route, 10, _pathState] call A3A_fnc_findPosOnRoute; + }; + + private _veh = createVehicle [_vehType, ASLtoAGL (_pathState#0) vectorAdd [0,0,0.5]]; // Give it a little air + private _vecUp = (_pathState#1) vectorCrossProduct [0,0,1] vectorCrossProduct (_pathState#1); // correct pitch angle + _veh setVectorDirAndUp [_pathState#1, _vecUp]; + _veh allowDamage false; + + private _group = [_sideX, _veh] call A3A_fnc_createVehicleCrew; + { [_x, nil, nil] call A3A_fnc_NATOinit; _x allowDamage false; _x disableAI "MINEDETECTION" } forEach (units _group); + _soldiers append (units _group); + (driver _veh) stop true; + deleteWaypoint [_group, 0]; // groups often start with a bogus waypoint + + [_veh, _sideX] call A3A_fnc_AIVEHinit; + _vehiclesX pushBack _veh; + _markNames pushBack _markName; + _veh; + }; + + private _convoyVehicles = []; + private _specOpsArray = if (_isDifficult) then {selectRandom (_faction get "groupSpecOpsRandom")} else {selectRandom ([_faction, "groupsTierSquads"] call SCRT_fnc_unit_flattenTier)}; + + private _vehEscort = [_escortvehicle, "Escort vehicle"] call _fnc_spawnConvoyVehicle; + if (_escortvehicle in FactionGet(all,"vehiclesArmor")) then { _vehEscort allowCrewInImmobile true }; // move this to AIVEHinit at some point? + /* if (_escortvehicle in FactionGet(all,"vehiclesMilitiaTrucks") || _escortvehicle in FactionGet(all,"vehiclesMilitiaTrucks") || _escortvehicle in FactionGet(all,"vehiclesMilitiaTrucks") || _escortvehicle in FactionGet(all,"vehiclesMilitiaCars") || + _escortvehicle in FactionGet(all,"vehiclesLightUnarmed")) then { */ + private _groupEsc = [_positionX, _sideX, _specOpsArray] call A3A_fnc_spawnGroup; // Unit limit? + {[_x, nil, nil] call A3A_fnc_NATOinit;_x assignAsCargo _vehEscort ;_x moveInCargo _vehEscort ;} forEach units _groupEsc; + { + private _index = _vehEscort getCargoIndex _x; + if (_index == -1) then { + deleteVehicle _x; + }; + } forEach units _groupEsc; + _soldiers append (units _groupEsc); + //}; + _convoyVehicles pushBack _vehEscort; + // Objective vehicle + sleep 2; + private _objText = if (_isDifficult) then {localize "STR_marker_convoy_objective_space"} else {localize "STR_marker_convoy_objective"}; + private _vehObj = [_vehicletransfer, _objText] call _fnc_spawnConvoyVehicle; + private _return = [_vehObj, _lootContainer] call A3A_Logistics_fnc_canLoad; + if (_vehicletransfer in FactionGet(all,"vehiclesCargoTrucks")) then { + if !(_return isEqualType 0) then { + _lootContainer setPos [getPos _vehObj select 0, getPos _vehObj select 1, (getPos _vehObj select 2) + 5]; + _return remoteExec ["A3A_Logistics_fnc_load", 2]; + }; + }; + _convoyVehicles pushBack _vehObj; + sleep 1; + + private _vehLead = [_convoylead, "Convoy Lead"] call _fnc_spawnConvoyVehicle; + if (_convoylead in FactionGet(all,"vehiclesArmor")) then { _vehLead allowCrewInImmobile true }; // move this to AIVEHinit at some point? + //if (_convoylead in FactionGet(all,"vehiclesMilitiaTrucks") || _convoylead in FactionGet(all,"vehiclesMilitiaTrucks") || _convoylead in FactionGet(all,"vehiclesMilitiaTrucks") || _convoylead in FactionGet(all,"vehiclesMilitiaCars") || _convoylead in FactionGet(all,"vehiclesLightUnarmed")) then { + private _groupEsc = [_positionX, _sideX, _specOpsArray] call A3A_fnc_spawnGroup; // Unit limit? + {[_x, nil, nil] call A3A_fnc_NATOinit;_x assignAsCargo _vehLead ;_x moveInCargo _vehLead ;} forEach units _groupEsc; + _soldiers append (units _groupEsc); + { + private _index = _vehLead getCargoIndex _x; + if (_index == -1) then { + deleteVehicle _x; + }; + } forEach units _groupEsc; + //}; + _convoyVehicles pushBack _vehLead; + _vehicles append _convoyVehicles; + + //_route = _route apply { _x select 0 }; // reduce to position array + if (_route isEqualTo []) then { _route = [_posOrigin, _posDest] }; + + //_route = _route select [_pathState#2, count _route]; // remove navpoints that we already passed while spawning + // This array is used to share remaining convoy vehicles between threads + reverse _convoyVehicles; + reverse _markNames; + { + (driver _x) stop false; + [_x, _route, _convoyVehicles, 30,true] spawn A3A_fnc_vehicleConvoyTravel; + [_x, _markNames#_forEachIndex, false] spawn A3A_fnc_inmuneConvoy; // Disabled the stuck-vehicle hacks + sleep 1; + } forEach _convoyVehicles; + waitUntil { + sleep 1; + dateToNumber date > _dateLimitNum || {(!isNil "_lootContainer" && (!alive _lootContainer || _lootContainer inArea [getMarkerPos respawnTeamPlayer, 50, 50, 0, false]))} || {(!isNil "_vehObj" && (!alive _vehObj || _vehObj inArea [getMarkerPos respawnTeamPlayer, 50, 50, 0, false]))} //and all rivals are dead? + }; +}; + + +switch(true) do { + case (dateToNumber date > _dateLimitNum): { + Info("Time is out, cancelling task."); + [_taskId, "RIV_ATT", "CANCELED"] call A3A_fnc_taskSetState; + }; + case (!isNil "_vehObj" && {(!alive _vehObj || {_vehObj inArea [getMarkerPos respawnTeamPlayer, 50, 50, 0, false]})}): { + Info("Transfer vehicle destroyed or stolen, success."); + [_taskId, "RIV_ATT", "SUCCEEDED"] call A3A_fnc_taskSetState; + [0, 1500] remoteExec ["A3A_fnc_resourcesFIA",2]; + { + [50,_x] call A3A_fnc_addScorePlayer; + [800,_x] call A3A_fnc_addMoneyPlayer; + } forEach (call SCRT_fnc_misc_getRebelPlayers); + [25,theBoss] call A3A_fnc_addScorePlayer; + [400,theBoss, true] call A3A_fnc_addMoneyPlayer; + + [_marker, "HIDEOUT"] remoteExecCall ["SCRT_fnc_rivals_destroyLocation",2]; + }; + case (!isNil "_lootContainer" && {(!alive _lootContainer || {_lootContainer inArea [getMarkerPos respawnTeamPlayer, 50, 50, 0, false]})}): { + Info("Transfer vehicle destroyed or stolen, success."); + [_taskId, "RIV_ATT", "SUCCEEDED"] call A3A_fnc_taskSetState; + [0, 1500] remoteExec ["A3A_fnc_resourcesFIA",2]; + { + [50,_x] call A3A_fnc_addScorePlayer; + [800,_x] call A3A_fnc_addMoneyPlayer; + } forEach (call SCRT_fnc_misc_getRebelPlayers); + [25,theBoss] call A3A_fnc_addScorePlayer; + [400,theBoss, true] call A3A_fnc_addMoneyPlayer; + + [_marker, "HIDEOUT"] remoteExecCall ["SCRT_fnc_rivals_destroyLocation",2]; + }; + default { + Error("Unexpected behaviour, cancelling mission."); + [_taskId, "RIV_ATT", "CANCELED"] call A3A_fnc_taskSetState; + }; +}; + +[_taskId, "RIV_ATT", 5] spawn A3A_fnc_taskDelete; + +sleep 30; + +{[_x] spawn A3A_fnc_vehDespawner} forEach _vehicles; +{[_x] spawn A3A_fnc_groupDespawner} forEach _groups; + +Info("Kill Cell Leader cleanup complete."); \ No newline at end of file diff --git a/A3A/addons/core/functions/Missions/fn_missionRequest.sqf b/A3A/addons/core/functions/Missions/fn_missionRequest.sqf index 53c6707e62..8c018292d0 100644 --- a/A3A/addons/core/functions/Missions/fn_missionRequest.sqf +++ b/A3A/addons/core/functions/Missions/fn_missionRequest.sqf @@ -92,8 +92,10 @@ switch (_type) do { case "CON": { //find apropriate sites - _possibleMarkers = [outposts + milAdministrationsX + resourcesX + (controlsX select {isOnRoad (getMarkerPos _x)})] call _findIfNearAndHostile; - + _possibleMarkers = [outposts + milAdministrationsX + seaports + factories + resourcesX + (controlsX select {isOnRoad (getMarkerPos _x)})] call _findIfNearAndHostile; + private _possibleMarkersForFrontline = [airportsX + milbases + outposts + seaports + factories + resourcesX] call _findIfNearAndHostile; + private _possibleFrontlineMarker = selectRandom _possibleMarkersForFrontline; + private _frontlineSite = [_possibleFrontlineMarker] call A3A_fnc_isFrontlineNoFIA; if (count _possibleMarkers == 0) then { if (!_silent) then { [petros, "globalChat", localize "STR_chats_mission_request_no_CON"] remoteExec ["A3A_fnc_commsMP",_requester]; @@ -102,13 +104,14 @@ switch (_type) do { } else { private _milAdmins = _possibleMarkers select {_x in milAdministrationsX }; private _site = if (_milAdmins isNotEqualTo []) then {selectRandom _milAdmins} else {selectRandom _possibleMarkers}; - if (_site in milAdministrationsX) then { - [[_site],"A3A_fnc_CON_MilAdmin"] remoteExec ["A3A_fnc_scheduler",2] + [[_site],"A3A_fnc_CON_MilAdmin"] remoteExec ["A3A_fnc_scheduler",2]; } else { - private _conMissions = ["A3A_fnc_CON_Outpost", 0.5, "A3A_fnc_CON_Outpost_Zombies", 0.5]; - private _conMission = selectRandomWeighted _conMissions; - [[_site],_conMission] remoteExec ["A3A_fnc_scheduler",2]; + if (_frontlineSite) then { + [[_possibleFrontlineMarker],"A3A_fnc_CON_Outpost_Compet"] remoteExec ["A3A_fnc_scheduler",2]; + } else { + [[_site],"A3A_fnc_CON_Outpost"] remoteExec ["A3A_fnc_scheduler",2]; + }; }; }; }; @@ -149,7 +152,7 @@ switch (_type) do { private _site = selectRandom _possibleMarkers; switch (true) do { case (_site in airportsX): { - if (random 10 < 6) then { + if (random 10 < 5) then { [[_site],"A3A_fnc_DES_Vehicle"] remoteExec ["A3A_fnc_scheduler",2]; } else { [[_site],"A3A_fnc_DES_Heli"] remoteExec ["A3A_fnc_scheduler",2]; @@ -270,7 +273,6 @@ switch (_type) do { [[0,0,0], [0,0,0]] ] call BIS_fnc_findSafePos; }; - switch (true) do { case (_shipwreckPosition isNotEqualTo [0,0,0]): { [[_site],"A3A_fnc_RES_Shipwreck"] remoteExec ["A3A_fnc_scheduler",2]; @@ -285,11 +287,19 @@ switch (_type) do { if ([_site] call _checkRivalsTaskPossibility) then { [[_site],"A3A_fnc_RIV_RES_Prisoners"] remoteExec ["A3A_fnc_scheduler",2]; } else { - [[_site],"A3A_fnc_RES_Prisoners"] remoteExec ["A3A_fnc_scheduler",2]; + if (tierWar >= 5) then { + private _roll = round random 100; + if(_roll < 99) then { + [[_site],"A3A_fnc_RES_Deserters"] remoteExec ["A3A_fnc_scheduler",2]; + } else { + [[_site],"A3A_fnc_RES_Prisoners"] remoteExec ["A3A_fnc_scheduler",2]; + }; + } else { + [[_site],"A3A_fnc_RES_Prisoners"] remoteExec ["A3A_fnc_scheduler",2]; + }; }; }; }; - if (_site in citiesX) then {[[_site],"A3A_fnc_RES_Refugees"] remoteExec ["A3A_fnc_scheduler",2]} else {[[_site],"A3A_fnc_RES_Prisoners"] remoteExec ["A3A_fnc_scheduler",2]}; }; }; diff --git a/A3A/addons/core/functions/REINF/fn_reDressInv.sqf b/A3A/addons/core/functions/REINF/fn_reDressInv.sqf new file mode 100644 index 0000000000..64ff743fb1 --- /dev/null +++ b/A3A/addons/core/functions/REINF/fn_reDressInv.sqf @@ -0,0 +1,4 @@ +params ["_unit"]; + +_unit forceAddUniform (selectRandom (A3A_faction_inv get "uniforms")); +_unit addItemToUniform "FirstAidKit"; \ No newline at end of file diff --git a/A3A/addons/core/functions/REINF/fn_reDressOcc.sqf b/A3A/addons/core/functions/REINF/fn_reDressOcc.sqf new file mode 100644 index 0000000000..4dc09c43c4 --- /dev/null +++ b/A3A/addons/core/functions/REINF/fn_reDressOcc.sqf @@ -0,0 +1,4 @@ +params ["_unit"]; + +_unit forceAddUniform (selectRandom (A3A_faction_occ get "uniforms")); +_unit addItemToUniform "FirstAidKit"; \ No newline at end of file diff --git a/A3A/addons/core/functions/Revive/fn_handleDamage.sqf b/A3A/addons/core/functions/Revive/fn_handleDamage.sqf index 6c71f1eae2..64758c5cb8 100644 --- a/A3A/addons/core/functions/Revive/fn_handleDamage.sqf +++ b/A3A/addons/core/functions/Revive/fn_handleDamage.sqf @@ -4,7 +4,8 @@ params ["_unit","_part","_damage","_injurer","_projectile","_hitIndex","_instiga // Functionality unrelated to Antistasi revive // Helmet popping: use _hitpoint rather than _part to work around ACE calling its fake hitpoint "head" -if (_damage >= 1 && {_hitPoint == "hithead"}) then +private _randomNumber = [1,100] call BIS_fnc_randomNum; +if (_damage >= 1 && {_hitPoint == "hithead"} && {helmetLossChance >= _randomNumber}) then { if (headgear _unit isNotEqualTo "") then { diff --git a/A3A/addons/core/functions/Revive/fn_handleDamageAAF.sqf b/A3A/addons/core/functions/Revive/fn_handleDamageAAF.sqf index 15c7cdf059..87272363d5 100644 --- a/A3A/addons/core/functions/Revive/fn_handleDamageAAF.sqf +++ b/A3A/addons/core/functions/Revive/fn_handleDamageAAF.sqf @@ -5,8 +5,9 @@ params ["_unit","_part","_damage","_injurer","_projectile","_hitIndex","_instiga // Functionality unrelated to Antistasi revive if (side group _injurer == teamPlayer) then { + private _randomNumber = [1,100] call BIS_fnc_randomNum; // Helmet popping: use _hitpoint rather than _part to work around ACE calling its fake hitpoint "head" - if (_damage >= 1 && {_hitPoint == "hithead"}) then + if (_damage >= 1 && {_hitPoint == "hithead"} && {helmetLossChance >= _randomNumber}) then { if (headgear _unit isNotEqualTo "") then { diff --git a/A3A/addons/core/functions/Supports/fn_SUP_ASFRoutine.sqf b/A3A/addons/core/functions/Supports/fn_SUP_ASFRoutine.sqf index fdad511912..b79f63ccc2 100644 --- a/A3A/addons/core/functions/Supports/fn_SUP_ASFRoutine.sqf +++ b/A3A/addons/core/functions/Supports/fn_SUP_ASFRoutine.sqf @@ -35,6 +35,7 @@ _plane setVariable ["SupportData", _suppData]; // for use in EHs private _group = [_side, _plane] call A3A_fnc_createVehicleCrew; { [_x, nil, false, _resPool] call A3A_fnc_NATOinit } forEach units _group; _group deleteGroupWhenEmpty true; +[-10 * count units _group, _side, _resPool] call A3A_fnc_addEnemyResources; _plane addEventHandler ["Killed", { params ["_plane"]; diff --git a/A3A/addons/core/functions/Supports/fn_SUP_CASRoutine.sqf b/A3A/addons/core/functions/Supports/fn_SUP_CASRoutine.sqf index e5dc6d3c80..d0505b5200 100644 --- a/A3A/addons/core/functions/Supports/fn_SUP_CASRoutine.sqf +++ b/A3A/addons/core/functions/Supports/fn_SUP_CASRoutine.sqf @@ -35,6 +35,7 @@ private _group = [_side, _plane] call A3A_fnc_createVehicleCrew; { [_x, nil, false, _resPool] call A3A_fnc_NATOinit } forEach units _group; _group deleteGroupWhenEmpty true; _group setBehaviourStrong "CARELESS"; +[-10 * count units _group, _side, _resPool] call A3A_fnc_addEnemyResources; _plane setVehicleRadar 1; diff --git a/A3A/addons/core/functions/Supports/fn_SUP_UAVRoutine.sqf b/A3A/addons/core/functions/Supports/fn_SUP_UAVRoutine.sqf index d7ba572888..3c11a695ef 100644 --- a/A3A/addons/core/functions/Supports/fn_SUP_UAVRoutine.sqf +++ b/A3A/addons/core/functions/Supports/fn_SUP_UAVRoutine.sqf @@ -27,6 +27,7 @@ private _uav = createVehicle [_planeType, _spawnPos, [], 0, "FLY"]; [_side, _uav] call A3A_fnc_createVehicleCrew; _groupVeh = group driver _uav; { [_x, nil, false, _resPool] call A3A_fnc_NATOinit } forEach (crew _uav); // arguable +[-10 * count units _groupVeh, _side, _resPool] call A3A_fnc_addEnemyResources; [_uav, _side, _resPool] call A3A_fnc_AIVEHinit; private _gunner = gunner _uav; diff --git a/A3A/addons/core/functions/Supports/fn_SUP_airstrikeRoutine.sqf b/A3A/addons/core/functions/Supports/fn_SUP_airstrikeRoutine.sqf index 6f3c1fc349..8bc5cfc4ec 100644 --- a/A3A/addons/core/functions/Supports/fn_SUP_airstrikeRoutine.sqf +++ b/A3A/addons/core/functions/Supports/fn_SUP_airstrikeRoutine.sqf @@ -38,6 +38,7 @@ _group deleteGroupWhenEmpty true; _x disableAI "TARGET"; _x disableAI "AUTOTARGET"; } forEach units _group; +[-10 * count units _group, _side, _resPool] call A3A_fnc_addEnemyResources; // Should we really have these? _plane addEventHandler ["Killed", { diff --git a/A3A/addons/core/functions/Supports/fn_SUP_artillery.sqf b/A3A/addons/core/functions/Supports/fn_SUP_artillery.sqf index 33894899cc..106e56df8e 100644 --- a/A3A/addons/core/functions/Supports/fn_SUP_artillery.sqf +++ b/A3A/addons/core/functions/Supports/fn_SUP_artillery.sqf @@ -65,4 +65,4 @@ A3A_activeSupports pushBack _suppData; [_reveal, _side, "ARTILLERY", _targPos, _delay] spawn A3A_fnc_showInterceptedSetupCall; // Vehicle cost + extra support cost for balance -(A3A_vehicleResourceCosts get _vehType) + 200; +(A3A_vehicleResourceCosts get _vehType) + (10 * count units _group) + 200; diff --git a/A3A/addons/core/functions/Supports/fn_SUP_artilleryAvailable.sqf b/A3A/addons/core/functions/Supports/fn_SUP_artilleryAvailable.sqf index d968fc48df..f258da4698 100644 --- a/A3A/addons/core/functions/Supports/fn_SUP_artilleryAvailable.sqf +++ b/A3A/addons/core/functions/Supports/fn_SUP_artilleryAvailable.sqf @@ -19,4 +19,4 @@ if (_target isKindOf "Air") exitWith { 0 }; // can't hit air // Weighted against mortars if(tierWar < 5) exitWith { 0 }; -(tierWar - 4) / 8; // ~12.5% at tier 5, 75% at tier 10 +(tierWar - 4) / 12; // ~8.3% at tier 5, 50% at tier 10 diff --git a/A3A/addons/core/functions/Supports/fn_SUP_mortar.sqf b/A3A/addons/core/functions/Supports/fn_SUP_mortar.sqf index feb5456456..5749cffee2 100644 --- a/A3A/addons/core/functions/Supports/fn_SUP_mortar.sqf +++ b/A3A/addons/core/functions/Supports/fn_SUP_mortar.sqf @@ -83,4 +83,4 @@ A3A_activeSupports pushBack _suppData; [_reveal, _side, "MORTAR", _targPos, _delay] spawn A3A_fnc_showInterceptedSetupCall; // Mortar cost (might be free?) + extra support cost for balance -(A3A_vehicleResourceCosts getOrDefault [_vehType, 0]) + 100; +(A3A_vehicleResourceCosts getOrDefault [_vehType, 0]) + (10 * count units _group) + 100; \ No newline at end of file diff --git a/A3A/addons/core/functions/Supports/fn_SUP_mortarAvailable.sqf b/A3A/addons/core/functions/Supports/fn_SUP_mortarAvailable.sqf index 2833e7b1cf..7c55febcf0 100644 --- a/A3A/addons/core/functions/Supports/fn_SUP_mortarAvailable.sqf +++ b/A3A/addons/core/functions/Supports/fn_SUP_mortarAvailable.sqf @@ -20,4 +20,4 @@ if (_target isKindOf "Air") exitWith { 0 }; // can't hit air // balance this one against artillery if (tierWar < 2) exitWith { 0 }; if (tierWar < 5 or !("ARTILLERY" in _availTypes)) exitWith { 1 }; -1 - (tierWar - 4) / 8; // // 87.5% at tier 5, 25% at tier 10 +1 - (tierWar - 4) / 12; // // 91.7% at tier 5, 50% at tier 1 \ No newline at end of file diff --git a/A3A/addons/core/functions/Supports/fn_SUP_tank.sqf b/A3A/addons/core/functions/Supports/fn_SUP_tank.sqf new file mode 100644 index 0000000000..688ddb4a82 --- /dev/null +++ b/A3A/addons/core/functions/Supports/fn_SUP_tank.sqf @@ -0,0 +1,51 @@ +/* Sets up a land QRF support + +Environment: Server, scheduled, internal + +Arguments: + The (unique) name of the support, mostly for logging + The side from which the support should be sent (occupants or invaders) + Resource pool used for this support. Should be "attack" or "defence" + Maximum resources to spend on this support. Must be greater than zero + Initial target, or "false" for none. + Estimated position of target, or center of target zone + Reveal value 0-1, higher values mean more information provided about support + Setup delay time in seconds, if negative will calculate based on war tier + +Returns: + Resource cost of support call, or -1 for failure +*/ + +#include "..\..\script_component.hpp" +FIX_LINE_NUMBERS() + +params ["_suppName", "_side", "_resPool", "_maxSpend", "_target", "_targPos", "_reveal", "_delay"]; + +private _base = [_side, _targPos] call A3A_fnc_availableBasesLand; +if (isNil "_base") exitWith { Info("Tanks cancelled because no land bases available"); -1 }; + +// Prevent ground QRFs spawning on top of each other. Should be gone after a minute. +[_base, 1] call A3A_fnc_addTimeForIdle; + +private _vehCount = 2 min ceil (_maxSpend / 200); +private _estResources = _vehCount * 200; + +// Land QRF delay is purely dependent on travel as they're slow enough already +if (_delay < 0) then { _delay = 0 }; // land QRFs slow enough already + +private _targArray = []; +if (_target isEqualType objNull and {!isNull _target}) then { + // Should probably put a partial "troops" entry in here too? + A3A_supportStrikes pushBack [_side, "TARGET", _target, time + 1800, 1800, 150*_vehCount]; + _targArray = [_target, _targPos]; +}; + +// name, side, suppType, center, radius, [target, targpos] +private _suppData = [_supportName, _side, "TANK", _targPos, 1000, _targArray]; +A3A_activeSupports pushBack _suppData; +[_suppData, _resPool, _base, _vehCount, _delay, _estResources] spawn A3A_fnc_SUP_tankRoutine; + +private _approxTime = _delay + (markerPos _base distance2D _targPos) / (30 / 3.6); // (badly) estimated travel time +[_reveal, _side, "TANK", _targPos, _approxTime] spawn A3A_fnc_showInterceptedSetupCall; + +_estResources; // *estimated* resource cost of vehicles \ No newline at end of file diff --git a/A3A/addons/core/functions/Supports/fn_SUP_tankAvailable.sqf b/A3A/addons/core/functions/Supports/fn_SUP_tankAvailable.sqf new file mode 100644 index 0000000000..3f758faaeb --- /dev/null +++ b/A3A/addons/core/functions/Supports/fn_SUP_tankAvailable.sqf @@ -0,0 +1,22 @@ +/* Get tank support selection weight against target +Arguments: + Target object + Side to send support from + Max resource spend (not currently used) + Array of strings of available types for this faction +Return value: + Weight value, 0 for unavailable or useless +*/ + +#include "..\..\script_component.hpp" +FIX_LINE_NUMBERS() + +params ["_target", "_side", "_maxSpend", "_availTypes"]; + +if (_target isKindOf "Air") exitWith { 0 }; // can't hit air + +if (_target isKindOf "Man") exitWith { 0.001 }; // Don't spawn to attack meatsacks, but re-use active supports + +// Against vehicles and statics, use more frequently against more dangerous stuff +private _threat = A3A_groundVehicleThreat getOrDefault [typeOf _target, 0]; +0.001 + _threat / 80; \ No newline at end of file diff --git a/A3A/addons/core/functions/Supports/fn_SUP_tankRoutine.sqf b/A3A/addons/core/functions/Supports/fn_SUP_tankRoutine.sqf new file mode 100644 index 0000000000..48f0e51279 --- /dev/null +++ b/A3A/addons/core/functions/Supports/fn_SUP_tankRoutine.sqf @@ -0,0 +1,126 @@ +/* Create and maintain close air support bomber +Environment: Server, must be spawned +Arguments: + Active support data, see initSupports + Resource pool of support, "attack" or "defence" + Marker name of source land base + Number of tanks to send + Delay time in seconds + Estimated resources already spent on support +// Amount of information to reveal to rebels, 0-1 +*/ +#include "..\..\script_component.hpp" +FIX_LINE_NUMBERS() + +Debug_1("tankRoutine called with %1", _this); + +params ["_suppData", "_resPool", "_base", "_vehCount", "_sleepTime", "_estResources"]; +_suppData params ["_supportName", "_side", "_suppType", "_suppCenter", "_suppRadius", "_suppTarget"]; + +sleep _sleepTime; + +// Only spawn tanks +private _data = [_side, _base, _suppCenter, _resPool, _vehCount, _vehCount, 2, true] call A3A_fnc_createAttackForceLand; +_data params ["_resources", "_vehicles", "_crewGroups", "_cargoGroups"]; +Info_1("Spawn performed: Vehicles %1", _vehicles apply { typeOf _x }); + +// Update the resource usage for the final value +[_estResources - _resources, _side, _resPool] remoteExec ["A3A_fnc_addEnemyResources", 2]; + + +#define STATE_TRAVEL 1 +#define STATE_ACQUIRE 2 +#define STATE_ATTACK 3 + +private _timeOut = time + 1800; +private _remTargets = 2; +private _state = STATE_TRAVEL; +private _targetObj = objNull; + +while {true} do +{ + private _remVehicles = _vehicles select { canFire _x and canMove _x and side _x == _side }; + if (_remVehicles isEqualTo []) exitWith { + Info_1("%1 has been defeated, starting retreat", _supportName); + }; + if (time > _timeOut) exitWith { + Info_1("%1 has timed out, starting retreat", _supportName); + }; + if (_remTargets <= 0) exitWith { + Info_1("%1 has run out of targets, aborting routine", _supportName); + }; + + switch (_state) do + { + case STATE_TRAVEL: { + if (_remVehicles inAreaArray [_suppCenter, _suppRadius, _suppRadius] isEqualTo []) exitWith { sleep 5 }; + + Debug_1("%1 reached patrol zone, acquiring target", _supportName); + _state = STATE_ACQUIRE; + continue; + }; + + case STATE_ACQUIRE: { + if (_suppTarget isEqualTo []) exitWith { sleep 5 }; + + _targetObj = _suppTarget select 0; + if !(_targetObj call A3A_fnc_canFight) exitWith { + _suppTarget resize 0; + Debug_1("%1 skips target, as it is already dead", _supportName); + }; + Debug_2("Next target for %2 is %1", _suppTarget, _supportName); + + private _lastKnownPos = _suppTarget select 1; + private _knownDist = _lastKnownPos distance2d getPosATL _targetObj; + private _knowledge = random 0.3 + _knownDist / _suppRadius; + + { + // reveal based on proximity to last known pos + _x reveal [_targetObj, 4*_knowledge]; + + { deleteWaypoint _x } forEachReversed (waypoints _x); + private _attackWP = _x addWaypoint [_targetObj, 0]; + _attackWP setWaypointType "DESTROY"; + _attackWP waypointAttachVehicle _targetObj; + private _sadWP = _x addWaypoint [_lastKnownPos, 0]; + _sadWP setWaypointType "SAD"; + + _x setCurrentWaypoint ([_sadWP, _attackWP] select (_knowledge > random 0.5)); + _x setBehaviourStrong "COMBAT"; + _x setCombatMode "RED"; + + } forEach _crewGroups; + + _timeout = _timeout + 300; + _state = STATE_ATTACK; + continue; + }; + + case STATE_ATTACK: { + if (alive _targetObj and {_targetObj distance2D _suppCenter < _suppRadius}) exitWith { sleep 5 }; + + _remTargets = _remTargets - 1; + _suppTarget resize 0; // clear target array so support routines can add the next + + if !(alive _targetObj) then { + Debug_1("Target destroyed, %1 returns to cycle mode", _supportName); + } else { + Debug_1("Target evaded, %1 returns to cycle mode", _supportName); + }; + + { + _x setBehaviourStrong "AWARE"; + _x setCombatMode "YELLOW"; + } forEach _crewGroups; + + _timeout = _timeout - 300; + _state = STATE_ACQUIRE; + continue; + }; + }; +}; + +_suppData set [4, 0]; // Set activesupport radius to 0, enables cleanup + +{ [_x] spawn A3A_fnc_VEHDespawner } forEach _vehicles; +{ [_x] spawn A3A_fnc_enemyReturnToBase } forEach (_crewGroups + _cargoGroups); \ No newline at end of file diff --git a/A3A/addons/core/functions/Supports/fn_initSupports.sqf b/A3A/addons/core/functions/Supports/fn_initSupports.sqf index 77c34ce72d..fa0597346f 100644 --- a/A3A/addons/core/functions/Supports/fn_initSupports.sqf +++ b/A3A/addons/core/functions/Supports/fn_initSupports.sqf @@ -38,7 +38,8 @@ private _initData = [ ["MORTAR", "AREA", 0.5, 0.9, 100, 50, "", "staticMortars"], ["HOWITZER", "AREA", 0.5, 0.9, 125, 65, "", "staticHowitzers"], ["ASF", "TARGET", 1.0, 0.4, 0, 100, "", "vehiclesPlanesAA"], // balanced against SAMs (if available), 66/33 weighting - ["CAS", "TARGET", 1.0, 0.4, 0, 100, "", "vehiclesPlanesCAS"], + ["CAS", "TARGET", 0.5, 0.3, 0, 100, "", "vehiclesPlanesCAS"], + ["TANK", "TARGET", 0.5, 0.7, 0, 100, "", ""], // balanced against CAS, lowAir based ["CASDIVE", "TARGET", 0.8, 0.3, 0, 100, "", "vehiclesPlanesCAS"], ["QRFLAND", "TROOPS", 1.0, 1.4, 0, 0, "", ""], ["QRFAIR", "TROOPS", 0.5, 0.1, 0, 0, "", ""], diff --git a/A3A/addons/core/functions/Supports/fn_showInterceptedSetupCall.sqf b/A3A/addons/core/functions/Supports/fn_showInterceptedSetupCall.sqf index 08101e08e1..1f79fd7029 100644 --- a/A3A/addons/core/functions/Supports/fn_showInterceptedSetupCall.sqf +++ b/A3A/addons/core/functions/Supports/fn_showInterceptedSetupCall.sqf @@ -56,6 +56,10 @@ else { _text = format [localize "STR_notifiers_SUP_setup_QRFVehAirdrop", _sideName]; }; + case ("TANK"): + { + _text = format [localize "STR_A3A_fn_support_showIntStpCll_TANK", _sideName]; + }; case ("AIRSTRIKE"): { _text = format [localize "STR_notifiers_SUP_setup_airstrike", _sideName]; @@ -121,7 +125,7 @@ private _timeStr = if(_setupTime < 60) then { "<1" } else { str round (_setup if(_reveal >= 0.8) then { - if(toupper _supportType in ["QRFLAND", "QRFAIR", "COUNTERATTACK", "MAJORATTACK", "QRFVEHAIRDROP"]) then + if(toupper _supportType in ["QRFLAND", "QRFAIR", "COUNTERATTACK", "MAJORATTACK", "QRFVEHAIRDROP", "TANK"]) then { _text = format [localize "STR_notifiers_SUP_QRF_setup_arrival", _text, _timeStr]; } diff --git a/A3A/addons/core/functions/Templates/fn_compileMissionAssets.sqf b/A3A/addons/core/functions/Templates/fn_compileMissionAssets.sqf index 8bcf0ebcd4..69b093df6b 100644 --- a/A3A/addons/core/functions/Templates/fn_compileMissionAssets.sqf +++ b/A3A/addons/core/functions/Templates/fn_compileMissionAssets.sqf @@ -1,245 +1,246 @@ -/* -Author: Håkon -Description: - Generates a list off all assets used by the factions, replaces old global variables like vehAttack - -Arguments: - -Return Value: the hashmap A3A_faction_all - -Scope: Server -Environment: unscheduled -Public: No -Dependencies: - -Example: - -License: MIT License -*/ -#include "..\..\script_component.hpp" -FIX_LINE_NUMBERS() - -#define OccAndInv(VAR) (FactionGetOrDefault(occ, VAR, []) + FactionGetOrDefault(inv, VAR, [])) -#define Reb(VAR) FactionGetOrDefault(reb, VAR, []) -#define Riv(VAR) FactionGetOrDefault(riv, VAR, []) -#define Occ(VAR) FactionGetOrDefault(occ, VAR, []) -#define Inv(VAR) FactionGetOrDefault(inv, VAR, []) - -A3A_faction_all = createHashMap; -//setVar expects an array -#define setVar(VAR, VALUE) A3A_faction_all set [VAR, (VALUE) arrayIntersect (VALUE)]; -#define getVar(VAR) (A3A_faction_all get VAR) - - -private _fnc_extractMarketClasses = { - private _type = _this; - private _vehicleRegisters = A3U_blackMarketStock select {(_x select 2) isEqualTo _type}; - if (_vehicleRegisters isEqualTo []) exitWith {[]}; - - _vehicleRegisters apply {_x select 0} -}; - -private _fnc_setHashmap = { - params ["_faction", "_templateVar"]; - - private _map = createHashMap; - {_map set [_x select 0, _x select 1]} forEach (_faction get _templateVar); - _faction set [_templateVar, _map]; -}; - - //=====\\ - // Units \\ -// ======= \\ -Info("Identifying unit types"); - -//create empty lists -private _squadLeaders = []; -private _medics = []; -private _radioMen = []; - -//add occ and inv units to the lists -{ - private _prefix = _x; - { - _squadLeaders pushBack ('loadouts_'+_prefix+_x+'SquadLeader');//type - _medics pushBack ('loadouts_'+_prefix+_x+'Medic'); - _radioMen pushBack ('loadouts_'+_prefix+_x+'Radioman'); - } forEach ["militia_","military_","elite_","SF_"];//section -} forEach ["occ_", "inv_"];//prefix - -_squadLeaders append [ - 'loadouts_occ_other_Official', - 'loadouts_riv_militia_CellLeader', - 'loadouts_riv_militia_Commander', - 'loadouts_reb_militia_SquadLeader' -]; -_medics append [ - 'loadouts_reb_militia_Medic', - 'loadouts_riv_militia_Medic' -]; - -_radioMen pushBack 'loadouts_occ_other_Official'; - -//set the lists in the hm -setVar("SquadLeaders", _squadLeaders); -setVar("Medics", _medics); -setVar("Radiomen", _radioMen); - - //========\\ - // Vehicles \\ -// ========== \\ -Info("Identifying vehicle types"); - -//Occ&Inv X vehicles -//Antistasi Ultimate stuff -setVar("vehiclesDropPod", OccAndInv("vehiclesDropPod")); -/// -setVar("vehiclesPolice", OccAndInv("vehiclesPolice")); -setVar("vehiclesAttack", OccAndInv("vehiclesAttack")); -setVar("vehiclesAmmoTrucks", OccAndInv("vehiclesAmmoTrucks")); -setVar("vehiclesLightAPCs", OccAndInv("vehiclesLightAPCs") + OccAndInv("vehiclesMilitiaAPCs") + OccAndInv("vehiclesAirborne")); -setVar("vehiclesMedical", OccAndInv("vehiclesMedical") + ((A3A_faction_civ get "vehiclesCivMedical") select {_x isEqualType ""})); -setVar("vehiclesAPCs", OccAndInv("vehiclesAPCs") + Riv("vehiclesRivalsAPCs") + ("APC" call _fnc_extractMarketClasses)); -setVar("vehiclesIFVs", OccAndInv("vehiclesIFVs") ); -setVar("vehiclesUAVs", OccAndInv("uavsAttack")+ OccAndInv("uavsPortable") + Riv("vehiclesRivalsUavs") + ("UAV" call _fnc_extractMarketClasses)); -setVar("vehiclesAA", OccAndInv("vehiclesAA") + ("AA" call _fnc_extractMarketClasses) + Reb("vehiclesAA")); -setVar("vehiclesArtillery", OccAndInv("vehiclesArtillery") + ("ARTILLERY" call _fnc_extractMarketClasses)); -setVar("vehiclesTanks", OccAndInv("vehiclesTanks") + Riv("vehiclesRivalsTanks") + ("TANK" call _fnc_extractMarketClasses)); -setVar("vehiclesTransportAir", OccAndInv("vehiclesHelisLight") + OccAndInv("vehiclesHelisTransport") + OccAndInv("vehiclesPlanesTransport")); -setVar("vehiclesHelisLight", OccAndInv("vehiclesHelisLight") ); -setVar("vehiclesHelisLightAttack", OccAndInv("vehiclesHelisLightAttack") ); -setVar("vehiclesHelisAttack", OccAndInv("vehiclesHelisAttack") ); -setVar("vehiclesHelisTransport", OccAndInv("vehiclesHelisTransport") ); -setVar("vehiclesPlanesAA", OccAndInv("vehiclesPlanesAA") ); -setVar("vehiclesPlanesCAS", OccAndInv("vehiclesPlanesCAS") ); -setVar("vehiclesPlanesLargeAA", OccAndInv("vehiclesPlanesLargeAA") ); -setVar("vehiclesPlanesLargeCAS", OccAndInv("vehiclesPlanesLargeCAS") ); -setVar("vehiclesPlanesTransport", OccAndInv("vehiclesPlanesTransport")); -setVar("staticMortars", OccAndInv("staticMortars") + Riv("staticMortars") + Reb("staticMortars") + ("STATICMORTAR" call _fnc_extractMarketClasses)); -setVar("staticAA", OccAndInv("staticAA") + Reb("staticAA") + ("STATICAA" call _fnc_extractMarketClasses)); -setVar("staticAT", OccAndInv("staticAT") + Reb("staticAT") + ("STATICAT" call _fnc_extractMarketClasses)); -setVar("staticMGs", OccAndInv("staticMGs") + Riv("staticLowWeapons") + Reb("staticMGs") + ("STATICMG" call _fnc_extractMarketClasses)); - -//Antistasi Plus stuff -setVar("vehiclesAirborne", OccAndInv("vehiclesAirborne")); -setVar("vehiclesLightTanks", OccAndInv("vehiclesLightTanks")); - -setVar("vehicleRadars", [Occ("vehicleRadar"), Inv("vehicleRadar")]); -setVar("vehicleSams", [Occ("vehicleSam"), Inv("vehicleSam")]); -setVar("staticHowitzers", OccAndInv("staticHowitzers")); - -[A3A_faction_inv, "animations"] call _fnc_setHashmap; -[A3A_faction_occ, "animations"] call _fnc_setHashmap; -[A3A_faction_reb, "animations"] call _fnc_setHashmap; -[A3A_faction_riv, "animations"] call _fnc_setHashmap; -[A3A_faction_civ, "animations"] call _fnc_setHashmap; -[A3A_faction_inv, "variants"] call _fnc_setHashmap; -[A3A_faction_occ, "variants"] call _fnc_setHashmap; -[A3A_faction_reb, "variants"] call _fnc_setHashmap; -[A3A_faction_riv, "variants"] call _fnc_setHashmap; -[A3A_faction_civ, "variants"] call _fnc_setHashmap; - -//Rivals -private _vehRivalsArmor = Riv("vehiclesRivalsAPCs") + Riv("vehiclesRivalsTanks"); -setVar("vehiclesRivalsArmor", _vehRivalsArmor); - -private _vehRivalsLight = Riv("vehiclesRivalsCars") + Riv("vehiclesRivalsLightArmed") + Riv("vehiclesRivalsTrucks"); -setVar("vehiclesRivalsLight", _vehRivalsLight); - -private _vehRivalsStatics = Riv("staticMGs") + Riv("staticAT") + Riv("staticAA"); -setVar("vehiclesRivalsStatics", _vehRivalsStatics); - -private _vehRivals = Riv("vehiclesRivalsAPCs") -+ Riv("vehiclesRivalsTanks") -+ Riv("vehiclesRivalsTrucks") -+ Riv("vehiclesRivalsCars") -+ Riv("vehiclesRivalsLightArmed") -+ Riv("vehiclesRivalsUavs"); -setVar("vehiclesRivals", _vehRivals); - -private _vehMilitia = OccAndInv("vehiclesMilitiaCars") -+ OccAndInv("vehiclesMilitiaTrucks") -+ OccAndInv("vehiclesMilitiaLightArmed") -+ OccAndInv("vehiclesMilitiaAPCs"); -setVar("vehiclesMilitia", _vehMilitia); - -//boats -private _vehBoats = OccAndInv("vehiclesTransportBoats") + OccAndInv("vehiclesGunBoats") + Reb("vehiclesBoat"); -setVar("vehiclesBoats", _vehBoats); - -//Occ&Inv helicopters -private _vehHelis = -OccAndInv("vehiclesHelisTransport") -+ OccAndInv("vehiclesHelisLightAttack") -+ OccAndInv("vehiclesHelisAttack") -+ OccAndInv("vehiclesHelisLight") -+ ("HELI" call _fnc_extractMarketClasses); -setVar("vehiclesHelis", _vehHelis); - -//fixed winged aircrafts -private _vehFixedWing = -OccAndInv("vehiclesPlanesCAS") -+ OccAndInv("vehiclesPlanesAA") -+ OccAndInv("vehiclesPlanesLargeAA") -+ OccAndInv("vehiclesPlanesLargeCAS") -+ OccAndInv("vehiclesPlanesTransport") -+ Reb("vehiclesPlane") -+ Reb("vehiclesCivPlane") -+ ("PLANE" call _fnc_extractMarketClasses); -setVar("vehiclesFixedWing", _vehFixedWing); - -//trucks to carry infantry -private _vehTrucks = -OccAndInv("vehiclesTrucks") -+ OccAndInv("vehiclesMilitiaTrucks") -+ Riv("vehiclesRivalsTrucks") -+ Reb("vehiclesTruck"); -setVar("vehiclesTrucks", _vehTrucks); - -//Armed cars -private _carsArmed = -OccAndInv("vehiclesLightArmed") -+ OccAndInv("vehiclesMilitiaLightArmed") -+ Reb("vehiclesLightArmed") -+ Riv("vehiclesRivalsLightArmed") -+ ("ARMEDCAR" call _fnc_extractMarketClasses); -setVar("vehiclesLightArmed", _carsArmed); - -//Unarmed cars -private _carsUnarmed = -OccAndInv("vehiclesLightUnarmed") // anything else? -+ OccAndInv("vehiclesMilitiaCars") -+ OccAndInv("vehiclesPolice") -+ Riv("vehiclesRivalsCars") -+ ("UNARMEDCAR" call _fnc_extractMarketClasses) -+ Reb("vehiclesLightUnarmed"); -setVar("vehiclesLightUnarmed", _carsUnarmed); -setVar("vehiclesLight", _carsArmed + _carsUnarmed); - -//all Occ&Inv armor -private _vehArmor = -getVar("vehiclesTanks") -+ getVar("vehiclesAA") -+ getVar("vehiclesArtillery") -+ getVar("vehiclesLightAPCs") -+ getVar("vehiclesAPCs") -+ getVar("vehiclesLightTanks") -+ getVar("vehiclesAirborne") -+ getVar("vehiclesIFVs"); -setVar("vehiclesArmor", _vehArmor); - -//rebel vehicles -private _vehReb = - Reb("vehiclesBasic") + Reb("vehiclesTruck") + Reb("vehiclesBoat") - + Reb("vehiclesAT") + Reb("vehiclesLightArmed") + Reb("vehiclesLightUnarmed") - + Reb("staticMGs") + Reb("staticAT") + Reb("staticAA") + Reb("staticMortars") - + Reb("vehiclesHelis") + Reb("vehiclesPlane") + Reb("vehiclesMedical") + Reb("vehiclesAA") - + (A3U_blackMarketStock apply {_x select 0}); -setVar("vehiclesReb", _vehReb); - -//trucks that can cary logistics cargo -private _vehCargoTrucks = (_vehTrucks + OccAndInv("vehiclesCargoTrucks")) select { [_x] call A3A_Logistics_fnc_getVehCapacity > 1 }; -setVar("vehiclesCargoTrucks", _vehCargoTrucks); - -missionNamespace setVariable ["A3A_faction_all", A3A_faction_all, true]; +/* +Author: Håkon +Description: + Generates a list off all assets used by the factions, replaces old global variables like vehAttack + +Arguments: + +Return Value: the hashmap A3A_faction_all + +Scope: Server +Environment: unscheduled +Public: No +Dependencies: + +Example: + +License: MIT License +*/ +#include "..\..\script_component.hpp" +FIX_LINE_NUMBERS() + +#define OccAndInv(VAR) (FactionGetOrDefault(occ, VAR, []) + FactionGetOrDefault(inv, VAR, [])) +#define Reb(VAR) FactionGetOrDefault(reb, VAR, []) +#define Riv(VAR) FactionGetOrDefault(riv, VAR, []) +#define Occ(VAR) FactionGetOrDefault(occ, VAR, []) +#define Inv(VAR) FactionGetOrDefault(inv, VAR, []) + +A3A_faction_all = createHashMap; +//setVar expects an array +#define setVar(VAR, VALUE) A3A_faction_all set [VAR, (VALUE) arrayIntersect (VALUE)]; +#define getVar(VAR) (A3A_faction_all get VAR) + + +private _fnc_extractMarketClasses = { + private _type = _this; + private _vehicleRegisters = A3U_blackMarketStock select {(_x select 2) isEqualTo _type}; + if (_vehicleRegisters isEqualTo []) exitWith {[]}; + + _vehicleRegisters apply {_x select 0} +}; + +private _fnc_setHashmap = { + params ["_faction", "_templateVar"]; + + private _map = createHashMap; + {_map set [_x select 0, _x select 1]} forEach (_faction get _templateVar); + _faction set [_templateVar, _map]; +}; + + //=====\\ + // Units \\ +// ======= \\ +Info("Identifying unit types"); + +//create empty lists +private _squadLeaders = []; +private _medics = []; +private _radioMen = []; + +//add occ and inv units to the lists +{ + private _prefix = _x; + { + _squadLeaders pushBack ('loadouts_'+_prefix+_x+'SquadLeader');//type + _medics pushBack ('loadouts_'+_prefix+_x+'Medic'); + _radioMen pushBack ('loadouts_'+_prefix+_x+'Radioman'); + } forEach ["militia_","military_","elite_","SF_"];//section +} forEach ["occ_", "inv_"];//prefix + +_squadLeaders append [ + 'loadouts_occ_other_Official', + 'loadouts_riv_militia_CellLeader', + 'loadouts_riv_militia_Commander', + 'loadouts_reb_militia_SquadLeader' +]; +_medics append [ + 'loadouts_reb_militia_Medic', + 'loadouts_riv_militia_Medic' +]; + +_radioMen pushBack 'loadouts_occ_other_Official'; + +//set the lists in the hm +setVar("SquadLeaders", _squadLeaders); +setVar("Medics", _medics); +setVar("Radiomen", _radioMen); + + //========\\ + // Vehicles \\ +// ========== \\ +Info("Identifying vehicle types"); + +//Occ&Inv X vehicles +//Antistasi Ultimate stuff +setVar("vehiclesDropPod", OccAndInv("vehiclesDropPod")); +setVar("vehiclesSDV", OccAndInv("vehiclesSDV")); +/// +setVar("vehiclesPolice", OccAndInv("vehiclesPolice")); +setVar("vehiclesAttack", OccAndInv("vehiclesAttack")); +setVar("vehiclesAmmoTrucks", OccAndInv("vehiclesAmmoTrucks")); +setVar("vehiclesLightAPCs", OccAndInv("vehiclesLightAPCs") + OccAndInv("vehiclesMilitiaAPCs") + OccAndInv("vehiclesAirborne")); +setVar("vehiclesMedical", OccAndInv("vehiclesMedical") + ((A3A_faction_civ get "vehiclesCivMedical") select {_x isEqualType ""})); +setVar("vehiclesAPCs", OccAndInv("vehiclesAPCs") + Riv("vehiclesRivalsAPCs") + ("APC" call _fnc_extractMarketClasses)); +setVar("vehiclesIFVs", OccAndInv("vehiclesIFVs") ); +setVar("vehiclesUAVs", OccAndInv("uavsAttack")+ OccAndInv("uavsPortable") + Riv("vehiclesRivalsUavs") + ("UAV" call _fnc_extractMarketClasses)); +setVar("vehiclesAA", OccAndInv("vehiclesAA") + ("AA" call _fnc_extractMarketClasses) + Reb("vehiclesAA")); +setVar("vehiclesArtillery", OccAndInv("vehiclesArtillery") + ("ARTILLERY" call _fnc_extractMarketClasses)); +setVar("vehiclesTanks", OccAndInv("vehiclesTanks") + Riv("vehiclesRivalsTanks") + ("TANK" call _fnc_extractMarketClasses)); +setVar("vehiclesTransportAir", OccAndInv("vehiclesHelisLight") + OccAndInv("vehiclesHelisTransport") + OccAndInv("vehiclesPlanesTransport")); +setVar("vehiclesHelisLight", OccAndInv("vehiclesHelisLight") ); +setVar("vehiclesHelisLightAttack", OccAndInv("vehiclesHelisLightAttack") ); +setVar("vehiclesHelisAttack", OccAndInv("vehiclesHelisAttack") ); +setVar("vehiclesHelisTransport", OccAndInv("vehiclesHelisTransport") ); +setVar("vehiclesPlanesAA", OccAndInv("vehiclesPlanesAA") ); +setVar("vehiclesPlanesCAS", OccAndInv("vehiclesPlanesCAS") ); +setVar("vehiclesPlanesLargeAA", OccAndInv("vehiclesPlanesLargeAA") ); +setVar("vehiclesPlanesLargeCAS", OccAndInv("vehiclesPlanesLargeCAS") ); +setVar("vehiclesPlanesTransport", OccAndInv("vehiclesPlanesTransport")); +setVar("staticMortars", OccAndInv("staticMortars") + Riv("staticMortars") + Reb("staticMortars") + ("STATICMORTAR" call _fnc_extractMarketClasses)); +setVar("staticAA", OccAndInv("staticAA") + Reb("staticAA") + ("STATICAA" call _fnc_extractMarketClasses)); +setVar("staticAT", OccAndInv("staticAT") + Reb("staticAT") + ("STATICAT" call _fnc_extractMarketClasses)); +setVar("staticMGs", OccAndInv("staticMGs") + Riv("staticLowWeapons") + Reb("staticMGs") + ("STATICMG" call _fnc_extractMarketClasses)); + +//Antistasi Plus stuff +setVar("vehiclesAirborne", OccAndInv("vehiclesAirborne")); +setVar("vehiclesLightTanks", OccAndInv("vehiclesLightTanks")); + +setVar("vehicleRadars", [Occ("vehicleRadar"), Inv("vehicleRadar")]); +setVar("vehicleSams", [Occ("vehicleSam"), Inv("vehicleSam")]); +setVar("staticHowitzers", OccAndInv("staticHowitzers")); + +[A3A_faction_inv, "animations"] call _fnc_setHashmap; +[A3A_faction_occ, "animations"] call _fnc_setHashmap; +[A3A_faction_reb, "animations"] call _fnc_setHashmap; +[A3A_faction_riv, "animations"] call _fnc_setHashmap; +[A3A_faction_civ, "animations"] call _fnc_setHashmap; +[A3A_faction_inv, "variants"] call _fnc_setHashmap; +[A3A_faction_occ, "variants"] call _fnc_setHashmap; +[A3A_faction_reb, "variants"] call _fnc_setHashmap; +[A3A_faction_riv, "variants"] call _fnc_setHashmap; +[A3A_faction_civ, "variants"] call _fnc_setHashmap; + +//Rivals +private _vehRivalsArmor = Riv("vehiclesRivalsAPCs") + Riv("vehiclesRivalsTanks"); +setVar("vehiclesRivalsArmor", _vehRivalsArmor); + +private _vehRivalsLight = Riv("vehiclesRivalsCars") + Riv("vehiclesRivalsLightArmed") + Riv("vehiclesRivalsTrucks"); +setVar("vehiclesRivalsLight", _vehRivalsLight); + +private _vehRivalsStatics = Riv("staticMGs") + Riv("staticAT") + Riv("staticAA"); +setVar("vehiclesRivalsStatics", _vehRivalsStatics); + +private _vehRivals = Riv("vehiclesRivalsAPCs") ++ Riv("vehiclesRivalsTanks") ++ Riv("vehiclesRivalsTrucks") ++ Riv("vehiclesRivalsCars") ++ Riv("vehiclesRivalsLightArmed") ++ Riv("vehiclesRivalsUavs"); +setVar("vehiclesRivals", _vehRivals); + +private _vehMilitia = OccAndInv("vehiclesMilitiaCars") ++ OccAndInv("vehiclesMilitiaTrucks") ++ OccAndInv("vehiclesMilitiaLightArmed") ++ OccAndInv("vehiclesMilitiaAPCs"); +setVar("vehiclesMilitia", _vehMilitia); + +//boats +private _vehBoats = OccAndInv("vehiclesTransportBoats") + OccAndInv("vehiclesGunBoats") + Reb("vehiclesBoat"); +setVar("vehiclesBoats", _vehBoats); + +//Occ&Inv helicopters +private _vehHelis = +OccAndInv("vehiclesHelisTransport") ++ OccAndInv("vehiclesHelisLightAttack") ++ OccAndInv("vehiclesHelisAttack") ++ OccAndInv("vehiclesHelisLight") ++ ("HELI" call _fnc_extractMarketClasses); +setVar("vehiclesHelis", _vehHelis); + +//fixed winged aircrafts +private _vehFixedWing = +OccAndInv("vehiclesPlanesCAS") ++ OccAndInv("vehiclesPlanesAA") ++ OccAndInv("vehiclesPlanesLargeAA") ++ OccAndInv("vehiclesPlanesLargeCAS") ++ OccAndInv("vehiclesPlanesTransport") ++ Reb("vehiclesPlane") ++ Reb("vehiclesCivPlane") ++ ("PLANE" call _fnc_extractMarketClasses); +setVar("vehiclesFixedWing", _vehFixedWing); + +//trucks to carry infantry +private _vehTrucks = +OccAndInv("vehiclesTrucks") ++ OccAndInv("vehiclesMilitiaTrucks") ++ Riv("vehiclesRivalsTrucks") ++ Reb("vehiclesTruck"); +setVar("vehiclesTrucks", _vehTrucks); + +//Armed cars +private _carsArmed = +OccAndInv("vehiclesLightArmed") ++ OccAndInv("vehiclesMilitiaLightArmed") ++ Reb("vehiclesLightArmed") ++ Riv("vehiclesRivalsLightArmed") ++ ("ARMEDCAR" call _fnc_extractMarketClasses); +setVar("vehiclesLightArmed", _carsArmed); + +//Unarmed cars +private _carsUnarmed = +OccAndInv("vehiclesLightUnarmed") // anything else? ++ OccAndInv("vehiclesMilitiaCars") ++ OccAndInv("vehiclesPolice") ++ Riv("vehiclesRivalsCars") ++ ("UNARMEDCAR" call _fnc_extractMarketClasses) ++ Reb("vehiclesLightUnarmed"); +setVar("vehiclesLightUnarmed", _carsUnarmed); +setVar("vehiclesLight", _carsArmed + _carsUnarmed); + +//all Occ&Inv armor +private _vehArmor = +getVar("vehiclesTanks") ++ getVar("vehiclesAA") ++ getVar("vehiclesArtillery") ++ getVar("vehiclesLightAPCs") ++ getVar("vehiclesAPCs") ++ getVar("vehiclesLightTanks") ++ getVar("vehiclesAirborne") ++ getVar("vehiclesIFVs"); +setVar("vehiclesArmor", _vehArmor); + +//rebel vehicles +private _vehReb = + Reb("vehiclesBasic") + Reb("vehiclesTruck") + Reb("vehiclesBoat") + + Reb("vehiclesAT") + Reb("vehiclesLightArmed") + Reb("vehiclesLightUnarmed") + + Reb("staticMGs") + Reb("staticAT") + Reb("staticAA") + Reb("staticMortars") + + Reb("vehiclesHelis") + Reb("vehiclesPlane") + Reb("vehiclesMedical") + Reb("vehiclesAA") + + (A3U_blackMarketStock apply {_x select 0}); +setVar("vehiclesReb", _vehReb); + +//trucks that can cary logistics cargo +private _vehCargoTrucks = (_vehTrucks + OccAndInv("vehiclesCargoTrucks")) select { [_x] call A3A_Logistics_fnc_getVehCapacity > 1 }; +setVar("vehiclesCargoTrucks", _vehCargoTrucks); + +missionNamespace setVariable ["A3A_faction_all", A3A_faction_all, true]; A3A_faction_all \ No newline at end of file diff --git a/A3A/addons/core/functions/init/fn_initServer.sqf b/A3A/addons/core/functions/init/fn_initServer.sqf index bf8da0785a..9866eb5557 100644 --- a/A3A/addons/core/functions/init/fn_initServer.sqf +++ b/A3A/addons/core/functions/init/fn_initServer.sqf @@ -17,6 +17,7 @@ if (call A3A_fnc_modBlacklist) exitWith {}; // hide all the HQ objects { + _x enableRopeAttach false; _x allowDamage false; _x hideObjectGlobal true; } forEach [boxX, flagX, vehicleBox, mapX, petros]; diff --git a/A3A/addons/core/functions/init/fn_initUtilityItems.sqf b/A3A/addons/core/functions/init/fn_initUtilityItems.sqf index 33a87bae26..c5638de264 100644 --- a/A3A/addons/core/functions/init/fn_initUtilityItems.sqf +++ b/A3A/addons/core/functions/init/fn_initUtilityItems.sqf @@ -38,10 +38,10 @@ _items append [ [_ammoStation#0, _ammoStation#1, localize "STR_A3AP_buyvehdialog_ammo_station", "rearm", ["cmmdr", "place", "move", "rotate", "save"]], [_repairStation#0, _repairStation#1, localize "STR_A3AP_buyvehdialog_repair_station", "repair", ["cmmdr", "place", "move", "rotate", "pack", "save"]], [_lightSource#0, _lightSource#1, localize "STR_A3AP_buyvehdialog_light", "", ["move"]], - ["Land_PlasticCase_01_medium_F", 100, "buildboxsmall", "", ["place", "move", "build"]], - ["Land_PlasticCase_01_large_F", 500, "buildboxlarge", "", ["place", "move", "build"]], - ["Land_PlasticCase_01_medium_black_F", 1000, "buildboxhuge", "", ["place", "move", "build"]], - ["Land_PlasticCase_01_large_black_F", 5000, "buildboxgigantic", "", ["place", "move", "build"]] + ["Land_PlasticCase_01_small_black_F", 250, "Build Box (Extra Small)", "", ["place", "move", "build"]], + ["Land_PlasticCase_01_medium_black_F", 500, "Build Box (Small)", "", ["place", "move", "build"]], + ["A3AU_Build_Box_Large_1", 2500, "Build Box (Medium)", "", ["place", "move", "build"]], + ["Land_PlasticCase_01_large_black_F", 5000, "Build Box (Large)", "", ["place", "move", "build"]] // TODO: get larger box from somewhere ]; diff --git a/A3A/addons/maps/BuildObjectsList.hpp b/A3A/addons/maps/BuildObjectsList.hpp index f4974d1c1d..a2326eeafe 100644 --- a/A3A/addons/maps/BuildObjectsList.hpp +++ b/A3A/addons/maps/BuildObjectsList.hpp @@ -6,7 +6,7 @@ #define BUILDABLES_HISTORIC {"Land_Tyres_F", 20}, {"Land_Barricade_01_10m_F", 50}, {"Land_Barricade_01_4m_F", 30}, {"Land_DeerStand_01_F", 100} -#define BUILDABLES_SCIFI {"Land_Cargo_Patrol_V2_F", 450}, {"Land_Cargo_Tower_V2_F", 1000}, {"Land_Cargo_HQ_V2_F", 500}, {"Land_Cargo_House_V2_F", 350} +#define BUILDABLES_SCIFI {"Land_Cargo_Patrol_V2_F", 1000}, {"Land_Cargo_Tower_V2_F", 2000}, {"Land_Cargo_HQ_V2_F", 1500}, {"Land_Cargo_House_V2_F", 500} //Map Climate Modifiers (What type of terrain is the biggest area of the map) #define BUILDABLES_ARID {"Land_BagFence_Corner_F", 10}, {"Land_BagFence_End_F", 10}, {"Land_BagFence_Long_F", 30}, {"Land_BagFence_Round_F", 30}, {"Land_BagFence_Short_F", 20} diff --git a/A3A/addons/scrt/Encounter/fn_encounter_frontlineSkirmish.sqf b/A3A/addons/scrt/Encounter/fn_encounter_frontlineSkirmish.sqf index 303caabda6..81ce69514c 100644 --- a/A3A/addons/scrt/Encounter/fn_encounter_frontlineSkirmish.sqf +++ b/A3A/addons/scrt/Encounter/fn_encounter_frontlineSkirmish.sqf @@ -27,7 +27,7 @@ diag_log _frontLine; diag_log _frontLine; diag_log _frontLine; */ -private _frontLine = (outposts + milbases + airportsX + resourcesX + factories + citiesX) select {([_x] call A3A_fnc_isFrontline && {sidesX getVariable [_x,sideUnknown] != teamPlayer})}; +private _frontLine = (outposts + milbases + airportsX + resourcesX + factories + citiesX) select {([_x] call A3A_fnc_isFrontlineNoFIA && {sidesX getVariable [_x,sideUnknown] != teamPlayer})}; private _frontlineSitesNearPlayer = ((outposts + milbases + airportsX + resourcesX + factories + citiesX) select {(_x in _frontLine) && {((getMarkerPos _x) distance2D _player < distanceSPWN*2.5) && {sidesX getVariable [_x,sideUnknown] != teamPlayer}}}) call BIS_fnc_arrayShuffle; if (_frontlineSitesNearPlayer isEqualTo []) exitWith { diff --git a/A3A/addons/scrt/Stringtable.xml b/A3A/addons/scrt/Stringtable.xml index afd9bf6d74..a18e8b9958 100644 --- a/A3A/addons/scrt/Stringtable.xml +++ b/A3A/addons/scrt/Stringtable.xml @@ -8686,6 +8686,14 @@ %1의 은신처 위치 %2이(가) 발견되었습니다. 이제 행동할 시간입니다. 가서 무기 보급품을 파괴하거나 훔치십시오(본부로 전달). 자원이 없다면 이 지역에서 우리를 상대로 어떠한 작전도 수행할 수 없을 것입니다. %3 이전에 완료하십시오. L'emplacement de la cachette %1 %2 a été trouvé, il est temps d'agir - allez-y et détruisez ou volez (livrez au QG) leur cache d'armes. Sans ressources, ils ne pourront pas mener d'opération secrète contre nous dans cette zone particulière. Faites-le avant %3. + + Prevent Invaders transfering valuable cargo to Rivals + Предотвратите передачу Захватчиками ценного груза Соперникам + + + We found out that the Invaders are going to transfer %1 valuable cargo at %2. Go there and stop the transfer. After the transmission is disrupted, %1 will stop conducting operations in this area. Do this before %3. + Мы выяснили что Захватчики собираются передать %1 ценный груз в %2 идите туда и остановите передачу. После срыва передачи, %1 перестанут их проводить в этой зоне. Сделайте это до %3. + Find the Arms Dealer Найти торговца оружием @@ -8770,6 +8778,30 @@ %1은(는) 해당 지역에서의 우리 작전을 방해하고 있습니다. 해당 지역으로 가서 %2 이전까지 점령하십시오. Un %1 perturbe nos opérations dans la région. Allez-y et capturez-le avant %2. + + Resource Acquisition at the frontline + Захват ресурсов на передовой + + + A %1 would be a fine addition to our cause. Go there and capture it before %2. %3 Sent their troups as well + %1 был бы прекрасным дополнением к нашему общему делу. Отправляйтесь туда и захватите его до %2. %3 также отправила туда свои войска + + + Destroy Roadblock at the frontline + Уничтожьте блокпост на передовой + + + A %1 interferes with our operations in the area. Go there and destroy it before %2. %3 Sent their troups as well + %1 мешает нашим операциям в окрестностях. Отправляйтесь туда и уничтожьте его до %2. %3 также отправила туда свои войска + + + Frontline Struggle + Борьба на передовой + + + A %1 is disturbing our operations in the area. Go there and capture it before %2. %3 Sent their troups as well + %1 мешает нашим операциям в окрестностях. Отправляйтесь туда и уничтожьте его до %2. %3 также отправила туда свои войска + Seize Administration Захватите администрацию @@ -9228,6 +9260,14 @@ %1에서 처형 대기 중인 포로가 있습니다. %2 이전까지 그들을 구출해야 합니다. 그들을 본부로 데려오십시오. Un groupe de prisonniers de guerre attend d'être exécuté à %1. Nous devons les sauver avant %2. Amenez-les au QG. + + Deresters Rescue + Спасите дезертиров + + + A group of enemy deserters is hiding in %1, they are hunted by enemy group. We must rescue them before %2. Bring them to HQ. + Группа вражеских дезертиров прячется в %1, их преследует вражеская группа. Мы должны спасти их до %2. Привезите их в штаб. + Rescue Prisoners Спасите пленников diff --git a/A3A/addons/scrt/UI/fn_ui_assignRivalsAttackLocationEventHandler.sqf b/A3A/addons/scrt/UI/fn_ui_assignRivalsAttackLocationEventHandler.sqf index 5efd2aad16..3ed2091d18 100644 --- a/A3A/addons/scrt/UI/fn_ui_assignRivalsAttackLocationEventHandler.sqf +++ b/A3A/addons/scrt/UI/fn_ui_assignRivalsAttackLocationEventHandler.sqf @@ -31,13 +31,20 @@ if(_mode == "ADD") then { if (_location in citiesX) then { [[_location],"A3A_fnc_RIV_ATT_Cell"] remoteExec ["A3A_fnc_scheduler",2]; } else { - [[_location],"A3A_fnc_RIV_ATT_Hideout"] remoteExec ["A3A_fnc_scheduler",2]; - }; - + if !(areInvadersDefeated) then { + /* private _roll = round random 100; + if (_roll >= 0.1) then { ///65 */ + [[_location],"A3A_fnc_RIV_ATT_Transfer"] remoteExec ["A3A_fnc_scheduler",2]; + /* } else { + [[_location],"A3A_fnc_RIV_ATT_Hideout"] remoteExec ["A3A_fnc_scheduler",2]; + }; */ + }; + ["REMOVE"] call SCRT_fnc_ui_assignRivalsAttackLocationEventHandler; closeDialog 0; closeDialog 0; [] call SCRT_fnc_ui_clearRivals; + }; }, [] ] call BIS_fnc_addStackedEventHandler; diff --git a/A3A/addons/ultimate/CfgFunctions.hpp b/A3A/addons/ultimate/CfgFunctions.hpp index 58d17ad921..c2fe410310 100644 --- a/A3A/addons/ultimate/CfgFunctions.hpp +++ b/A3A/addons/ultimate/CfgFunctions.hpp @@ -61,6 +61,12 @@ class CfgFunctions class logisticsGrabSeats {}; class weightTest {}; }; + class vehicles + { + file = QPATHTOFOLDER(functions\vehicles); + class setLock {}; + class toggleLock {}; + }; class zombie { file = QPATHTOFOLDER(functions\zombie); diff --git a/A3A/addons/ultimate/Stringtable.xml b/A3A/addons/ultimate/Stringtable.xml index cc87a74d50..171bcff66a 100644 --- a/A3A/addons/ultimate/Stringtable.xml +++ b/A3A/addons/ultimate/Stringtable.xml @@ -121,4 +121,9 @@ Dismemberment + + + %1 just sent a tank platoon. + + diff --git a/A3A/addons/ultimate/functions/vehicles/fn_setLock.sqf b/A3A/addons/ultimate/functions/vehicles/fn_setLock.sqf new file mode 100644 index 0000000000..eaa118fa50 --- /dev/null +++ b/A3A/addons/ultimate/functions/vehicles/fn_setLock.sqf @@ -0,0 +1,31 @@ +/* + Author: + Silence + + Description: + Locks or unlocks _vehicle with _state + + Params: + _vehicle + _state + + Usage: + [cursorObject, true] call A3U_fnc_setLock; + + Return: + true if successful +*/ + +params [ + ["_vehicle", ObjNull], + ["_state", false] +]; + +if (_vehicle isEqualTo ObjNull || {isNil "_vehicle"}) exitWith {false}; +if (alive _vehicle isEqualTo false) exitWith {false}; + +_vehicle lock _state; + +[format["%1 has been locked. State: %2", typeOf _vehicle, _state], _fnc_scriptName] call A3U_fnc_log; + +true; \ No newline at end of file diff --git a/A3A/addons/ultimate/functions/vehicles/fn_toggleLock.sqf b/A3A/addons/ultimate/functions/vehicles/fn_toggleLock.sqf new file mode 100644 index 0000000000..90d917aae5 --- /dev/null +++ b/A3A/addons/ultimate/functions/vehicles/fn_toggleLock.sqf @@ -0,0 +1,25 @@ +params [ + ["_vehicle", ObjNull] +]; + +if (_vehicle isEqualTo ObjNull || {isNil "_vehicle"}) exitWith {false}; + +switch (locked _vehicle) do +{ + case 0: + { + [_vehicle, true] call A3U_fnc_setLock; + }; + case 1; + case 2; + case 3: + { + [_vehicle, false] call A3U_fnc_setLock; + }; + default + { + diag_log format["Vehicle %1 lock state was not recognized. Perhaps it is null?", typeOf _vehicle]; + }; +}; + +true; \ No newline at end of file