Advertisement
Guest User

Untitled

a guest
May 25th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 43.75 KB | None | 0 0
  1. //VCOM AI, huge credits to Genesis, without VCOM this campaign would be so much less
  2.  
  3. OT_ACEremoveAction = [
  4.     "OT_Remove",
  5.     "Remove",
  6.     "",
  7.     {},
  8.     {params ["_target"]; (call OT_fnc_playerIsGeneral) || (_target call OT_fnc_playerIsOwner)},
  9.     {},
  10.     [],
  11.     [0,0,0],
  12.     10
  13. ] call ace_interact_menu_fnc_createAction;
  14. OT_ACEremoveActionConfirm = [
  15.     "OT_Remove_Confirm",
  16.     "Confirm",
  17.     "",
  18.     {params ["_target"]; deleteVehicle _target;},
  19.     {true},
  20.     {},
  21.     [],
  22.     [0,0,0],
  23.     10
  24. ] call ace_interact_menu_fnc_createAction;
  25.  
  26. //Find markers
  27. OT_ferryDestinations = [];
  28. OT_NATO_control = [];
  29. OT_regions = [];
  30. {
  31.     if((_x select [0,12]) isEqualTo "destination_") then {OT_ferryDestinations pushback _x};
  32.     if((_x select [0,8]) isEqualTo "control_") then {OT_NATO_control pushback _x};
  33.     if((_x select [0,7]) isEqualTo "island_") then {OT_regions pushback _x};
  34.     if((_x select [0,7]) isEqualTo "region_") then {OT_regions pushback _x};
  35. }foreach(allMapMarkers);
  36.  
  37. OT_missions = [];
  38. OT_localMissions = [];
  39. {
  40.     _name = configName _x;
  41.     _script = getText (_x >> "script");
  42.     _code = compileFinal preprocessFileLineNumbers _script;
  43.     OT_missions pushback _code;
  44. }foreach("true" configClasses ( configFile >> "CfgOverthrowMissions" ));
  45.  
  46. OT_tutorialMissions = [];
  47. OT_tutorialMissions pushback (compileFinal preprocessFileLineNumbers "\overthrow_main\missions\tutorial\tut_NATO.sqf");
  48. //OT_tutorialMissions pushback (compileFinal preprocessFileLineNumbers "\overthrow_main\missions\tutorial\tut_CRIM.sqf");
  49. OT_tutorialMissions pushback (compileFinal preprocessFileLineNumbers "\overthrow_main\missions\tutorial\tut_Drugs.sqf");
  50. OT_tutorialMissions pushback (compileFinal preprocessFileLineNumbers "\overthrow_main\missions\tutorial\tut_Economy.sqf");
  51.  
  52. OT_NATO_HQ_garrisonPos = [];
  53. OT_NATO_HQ_garrisonDir = 0;
  54.  
  55. // Load mission data
  56. call compile preprocessFileLineNumbers "data\names.sqf";
  57. call compile preprocessFileLineNumbers "data\towns.sqf";
  58. call compile preprocessFileLineNumbers "data\airports.sqf";
  59. call compile preprocessFileLineNumbers "data\objectives.sqf";
  60. call compile preprocessFileLineNumbers "data\economy.sqf";
  61. call compile preprocessFileLineNumbers "data\comms.sqf";
  62.  
  63. //Identity
  64. OT_faces_local = [];
  65. OT_faces_western = [];
  66. OT_faces_eastern = [];
  67. {
  68.     private _types = getArray(_x >> "identityTypes");
  69.     if(OT_identity_local in _types) then {OT_faces_local pushback configName _x};
  70.     if(OT_identity_western in _types) then {OT_faces_western pushback configName _x};
  71.     if(OT_identity_eastern in _types) then {OT_faces_eastern pushback configName _x};
  72. }foreach("getNumber(_x >> 'disabled') isEqualTo 0" configClasses (configfile >> "CfgFaces" >> "Man_A3"));
  73.  
  74. OT_voices_local = [];
  75. OT_voices_western = [];
  76. OT_voices_eastern = [];
  77. {
  78.     private _types = getArray(_x >> "identityTypes");
  79.     if(OT_language_local in _types) then {OT_voices_local pushback configName _x};
  80.     if(OT_language_western in _types) then {OT_voices_western pushback configName _x};
  81.     if(OT_language_eastern in _types) then {OT_voices_eastern pushback configName _x};
  82. }foreach("getNumber(_x >> 'scope') isEqualTo 2" configClasses (configfile >> "CfgVoice"));
  83.  
  84. //Find houses
  85. OT_hugePopHouses = ["Land_MultistoryBuilding_01_F","Land_MultistoryBuilding_03_F","Land_MultistoryBuilding_04_F","Land_House_2W04_F","Land_House_2W03_F"]; //buildings with potentially lots of people living in them
  86. OT_mansions = ["Land_House_Big_02_F","Land_House_Big_03_F","Land_Hotel_01_F","Land_Hotel_02_F"]; //buildings that rich guys like to live in
  87. OT_lowPopHouses = [];
  88. OT_medPopHouses = [];
  89. OT_highPopHouses = [];
  90. {
  91.     private _cost = getNumber(_x >> "cost");
  92.     [_cost,configName _x] call {
  93.         params ["_cost","_name"];
  94.         if(_cost > 70000) then {OT_hugePopHouses pushback _name;};
  95.         if(_cost > 55000) then {OT_highPopHouses pushback _name;};
  96.         if(_cost > 25000) then {OT_medPopHouses pushback _name;};
  97.         OT_lowPopHouses pushback _name;
  98.     };
  99. }foreach("(getNumber (_x >> 'scope') isEqualTo 2) && (configName _x isKindOf 'House') && (configName _x find '_House' > -1)" configClasses (configfile >> "CfgVehicles"));
  100.  
  101. OT_allBuyableBuildings = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_mansions + [OT_item_Tent,OT_flag_IND];
  102.  
  103. OT_allHouses = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses;
  104. OT_allRealEstate = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_mansions + [OT_warehouse,OT_policeStation,OT_barracks,OT_barracks,OT_workshopBuilding,OT_refugeeCamp,OT_trainingCamp];
  105.  
  106. OT_allTowns = [];
  107. OT_allTownPositions = [];
  108.  
  109. {
  110.     _x params ["_pos","_name"];
  111.     OT_allTowns pushBack _name;
  112.     OT_allTownPositions pushBack _pos;
  113.     if(isServer) then {
  114.         server setVariable [_name,_pos,true];
  115.     };
  116. }foreach(OT_townData);
  117.  
  118. OT_allAirports = OT_airportData apply { _x select 1 };
  119.  
  120. //Global overthrow variables related to any map
  121.  
  122. OT_currentMissionFaction = "";
  123. OT_rankXP = [100,250,500,1000,4000,10000,100000];
  124.  
  125. OT_adminMode = false;
  126. OT_deepDebug = false;
  127. OT_allIntel = [];
  128. OT_notifies = [];
  129.  
  130. OT_NATO_HQPos = [0,0,0];
  131.  
  132. OT_fastTime = true; //When true, 1 day will last 6 hrs real time
  133. OT_spawnDistance = 1200;
  134. if (isNil "OT_spawnCivPercentage") then {
  135.     OT_spawnCivPercentage = 0.03;
  136. };
  137. OT_spawnVehiclePercentage = 0.04;
  138. OT_standardMarkup = 0.2; //Markup in shops is calculated from this
  139. OT_randomSpawnTown = false; //if true, every player will start in a different town, if false, all players start in the same town (Multiplayer only)
  140. OT_distroThreshold = 500; //Size a towns order must be before a truck is sent (in dollars)
  141. OT_saving = false;
  142. OT_activeShops = [];
  143. OT_selling = false;
  144. OT_taking = false;
  145. OT_interactingWith = objNull;
  146.  
  147. OT_garrisonBuildings = ["Land_Cargo_Patrol_V1_F","Land_Cargo_Patrol_V2_F","Land_Cargo_Patrol_V3_F","Land_Cargo_Patrol_V4_F","Land_Cargo_HQ_V1_F","Land_Cargo_HQ_V2_F","Land_Cargo_HQ_V3_F","Land_Cargo_HQ_V4_F","Land_Cargo_Tower_V1_F","Land_Cargo_Tower_V2_F","Land_Cargo_Tower_V3_F","Land_Cargo_Tower_V4_F","Land_Cargo_Tower_V1_No1_F","Land_Cargo_Tower_V1_No2_F","Land_Cargo_Tower_V1_No3_F","Land_Cargo_Tower_V1_No4_F","Land_Cargo_Tower_V1_No5_F","Land_Cargo_Tower_V1_No6_F","Land_Cargo_Tower_V1_No7_F","Land_Cargo_Tower_V2_F", "Land_Cargo_Tower_V3_F"]; //Put HMGs in these buildings
  148.  
  149. OT_ammo_50cal = "OT_ammo50cal";
  150.  
  151. OT_item_wrecks = ["Land_Wreck_HMMWV_F","Land_Wreck_Skodovka_F","Land_Wreck_Truck_F","Land_Wreck_Car2_F","Land_Wreck_Car_F","Land_Wreck_Hunter_F","Land_Wreck_Offroad_F","Land_Wreck_Offroad2_F","Land_Wreck_UAZ_F","Land_Wreck_Truck_dropside_F"]; //rekt
  152.  
  153. OT_NATOwait = 500; //Half the Average time between NATO orders
  154. OT_CRIMwait = 500; //Half the Average time between crim changes
  155. OT_jobWait = 60;
  156.  
  157. OT_Resources = ["OT_Wood","OT_Steel","OT_Plastic","OT_Sugarcane","OT_Sugar","OT_Fertilizer"];
  158.  
  159. OT_item_CargoContainer = "B_Slingload_01_Cargo_F";
  160.  
  161. //Shop items
  162. OT_item_ShopRegister = "Land_CashDesk_F";//Cash registers
  163. OT_item_BasicGun = "hgun_P07_F";//Dealers always sell this cheap
  164. OT_item_BasicAmmo = "16Rnd_9x21_Mag";
  165.  
  166. OT_allDrugs = ["OT_Ganja","OT_Blow"];
  167. OT_illegalItems = OT_allDrugs;
  168.  
  169. OT_item_UAV = "I_UAV_01_F";
  170. OT_item_UAVterminal = "I_UavTerminal";
  171.  
  172. OT_item_DefaultBlueprints = [];
  173.  
  174. OT_itemCategoryDefinitions = [
  175.     ["General",["ACE_fieldDressing","Banana","Map","ToolKit","Compass","ACE_EarPlugs","Watch","Radio","Compass","ACE_Spraypaint","Altimiter","MapTools","Binocular"]],
  176.     ["Pharmacy",["Dressing","Bandage","morphine","adenosine","atropine","ACE_EarPlugs","epinephrine","bodyBag","quikclot","salineIV","bloodIV","plasmaIV","personalAidKit","surgicalKit","tourniquet"]],
  177.     ["Electronics",["Rangefinder","Cellphone","Radio","Watch","GPS","monitor","DAGR","_dagr","Battery","ATragMX","ACE_Flashlight","I_UavTerminal"]],
  178.     ["Hardware",["Tool","CableTie","ACE_Spraypaint","wirecutter","ACE_rope"]],
  179.     ["Surplus",["Rangefinder","Binocular","Compass","RangeCard","RangeTable","defusalKit","SpottingScope","ACE_Vector","ACE_Yardage"]]
  180. ];
  181.  
  182. OT_items = [];
  183. OT_allItems = [];
  184. OT_craftableItems = [];
  185.  
  186. call OT_fnc_detectItems;
  187.  
  188. OT_notifyHistory = [];
  189.  
  190. OT_staticBackpacks = [
  191.     ["I_HMG_01_high_weapon_F",600,1,0,1],
  192.     ["I_GMG_01_high_weapon_F",2500,1,0,1],
  193.     ["I_HMG_01_support_high_F",50,1,0,0],
  194.     ["I_Mortar_01_weapon_F",5000,1,0,1],
  195.     ["I_Mortar_01_support_F",100,1,0,0],
  196.     ["I_AT_01_weapon_F",2500,1,0,1],
  197.     ["I_AA_01_weapon_F",2500,1,0,1],
  198.     ["I_HMG_01_support_F",50,1,0,0]
  199. ];
  200.  
  201. OT_backpacks = [
  202.     ["B_AssaultPack_cbr",20,0,0,1],
  203.     ["B_AssaultPack_blk",20,0,0,1],
  204.     ["B_AssaultPack_khk",20,0,0,1],
  205.     ["B_AssaultPack_sgg",20,0,0,1],
  206.     ["B_FieldPack_cbr",30,0,0,1],
  207.     ["B_FieldPack_blk",30,0,0,1],
  208.     ["B_FieldPack_khk",30,0,0,1],
  209.     ["B_FieldPack_oli",30,0,0,1],
  210.     ["B_Kitbag_cbr",45,0,0,1],
  211.     ["B_Kitbag_sgg",45,0,0,1],
  212.     ["B_Carryall_cbr",60,0,0,1],
  213.     ["B_Carryall_khk",60,0,0,1],
  214.     ["B_Carryall_oli",60,0,0,1],
  215.     ["B_Parachute",50,0,0,1]
  216. ];
  217. if(OT_hasTFAR) then {
  218.     OT_backpacks append [
  219.         ["tf_anprc155",100,0,0,0.1],
  220.         ["tf_anarc210",150,0,0,0.1],
  221.         ["tf_anarc164",20,0,0,0.5],
  222.         ["tf_anprc155_coyote",10,0,0,0.5]
  223.     ];
  224. };
  225.  
  226. if (isServer) then {
  227.     cost setVariable ["OT_Wood",[5,0,0,0],true];
  228.     cost setVariable ["OT_Steel",[25,0,0,0],true];
  229.     cost setVariable ["OT_Plastic",[40,0,0,0],true];
  230.     cost setVariable ["OT_Sugarcane",[5,0,0,0],true];
  231.     cost setVariable ["OT_Grapes",[5,0,0,0],true];
  232.     cost setVariable ["OT_Sugar",[15,0,0,0],true];
  233.     cost setVariable ["OT_Wine",[25,0,0,0],true];
  234.     cost setVariable ["OT_Olives",[7,0,0,0],true];
  235.     cost setVariable ["OT_Fertilizer",[20,0,0,0],true];
  236. };
  237.  
  238.  
  239. //Detecting vehicles && weapons
  240.  
  241. OT_boats = [
  242.     ["C_Scooter_Transport_01_F",150,1,0,1],
  243.     ["C_Boat_Civil_01_rescue_F",300,1,1,1],
  244.     ["C_Boat_Transport_02_F",600,1,0,1]
  245. ];
  246. OT_vehicles = [];
  247. OT_helis = [];
  248. OT_allVehicles = [];
  249. OT_allBoats = ["B_Boat_Transport_01_F"];
  250. OT_allWeapons = [];
  251. OT_allOptics = [];
  252. OT_allMagazines = [OT_ammo_50cal];
  253. OT_allBackpacks = [];
  254. OT_allStaticBackpacks = [];
  255. OT_vehWeights_civ = [];
  256. OT_mostExpensiveVehicle = "";
  257. OT_allHeliThreats = [];
  258. OT_allPlaneThreats = [];
  259. OT_allVehicleThreats = [];
  260.  
  261. OT_spawnHouses = [];
  262. {
  263.     private _cls = configName _x;
  264.     OT_spawnHouses pushBack _cls;
  265.     OT_allBuyableBuildings pushBackUnique _cls;
  266.     OT_allRealEstate pushBackUnique _cls;
  267. }foreach( "getNumber ( _x >> ""ot_isPlayerHouse"" ) isEqualTo 1" configClasses ( configFile >> "CfgVehicles" ) );
  268.  
  269. //Mission house overrides
  270. {
  271.     _x params ["_cls","_template"];
  272.     OT_spawnHouses pushBack _cls;
  273.     OT_allBuyableBuildings pushBackUnique _cls;
  274.     OT_allRealEstate pushBackUnique _cls;
  275.     templates setVariable [_cls,_template,true];
  276. }foreach(OT_spawnHouseBuildings);
  277.  
  278. OT_gunDealerHouses = OT_spawnHouses;
  279.  
  280. private _allShops = "getNumber ( _x >> ""ot_isShop"" ) isEqualTo 1" configClasses ( configFile >> "CfgVehicles" );
  281. OT_shops = _allShops apply {configName _x};
  282.  
  283. //Mission shop overrides
  284. {
  285.     _x params ["_cls","_template"];
  286.     OT_shops pushBack _cls;
  287.     templates setVariable [_cls,_template,true];
  288. }foreach(OT_shopBuildings);
  289.  
  290. private _allCarShops = "getNumber ( _x >> ""ot_isCarDealer"" ) isEqualTo 1" configClasses ( configFile >> "CfgVehicles" );
  291. OT_carShops = _allCarShops apply {configName _x};
  292.  
  293. //Mission car shop overrides
  294. {
  295.     _x params ["_cls","_template"];
  296.     OT_carShops pushBack _cls;
  297.     templates setVariable [_cls,_template,true];
  298. }foreach(OT_carShopBuildings);
  299.  
  300. //Calculate prices
  301. //First, load the hardcoded prices from data/prices.sqf
  302. if(isServer) then {
  303.     OT_loadedPrices = [];
  304.     call compile preprocessFileLineNumbers "\overthrow_main\data\prices.sqf";
  305.     {
  306.         OT_loadedPrices pushback (_x select 0);
  307.         cost setVariable[_x select 0,_x select 1, true];
  308.     }forEach(OT_priceData);
  309.     OT_priceData = []; //free memory
  310. };
  311.  
  312. private _allVehs = "
  313.    ( getNumber ( _x >> ""scope"" ) isEqualTo 2
  314.    &&
  315.     { (getArray ( _x >> ""threat"" ) select 0) < 0.5}
  316.     &&
  317.    { (getText ( _x >> ""vehicleClass"" ) isEqualTo ""Car"") || (getText ( _x >> ""vehicleClass"" ) isEqualTo ""Support"")}
  318.     &&
  319.    { (getText ( _x >> ""faction"" ) isEqualTo ""CIV_F"") or
  320.     (getText ( _x >> ""faction"" ) isEqualTo ""IND_F"")})
  321.  
  322. " configClasses ( configFile >> "cfgVehicles" );
  323.  
  324. private _mostExpensive = 0;
  325. {
  326.     private _cls = configName _x;
  327.     private _clsConfig = configFile >> "cfgVehicles" >> _cls;
  328.     private _cost = round(getNumber (_clsConfig >> "armor") + (getNumber (_clsConfig >> "enginePower") * 2));
  329.     _cost = _cost + round(getNumber (_clsConfig >> "maximumLoad") * 0.1);
  330.  
  331.     if(_cls isKindOf "Truck_F") then {_cost = _cost * 2};
  332.     if(getText (_clsConfig >> "faction") != "CIV_F") then {_cost = _cost * 1.5};
  333.  
  334.  
  335.     OT_vehicles pushback [_cls,_cost,0,getNumber (_clsConfig >> "armor"),2];
  336.     OT_allVehicles pushback _cls;
  337.     if(getText (_clsConfig >> "faction") == "CIV_F") then {
  338.         if(getText(_clsConfig >> "textSingular") != "truck" && getText(_clsConfig >> "driverAction") != "Kart_driver") then {
  339.             OT_vehTypes_civ pushback _cls;
  340.  
  341.             if(_cost > _mostExpensive)then {
  342.                 _mostExpensive = _cost;
  343.                 OT_mostExpensiveVehicle = _cls;
  344.             };
  345.         };
  346.     };
  347. }foreach(_allVehs);
  348.  
  349. //Determine vehicle threats
  350. _allVehs = "
  351.     ( getNumber ( _x >> ""scope"" ) > 0
  352.     &&
  353.     { (getArray ( _x >> ""threat"" ) select 0) > 0}
  354.     &&
  355.     { (getText ( _x >> ""vehicleClass"" ) isEqualTo ""Car"") or
  356.      (getText ( _x >> ""vehicleClass"" ) isEqualTo ""Armored"")})
  357.  
  358. " configClasses ( configFile >> "cfgVehicles" );
  359.  
  360. {
  361.     OT_allVehicleThreats pushback (configName _x);
  362. }foreach(_allVehs);
  363.  
  364. private _allHelis = "
  365.    ( getNumber ( _x >> ""scope"" ) > 1
  366.    &&
  367.     { (getArray ( _x >> ""threat"" ) select 0) < 0.5}
  368.     &&
  369.    { getText ( _x >> ""vehicleClass"" ) isEqualTo ""Air""}
  370.     &&
  371.    { (getText ( _x >> ""faction"" ) isEqualTo ""CIV_F"") or
  372.     (getText ( _x >> ""faction"" ) isEqualTo ""IND_F"")})
  373. " configClasses ( configFile >> "cfgVehicles" );
  374.  
  375. {
  376.     private _cls = configName _x;
  377.     private _clsConfig = configFile >> "cfgVehicles" >> _cls;
  378.     private _multiply = 3;
  379.     if(_cls isKindOf "Plane") then {_multiply = 6};
  380.     private _cost = (getNumber (_clsConfig >> "armor") + getNumber (_clsConfig >> "enginePower")) * _multiply;
  381.     _cost = _cost + round(getNumber (_clsConfig >> "maximumLoad") * _multiply);
  382.     private _steel = round(getNumber (_clsConfig >> "armor"));
  383.     private _numturrets = count("true" configClasses(_clsConfig >> "Turrets"));
  384.     private _plastic = 2;
  385.     if(_numturrets > 0) then {
  386.         _cost = _cost + (_numturrets * _cost * _multiply);
  387.         _steel = _steel * 3;
  388.         _plastic = 6;
  389.     };
  390.  
  391.     if(isServer && isNil {cost getVariable _cls}) then {
  392.         cost setVariable [_cls,[_cost,0,_steel,_plastic],true];
  393.     };
  394.  
  395.     OT_helis pushback [_cls,[_cost,0,_steel,_plastic],true];
  396.     OT_allVehicles pushback _cls;
  397. }foreach(_allHelis);
  398.  
  399. //Determine aircraft threats
  400. _allHelis = "
  401.    ( getNumber ( _x >> ""scope"" ) > 0
  402.    &&
  403.     { (getArray ( _x >> ""threat"" ) select 0) >= 0.5}
  404.     &&
  405.    { getText ( _x >> ""vehicleClass"" ) isEqualTo ""Air""})
  406. " configClasses ( configFile >> "cfgVehicles" );
  407.  
  408. {
  409.     private _cls = configName _x;
  410.     private _clsConfig = configFile >> "cfgVehicles" >> _cls;
  411.     private _numturrets = count("true" configClasses(_clsConfig >> "Turrets"));
  412.  
  413.     if(_cls isKindOf "Plane") then {
  414.         OT_allPlaneThreats pushback _cls;
  415.     }else{
  416.         OT_allHeliThreats pushback _cls;
  417.     };
  418. }foreach(_allHelis);
  419.  
  420. //Chinook (unarmed) special case for production logistics
  421. OT_helis pushback ["B_Heli_Transport_03_unarmed_F",[150000,0,110,5],true];
  422. OT_allVehicles pushBackUnique "B_Heli_Transport_03_unarmed_F";
  423. if(isServer) then {
  424.     cost setVariable ["B_Heli_Transport_03_unarmed_F",[150000,0,110,5],true];
  425. };
  426.  
  427. {
  428.     private _cls = _x select 0;
  429.     if(isServer && isNil {cost getVariable _cls}) then {
  430.         cost setVariable [_cls,[_x select 1,_x select 2,_x select 3,_x select 4],true];
  431.     };
  432.     if(_cls in OT_vehTypes_civ) then {
  433.         OT_vehWeights_civ pushback (_mostExpensive - (_x select 1)) + 1; //This will make whatever is the most expensive car very rare
  434.     };
  435.     OT_allVehicles pushBack _cls;
  436. }foreach(OT_vehicles);
  437.  
  438. private _allWeapons = "
  439.    ( getNumber ( _x >> ""scope"" ) isEqualTo 2
  440.    &&
  441.    { getText ( _x >> ""simulation"" ) isEqualTo ""Weapon""})
  442. " configClasses ( configFile >> "cfgWeapons" );
  443.  
  444. private _allAttachments = "
  445.    ( getNumber ( _x >> ""scope"" ) isEqualTo 2
  446.    &&
  447.    { _t = getNumber ( _x >> ""ItemInfo"" >> ""type"" ); _t isEqualTo 301 || _t isEqualTo 302 || _t isEqualTo 101})
  448. " configClasses ( configFile >> "cfgWeapons" );
  449.  
  450. private _allOptics = "
  451.    ( getNumber ( _x >> ""scope"" ) isEqualTo 2
  452.    &&
  453.    { getNumber ( _x >> ""ItemInfo"" >> ""optics"" ) isEqualTo 1})
  454. " configClasses ( configFile >> "cfgWeapons" );
  455.  
  456. private _allDetonators = "
  457.    ( getNumber ( _x >> ""scope"" ) isEqualTo 2
  458.    &&
  459.    { getNumber ( _x >> ""ace_explosives_Detonator"" ) isEqualTo 1})
  460. " configClasses ( configFile >> "cfgWeapons" );
  461.  
  462. private _allUniforms = "
  463.    ( getNumber ( _x >> ""scope"" ) isEqualTo 2
  464.    &&
  465.    { getNumber ( _x >> ""ItemInfo"" >> ""type"" ) isEqualTo 801})
  466. " configClasses ( configFile >> "cfgWeapons" );
  467.  
  468. private _allHelmets = "
  469.    ( getNumber ( _x >> ""scope"" ) isEqualTo 2
  470.    &&
  471.    { getNumber ( _x >> ""ItemInfo"" >> ""type"" ) isEqualTo 605})
  472. " configClasses ( configFile >> "cfgWeapons" );
  473.  
  474. private _allAmmo = "
  475.    ( getNumber ( _x >> ""scope"" ) isEqualTo 2 )
  476. " configClasses ( configFile >> "cfgMagazines" );
  477.  
  478. private _allVehicles = "
  479.    ( getNumber ( _x >> ""scope"" ) > 0 )
  480. " configClasses ( configFile >> "cfgVehicles" );
  481.  
  482. private _allFactions = "
  483.    ( getNumber ( _x >> ""side"" ) < 3 )
  484. " configClasses ( configFile >> "cfgFactionClasses" );
  485.  
  486. private _allGlasses = "
  487.    ( getNumber ( _x >> ""scope"" ) isEqualTo 2 )
  488. " configClasses ( configFile >> "CfgGlasses" );
  489.  
  490. OT_allFactions = [];
  491. OT_allSubMachineGuns = [];
  492. OT_allAssaultRifles = [];
  493. OT_allMachineGuns = [];
  494. OT_allSniperRifles = [];
  495. OT_allHandGuns = [];
  496. OT_allMissileLaunchers = [];
  497. OT_allRocketLaunchers = [];
  498. OT_allExpensiveRifles = [];
  499. OT_allCheapRifles = [];
  500. OT_allVests = [];
  501. OT_allProtectiveVests = [];
  502. OT_allExpensiveVests = [];
  503. OT_allCheapVests = [];
  504. OT_allClothing = [];
  505. OT_allOptics = [];
  506. OT_allHelmets = [];
  507. OT_allHats = [];
  508. OT_allAttachments = [];
  509. OT_allExplosives = [];
  510. OT_explosives = [];
  511. OT_detonators = [];
  512. OT_allDetonators = [];
  513. OT_allGlasses = [];
  514. OT_allFacewear = [];
  515. OT_allGoggles = [];
  516. OT_allBLURifles = [];
  517. OT_allBLUSMG = [];
  518. OT_allBLUMachineGuns = [];
  519. OT_allBLUSniperRifles = [];
  520. OT_allBLUGLRifles = [];
  521. OT_allBLULaunchers = [];
  522. OT_allBLUPistols = [];
  523. OT_allBLUVehicles = [];
  524. OT_allBLUOffensiveVehicles = [];
  525.  
  526. {
  527.     private _name = configName _x;
  528.     private _title = getText (_x >> "displayname");
  529.     private _m = getNumber(_x >> "mass");
  530.     private _ignore = getNumber(_x >> "ot_shopignore");
  531.     if(_ignore != 1) then {
  532.         if((_name find "Balaclava_TI_") > -1) then {
  533.             _m = _m * 2;
  534.         };
  535.  
  536.         private _protection = getNumber(_x >> "ACE_Protection");
  537.         if(_protection > 0) then {
  538.             _m = round(_m * 1.5);
  539.         };
  540.  
  541.         [_name,_title] call {
  542.             params ["_name","_title"];
  543.             if(_name == "None") exitWith {};
  544.             if(_name == "G_Goggles_VR") exitWith {};
  545.             if((_title find "Tactical") > -1 || (_title find "Diving") > -1 || (_title find "Goggles") > -1) exitWith {
  546.                 OT_allGoggles pushback _name;
  547.             };
  548.             if((_title find "Balaclava") > -1 || (_title find "Bandana") > -1) exitWith {
  549.                 OT_allFacewear pushback _name;
  550.             };
  551.             OT_allGlasses pushback _name;
  552.         };
  553.         if(isServer && _name != "None" && isNil {cost getVariable _name}) then {
  554.             cost setVariable [_name,[_m*3,0,0,ceil(_m*0.5)],true];
  555.         };
  556.     };
  557. }foreach(_allGlasses);
  558.  
  559. {
  560.     private _name = configName _x;
  561.     private _title = getText (configFile >> "cfgFactionClasses" >> _name >> "displayName");
  562.     private _side = getNumber (configFile >> "cfgFactionClasses" >> _name >> "side");
  563.     private _flag = getText (configFile >> "cfgFactionClasses" >> _name >> "flag");
  564.     private _numblueprints = 0;
  565.  
  566.     //736
  567.  
  568.     //Get vehicles && weapons
  569.     private _vehicles = [];
  570.     private _weapons = [];
  571.     private _blacklist = ["Throw","Put","NLAW_F"];
  572.  
  573.     private _all = format["(getNumber( _x >> ""scope"" ) isEqualTo 2 ) && (getText( _x >> ""faction"" ) isEqualTo '%1')",_name] configClasses ( configFile >> "cfgVehicles" );
  574.     {
  575.         private _cls = configName _x;
  576.         if(_cls isKindOf "CAManBase") then {
  577.             //Get weapons;
  578.             {
  579.                 private _base = [_x] call BIS_fnc_baseWeapon;
  580.                 if !(_base in _blacklist) then {
  581.                     private _muzzleEffect = getText (configFile >> "CfgWeapons" >> _base >> "muzzleEffect");
  582.                     if !(_x in _weapons) then {_weapons pushback _base};
  583.                     if(_side isEqualTo 1 && !(_muzzleEffect isEqualTo "BIS_fnc_effectFiredFlares")) then {
  584.                         if(_base isKindOf ["Rifle", configFile >> "CfgWeapons"]) then {
  585.                             private _mass = getNumber (configFile >> "CfgWeapons" >> _base >> "WeaponSlotsInfo" >> "mass");
  586.                             _base call {
  587.                                 _itemType = ([_cls] call BIS_fnc_itemType) select 1;
  588.                                 if(_itemType isEqualTo "MachineGun") exitWith {OT_allBLUMachineGuns pushBackUnique _base};
  589.                                 if((_this select [0,7]) == "srifle_" || (_this isKindOf ["Rifle_Long_Base_F", configFile >> "CfgWeapons"])) exitWith {OT_allBLUSniperRifles pushBackUnique _base};
  590.                                 if((_this find "_GL_") > -1) exitWith {OT_allBLUGLRifles pushBackUnique _base};
  591.                                 if(_mass < 61) exitWith {OT_allBLUSMG pushBackUnique _base};
  592.                                 OT_allBLURifles pushBackUnique _base
  593.                             };
  594.                         };
  595.                         if(_base isKindOf ["Launcher", configFile >> "CfgWeapons"]) then {OT_allBLULaunchers pushBackUnique _base};
  596.                         if(_base isKindOf ["Pistol", configFile >> "CfgWeapons"]) then {OT_allBLUPistols pushBackUnique _base};
  597.                     };
  598.                     //Get ammo
  599.                     {
  600.                         if (!(_x in _blacklist) || _x in OT_allExplosives) then {
  601.                             _weapons pushbackUnique _x
  602.                         };
  603.                     }foreach(getArray(configFile >> "CfgWeapons" >> _base >> "magazines"));
  604.                 };
  605.             }foreach(getArray(configFile >> "CfgVehicles" >> _cls >> "weapons"));
  606.         }else{
  607.             //It's a vehicle
  608.             if !(_cls isKindOf "Bag_Base" || _cls isKindOf "StaticWeapon") then {
  609.                 if(_cls isKindOf "LandVehicle" || _cls isKindOf "Air" || _cls isKindOf "Ship") then {
  610.                     _vehicles pushback _cls;
  611.                     _numblueprints = _numblueprints + 1;
  612.                     if(_side isEqualTo 1) then {
  613.                         private _threat = getArray (_x >> "threat");
  614.                         if(_threat#0 > 0.5) then {
  615.                             OT_allBLUOffensiveVehicles pushBackUnique _cls;
  616.                         }else{
  617.                             OT_allBLUVehicles pushBackUnique _cls;
  618.                         };
  619.                     };
  620.                 };
  621.             };
  622.         };
  623.     }foreach(_all);
  624.     _weapons = (_weapons arrayIntersect _weapons); //remove duplicates
  625.  
  626.     if(isServer) then {
  627.         spawner setVariable [format["facweapons%1",_name],_weapons,true];
  628.         spawner setVariable [format["facvehicles%1",_name],_vehicles,true];
  629.     };
  630.     if(_side > -1 && _numblueprints > 0) then {
  631.         OT_allFactions pushback [_name,_title,_side,_flag];
  632.     };
  633. }foreach(_allFactions);
  634.  
  635. {
  636.     private _name = configName _x;
  637.     _name = [_name] call BIS_fnc_baseWeapon;
  638.  
  639.     private _short = getText (configFile >> "CfgWeapons" >> _name >> "descriptionShort");
  640.  
  641.     private _s = _short splitString ":";
  642.     private _caliber = " 5.56";
  643.     private _haslauncher = false;
  644.     if(count _s > 1) then{
  645.         _s = (_s select 1) splitString "x";
  646.         _caliber = _s select 0;
  647.     };
  648.  
  649.     private _weapon = [_name] call BIS_fnc_itemType;
  650.     private _weaponType = _weapon select 1;
  651.  
  652.     private _muzzles = getArray (configFile >> "CfgWeapons" >> _name >> "muzzles");
  653.     {
  654.         if((_x find "EGLM") > -1) then {
  655.             _haslauncher = true;
  656.         };
  657.     }foreach(_muzzles);
  658.  
  659.     ([_weaponType,_name,_caliber,_haslauncher,_short] call {
  660.         params ["_weaponType","_name","_caliber","_haslauncher","_short"];
  661.  
  662.         if (_weaponType == "SubmachineGun") exitWith {
  663.             OT_allSubMachineGuns pushBack _name;
  664.             [250, 0.5];
  665.         };
  666.         if (_weaponType == "AssaultRifle") exitWith {
  667.             private _cost = [_caliber] call {
  668.                 params ["_caliber"];
  669.                 if(_caliber == " 5.56" || _caliber == "5.56" || _caliber == " 5.45" || _caliber == " 5.8") exitWith {500};
  670.                 if(_caliber == " 12 gauge") exitWith {1200};
  671.                 if(_caliber == " .408") exitWith {4000};
  672.                 if(_caliber == " .338 Lapua Magnum" || _caliber == " .303") exitWith {700};
  673.                 if(_caliber == " 9") exitWith {400}; //9x21mm
  674.                 if(_caliber == " 6.5") exitWith {1000};
  675.                 if(_caliber == " 7.62") exitWith {1500};
  676.                 if(_caliber == " 9.3" || _caliber == "9.3") exitWith {1700};
  677.                 if(_caliber == " 12.7") exitWith {3000};
  678.                 //I dunno what caliber this is
  679.                 1500;
  680.             };
  681.             if(_haslauncher) then {_cost = round(_cost * 1.2)};
  682.             OT_allAssaultRifles pushBack _name;
  683.             if(_cost > 1400) then {
  684.                 OT_allExpensiveRifles pushback _name;
  685.             } else {
  686.                 OT_allCheapRifles pushback _name;
  687.             };
  688.             [_cost]
  689.         };
  690.         if (_weaponType ==  "MachineGun") exitWith {
  691.             OT_allMachineGuns pushBack _name;
  692.             [1500];
  693.         };
  694.         if (_weaponType ==  "SniperRifle") exitWith {
  695.             OT_allSniperRifles pushBack _name;
  696.             [4000];
  697.         };
  698.         if (_weaponType ==  "Handgun") exitWith {
  699.             private _cost = _caliber call {
  700.                 if(_this == " .408") exitWith {2000};
  701.                 if(_this == " .338 Lapua Magnum" || _this == " .303") exitWith {700};
  702.                 100
  703.             };
  704.             if(_short != "Metal Detector") then {
  705.                 OT_allHandGuns pushBack _name
  706.             };
  707.             [_cost, 1]
  708.         };
  709.         if (_weaponType ==  "MissileLauncher") exitWith {
  710.             OT_allMissileLaunchers pushBack _name;
  711.             [15000];
  712.         };
  713.         if (_weaponType ==  "RocketLauncher") exitWith {
  714.             OT_allRocketLaunchers pushBack _name;
  715.             private _cost = 1500;
  716.             if(_name == "launch_NLAW_F") then {
  717.                 _cost=1000
  718.             };
  719.             [_cost]
  720.         };
  721.         if (_weaponType ==  "Vest") exitWith {
  722.             if !(_name in ["V_RebreatherB","V_RebreatherIA","V_RebreatherIR","V_Rangemaster_belt"]) then {
  723.                 private _cost = 40 + (getNumber(configFile >> "CfgWeapons" >> _name >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Chest" >> "armor") * 20);
  724.                 if !(_name in ["V_Press_F","V_TacVest_blk_POLICE"]) then {
  725.                     OT_allVests pushBack _name;
  726.                     if(_cost > 40) then {
  727.                         OT_allProtectiveVests pushback _name;
  728.                     };
  729.                     if(_cost > 300) then {
  730.                         OT_allExpensiveVests pushback _name;
  731.                     };
  732.                     if(_cost < 300 && _cost > 40) then {
  733.                         OT_allCheapVests pushback _name;
  734.                     };
  735.                 };
  736.                 [_cost]
  737.             } else {
  738.                 []
  739.             };
  740.         };
  741.         []
  742.     }) params [["_cost", 500], ["_steel", 2]];
  743.     if(isServer && isNil {cost getVariable _name}) then {
  744.         cost setVariable [_name,[_cost,0,_steel,0],true];
  745.     };
  746. } foreach (_allWeapons);
  747.  
  748. OT_allLegalClothing = [];
  749. {
  750.     private _name = configName _x;
  751.     private _short = getText (configFile >> "CfgWeapons" >> _name >> "descriptionShort");
  752.     private _supply = getText(configfile >> "CfgWeapons" >> _name >> "ItemInfo" >> "containerClass");
  753.     private _carry = getNumber(configfile >> "CfgVehicles" >> _supply >> "maximumLoad");
  754.     private _cost = round(_carry * 0.5);
  755.  
  756.     OT_allClothing pushback _name;
  757.     private _c = _name splitString "_";
  758.     private _side = _c select 1;
  759.     if((_name == "V_RebreatherIA" || _side == "C" || _side == "I") && (_c select (count _c - 1) != "VR")) then {
  760.         OT_allLegalClothing pushback _name;
  761.     };
  762.     if (isServer && isNil {cost getVariable _name}) then {
  763.         cost setVariable [_name,[_cost,0,0,1],true];
  764.     };
  765. } foreach (_allUniforms);
  766.  
  767. {
  768.     private _name = configName _x;
  769.     private _cost = 20 + (getNumber(configFile >> "CfgWeapons" >> _name >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "armor") * 30);
  770.     if(_cost > 20) then {
  771.         OT_allHelmets pushback _name;
  772.     }else{
  773.         OT_allHats pushback _name;
  774.     };
  775.     if(isServer && isNil {cost getVariable _name}) then {
  776.         cost setVariable [_name,[_cost,0,1,0],true];
  777.     };
  778. } foreach (_allHelmets);
  779.  
  780. {
  781.     private _name = configName _x;
  782.     private _m = getNumber(_x >> "mass");
  783.     if(_name isKindOf ["Default",configFile >> "CfgMagazines"] && (_name != "NLAW_F") && !(_name isKindOf ["VehicleMagazine",configFile >> "CfgMagazines"])) then {
  784.         private _cost = round(_m * 4);
  785.         private _desc = getText(_x >> "descriptionShort");
  786.         if((_desc find ".408") > -1) then {
  787.             _cost = _cost * 4;
  788.         };
  789.         private _exp = false;
  790.         private _steel = 0.1;
  791.         private _plastic = 0;
  792.         if(getNumber(_x >> "ace_explosives_Placeable") == 1) then {
  793.             _exp = true;
  794.         };
  795.         if((_desc find "Smoke") > -1) then {
  796.             _cost = round(_m * 0.5);
  797.         }else{
  798.             if((_desc find "Grenade") > -1) then {
  799.                 _cost = round(_m * 2);
  800.                 _exp = true;
  801.             };
  802.         };
  803.         if((_desc find "Flare") > -1 || (_desc find "flare") > -1) then {
  804.             _cost = round(_m * 0.6);
  805.             _exp = false;
  806.         };
  807.  
  808.         if(_name isEqualTo OT_ammo_50cal) then {_cost = 50};
  809.  
  810.         if(_exp) then {
  811.             _steel = 0;
  812.             _plastic = round(_m * 0.5);
  813.             OT_allExplosives pushback _name;
  814.             OT_explosives pushback [_name,_cost,0,_steel,_plastic];
  815.         }else{
  816.             OT_allMagazines pushback _name;
  817.         };
  818.         if(isServer && isNil {cost getVariable _name}) then {
  819.             cost setVariable [_name,[_cost,0,_steel,_plastic],true];
  820.         };
  821.     };
  822. } foreach (_allAmmo);
  823.  
  824. {
  825.     private _name = configName _x;
  826.     private _m = getNumber(_x >> "ItemInfo" >> "mass");
  827.     if(getNumber(_x >> "ace_explosives_Range") > 1000) then {
  828.         _m = _m * 10;
  829.     };
  830.     OT_allDetonators pushback _name;
  831.     OT_detonators pushback [_name,_m,0,0.1,0];
  832.     if(isServer && isNil {cost getVariable _name}) then {
  833.         cost setVariable [_name,[_m,0,0.1,0],true];
  834.     };
  835. } foreach (_allDetonators);
  836.  
  837. if(isServer) then {
  838.     //Remaining vehicle costs
  839.     private _cfgVeh = configFile >> "cfgVehicles";
  840.     {
  841.         private _name = configName _x;
  842.         if((_name isKindOf "AllVehicles") && !(_name in OT_allVehicles)) then {
  843.             private _multiply = 80;
  844.             if(_name isKindOf "Air") then {_multiply = 700}; //Planes/Helis have less armor
  845.  
  846.             private _clsCfg = _cfgVeh >> _name;
  847.             private _cost = getNumber (_clsCfg >> "armor") * _multiply;
  848.             private _steel = round(getNumber (_clsCfg >> "armor") * 0.5);
  849.             private _numturrets = count("!((configName _x) select [0,5] == ""Cargo"")" configClasses(_clsCfg >> "Turrets"));
  850.             private _plastic = 2;
  851.             if(_numturrets > 0) then {
  852.                 _cost = _cost + (_numturrets * _cost * 10);
  853.                 _steel = _steel + 50;
  854.                 _plastic = 5 * _numturrets;
  855.  
  856.                 if(_name isKindOf "Air") then {_cost = _cost * 2};
  857.             };
  858.             if(isNil {cost getVariable _name}) then {
  859.                 cost setVariable [_name,[_cost,0,_steel,_plastic],true];
  860.             };
  861.         };
  862.     } foreach (_allVehicles);
  863. };
  864.  
  865. OT_attachments = [];
  866. {
  867.     private _name = configName _x;
  868.     private _cost = 75;
  869.     private _t = getNumber(configFile >> "CfgWeapons" >> _name >> "ItemInfo" >> "type");
  870.     if(_t isEqualTo 302) then {
  871.         //Bipods
  872.         _cost = 150;
  873.     };
  874.     if(_t isEqualTo 101) then {
  875.         //Suppressors
  876.         _cost = 350;
  877.     };
  878.     if(isServer && isNil {cost getVariable _name}) then {
  879.         cost setVariable [_name,[_cost,0,0,0.25],true];
  880.     };
  881.     OT_allAttachments pushback _name;
  882.     OT_attachments pushback [_name,[_cost,0,0,0.25]];
  883. } foreach (_allAttachments);
  884.  
  885. {
  886.     private _name = configName _x;
  887.     private _allModes = "true" configClasses ( configFile >> "cfgWeapons" >> _name >> "ItemInfo" >> "OpticsModes" );
  888.     private _cost = 50;
  889.     {
  890.         private _mode = configName _x;
  891.         private _max = getNumber (configFile >> "cfgWeapons" >> _name >> "ItemInfo" >> "OpticsModes" >> _mode >> "distanceZoomMax");
  892.         private _mul = 0.1;
  893.         if(_mode == "NVS") then {_mul = 0.2};
  894.         if(_mode == "TWS") then {_mul = 0.5};
  895.         _cost = _cost + floor(_max * _mul);
  896.     }foreach(_allModes);
  897.  
  898.     OT_allOptics pushback _name;
  899.     if(isServer && isNil {cost getVariable _name}) then {
  900.         cost setVariable [_name,[_cost,0,0,0.5],true];
  901.     };
  902. } foreach (_allOptics);
  903.  
  904. OT_allWeapons = OT_allSubMachineGuns + OT_allAssaultRifles + OT_allMachineGuns + OT_allSniperRifles + OT_allHandGuns + OT_allMissileLaunchers + OT_allRocketLaunchers;
  905.  
  906. if(isServer) then {
  907.     cost setVariable ["CIV",[80,0,0,0],true];
  908.     cost setVariable ["WAGE",[5,0,0,0],true];
  909.     cost setVariable [OT_item_UAV,[200,0,0,1],true];
  910.     cost setVariable ["FUEL",[5,0,0,0],true];
  911. };
  912. //populate the cost gamelogic with the above data so it can be accessed quickly
  913. {
  914.     if(isServer && isNil {cost getVariable (_x select 0)}) then {
  915.         cost setVariable [_x select 0,_x select [1,4],true];
  916.     };
  917.     OT_allBackpacks pushBack (_x select 0);
  918. }foreach(OT_backpacks);
  919. {
  920.     if(isServer && isNil {cost getVariable (_x select 0)}) then {
  921.         cost setVariable [_x select 0,_x select [1,4],true];
  922.     };
  923.     OT_allStaticBackpacks pushBack (_x select 0);
  924. }foreach(OT_staticBackpacks);
  925.  
  926. {
  927.     if(isServer && isNil {cost getVariable (_x select 0)}) then {
  928.         cost setVariable [_x select 0,_x select [1,4],true];
  929.     };
  930.     OT_allBoats pushBack (_x select 0);
  931. }foreach(OT_boats);
  932.  
  933. OT_staticMachineGuns = ["I_HMG_01_F","I_HMG_01_high_F","I_HMG_01_A_F","O_HMG_01_F","O_HMG_01_high_F","O_HMG_01_A_F","B_HMG_01_F","B_HMG_01_high_F","B_HMG_01_A_F"];
  934. OT_staticWeapons = ["I_Mortar_01_F","I_static_AA_F","I_static_AT_F","I_GMG_01_F","I_GMG_01_high_F","I_GMG_01_A_F","I_HMG_01_F","I_HMG_01_high_F","I_HMG_01_A_F","O_static_AA_F","O_static_AT_F","O_Mortar_01_F","O_GMG_01_F","O_GMG_01_high_F","O_GMG_01_A_F","O_HMG_01_F","O_HMG_01_high_F","O_HMG_01_A_F","B_static_AA_F","B_static_AT_F","B_Mortar_01_F","B_GMG_01_F","B_GMG_01_high_F","B_GMG_01_A_F","B_HMG_01_F","B_HMG_01_high_F","B_HMG_01_A_F"];
  935.  
  936. OT_miscables = ["ACE_Wheel","ACE_Track","Land_PortableLight_double_F","Land_PortableLight_single_F","Land_Camping_Light_F","Land_PortableHelipadLight_01_F","PortableHelipadLight_01_blue_F",
  937. "PortableHelipadLight_01_green_F","PortableHelipadLight_01_red_F","PortableHelipadLight_01_white_F","PortableHelipadLight_01_yellow_F","Land_Campfire_F","ArrowDesk_L_F",
  938. "ArrowDesk_R_F","ArrowMarker_L_F","ArrowMarker_R_F","Pole_F","Land_RedWhitePole_F","RoadBarrier_F","RoadBarrier_small_F","RoadCone_F","RoadCone_L_F","Land_VergePost_01_F",
  939. "TapeSign_F","Land_LampDecor_F","Land_WheelChock_01_F","Land_Sleeping_bag_F","Land_Sleeping_bag_blue_F","Land_WoodenLog_F","FlagChecked_F","FlagSmall_F","Land_LandMark_F","Land_Bollard_01_F"];
  940.  
  941. //Stuff you can build: [name,price,array of possible classnames,init function,??,description]
  942. OT_Buildables = [
  943.     ["Training Camp",1500,[
  944.         ["Land_IRMaskingCover_02_F",[-0.039865,0.14918,0],0,1,0,[],"","",true,false],
  945.         ["Box_NATO_Grenades_F",[1.23933,-1.05774,0],93.4866,1,0,[],"","",true,false],
  946.         ["Land_CampingTable_F",[-0.0490456,-1.74478,0],0,1,0,[],"","",true,false],
  947.         ["Land_CampingChair_V2_F",[-1.44146,-1.7173,0],223.485,1,0,[],"","",true,false],
  948.         ["Land_ClutterCutter_large_F",[0,0,0],0,1,0,[],"","",true,false]
  949.     ],"OT_fnc_initTrainingCamp",true,"Allows training of recruits && hiring of mercenaries"],
  950.     ["Bunkers",500,["Land_Hangar_F","Land_BagBunker_Tower_F","Land_BagBunker_Small_F","Land_HBarrierTower_F","Land_Bunker_01_blocks_3_F","Land_Bunker_01_blocks_1_f","Land_Bunker_01_big_F","Land_Bunker_01_small_F","Land_Bunker_01_tall_F","Land_Bunker_01_HQ_F","Land_BagBunker_01_small_green_F","Land_HBarrier_01_big_tower_green_F","Land_HBarrier_01_tower_green_F"],"",false,"Small Defensive Structures. CONTAINS TEST OBJECTS. Press space to change type."],
  951.     ["Walls",200,["Land_ConcreteWall_01_l_8m_F","Land_ConcreteWall_01_l_gate_F","Land_HBarrier_01_wall_6_green_F","Land_HBarrier_01_wall_4_green_F","Land_HBarrier_01_wall_corner_green_F"],"",false,"Stop people (or tanks) from getting in. Press space to change type."],
  952.     ["Helipad",50,["Land_HelipadCircle_F","Land_HelipadCivil_F","Land_HelipadRescue_F","Land_HelipadSquare_F"],"",false,"Informs helicopter pilots of where might be a nice place to land"],
  953.     ["Observation Post",800,["Land_Cargo_Patrol_V4_F","Land_Cargo_Patrol_V3_F","Land_Cargo_Patrol_V2_F","Land_Cargo_Patrol_V1_F"],"",false,"A small tower, can garrison a static HMG/GMG in it"],
  954.     ["Barracks",10000,[OT_barracks],"",false,"Allows recruiting of squads"],
  955.     ["Guard Tower",5000,["Land_Cargo_Tower_V4_F","Land_Cargo_Tower_V3_F","Land_Cargo_Tower_V2_F","Land_Cargo_Tower_V1_F"],"",false,"It's a huge tower, what else do you need?."],
  956.     ["Hangar",1200,["Land_Airport_01_hangar_F"],"",false,"A big empty building, could probably fit a plane inside it."],
  957.     ["Workshop",1000,[
  958.         ["Land_Cargo_House_V4_F",[0,0,0],0,1,0,[],"","",true,false],
  959.         ["Land_ClutterCutter_large_F",[0,0,0],0,1,0,[],"","",true,false],
  960.         ["Box_NATO_AmmoVeh_F",[-2.91,-2.008,0],90,1,0,[],"","",true,false],
  961.         ["Land_WeldingTrolley_01_F",[-3.53163,1.73366,0],87.0816,1,0,[],"","",true,false],
  962.         ["Land_ToolTrolley_02_F",[-3.47775,3.5155,0],331.186,1,0,[],"","",true,false]
  963.     ],"OT_fnc_initWorkshop",true,"Attach weapons to vehicles"],
  964.     ["House",1100,["Land_House_Small_06_F","Land_House_Small_02_F","Land_House_Small_03_F","Land_GarageShelter_01_F","Land_Slum_04_F"],"",false,"4 walls, a roof, && if you're lucky a door that opens."],
  965.     ["Police Station",2500,[OT_policeStation],"OT_fnc_initPoliceStation",false,"Allows hiring of policeman to raise stability in a town && keep the peace. Comes with 2 units."],
  966.     ["Warehouse",4000,[OT_warehouse],"OT_fnc_initWarehouse",false,"A house that you put wares in."],
  967.     ["Refugee Camp",600,[OT_refugeeCamp],"",false,"Can recruit civilians here without needing to chase them down"],
  968.     ["Radar",25000,[OT_radarBuilding],"OT_fnc_initRadar",false,"Reveals enemy drones, helicopters and planes within 2.5km"]
  969. ];
  970.  
  971. {
  972.     private _istpl = _x select 4;
  973.     if(_istpl) then {
  974.         private _tpl = _x select 2;
  975.         OT_allBuyableBuildings pushback ((_tpl select 0) select 0);
  976.     }else{
  977.         [OT_allBuyableBuildings,(_x select 2)] call BIS_fnc_arrayPushStack;
  978.     }
  979. }foreach(OT_Buildables);
  980.  
  981. //Items you can place
  982. OT_Placeables = [
  983.     ["Sandbags",20,["Land_BagFence_Short_F","Land_BagFence_Round_F","Land_BagFence_Long_F","Land_BagFence_End_F","Land_BagFence_Corner_F","Land_BagFence_01_long_green_F","Land_BagFence_01_short_green_F","Land_BagFence_01_round_green_F","Land_BagFence_01_corner_green_F","Land_BagFence_01_end_green_F"],[0,3,0.8],"Bags filled with lots of sand. Apparently this can stop bullets or something?"],
  984.     ["Camo Nets",40,["Land_MedicalTent_01_white_generic_open_F","Land_MedicalTent_01_MTP_open","Land_TentHanger_V1_F","CamoNet_INDP_open_F","CamoNet_INDP_F","CamoNet_ghex_F","CamoNet_ghex_open_F","CamoNet_ghex_big_F"],[0,7,2],"Large && terribly flimsy structures that may or may not obscure your forces from airborne units."],
  985.     ["Barriers",60,["Land_HBarrier_1_F","Land_HBarrier_3_F","Land_HBarrier_5_F","Land_HBarrier_Big_F","Land_HBarrierWall_corner_F","Land_HBarrier_01_line_5_green_F","Land_HBarrier_01_line_3_green_F","Land_HBarrier_01_line_1_green_F"],[0,4,1.2],"Really big sandbags, basically."],
  986.     ["Map",30,[OT_item_Map],[0,2,1.2],"Use these to save your game, change options or check town info."],
  987.     ["Safe",50,[OT_item_Safe],[0,2,0.5],"Store && retrieve money"],
  988.     ["Misc",30,OT_miscables,[0,3,1.2],"Various other items, including spare wheels && lights"]
  989. ];
  990.  
  991. OT_allSquads = OT_Squadables apply { _x params ["_name"]; _name };
  992.  
  993. OT_workshop = [
  994.     ["Static MG","C_Offroad_01_F",600,"I_HMG_01_high_weapon_F","I_HMG_01_high_F",[[0.25,-2,1]],0],
  995.     ["Static GL","C_Offroad_01_F",1100,"I_GMG_01_high_weapon_F","I_GMG_01_high_F",[[0.25,-2,1]],0],
  996.     ["Static AT","C_Offroad_01_F",2600,"I_AT_01_weapon_F","I_static_AT_F",[[0,-1.5,0.25],180]],
  997.     ["Static AA","C_Offroad_01_F",2600,"I_AA_01_weapon_F","I_static_AA_F",[[0,-1.5,0.25],180]]
  998. ];
  999.  
  1000. OT_repairableRuins = [
  1001.     ["Land_Cargo_Tower_V4_ruins_F","Land_Cargo_Tower_V4_F",2000],
  1002.     ["Land_Cargo_Tower_V1_ruins_F","Land_Cargo_Tower_V1_F",2000],
  1003.     ["Land_Cargo_Tower_V2_ruins_F","Land_Cargo_Tower_V2_F",2000],
  1004.     ["Land_Cargo_Tower_V3_ruins_F","Land_Cargo_Tower_V3_F",2000],
  1005.     ["Land_Cargo_Patrol_V1_ruins_F","Land_Cargo_Patrol_V1_F",500],
  1006.     ["Land_Cargo_Patrol_V2_ruins_F","Land_Cargo_Patrol_V2_F",500],
  1007.     ["Land_Cargo_Patrol_V3_ruins_F","Land_Cargo_Patrol_V3_F",500],
  1008.     ["Land_Cargo_Patrol_V4_ruins_F","Land_Cargo_Patrol_V4_F",500],
  1009.     ["Land_Cargo_HQ_V1_ruins_F","Land_Cargo_HQ_V1_F",2500],
  1010.     ["Land_Cargo_HQ_V2_ruins_F","Land_Cargo_HQ_V2_F",2500],
  1011.     ["Land_Cargo_HQ_V3_ruins_F","Land_Cargo_HQ_V3_F",2500],
  1012.     ["Land_Cargo_HQ_V4_ruins_F","Land_Cargo_HQ_V4_F",2500]
  1013. ];
  1014. OT_allRepairableRuins = [];
  1015. {
  1016.     _x params ["_ruin"];
  1017.     OT_allRepairableRuins pushback _ruin;
  1018. }foreach(OT_repairableRuins);
  1019.  
  1020. OT_loadingMessages = ["Adding Hidden Agendas","Adjusting Bell Curves","Aesthesizing Industrial Areas","Aligning Covariance Matrices","Applying Feng Shui Shaders","Applying Theatre Soda Layer","Asserting Packed Exemplars","Attempting to Lock Back-Buffer","Binding Sapling Root System","Breeding Fauna","Building Data Trees","Bureacritizing Bureaucracies","Calculating Inverse Probability Matrices","Calculating Llama Expectoration Trajectory","Calibrating Blue Skies","Charging Ozone Layer","Coalescing Cloud Formations","Cohorting Exemplars","Collecting Meteor Particles","Compounding Inert Tessellations","Compressing Fish Files","Computing Optimal Bin Packing","Concatenating Sub-Contractors","Containing Existential Buffer","Debarking Ark Ramp","Debunching Unionized Commercial Services","Deciding What Message to Display Next","Decomposing Singular Values","Decrementing Tectonic Plates","Deleting Ferry Routes","Depixelating Inner Mountain Surface Back Faces","Depositing Slush Funds","Destabilizing Economic Indicators","Determining Width of Blast Fronts","Deunionizing Bulldozers","Dicing Models","Diluting Livestock Nutrition Variables","Downloading Satellite Terrain Data","Exposing Flash Variables to Streak System","Extracting Resources","Factoring Pay Scale","Fixing Election Outcome Matrix","Flood-Filling Ground Water","Flushing Pipe Network","Gathering Particle Sources","Generating Jobs","Gesticulating Mimes","Graphing Whale Migration","Hiding Willio Webnet Mask","Implementing Impeachment Routine","Increasing Accuracy of RCI Simulators","Increasing Magmafacation","Initializing Rhinoceros Breeding Timetable","Initializing Robotic Click-Path AI","Inserting Sublimated Messages","Integrating Curves","Integrating Illumination Form Factors","Integrating Population Graphs","Iterating Cellular Automata","Lecturing Errant Subsystems","Mixing Genetic Pool","Modeling Object Components","Mopping Occupant Leaks","Normalizing Power","Obfuscating Quigley Matrix","Overconstraining Dirty Industry Calculations","Partitioning City Grid Singularities","Perturbing Matrices","Pixellating Nude Patch","Polishing Water Highlights","Populating Lot Templates","Preparing Sprites for Random Walks","Prioritizing Landmarks","Projecting Law Enforcement Pastry Intake","Realigning Alternate Time Frames","Reconfiguring User Mental Processes","Relaxing Splines","Removing Road Network Speed Bumps","Removing Texture Gradients","Removing Vehicle Avoidance Behavior","Resolving GUID Conflict","Reticulating Splines","Retracting Phong Shader","Retrieving from Back Store","Reverse Engineering Image Consultant","Routing Neural Network Infanstructure","Scattering Rhino Food Sources","Scrubbing Terrain","Searching for Llamas","Seeding Architecture Simulation Parameters","Sequencing Particles","Setting Advisor ","Setting Inner Deity ","Setting Universal Physical Constants","Sonically Enhancing Occupant-Free Timber","Speculating Stock Market Indices","Splatting Transforms","Stratifying Ground Layers","Sub-Sampling Water Data","Synthesizing Gravity","Synthesizing Wavelets","Time-Compressing Simulator Clock","Unable to Reveal Current Activity","Weathering Buildings","Zeroing Crime Network"];
  1021.  
  1022. //Find markers
  1023. OT_ferryDestinations = [];
  1024. OT_NATO_control = [];
  1025. OT_regions = [];
  1026. {
  1027.     if((_x select [0,12]) isEqualTo "destination_") then {OT_ferryDestinations pushback _x};
  1028.     if((_x select [0,8]) isEqualTo "control_") then {OT_NATO_control pushback _x};
  1029.     if((_x select [0,7]) isEqualTo "island_") then {OT_regions pushback _x};
  1030.     if((_x select [0,7]) isEqualTo "region_") then {OT_regions pushback _x};
  1031. }foreach(allMapMarkers);
  1032.  
  1033. OT_cigsArray = ["EWK_Cigar1", "EWK_Cigar2", "EWK_Cig1", "EWK_Cig2", "EWK_Cig3", "EWK_Cig4", "EWK_Glasses_Cig1", "EWK_Glasses_Cig2", "EWK_Glasses_Cig3", "EWK_Glasses_Cig4", "EWK_Glasses_Shemag_GRE_Cig6", "EWK_Glasses_Shemag_NB_Cig6", "EWK_Glasses_Shemag_tan_Cig6", "EWK_Cig5", "EWK_Glasses_Cig5", "EWK_Cig6", "EWK_Glasses_Cig6", "EWK_Shemag_GRE_Cig6", "EWK_Shemag_NB_Cig6", "EWK_Shemag_tan_Cig6", "murshun_cigs_cig0", "murshun_cigs_cig1", "murshun_cigs_cig2", "murshun_cigs_cig3", "murshun_cigs_cig4"];
  1034.  
  1035. // Weapon mags to delete or not copy on transfers.
  1036. OT_noCopyMags = ["ACE_PreloadedMissileDummy"];
  1037.  
  1038. OT_autoSave_time = 0;
  1039. OT_autoSave_last_time = (10*60);
  1040. OT_cleanup_civilian_loop = (5*60);
  1041. zeusToggle = true;
  1042.  
  1043. if(isServer) then {
  1044.     missionNamespace setVariable ["OT_varInitDone",true,true];
  1045. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement