Advertisement
Psygomin

Untitled

Feb 7th, 2016
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.91 KB | None | 0 0
  1. /*
  2. "novidvor" 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 = [7990.408203,6467.227539,0];
  15.  
  16. if ([_pos,DMS_StaticMinPlayerDistance] call DMS_fnc_IsPlayerNearby) exitWith {"delay"};
  17.  
  18.  
  19. // Set general mission difficulty
  20. _difficulty = "moderate";
  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. [8060.120605,6448.553711,0.125504],
  31. [8004.0454102,6532.410156,0.0547333],
  32. [7949.351074,6498.695313,0.101616],
  33. [7988.441406,6407.824707,0.0237122]
  34. ];
  35.  
  36. // Create AI
  37. _AICount = 20 + (round (random 5));
  38.  
  39.  
  40. _group =
  41. [
  42. _AISoldierSpawnLocations,
  43. _AICount,
  44. _difficulty,
  45. "random",
  46. _side
  47. ] call DMS_fnc_SpawnAIGroup_MultiPos;
  48.  
  49.  
  50. _staticGuns =
  51. [
  52. [
  53. //[23424.4,18844.1,15.33], // Top of the construction building. I added this and I thought it may be too much. Your choice if you want to uncomment ;)
  54. _pos vectorAdd [5,0,0], // 5 meters East of center pos
  55. _pos vectorAdd [-5,0,0], // 5 meters West of center pos
  56. [8045.905273,6497.180664,0.178833] // Top of the concrete water tower thing.
  57. ],
  58. _group,
  59. "assault",
  60. _difficulty,
  61. "bandit",
  62. "random"
  63. ] call DMS_fnc_SpawnAIStaticMG;
  64.  
  65.  
  66.  
  67. // Create Crate
  68. _crateClassname = "I_CargoNet_01_ammo_F";
  69. deleteVehicle (nearestObject [_pos, _crateClassname]); // Make sure to remove any previous crate.
  70.  
  71. _crate = [_crateClassname, _pos] call DMS_fnc_SpawnCrate;
  72.  
  73.  
  74. // Spawn the vehicle AFTER the base so that it spawns the vehicle in a (relatively) clear position.
  75. _veh =
  76. [
  77. [
  78. [_pos,100,random 360] call DMS_fnc_SelectOffsetPos,
  79. _pos
  80. ],
  81. _group,
  82. "assault",
  83. _difficulty,
  84. _side
  85. ] call DMS_fnc_SpawnAIVehicle;
  86.  
  87.  
  88. // Define mission-spawned AI Units
  89. _missionAIUnits =
  90. [
  91. _group // We only spawned the single group for this mission
  92. ];
  93.  
  94. // Define the group reinforcements
  95. _groupReinforcementsInfo =
  96. [
  97. [
  98. _group, // pass the group
  99. [
  100. [
  101. 5, // Only 5 "waves" (5 vehicles can spawn as reinforcement)
  102. 0
  103. ],
  104. [
  105. -1, // No need to limit the number of units since we're limiting "waves"
  106. 0
  107. ]
  108. ],
  109. [
  110. 300, // At least a 5 minute delay between reinforcements.
  111. diag_tickTime
  112. ],
  113. [
  114. [8004.0454102,6532.410156,0.0547333]
  115. ],
  116. "random",
  117. _difficulty,
  118. _side,
  119. "armed_vehicle",
  120. [
  121. 7, // Reinforcements will only trigger if there's fewer than 7 members left in the group
  122. "random" // Select a random armed vehicle from "DMS_ArmedVehicles"
  123. ]
  124. ],
  125. [
  126. _group, // pass the group (again)
  127. [
  128. [
  129. 0, // Let's limit number of units instead...
  130. 0
  131. ],
  132. [
  133. 100, // Maximum 100 units can be given as reinforcements.
  134. 0
  135. ]
  136. ],
  137. [
  138. 240, // About a 4 minute delay between reinforcements.
  139. diag_tickTime
  140. ],
  141. _AISoldierSpawnLocations,
  142. "random",
  143. _difficulty,
  144. _side,
  145. "reinforce",
  146. [
  147. 10, // Reinforcements will only trigger if there's fewer than 10 members left in the group
  148. 7 // 7 reinforcement units per wave.
  149. ]
  150. ]
  151. ];
  152.  
  153. // Define mission-spawned objects and loot values
  154. _missionObjs =
  155. [
  156. _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.
  157. [],
  158. [[_crate,[25,100,5]]]
  159. ];
  160.  
  161. // Define Mission Start message
  162. _msgStart = ['#FFFF00', "A Military Compound has been Assulted by Bandits! There are reports they have a weapon cache..."];
  163.  
  164. // Define Mission Win message
  165. _msgWIN = ['#0080ff',"Convicts have successfully assaulted the Compound and secured the cache"];
  166.  
  167. // Define Mission Lose message
  168. _msgLOSE = ['#FF0000',"Seems like the guards got bored and left the compound, taking the cache with them..."];
  169.  
  170. // Define mission name (for map marker and logging)
  171. _missionName = "Military Compound";
  172.  
  173. // Create Markers
  174. _markers =
  175. [
  176. _pos,
  177. _missionName,
  178. _difficulty
  179. ] call DMS_fnc_CreateMarker;
  180.  
  181. (_markers select 1) setMarkerSize [500,500];
  182.  
  183. // Record time here (for logging purposes, otherwise you could just put "diag_tickTime" into the "DMS_AddMissionToMonitor" parameters directly)
  184. _time = diag_tickTime;
  185.  
  186. // Parse and add mission info to missions monitor
  187. _added =
  188. [
  189. _pos,
  190. [
  191. [
  192. "kill",
  193. _group
  194. ],
  195. [
  196. "playerNear",
  197. [_pos,100]
  198. ]
  199. ],
  200. _groupReinforcementsInfo,
  201. [
  202. _time,
  203. DMS_StaticMissionTimeOut call DMS_fnc_SelectRandomVal
  204. ],
  205. _missionAIUnits,
  206. _missionObjs,
  207. [_missionName,_msgWIN,_msgLOSE],
  208. _markers,
  209. _side,
  210. _difficulty,
  211. [[],[]]
  212. ] call DMS_fnc_AddMissionToMonitor_Static;
  213.  
  214. // Check to see if it was added correctly, otherwise delete the stuff
  215. if !(_added) exitWith
  216. {
  217. 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];
  218.  
  219. _cleanup = [];
  220. {
  221. _cleanup pushBack _x;
  222. } forEach _missionAIUnits;
  223.  
  224. _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1));
  225.  
  226. {
  227. _cleanup pushBack (_x select 0);
  228. } foreach (_missionObjs select 2);
  229.  
  230. _cleanup call DMS_fnc_CleanUp;
  231.  
  232.  
  233. // Delete the markers directly
  234. {deleteMarker _x;} forEach _markers;
  235.  
  236.  
  237. // Reset the mission count
  238. DMS_MissionCount = DMS_MissionCount - 1;
  239. };
  240.  
  241.  
  242. // Notify players
  243. [_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;
  244.  
  245.  
  246.  
  247. if (DMS_DEBUG) then
  248. {
  249. (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;
  250. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement