Advertisement
Guest User

SaOk

a guest
Feb 3rd, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.15 KB | None | 0 0
  1. private ["_atLeastOnce","_ambpos","_diir","_xx","_yy","_start","_end","_class","_tank","_posPl","_st","_wp"];
  2. //INIT
  3. Pgroups = [];
  4. VarAlarm = false;
  5. _nul = [1] execVM "Music.sqf";
  6. sleep 5;
  7. while {true} do {
  8. //PATROLS
  9. _atLeastOnce = 1;
  10. while {{_x knowsabout vehicle player > 0.1} count (Pgroups + HeliGroups+ CampGroups + VehicleGroups + AirGroups) == 0 || _atLeastOnce > 0} do {
  11. _atLeastOnce = _atLeastOnce - 1;
  12. if (!isNil"debugi") then {hint "State - Patrol";};
  13. _ambpos = [(getposATL (vehicle player) select 0) + random (800) - random (800),(getposATL (vehicle player) select 1) + random (800) - random (800),0];
  14. if (count Pgroups < VarPG) then {_nul = [_ambpos,800,VarPGSize] SPAWN FUNKTIO_AmbientPatrol;};
  15. VarAlarm = false;
  16. if (random 1 < 0.3) then {
  17. if (random 1 < 0.5) then {
  18. _diir= random 360;
  19. _xx = random (1000);
  20. _yy = 1000 - _xx;
  21. if (random 1 < 0.5) then {_xx = _xx*(-1)};
  22. //if (random 1 < 0.5) then {_yy = _yy*(-1)};
  23. _start = [(getposATL (vehicle player) select 0) + _xx,(getposATL (vehicle player) select 1) + _yy,0];
  24. if (count (_start nearRoads 300) > 0) then {_start = getposATL ((_start nearRoads 300) select 0);};
  25. while {surfaceIsWater [_start select 0, _start select 1]} do {
  26. sleep 0.5;
  27. _xx = random (1000);
  28. _yy = 1000 - _xx;
  29. if (random 1 < 0.5) then {_xx = _xx*(-1)};
  30. //if (random 1 < 0.5) then {_yy = _yy*(-1)};
  31. _start = [(getposATL (vehicle player) select 0) + _xx,(getposATL (vehicle player) select 1) + _yy,0];
  32. if (count (_start nearRoads 300) > 0) then {_start =getposATL ((_start nearRoads 300) select 0);};
  33. };
  34. _xx = random (2000);
  35. _yy = 2000 - _xx;
  36. if (_start select 0 > 0) then {_xx = _xx*(-1)};
  37. if (random 1 < 0.5) then {_yy = _yy*(-1)};
  38. _end = [(getposATL (vehicle player) select 0) + _xx,(getposATL (vehicle player) select 1) + _yy,0];
  39. if (count (_end nearRoads 300) > 0) then {_end = getposATL ((_end nearRoads 300) select 0);};
  40. while {surfaceIsWater [_end select 0, _end select 1]} do {
  41. sleep 0.5;
  42. _xx = random (2000);
  43. _yy = 2000 - _xx;
  44. if (_start select 0 > 0) then {_xx = _xx*(-1)};
  45. if (random 1 < 0.5) then {_yy = _yy*(-1)};
  46. _end = [(getposATL (vehicle player) select 0) + _xx,(getposATL (vehicle player) select 1) + _yy,0];
  47. if (count (_end nearRoads 300) > 0) then {_end = getposATL ((_end nearRoads 300) select 0);};
  48. };
  49. if (count Pgroups < VarPG) then {
  50. _class = [["V3S_TK_EP1",["TK_Soldier_SL_EP1","TK_Soldier_B_EP1","TK_Soldier_Engineer_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_EP1","TK_Soldier_EP1"]],["UAZ_Unarmed_TK_EP1",["TK_Soldier_SL_EP1","TK_Soldier_B_EP1","TK_Soldier_EP1","TK_Soldier_EP1"]]];
  51. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_class = [["Ural_TK_2035",["TK_Soldier_SL","TK_Soldier_Medic","TK_Soldier_AR","TK_Soldier_MG","TK_Soldier","TK_Soldier"]],["UAZ_Unarmed_TK_2035",["TK_Soldier_SL","TK_Soldier_Medic","TK_Soldier","TK_Soldier_MG"]]];};
  52. _class = _class call BIS_fnc_selectRandom;
  53. _nul = [_class select 0,_start,_end,EAST,_diir,_class select 1, 0] execVM "AmbientScoutCar.sqf";
  54. };
  55. if (random 1 < 0.1 && count Pgroups < VarPG) then {
  56. _class = [["V3S_TK_EP1",["TK_Soldier_SL_EP1","TK_Soldier_B_EP1","TK_Soldier_Engineer_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_EP1","TK_Soldier_EP1"]],["UAZ_Unarmed_TK_EP1",["TK_Soldier_SL_EP1","TK_Soldier_B_EP1","TK_Soldier_EP1","TK_Soldier_EP1"]]];
  57. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_class = [["Ural_TK_2035",["TK_Soldier_SL","TK_Soldier_Medic","TK_Soldier_AR","TK_Soldier_MG","TK_Soldier","TK_Soldier"]],["UAZ_Unarmed_TK_2035",["TK_Soldier_SL","TK_Soldier_Medic","TK_Soldier","TK_Soldier_MG"]]];};
  58. _class = _class call BIS_fnc_selectRandom;
  59. _nul = [_class select 0,_start,_end,EAST,_diir,_class select 1, 0] execVM "AmbientScoutCar.sqf";
  60. };
  61. if (random 1 < 0.1 && count VehicleGroups < EVEHMAX) then {
  62. _class = VarVEH call BIS_fnc_selectRandom;
  63. _nul = [_class,_start,_end,EAST,_diir,[], 1] execVM "AmbientScoutCar.sqf";
  64. };
  65. } else {
  66. _diir= random 360;
  67. _xx = random (1000);
  68. _yy = 1000 - _xx;
  69. if (random 1 < 0.5) then {_xx = _xx*(-1)};
  70. //if (random 1 < 0.5) then {_yy = _yy*(-1)};
  71. _start = [(getposATL (vehicle player) select 0) + _xx,(getposATL (vehicle player) select 1) + _yy,0];
  72. if (count (_start nearRoads 300) > 0) then {_start = getposATL ((_start nearRoads 300) select 0);};
  73. while {surfaceIsWater [_start select 0, _start select 1]} do {
  74. sleep 0.5;
  75. _xx = random (1000);
  76. _yy = 1000 - _xx;
  77. if (random 1 < 0.5) then {_xx = _xx*(-1)};
  78. //if (random 1 < 0.5) then {_yy = _yy*(-1)};
  79. _start = [(getposATL (vehicle player) select 0) + _xx,(getposATL (vehicle player) select 1) + _yy,0];
  80. if (count (_start nearRoads 300) > 0) then {_start = getposATL ((_start nearRoads 300) select 0);};
  81. };
  82. _xx = random (2000);
  83. _yy = 2000 - _xx;
  84. if (_start select 0 > 0) then {_xx = _xx*(-1)};
  85. if (random 1 < 0.5) then {_yy = _yy*(-1)};
  86. _end = [(getposATL (vehicle player) select 0) + _xx,(getposATL (vehicle player) select 1) + _yy,0];
  87. if (count (_end nearRoads 300) > 0) then {_end = getposATL ((_end nearRoads 300) select 0);};
  88. while {surfaceIsWater [_end select 0, _end select 1]} do {
  89. sleep 0.5;
  90. _xx = random (2000);
  91. _yy = 2000 - _xx;
  92. if (_start select 0 > 0) then {_xx = _xx*(-1)};
  93. if (random 1 < 0.5) then {_yy = _yy*(-1)};
  94. _end = [(getposATL (vehicle player) select 0) + _xx,(getposATL (vehicle player) select 1) + _yy,0];
  95. if (count (_end nearRoads 300) > 0) then {_end = getposATL ((_end nearRoads 300) select 0);};
  96. };
  97. if (count VehicleGroups < EVEHMAX) then {
  98. _class = VarVEH call BIS_fnc_selectRandom;
  99. _nul = [_class,_start,_end,EAST,_diir,[], 1] execVM "AmbientScoutCar.sqf";
  100. };
  101. if (random 1 < 0.1 && count VehicleGroups < EVEHMAX) then {
  102. sleep 5;
  103. _class = VarVEH call BIS_fnc_selectRandom;
  104. _nul = [_class,_start,_end,EAST,_diir,[], 1] execVM "AmbientScoutCar.sqf";
  105. };
  106. if (random 1 < 0.05 && count VehicleGroups < EVEHMAX) then {
  107. sleep 5;
  108. _class = VarVEH call BIS_fnc_selectRandom;
  109. _nul = [_class,_start,_end,EAST,_diir,[], 1] execVM "AmbientScoutCar.sqf";
  110. };
  111. if (random 1 < 0.05 && count VehicleGroups < EVEHMAX) then {
  112. sleep 5;
  113. _class = VarVEH call BIS_fnc_selectRandom;
  114. _nul = [_class,_start,_end,EAST,_diir,[], 1] execVM "AmbientScoutCar.sqf";
  115. };
  116. };
  117. };
  118. while {count Pgroups > VarPG && {_x knowsabout vehicle player > 0.1} count (Pgroups + HeliGroups+ CampGroups + VehicleGroups + AirGroups) == 0} do {sleep 10;};
  119. };
  120. //FAST REINFORCEMENTS
  121. _nul = [2] execVM "Music.sqf";
  122. if (!isNil"debugi") then {hint "State - Fast Reinf";};
  123. VarAlarm = true;
  124.  
  125. {if (behaviour leader _x != "COMBAT") then {_x setbehaviour "AWARE";};} foreach Pgroups;
  126. _posPl=getposATL vehicle player;
  127. {
  128. while {(count (waypoints _x)) > 0} do
  129. {
  130. deleteWaypoint ((waypoints _x) select 0);
  131. };
  132. _wp = _x addWaypoint [[(_posPl select 0) + random (300) - random (300),(_posPl select 1) + random (300) - random (300),0], 0];
  133. } foreach Pgroups;
  134. if (VARCoLoop) then {_nul = [] SPAWN FUNKTIO_CL;};
  135.  
  136.  
  137.  
  138. if (random 1 < 0.3) then {
  139. if (VarTRChop && VarRes > 0.3 && count Pgroups < (VarPG + 1)) then {
  140. _tank = ["Mi17_TK_EP1","Mi17_TK_EP1","UH1H_TK_EP1","UH1H_TK_EP1","UH1H_TK_EP1","Mi24_D_TK_EP1","An2_TK_EP1"];
  141. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_tank = ["Mi17_TK_2035","Mi24_P_TK_2035","Mi24_V_TK_2035"];};
  142. _tank = _tank call BIS_fnc_selectRandom;
  143. _inf = ["TK_Soldier_SL_EP1","TK_Soldier_B_EP1","TK_Soldier_Engineer_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_EP1","TK_Soldier_EP1"];
  144. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_inf = ["TK_Soldier_SL","TK_Soldier_Medic","TK_Soldier_AR","TK_Soldier_MG","TK_Soldier","TK_Soldier","TK_Soldier"];};
  145. _nul = [[8135.96,1927.03,0], [(getposATL (vehicle player) select 0)+((random 500)-(random 500)),(getposATL (vehicle player) select 1)+((random 500)-(random 500)),0], [(getposATL (vehicle player) select 0)+((random 500)-(random 500))*0.5,(getposATL (vehicle player) select 1)+((random 500)-(random 500))*0.5,0], EAST, 290, _tank, 50,_inf,[0.6,0.7],0] execFSM "ChopperTransport.fsm";
  146. if (random 1 < 0.1 && count Pgroups < VarPG) then {
  147. _tank = ["Mi17_TK_EP1","Mi17_TK_EP1","UH1H_TK_EP1","UH1H_TK_EP1","UH1H_TK_EP1","Mi24_D_TK_EP1","An2_TK_EP1"];
  148. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_tank = ["Mi17_TK_2035","Mi24_P_TK_2035","Mi24_V_TK_2035"];};
  149. _tank = _tank call BIS_fnc_selectRandom;
  150. _inf = ["TK_Soldier_SL_EP1","TK_Soldier_B_EP1","TK_Soldier_Engineer_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_EP1","TK_Soldier_EP1"];
  151. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_inf = ["TK_Soldier_SL","TK_Soldier_Medic","TK_Soldier_AR","TK_Soldier_MG","TK_Soldier","TK_Soldier","TK_Soldier"];};
  152. _nul = [[8135.96,1927.03,0], [(getposATL (vehicle player) select 0)+((random 500)-(random 500)),(getposATL (vehicle player) select 1)+((random 500)-(random 500)),0], [(getposATL (vehicle player) select 0)+((random 500)-(random 500))*0.5,(getposATL (vehicle player) select 1)+((random 500)-(random 500))*0.5,0], EAST, 290, _tank, 50,_inf,[0.6,0.7],0] execFSM "ChopperTransport.fsm";
  153. };
  154. if (random 1 < 0.1 && count Pgroups < VarPG) then {
  155. _tank = ["Mi17_TK_EP1","Mi17_TK_EP1","UH1H_TK_EP1","UH1H_TK_EP1","UH1H_TK_EP1","Mi24_D_TK_EP1","An2_TK_EP1"];
  156. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_tank = ["Mi17_TK_2035","Mi24_P_TK_2035","Mi24_V_TK_2035"];};
  157. _tank = _tank call BIS_fnc_selectRandom;
  158. _inf = ["TK_Soldier_SL_EP1","TK_Soldier_B_EP1","TK_Soldier_Engineer_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_EP1","TK_Soldier_EP1"];
  159. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_inf = ["TK_Soldier_SL","TK_Soldier_Medic","TK_Soldier_AR","TK_Soldier_MG","TK_Soldier","TK_Soldier","TK_Soldier"];};
  160. _nul = [[8135.96,1927.03,0], [(getposATL (vehicle player) select 0)+((random 500)-(random 500)),(getposATL (vehicle player) select 1)+((random 500)-(random 500)),0], [(getposATL (vehicle player) select 0)+((random 500)-(random 500))*0.5,(getposATL (vehicle player) select 1)+((random 500)-(random 500))*0.5,0], EAST, 290, _tank, 50,_inf,[0.6,0.7],0] execFSM "ChopperTransport.fsm";
  161. };
  162. };
  163. } else {
  164. _xx = random (1100);
  165. _yy = 1100 - _xx;
  166. if (random 1 < 0.5) then {_xx = _xx*(-1)};
  167. if (random 1 < 0.5) then {_yy = _yy*(-1)};
  168. _start = [(getposATL (vehicle player) select 0) + _xx,(getposATL (vehicle player) select 1) + _yy,0];
  169. _st = [_start, 400,"(1 - forest) * (1 - sea) * (1 - houses)"] CALL FUNKTIO_POS;
  170. _start = (_st select 0) select 0;
  171. while {surfaceIsWater [_start select 0, _start select 1]} do {
  172. sleep 0.5;
  173. _xx = random (1100);
  174. _yy = 1100 - _xx;
  175. if (random 1 < 0.5) then {_xx = _xx*(-1)};
  176. if (random 1 < 0.5) then {_yy = _yy*(-1)};
  177. _start = [(getposATL (vehicle player) select 0) + _xx,(getposATL (vehicle player) select 1) + _yy,0];
  178. _st = [_start, 400,"(1 - forest) * (1 - sea) * (1 - houses)"] CALL FUNKTIO_POS;
  179. _start = (_st select 0) select 0;
  180. };
  181. _nul = [_start,_posPl] SPAWN {
  182. private ["_start","_posPl"];
  183. _start = _this select 0;
  184. _posPl = _this select 1;
  185. sleep (20+(random 20));
  186. _tank = ["M113_TK_EP1","M113_TK_EP1","BTR60_TK_EP1","BMP2_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_TK_EP1","V3S_TK_EP1"];
  187. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_tank = ["Ural_Open_TK_2035","Ural_TK_2035","BTR90_TK_2035","BMP3_TK_2035","BMP2_TK_2035"];};
  188. if (count Pgroups < (VarPG + 1)) then {
  189. _tank = _tank call BIS_fnc_selectRandom;
  190. _inf = ["TK_Soldier_SL_EP1","TK_Soldier_B_EP1","TK_Soldier_Engineer_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_EP1","TK_Soldier_EP1"];
  191. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_inf = ["TK_Soldier_SL","TK_Soldier_Medic","TK_Soldier_AR","TK_Soldier_MG","TK_Soldier","TK_Soldier","TK_Soldier"];};
  192. _nul = [_start, _posPl, _posPl, EAST, 90, _tank,_inf,[0.6,0.7],0] execFSM "LandTransport.fsm";
  193. };
  194. if (random 1 < 0.1 && count Pgroups < VarPG) then {
  195. sleep 10;
  196. _tank = ["M113_TK_EP1","M113_TK_EP1","BTR60_TK_EP1","BMP2_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_TK_EP1","V3S_TK_EP1"];
  197. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_tank = ["Ural_Open_TK_2035","Ural_TK_2035","BTR90_TK_2035","BMP3_TK_2035","BMP2_TK_2035"];};
  198. _tank = _tank call BIS_fnc_selectRandom;
  199. _inf = ["TK_Soldier_SL_EP1","TK_Soldier_B_EP1","TK_Soldier_Engineer_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_EP1","TK_Soldier_EP1"];
  200. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_inf = ["TK_Soldier_SL","TK_Soldier_Medic","TK_Soldier_AR","TK_Soldier_MG","TK_Soldier","TK_Soldier","TK_Soldier"];};
  201. _nul = [_start, _posPl, _posPl, EAST, 90, _tank,_inf,[0.6,0.7],0] execFSM "LandTransport.fsm";
  202. };
  203. if (random 1 < 0.1 && count Pgroups < VarPG) then {
  204. sleep 10;
  205. _tank = ["M113_TK_EP1","M113_TK_EP1","BTR60_TK_EP1","BMP2_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_TK_EP1","V3S_TK_EP1"];
  206. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_tank = ["Ural_Open_TK_2035","Ural_TK_2035","BTR90_TK_2035","BMP3_TK_2035","BMP2_TK_2035"];};
  207. _tank = _tank call BIS_fnc_selectRandom;
  208. _inf = ["TK_Soldier_SL_EP1","TK_Soldier_B_EP1","TK_Soldier_Engineer_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_EP1","TK_Soldier_EP1"];
  209. if (isClass(configFile >> "cfgVehicles" >> "BMP2_TK_2035")) then {_inf = ["TK_Soldier_SL","TK_Soldier_Medic","TK_Soldier_AR","TK_Soldier_MG","TK_Soldier","TK_Soldier","TK_Soldier"];};
  210. _nul = [_start, _posPl, _posPl, EAST, 90, _tank,_inf,[0.6,0.7],0] execFSM "LandTransport.fsm";
  211. };
  212. };
  213. };
  214.  
  215. sleep (110 + (random 70));
  216. //SLOW REINFORCEMENTS
  217. _nul = [3] execVM "Music.sqf";
  218. if (!isNil"debugi") then {hint "State - Slow Reinf";};
  219. if (random 1 < VarArty) then {_nul = [_posPl] execVM "AIUseArty.sqf";};
  220.  
  221. _nul = [_posPl] execVM "EnemySupport.sqf";
  222. _nul = [] execVM "FriendlySupport.sqf";
  223.  
  224. if (random 1 < 0.1) then {_nul = [_posPl] execVM "EnemySupport.sqf";};
  225. if (random 1 < 0.1) then {_nul = [] execVM "FriendlySupport.sqf";};
  226. sleep 400;
  227. //ALIVE GROUPS TO PATROL
  228. {
  229. while {(count (waypoints _x)) > 0} do
  230. {
  231. deleteWaypoint ((waypoints _x) select 0);
  232. };
  233. [_x, [(_posPl select 0) + random (1100) - random (1100),(_posPl select 1) + random (1100) - random (1100),0],600] call bis_fnc_taskPatrol;
  234. } foreach Pgroups;
  235. _nul = [1] execVM "Music.sqf";
  236. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement