forked from jerrydrake/WLA_resurrection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAISmoke.sqf
49 lines (41 loc) · 1.18 KB
/
AISmoke.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
private ["_unit", "_group"];
_unit = _this select 0;
waituntil {sleep 4; isNil"_unit" || {behaviour _unit == "COMBAT"} || {!(alive _unit)}};
if (!isNil"_unit" && alive _unit) then {
if (!(daytime < 3.5 || {daytime > 21})) then {
if (_unit canAdd "SmokeShell") then {
_unit addmagazine "SmokeShell";
sleep 1;
_unit forceWeaponFire ["SmokeShellMuzzle","SmokeShellMuzzle"];
};
} else {
if (_unit canAdd "Chemlight_Red") then {
_unit addmagazine "Chemlight_Red";
sleep 1;
_unit forceWeaponFire ["ChemlightRedMuzzle","ChemlightRedMuzzle"];
};
};
_group = (units (group _unit) - [_unit]);
if ((count _group)> 1) then {
_unit = _group call RETURNRANDOM;
if (_unit canAdd "SmokeShell") then {
_unit addmagazine "SmokeShell";
sleep 1;
_unit forceWeaponFire ["SmokeShellMuzzle","SmokeShellMuzzle"];
};
};
_group = units group _unit - [_unit, leader _unit];
if ((count _group)> 1) then {
_unit = _group call RETURNRANDOM;
if (_unit canAdd "SmokeShell") then {
_unit addmagazine "SmokeShell";
sleep 1;
_unit forceWeaponFire ["SmokeShellMuzzle","SmokeShellMuzzle"];
};
_group = (units group _unit) - [_unit];
if ((count _group)> 1) then {
_unit = _group call RETURNRANDOM;
_unit suppressFor (6+(random 10));
};
};
};