Psygomin

Untitled

Feb 7th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.92 KB | None | 0 0
  1. /*
  2. "sectorb" 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 = [22698,19711,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. [23025.751953,19293.861328,0.00143862],
  31. [22992.705078,19570.339844,0.00143862],
  32. [22968.332031,19947.615234,0.00143862],
  33. [22574.429688,20229.257813,0.00143862],
  34. [22480.148438,20027.519531,0.00143862],
  35. [22499.912109,19790.904297,0.00143862],
  36. [22461.966797,19478.164063,0.00143862],
  37. [22422.921875,19232.820313,0],
  38. [22655.435547,19070.40625,0],
  39. [22190.574219,19426.90625,0],
  40. [22226.789063,19679.146484,0],
  41. [22237.111328,19690.556641,0],
  42. [22218.667969,19857.771484,0],
  43. [22287.675781,20033.203125,0],
  44. [22764.445313,19287.0585938,0],
  45. [22765.0996094,19555.298828,0],
  46. [22768.619141,19810.292969,0]
  47. ];
  48.  
  49. // Create AI
  50. _AICount = 20 + (round (random 5));
  51.  
  52.  
  53. _group =
  54. [
  55. _AISoldierSpawnLocations,
  56. _AICount,
  57. _difficulty,
  58. "random",
  59. _side
  60. ] call DMS_fnc_SpawnAIGroup_MultiPos;
  61.  
  62.  
  63. _staticGuns =
  64. [
  65. [
  66. _pos vectorAdd [5,0,0], // 5 meters East of center pos
  67. _pos vectorAdd [-5,0,0], // 5 meters West of center pos
  68. _pos vectorAdd [0,5,0], // 5 meters North of center pos
  69. _pos vectorAdd [0,-5,0], // 5 meters South of center pos
  70. [22892.841797,19841.365234,12.764622], // Top of NorthWest Tower
  71. [22766.492188,19234.724609,0], // Top of NorthEast Tower
  72. [22197.535156,19250.287109,0], // Top of SouthEast Tower
  73. [22185.101563,19267.111328,0], // Top of SouthWest Tower
  74. [22139.515625,19847.607422,0.00274658] // Top of the concrete water tower thing.
  75. ],
  76. _group,
  77. "assault",
  78. _difficulty,
  79. "bandit",
  80. "random"
  81. ] call DMS_fnc_SpawnAIStaticMG;
  82.  
  83.  
  84.  
  85. // Create Crate
  86. _crateClassname = "I_CargoNet_01_ammo_F";
  87. deleteVehicle (nearestObject [_pos, _crateClassname]); // Make sure to remove any previous crate.
  88.  
  89. _crate = [_crateClassname, _pos] call DMS_fnc_SpawnCrate;
  90.  
  91.  
  92. // Spawn the vehicle AFTER the base so that it spawns the vehicle in a (relatively) clear position.
  93. _veh =
  94. [
  95. [
  96. [_pos,100,random 360] call DMS_fnc_SelectOffsetPos,
  97. _pos
  98. ],
  99. _group,
  100. "assault",
  101. _difficulty,
  102. _side
  103. ] call DMS_fnc_SpawnAIVehicle;
  104.  
  105.  
  106. // Define mission-spawned AI Units
  107. _missionAIUnits =
  108. [
  109. _group // We only spawned the single group for this mission
  110. ];
  111.  
  112. // Define the group reinforcements
  113. _groupReinforcementsInfo =
  114. [
  115. [
  116. _group, // pass the group
  117. [
  118. [
  119. 5, // Only 5 "waves" (5 vehicles can spawn as reinforcement)
  120. 0
  121. ],
  122. [
  123. -1, // No need to limit the number of units since we're limiting "waves"
  124. 0
  125. ]
  126. ],
  127. [
  128. 300, // At least a 5 minute delay between reinforcements.
  129. diag_tickTime
  130. ],
  131. [
  132. [22992.705078,19570.339844,0.00143862],
  133. [22993.705078,19570.339844,0.00143862],
  134. [22994.705078,19572.339844,0.00143862],
  135. [22995.705078,19573.339844,0.00143862],
  136. [22996.705078,19574.339844,0.00143862],
  137. [22997.705078,19575.339844,0.00143862],
  138. [22998.705078,19576.339844,0.00143862],
  139. [22999.705078,19577.339844,0.00143862],
  140. [22300.705078,19578.339844,0.00143862]
  141. ],
  142. "random",
  143. _difficulty,
  144. _side,
  145. "armed_vehicle",
  146. [
  147. 7, // Reinforcements will only trigger if there's fewer than 7 members left in the group
  148. "random" // Select a random armed vehicle from "DMS_ArmedVehicles"
  149. ]
  150. ],
  151. [
  152. _group, // pass the group (again)
  153. [
  154. [
  155. 0, // Let's limit number of units instead...
  156. 0
  157. ],
  158. [
  159. 100, // Maximum 100 units can be given as reinforcements.
  160. 0
  161. ]
  162. ],
  163. [
  164. 240, // About a 4 minute delay between reinforcements.
  165. diag_tickTime
  166. ],
  167. _AISoldierSpawnLocations,
  168. "random",
  169. _difficulty,
  170. _side,
  171. "reinforce",
  172. [
  173. 10, // Reinforcements will only trigger if there's fewer than 10 members left in the group
  174. 7 // 7 reinforcement units per wave.
  175. ]
  176. ]
  177. ];
  178.  
  179. // Define mission-spawned objects and loot values
  180. _missionObjs =
  181. [
  182. _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.
  183. [],
  184. [[_crate,[75,250,5]]]
  185. ];
  186.  
  187. // Define Mission Start message
  188. _msgStart = ['#FFFF00', "A heavily guarded base has been located Sector B! There are reports they have a large weapon cache..."];
  189.  
  190. // Define Mission Win message
  191. _msgWIN = ['#0080ff',"Convicts have successfully assaulted the base at Sector B and secured the cache!"];
  192.  
  193. // Define Mission Lose message
  194. _msgLOSE = ['#FF0000',"Seems like the guards got bored and left the base, taking the cache with them..."];
  195.  
  196. // Define mission name (for map marker and logging)
  197. _missionName = "AI Base";
  198.  
  199. // Create Markers
  200. _markers =
  201. [
  202. _pos,
  203. _missionName,
  204. _difficulty
  205. ] call DMS_fnc_CreateMarker;
  206.  
  207. (_markers select 1) setMarkerSize [1500,1500];
  208.  
  209. // Record time here (for logging purposes, otherwise you could just put "diag_tickTime" into the "DMS_AddMissionToMonitor" parameters directly)
  210. _time = diag_tickTime;
  211.  
  212. // Parse and add mission info to missions monitor
  213. _added =
  214. [
  215. _pos,
  216. [
  217. [
  218. "kill",
  219. _group
  220. ],
  221. [
  222. "playerNear",
  223. [_pos,100]
  224. ]
  225. ],
  226. _groupReinforcementsInfo,
  227. [
  228. _time,
  229. DMS_StaticMissionTimeOut call DMS_fnc_SelectRandomVal
  230. ],
  231. _missionAIUnits,
  232. _missionObjs,
  233. [_missionName,_msgWIN,_msgLOSE],
  234. _markers,
  235. _side,
  236. _difficulty,
  237. [[],[]]
  238. ] call DMS_fnc_AddMissionToMonitor_Static;
  239.  
  240. // Check to see if it was added correctly, otherwise delete the stuff
  241. if !(_added) exitWith
  242. {
  243. 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];
  244.  
  245. _cleanup = [];
  246. {
  247. _cleanup pushBack _x;
  248. } forEach _missionAIUnits;
  249.  
  250. _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1));
  251.  
  252. {
  253. _cleanup pushBack (_x select 0);
  254. } foreach (_missionObjs select 2);
  255.  
  256. _cleanup call DMS_fnc_CleanUp;
  257.  
  258.  
  259. // Delete the markers directly
  260. {deleteMarker _x;} forEach _markers;
  261.  
  262.  
  263. // Reset the mission count
  264. DMS_MissionCount = DMS_MissionCount - 1;
  265. };
  266.  
  267.  
  268. // Notify players
  269. [_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;
  270.  
  271.  
  272.  
  273. if (DMS_DEBUG) then
  274. {
  275. (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;
  276. };
Advertisement
Add Comment
Please, Sign In to add comment