Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_aiunit","_xpos","_ypos","_unitpos","_aiGroup","_wppos","_wpradius","_wpnum","_numunits","_wp","_aispawnpos","_monsterskin"];
- _aiunit = objNull;
- _aispawnpos =_this select 0;
- _wpradius = _this select 1;
- _wpnum = _this select 2;
- _numunits = _this select 3;
- _xpos = _aispawnpos select 0;
- _ypos = _aispawnpos select 1;
- _sound = ["demon","swell"] call BIS_fnc_selectRandom;
- _monsterskin = "O_G_engineer_F";
- if (true) then {
- _aiGroup = createGroup east;
- for [{ x=1 },{ x < _numunits+1 },{ x = x + 1; }] do {
- _unitpos = [_xpos+x,_ypos+x,0];
- _monsterskin createUnit [_unitpos, _aiGroup, "_aiunit=this;",0.6,"Private"];
- uisleep 0.01;
- while {alive _this} do
- {
- if ((_x distance _aiunit) < 500) then {
- SoundBroadcaster = [_aiunit,'_sound'];
- (owner _x) publicVariableClient 'SoundBroadcaster';
- uisleep 5;
- };
- } forEach playableUnits;
- removeAllWeapons _aiunit;
- removeallitems _aiunit;
- };
- };
- //set skills
- _aiunit setSkill ["aimingAccuracy",1];
- _aiunit setSkill ["aimingShake",1];
- _aiunit setSkill ["aimingSpeed",1];
- _aiunit setSkill ["endurance",1];
- _aiunit setSkill ["spotDistance",1];
- _aiunit setSkill ["spotTime",1];
- _aiunit setSkill ["courage",1];
- _aiunit setSkill ["reloadSpeed",1];
- _aiunit setSkill ["commanding",1];
- _aiunit setSkill ["general",1];
- _aiunit enableAI "TARGET";
- _aiunit enableAI "AUTOTARGET";
- _aiunit enableAI "MOVE";
- _aiunit enableAI "ANIM";
- _aiunit enableAI "FSM";
- _aiunit allowDammage false;
- _aiunit setCombatMode "YELLOW";
- _aiunit setBehaviour "CARELESS";
- //generate waypoints
- for [{ x=1 },{ x < _wpnum },{ x = x + 1; }] do {
- _wppos = [_xpos+(x*20),_ypos+(x*20),_wpradius];
- _wp = _aiGroup addWaypoint [_wppos, _wpradius];
- _wp setWaypointType "MOVE";
- };
- _wp = _aiGroup addWaypoint [[_xpos,_ypos,0], _wpradius];
- _wp setWaypointType "CYCLE";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement