Advertisement
Hellstorm77

Untitled

Jul 1st, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.76 KB | None | 0 0
  1. if(count ep_locations < 1) exitWith{};
  2. diag_log [diag_frameno, diag_ticktime, time, "MISSION TASK MSO_AUTO.sqf"];
  3.  
  4. private["_killtasktime","_AO","_location","_taskid","_position","_types","_unittypes","_unittype","_HVTgrp","_HVT","_cleared", "_activatedAOTypes"];
  5.  
  6. // *** start of HACK for BL1P by zsawyer ***
  7. _activatedAOTypes = ["Camp", "AA", "RB", "Infantry", "Motorized", "Mechanized", "Armored"];
  8.  
  9. _AOtype = "";
  10. while {-1 == _activatedAOTypes find _AOtype} do {
  11. _AO = (ep_locations call mps_getRandomElement);
  12. _AOtype = _AO select 0;
  13.  
  14. diag_log format ["found AOtype: %1", _AOtype];
  15. hint format ["found AOtype: %1", _AOtype];
  16. sleep 2;
  17. };
  18. // *** end of HACK for BL1P by zsawyer ***
  19. _position = _AO select 1;
  20. _HVTgrp = nil;
  21. _HVT = nil;
  22. _killtasktime = 0;
  23.  
  24. _taskid = format["%1%2%3",round (_position select 0),round (_position select 1),(round random 999)];
  25.  
  26. sleep 1;
  27. _di = 1000;
  28. _neartwns = nearestLocations [_position, ["NameVillage","NameCity","NameCityCapital","NameLocal"], _di];
  29. while {count _neartwns < 1} do {
  30. _di = _di + 500;
  31. _neartwns = nearestLocations [_position, ["NameVillage","NameCity","NameCityCapital","NameLocal"], _di];
  32. };
  33. _nearesttwn = _neartwns select 0;
  34.  
  35. switch (_AOtype) do {
  36.  
  37. case "Camp": {
  38. _HVTgrp = creategroup EAST;
  39. "Land_dp_smallFactory_F" createUnit [_position, _HVTgrp];
  40. _HVT = leader _HVTgrp;
  41. _chkdist = 200;
  42.  
  43. [
  44. format["TASK%1",_taskid],
  45. format["Eliminate High Value Target!", _taskid],
  46. format["We received HUMINT of an High Value Target (HVT) near %1! Eliminate the target Within 3 hrs!", text _nearesttwn],
  47. true,
  48. [format["MARK%1",_taskid],(_position),"hd_objective","ColorRedAlpha","Target"],
  49. "created",
  50. _position
  51. ] call mps_tasks_add;
  52. };
  53. case "AA": {
  54. _chkdist = 200;
  55.  
  56. [
  57. format["TASK%1",_taskid],
  58. format["Take out AAA placement near %1!",text _nearesttwn],
  59. format["An hostile AAA camp was revealed in the area of %1! Take out all Hostiles in the AO!!!! You have 3hrs!",text _nearesttwn],
  60. true,
  61. [format["MARK%1",_taskid],(_position),"hd_objective","ColorRedAlpha","Target"],
  62. "created",
  63. _position
  64. ] call mps_tasks_add;
  65.  
  66. };
  67. case "RB": {
  68. _chkdist = 150;
  69.  
  70. [
  71. format["TASK%1",_taskid],
  72. format["Clear enemy roadblock in %1!",text _nearesttwn],
  73. format["We received HUMINT about a roadblock in the vicinity of %1! Recon the area and Take out all Hostiles in the AO!!!! You have 3hrs!!",text _nearesttwn],
  74. true,
  75. [format["MARK%1",_taskid],(_position),"hd_objective","ColorRedAlpha","Target"],
  76. "created",
  77. _position
  78. ] call mps_tasks_add;
  79. };
  80. case "Infantry": {
  81. _chkdist = 500;
  82.  
  83. [
  84. format["TASK%1",_taskid],
  85. format ["Enemy troops movement in %1!",text _nearesttwn],
  86. format["We received HUMINT about troops in the area of %1! Recon the AO before to get an overview of the situation, Then take out all Hostiles in the AO!!!! You have 3hrs!!",text _nearesttwn],
  87. true,
  88. [format["MARK%1",_taskid],(_position),"hd_objective","ColorRedAlpha","Target"],
  89. "created",
  90. _position
  91. ] call mps_tasks_add;
  92. };
  93. case "Motorized": {
  94. _chkdist = 500;
  95.  
  96. [
  97. format["TASK%1",_taskid],
  98. format ["Motorized groups spotted at %1!",text _nearesttwn],
  99. format["A motorized group was located in the vicinity of %1! Be sure to recon the AO before you attack! Take out all Hostiles in the AO!!!! You have 3hrs!",text _nearesttwn],
  100. true,
  101. [format["MARK%1",_taskid],(_position),"hd_objective","ColorRedAlpha","Target"],
  102. "created",
  103. _position
  104. ] call mps_tasks_add;
  105. };
  106. case "Mechanized": {
  107. _chkdist = 500;
  108.  
  109. [
  110. format["TASK%1",_taskid],
  111. format ["Light armour spotted near %1!",text _nearesttwn],
  112. format["A mech group moves around near %1! Be sure to spot your primary target prior to Taking out all Hostiles in the AO!!!! You have 3hrs!",text _nearesttwn],
  113. true,
  114. [format["MARK%1",_taskid],(_position),"hd_objective","ColorRedAlpha","Target"],
  115. "created",
  116. _position
  117. ] call mps_tasks_add;
  118. };
  119. case "Armored": {
  120. _chkdist = 500;
  121.  
  122. [
  123. format["TASK%1",_taskid],
  124. format ["Heavy tanks spotted near %1!",text _nearesttwn],
  125. format["Tanks have been spotted in the area of %1! Be sure to have AT weapons loaded and be sure to have reconned the AO! Primary goal is Take out all Hostiles in the AO!!!! You have 3hrs!",text _nearesttwn],
  126. true,
  127. [format["MARK%1",_taskid],(_position),"hd_objective","ColorRedAlpha","Target"],
  128. "created",
  129. _position
  130. ] call mps_tasks_add;
  131. };
  132. };
  133.  
  134. _rmin = 0;
  135. _rmax = 1;
  136. _rplayers = 1 max (playersNumber (SIDE_A select 0));
  137. _ra = (_rmax-_rmin)/(mps_ref_playercount-1);
  138. _rb = _rmin - _ra;
  139. _diffresult = round(_rplayers * _ra + _rb);
  140.  
  141. _b = (2 max (round (random (playersNumber (SIDE_A select 0) / 3)))) * MISSIONDIFF;
  142.  
  143.  
  144. _stance = ["patrol","hide"] call mps_getRandomElement;
  145. _grp = [_position,"INF",(5 + random 5),50,_stance ] call CREATE_OPFOR_SQUAD;
  146. if( _diffresult > 0.18 ) then { [_position] spawn CREATE_OPFOR_SNIPERS };
  147.  
  148. sleep 0.3;
  149.  
  150.  
  151.  
  152. _cleared = false;
  153. _cntr = 0;
  154. while {!(ABORTTASK) && (_killtasktime < 10800) && !(_cleared)} do {
  155. if ([_position, rmm_ep_spawn_dist] call fPlayersInside) then {
  156. sleep 2;
  157. _EnemyCnt = {(str(side _x) != "west") && (str(side _x) != "Civilian") && alive _x} count (nearestObjects [_position, ["CAManBase","Tank"], 500]);
  158. if (_EnemyCnt == 0) then {
  159. if (_cntr > 20) then {_cleared = true};
  160. _cntr = _cntr + 2;
  161. } else {
  162. _cntr = 0;
  163. };
  164. if !(isnil "_HVT") then {if !(alive _HVT) then {_cleared = true};};
  165. } else {
  166. _killtasktime = _killtasktime + 2;
  167. _cntr = 0;
  168. sleep 2;
  169. };
  170. };
  171.  
  172. if (!ABORTTASK && _cleared) then {
  173. [format["TASK%1",_taskid],"succeeded"] call mps_tasks_upd;
  174. {deletevehicle _x} foreach _units;
  175. deletegroup _HVTgrp;
  176.  
  177. _idx = [ep_locations, _AO] call BIS_fnc_arrayFindDeep;
  178. if (typename _idx == "ARRAY") then {
  179. _idx = _idx select 0;
  180. ep_locations set [_idx, ">REMOVE<"];
  181. ep_locations = ep_locations - [">REMOVE<"];
  182. };
  183.  
  184. mps_mission_status = 2;
  185. } else {
  186. [format["TASK%1",_taskid],"failed"] call mps_tasks_upd;
  187. {deletevehicle _x} foreach (units _HVTgrp);
  188. deletegroup _HVTgrp;
  189.  
  190. _idx = [ep_locations, _AO] call BIS_fnc_arrayFindDeep;
  191. _idx = _idx select 0;
  192. ep_locations set [_idx, ">REMOVE<"];
  193. ep_locations = ep_locations - [">REMOVE<"];
  194.  
  195. mps_mission_status = 3;
  196. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement