Advertisement
Guest User

[ZEUS | 20:00] Dezynfekcja

a guest
Mar 23rd, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 4.95 KB | None | 0 0
  1. ["Zeus Template", "Corona", {
  2.     params ["_pos", "_obj"]; ASLToATL _pos spawn {
  3.         _pos = _this;
  4.         _unitsCfg = "(getText (_x >> 'faction') == 'LOP_CHR_Civ') && (getText (_x >> 'vehicleClass') == 'LOP_Men')" configClasses (configFile >> "CfgVehicles");
  5.  
  6.         _units = [];
  7.  
  8.         {
  9.             _units pushBack (configName _x);
  10.         } forEach _unitsCfg;
  11.  
  12.         _selected = [
  13.             "Setting",
  14.             [
  15.                 ["CHECKBOX", "Garrison building", false],
  16.                 ["CHECKBOX", "Patrols", true],
  17.                 ["SLIDER", "Radius", [50, 3000, 100, 0]],
  18.                 ["SLIDER", "Probability", [0, 1, 0.4, 2]],
  19.                 ["CHECKBOX", "Dynamic Simulation", true]
  20.             ],
  21.             {
  22.                 params ["_dialog", "_args"];
  23.                 TZ_DIALOG_RETURN = _dialog;
  24.             },
  25.             {
  26.                 TZ_DIALOG_RETURN = false;
  27.             },
  28.             []
  29.         ] call tz_fnc_createDialog;
  30.  
  31.         if (_selected isEqualTo false) exitWith {};
  32.  
  33.         _selected params ["_garrison", "_patrols", "_radius", "_probability", "_dynamicSimulation"];
  34.  
  35.         _masks = [
  36.             "G_Respirator_blue_F",
  37.             "G_Respirator_white_F",
  38.             "G_Respirator_yellow_F",
  39.             "G_AirPurifyingRespirator_02_black_F",
  40.             "G_AirPurifyingRespirator_02_olive_F",
  41.             "G_AirPurifyingRespirator_02_sand_F",
  42.             "G_AirPurifyingRespirator_01_F",
  43.             "G_RegulatorMask_F"
  44.         ];
  45.  
  46.         if (_garrison) then {
  47.             _houses = nearestObjects [_pos , ["house"], _radius];
  48.             if (count _houses > 0) then {
  49.                 {
  50.                     if ((random 1) < _probability) then {
  51.                         _houseDistance = _pos distance2D _x;
  52.                         if(_houseDistance < random [_radius*0.1, _radius*0.1, _radius]) then {
  53.                             _group = createGroup civilian;
  54.                             _positions = _x buildingPos - 1;
  55.                             {
  56.                                 if ((random 1) < _probability) then {
  57.                                     _class = selectRandom _units;
  58.                                     _unit = _group createUnit [_class, _x, [], 0, "NONE"];
  59.                                     _unit disableAi "PATH";
  60.                                     if ((random 1) > 0.5) then {
  61.                                         _unit setUnitPos "UP";
  62.                                     } else {
  63.                                         _unit setUnitPos "MIDDLE";
  64.                                     };
  65.  
  66.                                     _unit addGoggles (selectRandom _masks);
  67.                                 };
  68.                             } forEach _positions;
  69.                             if (_dynamicSimulation) then {
  70.                                 _group enableDynamicSimulation true;
  71.                             };
  72.                         };
  73.                     };
  74.                 } forEach _houses;
  75.             };
  76.         };
  77.  
  78.         if(_patrols) then {
  79.             _roads = _pos nearRoads _radius;
  80.             if (count _roads > 0) then {
  81.                 _patrolCount = ((_radius/100)*_probability) max 1;
  82.                 for "_i" from 0 to _patrolCount do {
  83.                     _patrolPos = getPos (selectRandom _roads);
  84.                    
  85.                     _group = createGroup civilian;
  86.                     for "_i" from 0 to (selectRandom [2, 3, 4, 5]) do {
  87.                         _class = selectRandom _units;
  88.                         _unit = _group createUnit [_class, _patrolPos, [], 0, "NONE"];
  89.                         _unit addGoggles (selectRandom _masks);
  90.                     };
  91.  
  92.                     if (_dynamicSimulation) then {
  93.                         _group enableDynamicSimulation true;
  94.                     };
  95.                                    
  96.                     for "_j" from 0 to 8 do {
  97.                         _road = getPos (selectRandom _roads);
  98.                         _wp = _group addWaypoint [_road, _j];
  99.                         _wp setWaypointBehaviour "SAFE";
  100.                         };
  101.                     _wp = _group addWaypoint [getPos (leader _group), _patrolCount];
  102.                     _wp setWaypointType "CYCLE";
  103.                 };
  104.             };
  105.         };
  106.  
  107.     };
  108. }] call zen_custom_modules_fnc_register;
  109.  
  110. ["Zeus Template", "Corona infected", {
  111.     params ["_pos", "_obj"]; ASLToATL _pos spawn {
  112.         _pos = _this;
  113.         _selected = [
  114.             "Setting",
  115.             [
  116.                 ["SLIDER", "Radius", [50, 3000, 100, 0]],
  117.                 ["SLIDER", "Probability", [0, 1, 0.4, 2]]
  118.             ],
  119.             {
  120.                 params ["_dialog", "_args"];
  121.                 TZ_DIALOG_RETURN = _dialog;
  122.             },
  123.             {
  124.                 TZ_DIALOG_RETURN = false;
  125.             },
  126.             []
  127.         ] call tz_fnc_createDialog;
  128.  
  129.         if (_selected isEqualTo false) exitWith {};
  130.         _selected params ["_radius", "_probability"];
  131.  
  132.         _civilians = _pos nearEntities ["Man", _radius];
  133.  
  134.         {
  135.             if(!isPlayer _x) then {
  136.                 if ((random 1) < _probability) then {
  137.                     _x setVariable ["TEMPERATURE", (random [36, 37, 43]), true];
  138.                 } else {
  139.                     _x setVariable ["TEMPERATURE", (random [36, 36.6, 36.6]), true];
  140.                 };
  141.             };     
  142.         } forEach _civilians;
  143.     };
  144. }] call zen_custom_modules_fnc_register;
  145.  
  146. ["Zeus Template", "Enabled AI", {
  147.     params ["_pos", "_obj"]; ASLToATL _pos spawn {
  148.         _pos = _this;
  149.         _selected = [
  150.             "Setting",
  151.             [
  152.                 ["SLIDER", "Radius", [50, 3000, 100, 0]],
  153.                 ["SLIDER", "Probability", [0, 1, 0.4, 2]]
  154.             ],
  155.             {
  156.                 params ["_dialog", "_args"];
  157.                 TZ_DIALOG_RETURN = _dialog;
  158.             },
  159.             {
  160.                 TZ_DIALOG_RETURN = false;
  161.             },
  162.             []
  163.         ] call tz_fnc_createDialog;
  164.  
  165.         if (_selected isEqualTo false) exitWith {};
  166.         _selected params ["_radius", "_probability"];
  167.  
  168.         _civilians = _pos nearEntities ["Man", _radius];
  169.  
  170.         {
  171.             if(!isPlayer _x) then {
  172.                 if ((random 1) < _probability) then {
  173.                     _x enableAI "All";
  174.                 };
  175.             };     
  176.         } forEach _civilians;
  177.     };
  178. }] call zen_custom_modules_fnc_register;
  179.  
  180.  
  181. _temp_act =
  182. [
  183.     "Temperatura",
  184.     "Temperatura",
  185.     "",
  186.     {
  187.         _t = _target getVariable ["TEMPERATURE", 36.6];
  188.         hintC ("Temperatura: " + str(_t));
  189.     },
  190.     {true}
  191. ] call ace_interact_menu_fnc_createAction;
  192. ["Civilian_F", 0, ["ACE_MainActions"], _temp_act, true] call ace_interact_menu_fnc_addActionToClass;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement