Advertisement
Guest User

Untitled

a guest
May 3rd, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. private ["_aiunit","_xpos","_ypos","_unitpos","_aiGroup","_wppos","_wpradius","_wpnum","_numunits","_wp","_aispawnpos","_monsterskin"];
  2. _aiunit = objNull;
  3. _aispawnpos =_this select 0;
  4. _wpradius = _this select 1;
  5. _wpnum = _this select 2;
  6. _numunits = _this select 3;
  7. _xpos = _aispawnpos select 0;
  8. _ypos = _aispawnpos select 1;
  9. _sound = ["demon","swell"] call BIS_fnc_selectRandom;
  10.  
  11. _monsterskin = "O_G_engineer_F";
  12.  
  13.  
  14. if (true) then {
  15. _aiGroup = createGroup east;
  16. for [{ x=1 },{ x < _numunits+1 },{ x = x + 1; }] do {
  17. _unitpos = [_xpos+x,_ypos+x,0];
  18.  
  19. _monsterskin createUnit [_unitpos, _aiGroup, "_aiunit=this;",0.6,"Private"];
  20. uisleep 0.01;
  21.  
  22. while {alive _this} do
  23. {
  24. if ((_x distance _aiunit) < 500) then {
  25. SoundBroadcaster = [_aiunit,'_sound'];
  26. (owner _x) publicVariableClient 'SoundBroadcaster';
  27. uisleep 5;
  28. };
  29. } forEach playableUnits;
  30.  
  31. removeAllWeapons _aiunit;
  32. removeallitems _aiunit;
  33. };
  34. };
  35.  
  36. //set skills
  37. _aiunit setSkill ["aimingAccuracy",1];
  38. _aiunit setSkill ["aimingShake",1];
  39. _aiunit setSkill ["aimingSpeed",1];
  40. _aiunit setSkill ["endurance",1];
  41. _aiunit setSkill ["spotDistance",1];
  42. _aiunit setSkill ["spotTime",1];
  43. _aiunit setSkill ["courage",1];
  44. _aiunit setSkill ["reloadSpeed",1];
  45. _aiunit setSkill ["commanding",1];
  46. _aiunit setSkill ["general",1];
  47.  
  48. _aiunit enableAI "TARGET";
  49. _aiunit enableAI "AUTOTARGET";
  50. _aiunit enableAI "MOVE";
  51. _aiunit enableAI "ANIM";
  52. _aiunit enableAI "FSM";
  53. _aiunit allowDammage false;
  54. _aiunit setCombatMode "YELLOW";
  55. _aiunit setBehaviour "CARELESS";
  56.  
  57.  
  58.  
  59. //generate waypoints
  60. for [{ x=1 },{ x < _wpnum },{ x = x + 1; }] do {
  61. _wppos = [_xpos+(x*20),_ypos+(x*20),_wpradius];
  62. _wp = _aiGroup addWaypoint [_wppos, _wpradius];
  63. _wp setWaypointType "MOVE";
  64. };
  65. _wp = _aiGroup addWaypoint [[_xpos,_ypos,0], _wpradius];
  66. _wp setWaypointType "CYCLE";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement