brujo22

Maze Mission

May 18th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.45 KB | None | 0 0
  1. /*
  2. "Lost In The Maze" static mission for Taunus.
  3.  
  4.  
  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 = [0,0,0];
  15.  
  16. if ([_pos,DMS_StaticMinPlayerDistance] call DMS_fnc_IsPlayerNearby) exitWith {"delay"};
  17.  
  18.  
  19. // Set general mission difficulty
  20. _difficulty = "hardcore";
  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. [0,0,0],
  28. [0,0,0],
  29. [0,0,0],
  30. [0,0,0],
  31. [0,0,0],
  32. [0,0,0],
  33. ];
  34.  
  35. // Create AI
  36. _AICount = 30 + (round (random 5));
  37.  
  38.  
  39. _group =
  40. [
  41. _AISoldierSpawnLocations+[_pos,_pos,_pos], // Pass the regular spawn locations as well as the center pos 3x
  42. _AICount,
  43. _difficulty,
  44. "random",
  45. _side
  46. ] call DMS_fnc_SpawnAIGroup_MultiPos;
  47.  
  48.  
  49. _staticGuns =
  50. [
  51. [
  52. [0,0,0],
  53. [0,0,0],
  54. [0,0,0],
  55. [0,0,0],
  56. [0,0,0],
  57. [0,0,0],
  58. ],
  59. _group,
  60. "assault",
  61. _difficulty,
  62. "bandit",
  63. "random"
  64. ] call DMS_fnc_SpawnAIStaticMG;
  65.  
  66.  
  67.  
  68. // Define the classnames and locations where the crates can spawn (at least 2, since we're spawning 2 crates)
  69. _crateClasses_and_Positions =
  70. [
  71. [[0,0,0],"I_CargoNet_01_ammo_F"],
  72. [[0,0,0],"I_CargoNet_01_ammo_F"],
  73. [[0,0,0],"I_CargoNet_01_ammo_F"],
  74. [[0,0,0],"I_CargoNet_01_ammo_F"],
  75. [[0,0,0],"I_CargoNet_01_ammo_F"]
  76. ];
  77.  
  78. {
  79. deleteVehicle (nearestObject _x); // Make sure to remove any previous crates.
  80. } forEach _crateClasses_and_Positions;
  81.  
  82. // Shuffle the list
  83. _crateClasses_and_Positions = _crateClasses_and_Positions call ExileClient_util_array_shuffle;
  84.  
  85.  
  86. // Create Crates
  87. _crate0 = [_crateClasses_and_Positions select 0 select 1, _crateClasses_and_Positions select 0 select 0] call DMS_fnc_SpawnCrate;
  88. _crate1 = [_crateClasses_and_Positions select 1 select 1, _crateClasses_and_Positions select 1 select 0] call DMS_fnc_SpawnCrate;
  89.  
  90. // Disable smoke on the crates so that the players have to search for them >:D
  91. {
  92. _x setVariable ["DMS_AllowSmoke", false];
  93. } forEach [_crate0,_crate1];
  94.  
  95. /*
  96. // Don't think an armed AI vehicle fit the idea behind the mission. You're welcome to uncomment this if you want.
  97. _veh =
  98. [
  99. [
  100. [_pos,100,random 360] call DMS_fnc_SelectOffsetPos,
  101. _pos
  102. ],
  103. _group,
  104. "assault",
  105. _difficulty,
  106. _side
  107. ] call DMS_fnc_SpawnAIVehicle;
  108. */
  109.  
  110.  
  111. // Define mission-spawned AI Units
  112. _missionAIUnits =
  113. [
  114. _group // We only spawned the single group for this mission
  115. ];
  116.  
  117. // Define the group reinforcements
  118. _groupReinforcementsInfo =
  119. [
  120. [
  121. _group, // pass the group
  122. [
  123. [
  124. -1, // Let's limit number of units instead...
  125. 0
  126. ],
  127. [
  128. 100, // Maximum 100 units can be given as reinforcements.
  129. 0
  130. ]
  131. ],
  132. [
  133. 240, // About a 4 minute delay between reinforcements.
  134. diag_tickTime
  135. ],
  136. _AISoldierSpawnLocations,
  137. "random",
  138. _difficulty,
  139. _side,
  140. "reinforce",
  141. [
  142. 10, // Reinforcements will only trigger if there's fewer than 10 members left in the group
  143. 7 // 7 reinforcement units per wave.
  144. ]
  145. ]
  146. ];
  147.  
  148. // Define mission-spawned objects and loot values
  149. _missionObjs =
  150. [
  151. _staticGuns, // static gun(s). Note, we don't add the base itself because it already spawns on server start.
  152. [],
  153. [[_crate0,[0,0,0]],[_crate1,[0,0,0]]]
  154. ];
  155.  
  156. // Define Mission Start message
  157. _msgStart = ['#FFFF00', "Some bandits have set up camp in The Maze"];
  158.  
  159. // Define Mission Win message
  160. _msgWIN = ['#0080ff',"The bandit camp has been wiped out."];
  161.  
  162. // Define Mission Lose message
  163. _msgLOSE = ['#FF0000',"The bandit camp was relocated to an unknown location."];
  164.  
  165. // Define mission name (for map marker and logging)
  166. _missionName = "Lost In The Maze";
  167.  
  168. // Create Markers
  169. _markers =
  170. [
  171. _pos,
  172. _missionName,
  173. _difficulty
  174. ] call DMS_fnc_CreateMarker;
  175.  
  176. _circle = _markers select 1;
  177. _circle setMarkerDir 20;
  178. _circle setMarkerSize [150,50];
  179.  
  180.  
  181. _time = diag_tickTime;
  182.  
  183. // Parse and add mission info to missions monitor
  184. _added =
  185. [
  186. _pos,
  187. [
  188. [
  189. "kill",
  190. _group
  191. ],
  192. [
  193. "playerNear",
  194. [_pos,100]
  195. ]
  196. ],
  197. _groupReinforcementsInfo,
  198. [
  199. _time,
  200. DMS_StaticMissionTimeOut call DMS_fnc_SelectRandomVal
  201. ],
  202. _missionAIUnits,
  203. _missionObjs,
  204. [_missionName,_msgWIN,_msgLOSE],
  205. _markers,
  206. _side,
  207. _difficulty,
  208. []
  209. ] call DMS_fnc_AddMissionToMonitor_Static;
  210.  
  211. // Check to see if it was added correctly, otherwise delete the stuff
  212. if !(_added) exitWith
  213. {
  214. 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];
  215.  
  216. _cleanup = [];
  217. {
  218. _cleanup pushBack _x;
  219. } forEach _missionAIUnits;
  220.  
  221. _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1));
  222.  
  223. {
  224. _cleanup pushBack (_x select 0);
  225. } foreach (_missionObjs select 2);
  226.  
  227. _cleanup call DMS_fnc_CleanUp;
  228.  
  229.  
  230. // Delete the markers directly
  231. {deleteMarker _x;} forEach _markers;
  232.  
  233.  
  234. // Reset the mission count
  235. DMS_MissionCount = DMS_MissionCount - 1;
  236. };
  237.  
  238.  
  239. // Notify players
  240. [_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;
  241.  
  242.  
  243.  
  244. if (DMS_DEBUG) then
  245. {
  246. (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;
  247. };
Advertisement
Add Comment
Please, Sign In to add comment