Advertisement
Psygomin

Untitled

Feb 7th, 2016
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.96 KB | None | 0 0
  1. /*
  2. "nuclearplant" static mission for Altis.
  3. Created by eraser1
  4. Credits to "Darth Rogue" for creating the base.
  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 = [9474.728516,4488.0600586,0];
  15.  
  16. if ([_pos,DMS_StaticMinPlayerDistance] call DMS_fnc_IsPlayerNearby) exitWith {"delay"};
  17.  
  18.  
  19. // Set general mission difficulty
  20. _difficulty = "difficult";
  21.  
  22.  
  23. // Define spawn locations for AI Soldiers. These will be used for the initial spawning of AI as well as reinforcements.
  24. // 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.
  25. _AISoldierSpawnLocations =
  26. [
  27. _pos,
  28. _pos,
  29. _pos,
  30. [9302.894531,4260.821289,0.00144196],
  31. [9603.484375,4282.19043,0.00144196],
  32. [9603.384766,4469.110352,0.00144196],
  33. [9596.975586,4707.866211,0.00144196],
  34. [9302.865234,4656.453613,0.00144196],
  35. [9295.0800781,4490.34668,0.00144196]
  36. ];
  37.  
  38. // Create AI
  39. _AICount = 20 + (round (random 5));
  40.  
  41.  
  42. _group =
  43. [
  44. _AISoldierSpawnLocations,
  45. _AICount,
  46. _difficulty,
  47. "random",
  48. _side
  49. ] call DMS_fnc_SpawnAIGroup_MultiPos;
  50.  
  51.  
  52. _staticGuns =
  53. [
  54. [
  55.  
  56. _pos vectorAdd [5,0,0], // 5 meters East of center pos
  57. _pos vectorAdd [-5,0,0], // 5 meters West of center pos
  58. [9682.238281,4448.80957,0.00144196], // Top of SouthWest Tower
  59. [9301.894531,4448.736816,0.00144196] // Top of the concrete water tower thing.
  60. ],
  61. _group,
  62. "assault",
  63. _difficulty,
  64. "bandit",
  65. "random"
  66. ] call DMS_fnc_SpawnAIStaticMG;
  67.  
  68.  
  69.  
  70. // Create Crate
  71. _crateClassname = "I_CargoNet_01_ammo_F";
  72. deleteVehicle (nearestObject [_pos, _crateClassname]); // Make sure to remove any previous crate.
  73.  
  74. _crate = [_crateClassname, _pos] call DMS_fnc_SpawnCrate;
  75.  
  76.  
  77.  
  78. // Spawn the vehicle AFTER the base so that it spawns the vehicle in a (relatively) clear position.
  79. _veh =
  80. [
  81. [
  82. [_pos,100,random 360] call DMS_fnc_SelectOffsetPos,
  83. _pos
  84. ],
  85. _group,
  86. "assault",
  87. _difficulty,
  88. _side
  89. ] call DMS_fnc_SpawnAIVehicle;
  90.  
  91.  
  92. // Define mission-spawned AI Units
  93. _missionAIUnits =
  94. [
  95. _group // We only spawned the single group for this mission
  96. ];
  97.  
  98. // Define the group reinforcements
  99. _groupReinforcementsInfo =
  100. [
  101. [
  102. _group, // pass the group
  103. [
  104. [
  105. 5, // Only 5 "waves" (5 vehicles can spawn as reinforcement)
  106. 0
  107. ],
  108. [
  109. -1, // No need to limit the number of units since we're limiting "waves"
  110. 0
  111. ]
  112. ],
  113. [
  114. 300, // At least a 5 minute delay between reinforcements.
  115. diag_tickTime
  116. ],
  117. [
  118. [9302.894531,4260.821289,0.00144196]
  119. ],
  120. "random",
  121. _difficulty,
  122. _side,
  123. "armed_vehicle",
  124. [
  125. 7, // Reinforcements will only trigger if there's fewer than 7 members left in the group
  126. "random" // Select a random armed vehicle from "DMS_ArmedVehicles"
  127. ]
  128. ],
  129. [
  130. _group, // pass the group (again)
  131. [
  132. [
  133. 0, // Let's limit number of units instead...
  134. 0
  135. ],
  136. [
  137. 100, // Maximum 100 units can be given as reinforcements.
  138. 0
  139. ]
  140. ],
  141. [
  142. 240, // About a 4 minute delay between reinforcements.
  143. diag_tickTime
  144. ],
  145. _AISoldierSpawnLocations,
  146. "random",
  147. _difficulty,
  148. _side,
  149. "reinforce",
  150. [
  151. 10, // Reinforcements will only trigger if there's fewer than 10 members left in the group
  152. 7 // 7 reinforcement units per wave.
  153. ]
  154. ]
  155. ];
  156.  
  157.  
  158. // Define mission-spawned objects and loot values
  159. _missionObjs =
  160. [
  161. _staticGuns+[_veh], // armed AI vehicle and static gun(s). Note, we don't add the base itself because we don't want to delete it and respawn it if the mission respawns.
  162. [],
  163. [[_crate,[30,150,5]]]
  164. ];
  165.  
  166. // Define Mission Start message
  167. _msgStart = ['#FFFF00', "A Group of Terrorists have Assulted the Nuclear Power Plant. There are reports they are Heavily Armed and have a stockpile of Weapons."];
  168.  
  169. // Define Mission Win message
  170. _msgWIN = ['#0080ff',"Convicts have successfully liberated the Power plant and have tacken the cache"];
  171.  
  172. // Define Mission Lose message
  173. _msgLOSE = ['#FF0000',"Seems like the terrorists couldnt arm the reactor, and left taking the cache with them..."];
  174.  
  175. // Define mission name (for map marker and logging)
  176. _missionName = "Nuke Plant";
  177.  
  178. // Create Markers
  179. _markers =
  180. [
  181. _pos,
  182. _missionName,
  183. _difficulty
  184. ] call DMS_fnc_CreateMarker;
  185.  
  186. (_markers select 1) setMarkerSize [500,500];
  187.  
  188. // Record time here (for logging purposes, otherwise you could just put "diag_tickTime" into the "DMS_AddMissionToMonitor" parameters directly)
  189. _time = diag_tickTime;
  190.  
  191. // Parse and add mission info to missions monitor
  192. _added =
  193. [
  194. _pos,
  195. [
  196. [
  197. "kill",
  198. _group
  199. ],
  200. [
  201. "playerNear",
  202. [_pos,100]
  203. ]
  204. ],
  205. _groupReinforcementsInfo,
  206. [
  207. _time,
  208. DMS_StaticMissionTimeOut call DMS_fnc_SelectRandomVal
  209. ],
  210. _missionAIUnits,
  211. _missionObjs,
  212. [_missionName,_msgWIN,_msgLOSE],
  213. _markers,
  214. _side,
  215. _difficulty,
  216. [[],[]]
  217. ] call DMS_fnc_AddMissionToMonitor_Static;
  218.  
  219. // Check to see if it was added correctly, otherwise delete the stuff
  220. if !(_added) exitWith
  221. {
  222. 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];
  223.  
  224. _cleanup = [];
  225. {
  226. _cleanup pushBack _x;
  227. } forEach _missionAIUnits;
  228.  
  229. _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1));
  230.  
  231. {
  232. _cleanup pushBack (_x select 0);
  233. } foreach (_missionObjs select 2);
  234.  
  235. _cleanup call DMS_fnc_CleanUp;
  236.  
  237.  
  238. // Delete the markers directly
  239. {deleteMarker _x;} forEach _markers;
  240.  
  241.  
  242. // Reset the mission count
  243. DMS_MissionCount = DMS_MissionCount - 1;
  244. };
  245.  
  246.  
  247. // Notify players
  248. [_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;
  249.  
  250.  
  251.  
  252. if (DMS_DEBUG) then
  253. {
  254. (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;
  255. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement