Advertisement
zSkullfox

Untitled

Mar 6th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. _type = _this select 0;
  2.  
  3. _location = [1] call fox_alive_fnc_getLocations select 0;
  4. _name = [_location,"locationName"] call fox_alive_fnc_getLocationData;
  5. _position = [_location,"position"] call fox_alive_fnc_getLocationData;
  6. _radius = [_location,"radius"] call fox_alive_fnc_getLocationData;
  7.  
  8. _missionDescription = getText(missionconfigfile >> fox_taskSet >> _type >> "text");
  9. _missionTitle = getText(missionconfigfile >> fox_taskSet >> _type >> "title");
  10. _missionType = getText(missionconfigfile >> fox_taskSet >> _type >> "type");
  11. _faction = selectRandom fox_alive_faction_eastArray;
  12.  
  13. _factionName = getText(configfile >> "CfgFactionClasses" >> _faction >> "displayName"); // need rework;
  14. _taskID = format["%1_%2",_type, [_name] call fox_alive_fnc_removeWhiteSpacer ];
  15. _missionGroups = [];
  16.  
  17. _taskMarker = [_taskID,_position,_radius] call fox_alive_fnc_createMissionMarker;
  18.  
  19. _unitArray = getArray(missionconfigfile >> "fox_factions" >> "EAST" >> _faction >> "units");
  20.  
  21. _dummyUnits = [];
  22. for [{_i=0}, {_i<5}, {_i=_i+1}] do
  23. {
  24. _dummyUnits pushBack selectRandom _unitArray;
  25. };
  26.  
  27. _max = (count (allPlayers - entities "HeadlessClient_F")) * 2;
  28.  
  29. for [{_i=0}, {_i<_max}, {_i=_i+1}] do
  30. {
  31. _pos = _taskMarker call BIS_fnc_randomPosTrigger;
  32. _grp = [ _pos, EAST, _dummyUnits,[],[],[],[],[],180] call BIS_fnc_spawnGroup;
  33. _missionGroups pushBack _grp;
  34. [_grp,_position,(_radius select 0) ,5 ,"MOVE","SAFE"] call CBA_fnc_taskPatrol;
  35. };
  36.  
  37. for [{_i=0}, {_i<_max - 1}, {_i=_i+1}] do
  38. {
  39. _pos = _taskMarker call BIS_fnc_randomPosTrigger;
  40. _grp = [ _pos, EAST, _dummyUnits,[],[],[],[],[],180] call BIS_fnc_spawnGroup;
  41. _missionGroups pushBack _grp;
  42. [[_position select 0,_position select 1 ,0], [],units _grp, (_radius select 0),0, false, false] call ace_ai_fnc_garrison;
  43. };
  44.  
  45. _objects = getArray(missionconfigfile >> "fox_factions" >> "EAST" >> _faction >> "carsS") + getArray(missionconfigfile >> "fox_factions" >> "EAST" >> _faction >> "carsA")+ getArray(missionconfigfile >> "fox_factions" >> "EAST" >> _faction >> "turrets");
  46. _targets = [];
  47. _n = (ceil random 3) + 1;
  48. _condition = "";
  49. _vehicleStrings = "a ";
  50. for [{_i=0}, {_i < _n}, {_i=_i+1}] do
  51. {
  52.  
  53. _pos = _taskMarker call BIS_fnc_randomPosTrigger;
  54. _class = selectRandom _objects;
  55. _t = createVehicle [_class, _pos, [], 0, "NONE"];
  56. createVehicleCrew _t;
  57. _targets pushBack _t;
  58. [_t,_position,(_radius select 0) ,5 ,"MOVE","SAFE"] call CBA_fnc_taskPatrol;
  59.  
  60. _vehicleName = getText(configfile >> "CfgVehicles" >> _class >> "displayName");
  61.  
  62.  
  63. if(_i < (_n - 1))then{
  64. _condition = _condition + format["!alive (%1 call BIS_fnc_objectFromNetId) AND ",str (_t call BIS_fnc_netId)];
  65. _vehicleStrings = _vehicleStrings + format["%1, ",_vehicleName];
  66. }else{
  67. _condition = _condition + format["!alive (%1 call BIS_fnc_objectFromNetId)",str (_t call BIS_fnc_netId)];
  68. _vehicleStrings = _vehicleStrings + format["and %1 ",_vehicleName];
  69. };
  70.  
  71. };
  72.  
  73. _taskTrigger = createTrigger ["EmptyDetector", _position];
  74. _taskTrigger setTriggerArea [1 ,0, 0, false];
  75. _taskTrigger setTriggerActivation ["NONE", "PRESENT", true];
  76. _taskTrigger setTriggerStatements [ format["call %1", compile _condition ], format["[%1,%2]call fox_alive_fnc_updateTask;",str _taskID,str "SUCCEEDED"], ""];
  77.  
  78. [west,_taskID,[format[_missionDescription,_vehicleStrings,_name],_missionTitle],_position,true,0,true,_missionType] call BIS_fnc_taskCreate;
  79. fox_tasks pushBack [_taskID,[ [_taskMarker],[_taskTrigger],_missionGroups ]];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement