Advertisement
Guest User

server_fncs.sqf

a guest
Mar 6th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.14 KB | None | 0 0
  1. remove_carcass_fnc = {
  2. // Deletes dead bodys and destroyed vehicles. Code by BIS
  3. _unit = _this select 0;
  4. if (not (_unit isKindOf "Man")) then
  5. {
  6. {_x setpos position _unit} forEach crew _unit;
  7. sleep 45.0;
  8. deletevehicle _unit;
  9. };
  10. if (_unit isKindOf "Man") then
  11. {
  12. if(not ((vehicle _unit) isKindOf "Man")) then {_unit setpos (position vehicle _unit)};
  13. sleep 60.0;
  14. hideBody _unit;
  15. _unit removeAllEventHandlers "killed";
  16. };
  17. };
  18. BTC_m_fnc_only_server = {
  19. _array = _this select 1;
  20. _type = _array select 0;
  21. if (_type isEqualTo 0) then
  22. {
  23. private ["_veh"];
  24. _veh = _array select 1;
  25. _veh spawn BTC_server_repair_wreck;
  26. }
  27. else
  28. {};
  29. };
  30. BTC_AI_init = {
  31. // sets skill of a group if ASR AI is not detected
  32. _group = _this select 0;
  33. if (isClass(configFile >> "cfgPatches" >> "asr_ai_main")) exitWith {};
  34. {
  35. _x setSkill ["aimingAccuracy", BTC_AI_skill];
  36. _x setSkill ["aimingShake", 0.6];
  37. _x setSkill ["aimingSpeed", 0.5];
  38. _x setSkill ["endurance", 0.6];
  39. _x setSkill ["spotTime", 0.5];
  40. _x setSkill ["courage", 0.4];
  41. _x setSkill ["spotDistance", 0.4];
  42. _x setSkill ["reloadSpeed", 1];
  43. if (leader _group isEqualTo _x) then
  44. {
  45. _x setSkill ["commanding", 1];
  46. };
  47. } foreach units _group;
  48. };
  49. BTC_AIunit_init = {
  50. // sets skill of a unit if ASR AI is not detected
  51. _unit = _this select 0;
  52. if (isClass(configFile >> "cfgPatches" >> "asr_ai_main")) exitWith {};
  53. _unit setSkill ["aimingAccuracy", BTC_AI_skill];
  54. _unit setSkill ["aimingShake", 0.6];
  55. _unit setSkill ["aimingSpeed", 0.5];
  56. _unit setSkill ["endurance", 0.6];
  57. _unit setSkill ["spotTime", 0.5];
  58. _unit setSkill ["courage", 0.4];
  59. _unit setSkill ["spotDistance", 0.5];
  60. _unit setSkill ["reloadSpeed", 1];
  61. if (_unit isEqualTo (leader group _x)) then
  62. {
  63. _unit setSkill ["commanding", 1];
  64. };
  65. };
  66. paint_heli_fnc = {
  67. private "_veh";
  68. _veh = _this select 0;
  69.  
  70. switch (true) do {
  71. case (toLower (worldName) isEqualTo "altis"):
  72. {// dark grey
  73. _veh setObjectTextureGlobal [0,"#(argb,8,8,3)color(0.518,0.519,0.455,0.2)"];
  74. _veh setObjectTextureGlobal [1,"#(argb,8,8,3)color(0.518,0.519,0.455,0.2)"];
  75. _veh setObjectTextureGlobal [2,"#(argb,8,8,3)color(0.518,0.519,0.455,0.2)"];
  76. };
  77. case (toLower (worldName) isEqualTo "fallujah"):
  78. {// sand color
  79. _veh setObjectTextureGlobal [0,"#(argb,8,8,3)color(0.96,0.88,0.69,0.35)"];
  80. _veh setObjectTextureGlobal [1,"#(argb,8,8,3)color(0.96,0.88,0.69,0.35)"];
  81. _veh setObjectTextureGlobal [2,"#(argb,8,8,3)color(0.96,0.88,0.69,0.35)"];
  82. };
  83. case (toLower (worldName) isEqualTo "pja305"):
  84. {// green color
  85. _veh setObjectTextureGlobal [0,"#(argb,8,8,3)color(0.333,0.445,0.18,0.1)"];
  86. _veh setObjectTextureGlobal [1,"#(argb,8,8,3)color(0.333,0.445,0.18,0.1)"];
  87. _veh setObjectTextureGlobal [2,"#(argb,8,8,3)color(0.333,0.445,0.18,0.1)"];
  88. };
  89. case (toLower (worldName) isEqualTo "takistan"):
  90. {// sand color
  91. _veh setObjectTextureGlobal [0,"#(argb,8,8,3)color(0.96,0.88,0.69,0.35)"];
  92. _veh setObjectTextureGlobal [1,"#(argb,8,8,3)color(0.96,0.88,0.69,0.35)"];
  93. _veh setObjectTextureGlobal [2,"#(argb,8,8,3)color(0.96,0.88,0.69,0.35)"];
  94. };
  95. case (toLower (worldName) isEqualTo "zargabad"):
  96. {// sand color
  97. _veh setObjectTextureGlobal [0,"#(argb,8,8,3)color(0.96,0.88,0.69,0.35)"];
  98. _veh setObjectTextureGlobal [1,"#(argb,8,8,3)color(0.96,0.88,0.69,0.35)"];
  99. _veh setObjectTextureGlobal [2,"#(argb,8,8,3)color(0.96,0.88,0.69,0.35)"];
  100. };
  101. case (toLower (worldName) isEqualTo "stratis"):
  102. {// dark grey
  103. _veh setObjectTextureGlobal [0,"#(argb,8,8,3)color(0.518,0.519,0.455,0.2)"];
  104. _veh setObjectTextureGlobal [1,"#(argb,8,8,3)color(0.518,0.519,0.455,0.2)"];
  105. _veh setObjectTextureGlobal [2,"#(argb,8,8,3)color(0.518,0.519,0.455,0.2)"];
  106. };
  107. default {};
  108. };
  109. };
  110. anti_collision = {
  111. //fixes wheels stuck in ground/vehicles exploding when entering bug
  112. private "_obj";
  113. _obj = _this select 0;
  114. _obj setVectorUP (surfaceNormal [(getPosATL _obj) select 0,(getPosATL _obj) select 1]);
  115. true
  116. };
  117. add_UAV_crew = {
  118. // add crew to UAV/UGV.
  119. private "_veh";
  120. _veh = _this select 0;
  121. createVehicleCrew _veh;
  122. };
  123. add_veh_flare = {
  124. // add flares
  125. private "_veh";
  126. _veh = _this select 0;
  127. _veh addweapon "CMFlareLauncher";
  128. _veh addmagazine "120Rnd_CMFlare_Chaff_Magazine";
  129. };
  130. remove_veh_ti = {
  131. // remove vehicle thermal imaging
  132. private "_veh";
  133. _veh = _this select 0;
  134. _veh disableTIEquipment true;
  135. };
  136. fnc_ghst_build_positions = {
  137. /*
  138. //building positions function for one building
  139. //_build_positions = _building call fnc_ghst_find_positions;
  140. */
  141. private ["_i","_p","_b"];
  142. _i = 0;
  143. _b = [];
  144. _build_positions = [];
  145. _pIsEmpty = false;
  146. while { ! _pIsEmpty } do
  147. {
  148. _p = _this buildingPos _i;
  149. if ( str _p != "[0,0,0]" ) then
  150. {
  151. _b = _b + [_p];
  152. }
  153. else
  154. {
  155. _pIsEmpty = true;
  156. };
  157. _i = _i + 1;
  158. };
  159. if ((count _b > 0) and !(isNil "_b")) then {
  160. _build_positions = _build_positions + _b;
  161. };
  162. _build_positions
  163. };
  164. fnc_ghst_rand_position = {
  165. /*
  166. //Find Random Position in a rectangle radius
  167. //_pos = [[1,1,2],[300,500,60]] call fnc_ghst_rand_position;
  168. //_pos = ["marker",[]] call fnc_ghst_rand_position;
  169. */
  170. private ["_dir","_position_mark","_radx","_rady","_pos","_xpos","_ypos"];
  171.  
  172. _pos_mark = _this select 0;//position or marker
  173. _radarray = _this select 1;//array of x,y radius and direction
  174. _wateronly = if (count _this > 2) then {_this select 2;} else {false;};//get position in water only
  175.  
  176. if (typename _pos_mark == typename []) then {
  177. _position_mark = _pos_mark;//position array
  178. _radx = _radarray select 0;//radius A if position is Not a marker
  179. _rady = _radarray select 1;//radius B if position is Not a marker
  180. _dir = _radarray select 2;
  181. if (isnil "_dir") then {
  182. _dir = (random 360) * -1;//random direction if not given
  183. } else {
  184. _dir = (_radarray select 2) * -1;//specified direction
  185. };
  186. }else{
  187. _position_mark = (getmarkerpos _pos_mark);//getmarker position
  188. _radx = (getMarkerSize _pos_mark) select 0;//radius A if position is a marker
  189. _rady = (getMarkerSize _pos_mark) select 1;//radius b if position is a marker
  190. _dir = (markerDir _pos_mark) * -1;//Marker Direction
  191. };
  192. _loop = true;
  193. while {_loop} do {
  194. _rx = (random (_radx * 2)) - _radx;
  195. _ry = (random (_rady * 2)) - _rady;
  196. if (_dir != 0) then {
  197. _xpos = (abs(_position_mark select 0)) + ((cos _dir) * _rx - (sin _dir) * _ry);
  198. _ypos = (abs(_position_mark select 1)) + ((sin _dir) * _rx + (cos _dir) * _ry);
  199. }else{
  200. _xpos = (abs(_position_mark select 0)) + _rx;
  201. _ypos = (abs(_position_mark select 1)) + _ry;
  202. };
  203. _pos = [_xpos,_ypos,0];
  204. if (!_wateronly and !(surfaceIsWater [_pos select 0,_pos select 1])) then {_loop = false};
  205. if (_wateronly and (surfaceIsWater [_pos select 0,_pos select 1])) then {_loop = false};
  206. };
  207. _pos
  208. };
  209. JIG_ammmoCache_damage = {
  210. // Damage is restricted to specific items, delete cache box, add score, side chat message,a nd vehicle paradrop
  211. _cache = _this select 0;
  212. _damage = _this select 2;
  213. _source = _this select 3;
  214. _ammo = _this select 4;
  215. _out = 0;
  216.  
  217. if ((_ammo == "satchelCharge_remote_ammo") || (_ammo == "demoCharge_remote_ammo") || (_ammo == "satchelCharge_remote_ammo_scripted") || (_ammo == "demoCharge_remote_ammo_scripted")) then {
  218. _cache spawn {
  219. sleep 0.1;
  220. _this setDamage 1;
  221. sleep 2;
  222.  
  223. //Block from Insurgency by Fireball, Kol9yN
  224. private ["_pos","_dur","_count","_veh"];
  225. _pos = getPosATL(_this);
  226. curTime = time;
  227. _dur = 5 + random 5;
  228. deleteVehicle _this;
  229. "Bo_Air_LGB" createVehicle _pos;
  230. while{ true }do{
  231. _veh = "Bo_Air_LGB" createVehicle _pos;
  232. _veh setVectorDirAndUp [[(random 1) -0.5,(random 1)-0.5,(random 1) -0.5],[0,(random -1.5),(random 1) -0.5]];//Jig adding
  233. //if (random 100 > 70) then { "Cluster_120mm_AMOS" createVehicle _pos; };
  234. if ((time - curTime) > _dur) exitWith { "Bo_Air_LGB" createVehicle _pos; };
  235. sleep random 1;
  236. };
  237. };
  238. [_source] spawn {
  239. _source = _this select 0;
  240. if (side _source == INS_Blu_side) then
  241. {
  242. _pScore = 20;
  243. _source addrating 2000;
  244. _source addScore _pScore;
  245. paddscore = [_source, _pscore]; publicVariable "paddscore";
  246. [West,"HQ"] sideChat "+20 points";
  247. if (!isNull _source) then {
  248. rewardp = getPlayerUID _source;
  249. publicVariable "rewardp";
  250. _destroyerName = name _source;
  251. _text = format ["%1, Destroyed Ammo Cache",_destroyerName];
  252. [[_text],"JIG_MPsideChatWest_fnc"] call BIS_fnc_mp;
  253. };
  254. }else{
  255. _pScore = -10;
  256. _source addScore _pScore;
  257. paddscore = [_source, _pscore]; publicVariable "paddscore";
  258. [East,"HQ"] sideChat "-10 points";
  259. };
  260. };
  261. };
  262. _out
  263. };
  264. JIG_tower_damage = {
  265. // Damage is restricted to specific items, delete cache box, add score, and side chat message
  266. _tower = _this select 0;
  267. _damage = _this select 2;
  268. _source = _this select 3;
  269. _ammo = _this select 4;
  270. _out = 0;
  271.  
  272. if ((_ammo == "satchelCharge_remote_ammo") || (_ammo == "demoCharge_remote_ammo") || (_ammo == "satchelCharge_remote_ammo_scripted") || (_ammo == "demoCharge_remote_ammo_scripted")) then {
  273. _tower spawn {
  274. sleep 0.1;
  275. _this setDamage 1;
  276. sleep 3;
  277. deleteVehicle _this;
  278. };
  279. if (!isNull _source) then {
  280. _destroyerName = name _source;
  281. _text = format ["%1, Destroyed Tower",_destroyerName];
  282. [[_text],"JIG_MPsideChatWest_fnc"] call BIS_fnc_mp;
  283. };
  284. };
  285. _out
  286. };
  287. killed_ss_bmbr_fnc = {
  288. // Add point back to killer of civilian bomber
  289. _bmbr = _this select 0;
  290. _killer = _this select 1;
  291. _pScore = 1;
  292. _killer addrating 2000;
  293. _killer addScore _pScore;
  294. paddscore = [_killer, _pscore]; publicVariable "paddscore";
  295. };
  296. bmbr_spawnpos_fnc = {
  297. // Add point back to killer of Suicide Bomber
  298. private ["_posnotfound","_counter","_goodPos","_dis","_cooX","_cooY","_SpawnBmbrRandomPos","_newPos","_marker2","_sudoNewPos","_eastbase1a","_westbase1a","_westbase2a","_wheX","_wheY","_disX","_disY"];
  299.  
  300. _cooX = _this select 0;
  301. _cooY = _this select 1;
  302. //_dis = 95;
  303. _disX = [60,85] call BIS_fnc_randomInt;
  304. _disY = [60,85] call BIS_fnc_randomInt;
  305. _wheX = random (_disX*2)-_disX;
  306. _wheY = random (_disY*2)-_disY;
  307. //_SpawnBmbrRandomPos = [_cooX,_cooY,0];
  308. _SpawnBmbrRandomPos = [_cooX+_wheX,_cooY+_wheY,0];
  309. _posnotfound = [];
  310. _goodPos = [];
  311. _counter = 0;
  312.  
  313. _newPos = _SpawnBmbrRandomPos isFlatEmpty [15,384,0.5,2,0,false,ObjNull];
  314. while {(count _newPos) < 1} do {
  315. _newPos = _SpawnBmbrRandomPos isFlatEmpty [10,384,0.7,2,0,false,ObjNull];
  316. _counter = _counter + 1;
  317. if (DebugEnabled > 0) then {hintsilent "finding suitable pos for sstBomber";};
  318. if (_counter > 5) exitWith {_goodPos = [];};
  319. sleep 1;
  320. };
  321.  
  322. if (!(_newPos isEqualTo [])) then
  323. {
  324. if (!isNil "tempBMRBmrkr") then {deleteMarkerLocal "tempBMRBmrkr";};
  325. _marker2 = createMarkerLocal ["tempBMRBmrkr", _newPos];
  326. _marker2 setMarkerShapeLocal "ELLIPSE";
  327. "tempBMRBmrkr" setMarkerSizeLocal [1, 1];
  328. "tempBMRBmrkr" setMarkerShapeLocal "ICON";
  329. "tempBMRBmrkr" setMarkerTypeLocal "EMPTY";//"mil_dot" , "EMPTY"
  330. };
  331.  
  332. if (_newPos isEqualTo []) exitWith {_posnotfound;};
  333. _newPos
  334. };
  335. sta_spawnpos_fnc = {
  336. // Static Objective Placement
  337. private ["_posnotfound","_counter","_dis","_cooX","_cooY","_wheX","_wheY","_SpawnGunnerRandomPos","_newPos","_marker2","_sudoNewPos","_eastbase1a","_westbase1a","_westbase2a"];
  338.  
  339. _cooX = _this select 0;
  340. _cooY = _this select 1;
  341. _dis = 150;
  342. _wheX = random (_dis*2)-_dis;
  343. _wheY = random (_dis*2)-_dis;
  344. _SpawnGunnerRandomPos = [_cooX+_wheX,_cooY+_wheY,0];
  345. _posnotfound = [];
  346. _counter = 0;
  347. _newPos = _SpawnGunnerRandomPos isFlatEmpty [20,384,0.4,2,0,false,ObjNull];
  348.  
  349. while {(count _newPos) < 1} do {
  350. _newPos = _SpawnGunnerRandomPos isFlatEmpty [14,384,0.6,2,0,false,ObjNull];
  351. _counter = _counter + 1;
  352. if (_counter > 5) exitWith {_posnotfound = [];};
  353. sleep 0.5;
  354. };
  355.  
  356. if (_newPos isEqualTo []) exitWith {_posnotfound;};
  357. _newPos;
  358. };
  359. miss_object_pos_fnc = {
  360. // Objective position
  361. private ["_posnotfound","_counter","_goodPos","_dis","_cooX","_cooY","_wheX","_wheY","_ObjRandomPos","_newPos","_marker2"];
  362.  
  363. _cooX = _this select 0;
  364. _cooY = _this select 1;
  365. _dis = 150;
  366. _wheX = random (_dis*2)-_dis;
  367. _wheY = random (_dis*2)-_dis;
  368. _ObjRandomPos = [_cooX+_wheX,_cooY+_wheY,0];
  369. _posnotfound = [];
  370. _goodPos = [];
  371. _newPos = _ObjRandomPos isFlatEmpty [25,384,0.4,2,0,false,ObjNull];
  372.  
  373. while {(count _newPos) < 1} do {
  374. _newPos = _ObjRandomPos isFlatEmpty [20,384,0.6,2,0,false,ObjNull];
  375. _dis = _dis + 50;
  376. _wheX = random (_dis*2)-_dis;
  377. _wheY = random (_dis*2)-_dis;
  378. _ObjRandomPos = [_cooX+_wheX,_cooY+_wheY,0];
  379. if (_dis > 550) exitWith {_goodPos = [];};
  380. sleep 0.5;
  381. };
  382.  
  383. if (!(_newPos isEqualTo [])) then
  384. {
  385. if (!isNil "tempObjMkr") then {deleteMarkerLocal "tempObjMkr";};
  386. _marker2 = createMarkerLocal ["tempObjMkr", _newPos];
  387. _marker2 setMarkerShapeLocal "ELLIPSE";
  388. "tempObjMkr" setMarkerSizeLocal [1, 1];
  389. "tempObjMkr" setMarkerShapeLocal "ICON";
  390. "tempObjMkr" setMarkerTypeLocal "mil_dot";//"mil_dot" , "EMPTY"
  391. };
  392. if (_newPos isEqualTo []) exitWith {_posnotfound;};
  393. _newPos;
  394. };
  395. remove_opfor_NVG = {
  396. // Remove NVG from all existing enemy units, force flashlights. - By Constance
  397. {
  398. if (side _x == resistance) then {
  399. //_x unassignItem "NVGoggles_INDEP";
  400. //_x removeItem "NVGoggles_INDEP";
  401. }else{
  402. if (side _x == east) then {
  403. //_x unassignItem "NVGoggles_OPFOR";
  404. //_x removeItem "NVGoggles_OPFOR";
  405. };
  406. };
  407. _x addPrimaryWeaponItem "acc_flashlight";
  408. _x enableGunLights "forceOn";//"AUTO"
  409. } foreach allUnits;
  410. };
  411. JIPmkr_updateClient_fnc = {
  412. // Local client maker states update
  413. _coloredMarkers=server getvariable "IntelMarkers";
  414. if (isNil {server getVariable "IntelMarkers"}) exitWith {};
  415. {
  416. _x setMarkerType (getMarkerType _x);
  417. _x setMarkercolor (getMarkercolor _x);
  418. _x setMarkerAlpha (MarkerAlpha _x);
  419. } foreach _coloredMarkers;
  420. };
  421. find_bombee_fnc = {
  422. // Find suicide bomber player target
  423. private ["_missionPlayers","_bombee_speed"];
  424. _missionPlayers = playableUnits;
  425.  
  426. {
  427. _bombee_speed = speed _x;
  428. _pos = (getPosATL _x);
  429. if ((_bombee_speed > 8) || (_pos select 2 > 3)) then {_missionPlayers = _missionPlayers - [_x];};
  430. } foreach _missionPlayers;// exclude players in moving vehicles, exclude above ground players such as players in aircraft or in high structures
  431.  
  432. {
  433. if (side _x isEqualTo east) then {_missionPlayers = _missionPlayers - [_x];};
  434. } foreach _missionPlayers;// exclude east players
  435.  
  436. if (count _missionPlayers > 0) then {
  437. random_w_player4 = _missionPlayers select (floor (random (count _missionPlayers)));
  438. publicVariable "random_w_player4";
  439. };
  440. true
  441. };
  442. spawn_Op4_grp = {
  443. // Creates infantry group
  444. private ["_newZone","_grp_size","_grp","_unit_type","_damage","_unit"];
  445. _newZone = _this select 0;
  446. _grp_size = _this select 1;
  447. _grp = createGroup INS_Op4_side;
  448.  
  449. for "_i" from 0 to (_grp_size - 2) do
  450. {
  451. _unit_type = INS_men_list select (round (random ((count INS_men_list) - 1)));
  452. _unit = _grp createUnit [_unit_type, _newZone, [], 0, "NONE"];
  453. sleep 0.5;
  454. };
  455. _grp createUnit [INS_Op4_medic, _newZone, [], 0, "NONE"];
  456. sleep 0.5;
  457.  
  458. if (BTC_p_skill isEqualTo 1) then {[_grp] call BTC_AI_init;};
  459. (group _unit) setVariable ["zbe_cacheDisabled",false];
  460.  
  461. {
  462. _x addeventhandler ["killed","(_this select 0) spawn {[_this] call remove_carcass_fnc}"];
  463. if (EOS_DAMAGE_MULTIPLIER != 1) then
  464.  
  465. {
  466. _x removeAllEventHandlers "HandleDamage";
  467. _x addEventHandler ["HandleDamage",{_damage = (_this select 2)*EOS_DAMAGE_MULTIPLIER;_damage}];
  468. };
  469. } forEach (units _grp);
  470.  
  471. _grp
  472. };
  473. spawn_Op4_StatDef = {
  474. // Static Gunner group creation and placements
  475. private ["_newZone","_grp_size","_stat_grp","_offset_pos1","_offset_pos2","_offset_pos3","_stat_type1","_stat_type2","_stat_type3","_unit_type","_damage","_static1","_static2","_static3","_StaticArray1","_StaticArray2","_StaticArray3"];
  476.  
  477. _newZone = _this select 0;
  478. _grp_size = _this select 1;
  479. _stat_grp = createGroup INS_Op4_side;
  480. _stat_type1 = INS_Op4_stat_weps select 0;
  481. _stat_type2 = INS_Op4_stat_weps select 1;
  482. _stat_type3 = INS_Op4_stat_weps select 2;
  483. _offset_pos1 = [(_newZone select 0) + 5, (_newZone select 1) + 5, 0];
  484. _offset_pos2 = [(_newZone select 0) - 5, (_newZone select 1) + 5, 0];
  485. _offset_pos3 = [(_newZone select 0), (_newZone select 1) - 5, 0];
  486.  
  487. for "_i" from 0 to (_grp_size - 2) do
  488. {
  489. _unit_type = INS_men_list select (round (random ((count INS_men_list) - 1)));
  490. _stat_grp createUnit [_unit_type, _newZone, [], 0, "NONE"];
  491. sleep 0.5;
  492. };
  493. _stat_grp createUnit [INS_Op4_Eng, _newZone, [], 0, "NONE"];
  494. sleep 0.5;
  495.  
  496. if (BTC_p_skill isEqualTo 1) then {[_stat_grp] call BTC_AI_init;};
  497.  
  498. {
  499. _x addeventhandler ["killed","(_this select 0) spawn {[_this] call remove_carcass_fnc}"];
  500. if (EOS_DAMAGE_MULTIPLIER != 1) then
  501.  
  502. {
  503. _x removeAllEventHandlers "HandleDamage";
  504. _x addEventHandler ["HandleDamage",{_damage = (_this select 2)*EOS_DAMAGE_MULTIPLIER;_damage}];
  505. };
  506. } forEach (units _stat_grp);
  507.  
  508. _static1 = createVehicle [_stat_type1, _offset_pos1, [], 0, "None"]; sleep jig_tvt_globalsleep;
  509. _static2 = createVehicle [_stat_type2, _offset_pos2, [], 0, "None"]; sleep jig_tvt_globalsleep;
  510. _static3 = createVehicle [_stat_type1, _offset_pos3, [], 0, "None"]; sleep jig_tvt_globalsleep;
  511.  
  512. _static1 setDir 0;
  513. _static2 setDir 120;
  514. _static3 setDir 240;
  515. (units _stat_grp select 0) assignAsGunner _static1; sleep jig_tvt_globalsleep;
  516. (units _stat_grp select 1) assignAsGunner _static2; sleep jig_tvt_globalsleep;
  517. (units _stat_grp select 2) assignAsGunner _static3; sleep jig_tvt_globalsleep;
  518. (units _stat_grp select 0) moveInGunner _static1; sleep jig_tvt_globalsleep;
  519. (units _stat_grp select 1) moveInGunner _static2; sleep jig_tvt_globalsleep;
  520. (units _stat_grp select 2) moveInGunner _static3; sleep jig_tvt_globalsleep;
  521.  
  522. _StaticArray1 = [_static1];
  523. _StaticArray2 = [_static2];
  524. _StaticArray3 = [_static1,_static2,_static3];
  525. sleep 2;
  526. nul = [_newZone, _StaticArray1, 110, 2, [0,33], true, false] execVM "scripts\SHK_buildingpos.sqf";
  527. //nul = [_newZone, _StaticArray2, 110, 2, [1,33], true, false] execVM "scripts\SHK_buildingpos.sqf";
  528.  
  529. _stat_grp
  530. };
  531. INS_Tsk_GrpMkrs = {
  532. private ["_marker","_new_marker","_grp","_wp_marker","_wp_mkr_array"];
  533. _grp = _this select 0;
  534. _wp_mkr_array = [];
  535.  
  536. for "_i" from 1 to (count (waypoints _grp)) do
  537. {
  538. _marker = format["%1 WP%2", objective_pos_logic,_i];
  539. _wp_marker = createMarker [_marker, getWPPos [_grp, _i]];
  540. _wp_marker setMarkerText _marker;
  541. _wp_marker setMarkerType "waypoint";
  542. _wp_mkr_array = _wp_mkr_array + [_wp_marker];
  543. };
  544.  
  545. _marker = "Tsk Defence Grp";
  546. _new_marker = createMarker [_marker, (position leader _grp)];
  547. _new_marker setMarkerText _marker;
  548. _new_marker setMarkerType "o_inf";
  549.  
  550. while {alive leader _grp} do
  551. {
  552. _new_marker setMarkerPos (position leader _grp);
  553. uiSleep 0.5;
  554. };
  555. deleteMarker _new_marker;
  556. {deleteMarker _x;} foreach _wp_mkr_array;
  557. };
  558. Veh_taskPatrol_mod = {
  559. // BIS_fnc_taskPatrol modified by Demonized to fix some vehicle bugs not moving when speed or behaviour was not defined for each wp.
  560. _grp = _this select 0;
  561. _pos = _this select 1;
  562. _maxDist = _this select 2;
  563.  
  564. for "_i" from 0 to (2 + (floor (random 3))) do {
  565. _newPos = [_pos, 50, _maxDist, 1, 0, 60 * (pi / 180), 0, []] call BIS_fnc_findSafePos;
  566. _wp = _grp addWaypoint [_newPos, 0];
  567. _wp setWaypointType "MOVE";
  568. _wp setWaypointSpeed "LIMITED";
  569. _wp setWaypointBehaviour "SAFE";
  570. _wp setWaypointFormation "COLUMN";//"STAG COLUMN"
  571. _wp setWaypointCompletionRadius 20;
  572. };
  573.  
  574. _wp = _grp addWaypoint [_pos, 0];
  575. _wp setWaypointType "CYCLE";
  576. _wp setWaypointCompletionRadius 20;
  577. true
  578. };
  579. remove_charge_fnc = {
  580. //remove charge/satchel from ammo cache's cargo space
  581. private ["_crate","_all_mags","_type"];
  582. _crate = _this select 0;
  583. _all_mags = magazineCargo _crate;
  584. {
  585. _type = [_x] call BIS_fnc_itemType;
  586. if ((_type select 1) == "mine") then {
  587. _all_mags = _all_mags - [_x];
  588. };
  589. } forEach _all_mags;
  590. clearMagazineCargoGlobal _crate;
  591. {_crate addMagazineCargoGlobal [_x, 1];} foreach _all_mags;
  592. //hint str (_all_mags);
  593. true
  594. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement