Advertisement
MGT

underwater_stash_malden.sqf

MGT
May 30th, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.20 KB | None | 0 0
  1. /*
  2. "Underwater Stash" mission for Malden
  3. Created by eraser1
  4. Modified by MGTDB for Malden
  5. */
  6.  
  7. // For logging purposes
  8. _num = DMS_MissionCount;
  9.  
  10.  
  11. // Set mission side (only "bandit" is supported for now)
  12. _side = "bandit";
  13.  
  14. _pos = [1839.61,7520.79,10];
  15.  
  16. // This mission should spawn on server start. Otherwise, if somebody is dumb enough to wait for it to spawn, then they're gonna get killed lol.
  17. //if ([_pos,DMS_StaticMinPlayerDistance] call DMS_fnc_IsPlayerNearby) exitWith {"delay"};
  18.  
  19.  
  20. DMS_CrateCase_DiverGear =
  21. [
  22. [
  23. "arifle_SDAR_F",
  24. "arifle_SDAR_F",
  25. "arifle_SDAR_F",
  26. "arifle_SDAR_F",
  27. "arifle_SDAR_F"
  28. ],
  29. [
  30. "20Rnd_556x45_UW_mag",
  31. "20Rnd_556x45_UW_mag",
  32. "20Rnd_556x45_UW_mag",
  33. "20Rnd_556x45_UW_mag",
  34. "20Rnd_556x45_UW_mag",
  35. "20Rnd_556x45_UW_mag",
  36. "20Rnd_556x45_UW_mag",
  37. "20Rnd_556x45_UW_mag",
  38. "20Rnd_556x45_UW_mag",
  39. "20Rnd_556x45_UW_mag",
  40. "U_O_Wetsuit",
  41. "U_O_Wetsuit",
  42. "U_O_Wetsuit",
  43. "U_O_Wetsuit",
  44. "U_O_Wetsuit",
  45. "V_RebreatherIA",
  46. "V_RebreatherIA",
  47. "V_RebreatherIA",
  48. "V_RebreatherIA",
  49. "V_RebreatherIA"
  50. ],
  51. [
  52. "B_Carryall_oli",
  53. "B_Bergen_tna_F",
  54. "B_ViperHarness_oli_F"
  55. ]
  56. ];
  57.  
  58. // I only made some of the variables in this file "private" because I couldn't bother making all of them private :p
  59. private _crate = ["Box_IND_AmmoVeh_F",[2700.2,7308.45,0.0017885]] call DMS_fnc_SpawnCrate;
  60. _crate setVariable ["DMS_AllowSmoke", false];
  61.  
  62.  
  63. [_crate, "DiverGear"] call DMS_fnc_FillCrate;
  64.  
  65.  
  66.  
  67. private _sub1 = ["Exile_Boat_SDV_CSAT",[0,0,0]] call DMS_fnc_SpawnNonPersistentVehicle;
  68. _sub1 setPosASL [1839.61,7520.79,-38.3983];
  69. _sub1 setVariable ["DMS_AllowSmoke", false];
  70.  
  71. private _sub2 = ["Exile_Boat_SDV_CSAT",[0,0,0]] call DMS_fnc_SpawnNonPersistentVehicle;
  72. _sub2 setPosASL [1762.49,7545.11,-48.3991];
  73. _sub2 setVariable ["DMS_AllowSmoke", false];
  74.  
  75.  
  76.  
  77. private _diverGearSet =
  78. [
  79. "arifle_SDAR_F",
  80. [],
  81. [["20Rnd_556x45_UW_mag",6]],
  82. "",
  83. [],
  84. ["Rangefinder","ItemGPS","NVGoggles"],
  85. "",
  86. "",
  87. "U_O_Wetsuit",
  88. "V_RebreatherIA",
  89. "B_Bergen_mcamo"
  90. ];
  91.  
  92.  
  93. private _temp = DMS_ai_use_launchers;
  94. DMS_ai_use_launchers = false;
  95.  
  96. private _diverGroup =
  97. [
  98. [
  99. [1792.18,7523.33,-28.3992],
  100. [1793.18,7523.33,-18.3992],
  101. [1794.18,7523.33,-34.3992],
  102. [1795.18,7523.33,-35.3992],
  103. [1796.18,7523.33,-36.3992],
  104. [1797.18,7523.33,-37.3992],
  105. [1798.18,7523.33,-32.3992],
  106. [1799.18,7520.33,-33.3992],
  107. [1799.18,7529.33,-35.3992],
  108. [1799.18,7528.33,-34.3992],
  109. [1799.18,7527.33,-33.3992],
  110. [1799.18,7526.33,-33.3992],
  111. [1799.18,7525.33,-37.3992],
  112. [1799.18,7524.33,-38.3992],
  113. [1799.18,7523.33,-40.3992]
  114. ],
  115. 15,
  116. "hardcore",
  117. "custom",
  118. _side,
  119. _diverGearSet
  120. ] call DMS_fnc_SpawnAIGroup_MultiPos;
  121.  
  122. DMS_ai_use_launchers = _temp;
  123.  
  124.  
  125. {
  126. _x disableAI "PATH";
  127. } forEach (units _diverGroup);
  128.  
  129.  
  130.  
  131.  
  132.  
  133. private _landGroup =
  134. [
  135. [2726.12,7336.13,0.000784874],
  136. 5,
  137. "hardcore",
  138. "sniper",
  139. "bandit"
  140. ] call DMS_fnc_SpawnAIGroup;
  141.  
  142.  
  143.  
  144. // Define mission-spawned AI Units
  145. _missionAIUnits =
  146. [
  147. _diverGroup, // We only spawned the single group for this mission
  148. _landGroup
  149. ];
  150.  
  151. // Define the group reinforcements
  152. _groupReinforcementsInfo =
  153. [
  154. // Removed reinforcements for this because while I was testing the mission the AI took too long to get back to the objective, and that's annoying
  155. /*
  156. [
  157. _diverGroup, // pass the group
  158. [
  159. [
  160. -1, // Let's limit number of units instead...
  161. 0
  162. ],
  163. [
  164. 10, // Maximum 10 units can be given as reinforcements.
  165. 0
  166. ]
  167. ],
  168. [
  169. 180, // About a 3 minute delay between reinforcements.
  170. diag_tickTime
  171. ],
  172. [
  173. [5810,2874,1],
  174. [5933,2912,2],
  175. [5862,3132,0.5]
  176. ],
  177. "custom",
  178. "hardcore",
  179. _side,
  180. "reinforce",
  181. [
  182. 5, // Reinforcements will only trigger if there's fewer than 5 members left in the group
  183. 3 // 3 reinforcement units per wave.
  184. ],
  185. _diverGearSet
  186. ]
  187. */
  188. ];
  189.  
  190. // Define mission-spawned objects and loot values
  191. _missionObjs =
  192. [
  193. [],
  194. [_sub1, _sub2],
  195. [
  196. [
  197. _sub1,
  198. [
  199. 1,
  200. [2,DMS_Box_BaseParts_Concrete],
  201. 1
  202. ]
  203. ],
  204. [
  205. _sub2,
  206. [
  207. [2,DMS_sniper_weps], // Spawn a random 5 weapons that AI snipers can spawn with.
  208. [5,DMS_BoxSurvivalSupplies],
  209. 1
  210. ]
  211. ]
  212. ]
  213. ];
  214.  
  215. // Define Mission Start message
  216. _msgStart = ['#FFFF00', "The CSAT are storing money and supplies in an underwater stash! Eliminate them and take the supplies!"];
  217.  
  218. // Define Mission Win message
  219. _msgWIN = ['#0080ff',"Convicts have successfully eliminated the CSAT and obtained the underwater stash!"];
  220.  
  221. // Define Mission Lose message
  222. _msgLOSE = ['#FF0000',"Seems like CSAT forces moved their stash away..."];
  223.  
  224. // Define mission name (for map marker and logging)
  225. _missionName = "Underwater Stash";
  226.  
  227. // Create Markers
  228. _markers =
  229. [
  230. _pos,
  231. _missionName,
  232. "hardcore"
  233. ] call DMS_fnc_CreateMarker;
  234.  
  235. // Record time here (for logging purposes, otherwise you could just put "diag_tickTime" into the "DMS_AddMissionToMonitor" parameters directly)
  236. _time = diag_tickTime;
  237.  
  238. // Parse and add mission info to missions monitor
  239. _added =
  240. [
  241. _pos,
  242. [
  243. [
  244. "kill",
  245. _diverGroup // Only need to kill the diver group.
  246. ],
  247. [
  248. "playerNear",
  249. [_sub1,40]
  250. ]
  251. ],
  252. _groupReinforcementsInfo,
  253. [
  254. _time,
  255. DMS_StaticMissionTimeOut call DMS_fnc_SelectRandomVal
  256. ],
  257. _missionAIUnits,
  258. _missionObjs,
  259. [_missionName,_msgWIN,_msgLOSE],
  260. _markers,
  261. _side,
  262. "hardcore",
  263. [],
  264. [
  265. [
  266. [
  267. _sub1,
  268. {_this setVariable ["ExileMoney",15000,true]} // The submarine will have 25,000 poptabs after the mission completes. The capacity is actually 5000, but I just overload it.
  269. ]
  270. ],
  271. [],
  272. {},
  273. {}
  274. ]
  275. ] call DMS_fnc_AddMissionToMonitor_Static;
  276.  
  277. // Check to see if it was added correctly, otherwise delete the stuff
  278. if !(_added) exitWith
  279. {
  280. diag_log format ["DMS ERROR :: Attempt to set up mission %1 with invalid parameters for DMS_fnc_AddMissionToMonitor_Static! Deleting mission objects and resetting DMS_MissionCount.",_missionName];
  281.  
  282. _cleanup = [];
  283. {
  284. _cleanup pushBack _x;
  285. } forEach _missionAIUnits;
  286.  
  287. _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1));
  288.  
  289. {
  290. _cleanup pushBack (_x select 0);
  291. } foreach (_missionObjs select 2);
  292.  
  293. _cleanup call DMS_fnc_CleanUp;
  294.  
  295.  
  296. // Delete the markers directly
  297. {deleteMarker _x;} forEach _markers;
  298.  
  299.  
  300. // Reset the mission count
  301. DMS_MissionCount = DMS_MissionCount - 1;
  302. };
  303.  
  304.  
  305. // Notify players
  306. [_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;
  307.  
  308.  
  309.  
  310. if (DMS_DEBUG) then
  311. {
  312. (format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,26,"hardcore",_time]) call DMS_fnc_DebugLog;
  313. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement