Advertisement
Guest User

Untitled

a guest
Jun 14th, 2018
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.74 KB | None | 0 0
  1. /*
  2. "Oil Rig Pirates" v2.1 static mission for Altis.
  3. Created by Fatunkist using templates by eraser1
  4. easy/mod/difficult/hardcore - reworked by [CiC]red_ned http://cic-gaming.co.uk
  5. */
  6.  
  7. private ["_AICount", "_AIMaxReinforcements", "_AItrigger", "_AIwave", "_AIdelay", "_staticguns", "_missionObjs", "_crate0", "_crate1", "_crate_loot_values0", "_crate_loot_values1", "_crate_weapons0", "_crate_weapons1", "_crate_items0", "_crate_items1", "_crate_backpacks0", "_crate_backpacks1", "_difficultyM", "_difficulty", "_PossibleDifficulty", "_msgWIN", "_cash"];
  8.  
  9. // For logging purposes
  10. _num = DMS_MissionCount;
  11.  
  12. // Set mission side (only "bandit" is supported for now)
  13. _side = "bandit";
  14.  
  15. _pos = [15542, 13477.1, 108.110]; //insert the centre here
  16.  
  17. if ([_pos,DMS_StaticMinPlayerDistance] call DMS_fnc_IsPlayerNearby) exitWith {"delay"};
  18.  
  19. //create possible difficulty add more of one difficulty to weight it towards that
  20. _PossibleDifficulty = [
  21. "easy",
  22. "moderate",
  23. "moderate",
  24. "difficult",
  25. "difficult",
  26. "difficult",
  27. "hardcore",
  28. "hardcore",
  29. "hardcore",
  30. "hardcore"
  31. ];
  32. //choose mission difficulty and set value and is also marker colour
  33. _difficultyM = selectRandom _PossibleDifficulty;
  34.  
  35. switch (_difficultyM) do
  36. {
  37. case "easy":
  38. {
  39. _difficulty = "easy"; //AI difficulty
  40. _AICount = (15 + (round (random 5))); //AI starting numbers
  41. _AIMaxReinforcements = (10 + (round (random 30))); //AI reinforcement cap
  42. _AItrigger = (10 + (round (random 5))); //If AI numbers fall below this number then reinforce if any left from AIMax
  43. _AIwave = (4 + (round (random 4))); //Max amount of AI in reinforcement wave
  44. _AIdelay = (55 + (round (random 120))); //The delay between reinforcements
  45. _cash = (250 + round (random (500))); //this gives 250 to 750 cash
  46. _crate_weapons0 = (5 + (round (random 20))); //Crate 0 weapons number
  47. _crate_items0 = (5 + (round (random 20))); //Crate 0 items number
  48. _crate_backpacks0 = (3 + (round (random 1))); //Crate 0 back packs number
  49. _crate_weapons1 = (4 + (round (random 2))); //Crate 1 weapons number
  50. _crate_items1 = (10 + (round (random 40))); //Crate 1 items number
  51. _crate_backpacks1 = (1 + (round (random 8))); //Crate 1 back packs number
  52. };
  53. case "moderate":
  54. {
  55. _difficulty = "moderate";
  56. _AICount = (20 + (round (random 5)));
  57. _AIMaxReinforcements = (20 + (round (random 20)));
  58. _AItrigger = (10 + (round (random 10)));
  59. _AIwave = (5 + (round (random 3)));
  60. _AIdelay = (55 + (round (random 120)));
  61. _cash = (500 + round (random (750))); //this gives 500 to 1250 cash
  62. _crate_weapons0 = (10 + (round (random 15)));
  63. _crate_items0 = (10 + (round (random 15)));
  64. _crate_backpacks0 = (3 + (round (random 1)));
  65. _crate_weapons1 = (6 + (round (random 3)));
  66. _crate_items1 = (20 + (round (random 30)));
  67. _crate_backpacks1 = (5 + (round (random 4)));
  68. };
  69. case "difficult":
  70. {
  71. _difficulty = "difficult";
  72. _AICount = (20 + (round (random 7)));
  73. _AIMaxReinforcements = (30 + (round (random 20)));
  74. _AItrigger = (10 + (round (random 10)));
  75. _AIwave = (6 + (round (random 2)));
  76. _AIdelay = (55 + (round (random 120)));
  77. _cash = (750 + round (random (1000))); //this gives 750 to 1750 cash
  78. _crate_weapons0 = (30 + (round (random 20)));
  79. _crate_items0 = (15 + (round (random 10)));
  80. _crate_backpacks0 = (3 + (round (random 1)));
  81. _crate_weapons1 = (8 + (round (random 3)));
  82. _crate_items1 = (30 + (round (random 20)));
  83. _crate_backpacks1 = (6 + (round (random 4)));
  84. };
  85. //case "hardcore":
  86. default
  87. {
  88. _difficulty = "hardcore";
  89. _AICount = (20 + (round (random 10)));
  90. _AIMaxReinforcements = (40 + (round (random 10)));
  91. _AItrigger = (15 + (round (random 5)));
  92. _AIwave = (6 + (round (random 2)));
  93. _AIdelay = (55 + (round (random 120)));
  94. _cash = (1000 + round (random (1500))); //this gives 1000 to 2500 cash
  95. _crate_weapons0 = (20 + (round (random 5)));
  96. _crate_items0 = (20 + (round (random 5)));
  97. _crate_backpacks0 = (2 + (round (random 1)));
  98. _crate_weapons1 = (10 + (round (random 2)));
  99. _crate_items1 = (40 + (round (random 10)));
  100. _crate_backpacks1 = (10 + (round (random 2)));
  101. };
  102. };
  103.  
  104. // Define spawn locations for AI Soldiers. These will be used for the initial spawning of AI as well as reinforcements.
  105. // The center spawn location is added 3 times so at least 3 AI will spawn initially at the center location, and so that future reinforcements are more likely to spawn at the center.
  106. _AISoldierSpawnLocations =
  107. [
  108. [15540.5,13478.5,108.163],
  109. [15545.8,13480,107.987],
  110. [15543.7,13473.6,108.340],
  111. [15525.5,13508.1,131.571],
  112. [15540.3,13474.5,133.765],
  113. [15512.8,13476.4,133.888],
  114. [15506.8,13489.2,107.263],
  115. [15515,13494.8,106.981],
  116. [15515.7,13487.5,107.595],
  117. [15556.4,13466.3,133.684],
  118. [15543.8,13457.6,134.483],
  119. [15536.9,13452.7,135.013],
  120. [15550.4,13461.6,108.685],
  121. [15546.1,13458.5,108.976],
  122. [15542.6,13456.1,109.222],
  123. [15525.7,13477.2,133.881],
  124. [15524.9,13481.7,133.552],
  125. [15520.9,13479.8,133.691],
  126. [15511.9,13507.4,105.887],
  127. [15515.8,13510.2,105.797],
  128. [15519.4,13512.6,105.722],
  129. [15493.5,13498.3,131.397],
  130. [15496.3,13489.7,132.399],
  131. [15501.3,13492.9,132.265],
  132. [15560.5,13493.7,107.263],
  133. [15556,13497.5,107.108],
  134. [15554.4,13491.4,107.666],
  135. [15517.1,13450.1,145.999],
  136. [15519.1,13445.2,146.254],
  137. [15523.1,13441.1,146.345],
  138. [15531.8,13445.3,114.393],
  139. [15530.2,13447.5,114.353],
  140. [15527,13445.7,114.584],
  141. [15559.7,13471,147.802],
  142. [15562.8,13465.8,147.866],
  143. [15567.7,13469,147.649]
  144. ];
  145.  
  146. _group =
  147. [
  148. _AISoldierSpawnLocations+[_pos,_pos,_pos], // Pass the regular spawn locations as well as the center pos 3x
  149. _AICount,
  150. _difficulty,
  151. "random",
  152. _side
  153. ] call DMS_fnc_SpawnAIGroup_MultiPos;
  154.  
  155. //Reduce Static guns if mission is easy
  156. if (_difficultyM isEqualTo "easy") then {
  157. _staticGuns =
  158. [
  159. [
  160. [15502.7,13506.9,139.553],
  161. [15489.9,13498.2,139.775],
  162. [15500.7,13481.5,141.746],
  163. [15539.9,13503.4,158.243],
  164. [15537.9,13493.7,158.814],
  165. [15564.4,13469,151.439],
  166. [15525.6,13444.9,148.209],
  167. [15530.2,13447.7,147.853],
  168. [15567,13458.9,95.216],
  169. [15556.4,13451.7,95.856]
  170. ],
  171. _group,
  172. "assault",
  173. _difficulty,
  174. "bandit",
  175. "random"
  176. ] call DMS_fnc_SpawnAIStaticMG;
  177. } else
  178. {
  179. _staticGuns =
  180. [
  181. [
  182. _pos vectorAdd [-1,0,0], // 1 meter West of center pos
  183. [15502.7,13506.9,139.553],
  184. [15489.9,13498.2,139.775],
  185. [15500.7,13481.5,141.746],
  186. [15539.9,13503.4,158.243],
  187. [15537.9,13493.7,158.814],
  188. [15564.4,13469,151.439],
  189. [15525.6,13444.9,148.209],
  190. [15530.2,13447.7,147.853],
  191. [15567,13458.9,95.216],
  192. [15556.4,13451.7,95.856],
  193. [15494.8,13512.3,91.902],
  194. [15484,13504.2,92.089],
  195. [15524.3,13521.2,136.648]
  196. ],
  197. _group,
  198. "assault",
  199. _difficulty,
  200. "bandit",
  201. "random"
  202. ] call DMS_fnc_SpawnAIStaticMG;
  203. };
  204.  
  205. // Define the classnames and locations where the crates can spawn (at least 2, since we're spawning 2 crates)
  206. _crateClasses_and_Positions =
  207. [
  208. [[15496.5,13512.2,91.982],"I_CargoNet_01_ammo_F"],
  209. [[15494.4,13515,91.649],"I_CargoNet_01_ammo_F"],
  210. [[15505.4,13485.6,141.481],"I_CargoNet_01_ammo_F"],
  211. [[15508.5,13487.6,141.379],"I_CargoNet_01_ammo_F"],
  212. [[15553.7,13451.8,95.981],"I_CargoNet_01_ammo_F"],
  213. [[15555.7,13448.5,95.992],"I_CargoNet_01_ammo_F"],
  214. [[15567,13459.5,95.206],"I_CargoNet_01_ammo_F"],
  215. [[15483.1,13503.3,92.126],"I_CargoNet_01_ammo_F"]
  216. ];
  217.  
  218. {
  219. deleteVehicle (nearestObject _x); // Make sure to remove any previous crates.
  220. } forEach _crateClasses_and_Positions;
  221.  
  222. // Shuffle the list
  223. _crateClasses_and_Positions = _crateClasses_and_Positions call ExileClient_util_array_shuffle;
  224.  
  225. // Create Crates
  226. _crate0 = [_crateClasses_and_Positions select 0 select 1, _crateClasses_and_Positions select 0 select 0] call DMS_fnc_SpawnCrate;
  227. _crate1 = [_crateClasses_and_Positions select 1 select 1, _crateClasses_and_Positions select 1 select 0] call DMS_fnc_SpawnCrate;
  228.  
  229. // Enable smoke on the crates due to size of area
  230. {
  231. _x setVariable ["DMS_AllowSmoke", true];
  232. } forEach [_crate0,_crate1];
  233.  
  234. // Define mission-spawned AI Units
  235. _missionAIUnits =
  236. [
  237. _group // We only spawned the single group for this mission
  238. ];
  239.  
  240. // Define the group reinforcements
  241. _groupReinforcementsInfo =
  242. [
  243. [
  244. _group, // pass the group
  245. [
  246. [
  247. 0, // Let's limit number of units instead...
  248. 0
  249. ],
  250. [
  251. _AIMaxReinforcements, // Maximum units that can be given as reinforcements (defined in difficulty selection).
  252. 0
  253. ]
  254. ],
  255. [
  256. _AIdelay, // The delay between reinforcements. >> you can change this in difficulty settings
  257. diag_tickTime
  258. ],
  259. _AISoldierSpawnLocations,
  260. "random",
  261. _difficulty,
  262. _side,
  263. "reinforce",
  264. [
  265. _AItrigger, // Set in difficulty select - Reinforcements will only trigger if there's fewer than X members left
  266. _AIwave // X reinforcement units per wave. >> you can change this in mission difficulty section
  267. ]
  268. ]
  269. ];
  270.  
  271. // setup crates with items from choices
  272. _crate_loot_values0 =
  273. [
  274. _crate_weapons0, // Set in difficulty select - Weapons
  275. _crate_items0, // Set in difficulty select - Items
  276. _crate_backpacks0 // Set in difficulty select - Backpacks
  277. ];
  278. _crate_loot_values1 =
  279. [
  280. _crate_weapons1, // Set in difficulty select - Weapons
  281. _crate_items1, // Set in difficulty select - Items
  282. _crate_backpacks1 // Set in difficulty select - Backpacks
  283. ];
  284.  
  285. // add cash to _crate0
  286. _crate0 setVariable ["ExileMoney", _cash,true];
  287.  
  288. // Define mission-spawned objects and loot values
  289. _missionObjs =
  290. [
  291. _staticGuns, // static gun(s). Note, we don't add the base itself because it already spawns on server start.
  292. [],
  293. [[_crate0,_crate_loot_values0],[_crate1,_crate_loot_values1]]
  294. ];
  295.  
  296. // Define Mission Start message
  297. _msgStart = ['#FFFF00',format["A large group of %1 pirates have taken over the Pyrgos Gulf Oil Rig",_difficultyM]];
  298.  
  299. // Define Mission Win message
  300. _msgWIN = ['#0080ff',"Convicts have successfully killed the terrorists and claimed all the crates"];
  301.  
  302. // Define Mission Lose message
  303. _msgLOSE = ['#FF0000',"The terrorists have gone off to find more parts for their vehicles..."];
  304.  
  305. // Define mission name (for map marker and logging)
  306. _missionName = "Death at Dawn Pirates";
  307.  
  308. // Create Markers
  309. _markers =
  310. [
  311. _pos,
  312. _missionName,
  313. _difficultyM
  314. ] call DMS_fnc_CreateMarker;
  315.  
  316. _circle = _markers select 1;
  317. _circle setMarkerDir 20;
  318. _circle setMarkerSize [250,250];
  319.  
  320. _time = diag_tickTime;
  321.  
  322. // Parse and add mission info to missions monitor
  323. _added =
  324. [
  325. _pos,
  326. [
  327. [
  328. "kill",
  329. _group
  330. ],
  331. [
  332. "playerNear",
  333. [_pos,100]
  334. ]
  335. ],
  336. _groupReinforcementsInfo,
  337. [
  338. _time,
  339. DMS_StaticMissionTimeOut call DMS_fnc_SelectRandomVal
  340. ],
  341. _missionAIUnits,
  342. _missionObjs,
  343. [_missionName,_msgWIN,_msgLOSE],
  344. _markers,
  345. _side,
  346. _difficulty,
  347. [[],[]]
  348. ] call DMS_fnc_AddMissionToMonitor_Static;
  349.  
  350. // Check to see if it was added correctly, otherwise delete the stuff
  351. if !(_added) exitWith
  352. {
  353. 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];
  354.  
  355. _cleanup = [];
  356. {
  357. _cleanup pushBack _x;
  358. } forEach _missionAIUnits;
  359.  
  360. _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1));
  361.  
  362. {
  363. _cleanup pushBack (_x select 0);
  364. } foreach (_missionObjs select 2);
  365.  
  366. _cleanup call DMS_fnc_CleanUp;
  367.  
  368.  
  369. // Delete the markers directly
  370. {deleteMarker _x;} forEach _markers;
  371.  
  372. // Reset the mission count
  373. DMS_MissionCount = DMS_MissionCount - 1;
  374. };
  375.  
  376. // Notify players
  377. [_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;
  378.  
  379. if (DMS_DEBUG) then
  380. {
  381. (format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
  382. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement