|
1 | 1 | if (!isServer) exitWith {};
|
| 2 | +params [ "_unit", "_anim", "_shans", "_shooter", "_stanceu"]; |
2 | 3 |
|
3 |
| -_unit = _this select 0; |
4 |
| -_anim = _this select 1; |
5 |
| -_shans = _this select 2; |
6 |
| -_shooter = _this select 3; |
7 |
| - |
8 |
| -_unitGrp = group _unit; |
9 |
| -_unitGrpPR = str side group _unit; |
10 |
| - |
11 |
| -private [ "_unit", "_anim", "_shans", "_unitGrp", "_unitGrpPR", "_numberOfKits", "_stanceu", "_shooter"]; |
12 |
| - |
| 4 | +IF (alive _unit) then { |
13 | 5 |
|
14 |
| -IF !(PiR_captive_on) then { |
15 |
| -_unit setcaptive true; |
16 |
| -}; |
| 6 | + IF !(PiR_captive_on) then { |
| 7 | + _unit setcaptive true; |
| 8 | + }; |
17 | 9 |
|
18 | 10 |
|
19 |
| -IF (alive _unit) then { |
20 |
| -[_unit] remoteExec [ "removeAllActions", 0, true ]; |
| 11 | +[_unit] remoteExecCall [ "removeAllActions", 0, true ]; |
21 | 12 | _stanceu = 0;
|
22 |
| - IF ("STAND" == stance _unit ) then { |
23 |
| - [_unit,(selectRandom ["AinvPknlMstpSlayWrflDnon_healed", "AinvPknlMstpSlayWrflDnon_healed2"])] remoteExec ["playMove", 0]; |
24 |
| - _stanceu = 1; |
| 13 | + |
| 14 | + IF ("STAND" == stance _unit ) then { |
| 15 | + [_unit,(selectRandom ["AinvPknlMstpSlayWrflDnon_healed", "AinvPknlMstpSlayWrflDnon_healed2"])] remoteExecCall ["playMove", 0]; |
| 16 | + _stanceu = 1; |
| 17 | + } ELSE { |
| 18 | + IF ("CROUCH" == stance _unit ) then { |
| 19 | + _stanceu = 2; |
| 20 | + [_unit,"AmovPknlMstpSrasWrflDnon_AinvPknlMstpSlayWrflDnon"] remoteExecCall ["switchMove", 0]; |
| 21 | + [{[(_this select 0),(selectRandom ["AinvPknlMstpSlayWrflDnon_healed", "AinvPknlMstpSlayWrflDnon_healed2"])] remoteExecCall ["switchMove", 0];}, [_unit], 0.76] call CBA_fnc_waitAndExecute; |
| 22 | + } ELSE { |
| 23 | + IF ("PRONE" == stance _unit ) then { |
| 24 | + [_unit,"AmovPpneMstpSrasWrflDnon_healed"] remoteExecCall ["playMove", 0]; |
25 | 25 | } ELSE {
|
26 |
| - IF ("CROUCH" == stance _unit ) then { |
27 |
| - _stanceu = 2; |
28 |
| - [_unit,"AmovPknlMstpSrasWrflDnon_AinvPknlMstpSlayWrflDnon"] remoteExec ["switchMove", 0]; |
29 |
| - sleep 0.76; |
30 |
| - [_unit,(selectRandom ["AinvPknlMstpSlayWrflDnon_healed", "AinvPknlMstpSlayWrflDnon_healed2"])] remoteExec ["switchMove", 0]; |
31 |
| - } ELSE { |
32 |
| - IF ("PRONE" == stance _unit ) then { |
33 |
| - [_unit,"AmovPpneMstpSrasWrflDnon_healed"] remoteExec ["playMove", 0]; |
34 |
| - } ELSE { |
35 |
| - IF ("UNDEFINED" == stance _unit ) then { |
36 |
| - [_unit,(selectRandom ["AinvPknlMstpSlayWrflDnon_healed", "AinvPknlMstpSlayWrflDnon_healed2"])] remoteExec ["playMove", 0]; |
37 |
| - }; |
38 |
| - }; |
| 26 | + IF ("UNDEFINED" == stance _unit ) then { |
| 27 | + [_unit,(selectRandom ["AinvPknlMstpSlayWrflDnon_healed", "AinvPknlMstpSlayWrflDnon_healed2"])] remoteExecCall ["playMove", 0]; |
39 | 28 | };
|
40 | 29 | };
|
41 |
| - |
42 |
| - |
43 |
| - waitUntil { sleep 0.1; ((AnimationState _unit == "AinvPknlMstpSlayWrflDnon_healed") or (AnimationState _unit == "AinvPknlMstpSlayWrflDnon_healed2") or (AnimationState _unit == "AmovPpneMstpSrasWrflDnon_healed") or (!alive _unit)) |
44 |
| - }; |
45 |
| - sleep (3 + (random 2)); |
46 |
| - IF (!alive _unit) exitWith { |
47 |
| - _unit setVariable ["dam_ignore_injured0",false,true]; |
| 30 | + }; |
48 | 31 | };
|
49 | 32 |
|
50 |
| - |
51 |
| -//__________________________________________________________Выход_______________________________________________________________ |
52 | 33 |
|
| 34 | + [{(AnimationState (_this select 0) == "AinvPknlMstpSlayWrflDnon_healed") or (AnimationState (_this select 0) == "AinvPknlMstpSlayWrflDnon_healed2") or (AnimationState (_this select 0) == "AmovPpneMstpSrasWrflDnon_healed") or (!alive (_this select 0)) |
| 35 | + }, { |
| 36 | + params [ "_unit", "_anim", "_shans", "_shooter", "_stanceu"]; |
53 | 37 |
|
54 |
| - IF (alive _unit) then { |
55 |
| - IF ((_shans - (random 15)) >=0) then { |
| 38 | + [{ |
| 39 | + params [ "_unit", "_anim", "_shans", "_shooter", "_stanceu"]; |
56 | 40 |
|
57 |
| - IF (_stanceu == 0) then { |
58 |
| - [_unit,"AmovPpneMstpSrasWrflDnon"] remoteExec ["switchMove", 0]; |
59 |
| - } ELSE { |
60 |
| - [_unit,"AmovPknlMstpSrasWrflDnon_AmovPpneMstpSrasWrflDnon"] remoteExec ["switchMove", 0]; |
61 |
| - }; |
62 |
| - sleep 0.05; |
| 41 | + |
| 42 | + IF (!alive _unit) exitWith { |
| 43 | + _unit setVariable ["dam_ignore_injured0",false,true]; |
| 44 | + |
| 45 | + IF !(PiR_captive_on) then { |
| 46 | + _unit setcaptive false; |
| 47 | + } |
| 48 | + }; |
| 49 | +//__________________________________________________________Выход_______________________________________________________________ |
63 | 50 |
|
64 | 51 |
|
65 |
| - IF ((_shans - (random 18)) >=0) then { |
66 |
| - _null = [_unit, _anim, _shans, _shooter] spawn Crawl; |
67 |
| - } ELSE { |
68 |
| - _null = [_unit, _anim, _shans, _shooter] spawn Uncondition; |
69 |
| - }; |
| 52 | + IF (alive _unit) then { |
70 | 53 |
|
71 |
| - } ELSE { |
72 |
| - |
73 |
| - waitUntil { sleep 0.1; (((AnimationState _unit != "AinvPknlMstpSlayWrflDnon_healed") && (AnimationState _unit != "AinvPknlMstpSlayWrflDnon_healed2") && (AnimationState _unit != "AmovPpneMstpSrasWrflDnon_healed")) or (!alive _unit)) |
74 |
| - }; |
| 54 | + IF ((_shans - (random 15)) >=0) then { |
75 | 55 |
|
76 |
| - IF (_stanceu == 1) then { |
77 |
| - [_unit,"AinvPknlMstpSlayWrflDnon_AmovPercMstpSrasWrflDnon"] remoteExec ["switchMove", 0]; |
78 |
| - waitUntil { sleep 0.1; (((AnimationState _unit != "AinvPknlMstpSlayWrflDnon_AmovPercMstpSrasWrflDnon") && (AnimationState _unit != "AinvPknlMstpSlayWrflDnon_AmovPknlMstpSrasWrflDnon") && (AnimationState _unit != "AinvPknlMstpSlayWrflDnon") && (AnimationState _unit != "AinvPknlMstpSlayWrflDnon_1") && (AnimationState _unit != "AmovPknlMstpSrasWrflDnon_AinvPknlMstpSlayWrflDnon")) or (!alive _unit)) |
| 56 | + IF (_stanceu == 0) then { |
| 57 | + [_unit,"AmovPpneMstpSrasWrflDnon"] remoteExecCall ["switchMove", 0]; |
| 58 | + } ELSE { |
| 59 | + [_unit,"AmovPknlMstpSrasWrflDnon_AmovPpneMstpSrasWrflDnon"] remoteExecCall ["switchMove", 0]; |
79 | 60 | };
|
80 |
| - [_unit,"AmovPercMstpSrasWrflDnon"] remoteExec ["switchMove", 0]; |
81 |
| - |
82 |
| - }; |
83 |
| - IF (_stanceu == 2) then { |
84 |
| - [_unit,"AinvPknlMstpSlayWrflDnon_AmovPknlMstpSrasWrflDnon"] remoteExec ["switchMove", 0]; |
85 |
| - waitUntil { sleep 0.1; (((AnimationState _unit != "AinvPknlMstpSlayWrflDnon_AmovPercMstpSrasWrflDnon") && (AnimationState _unit != "AinvPknlMstpSlayWrflDnon_AmovPknlMstpSrasWrflDnon") && (AnimationState _unit != "AinvPknlMstpSlayWrflDnon") && (AnimationState _unit != "AinvPknlMstpSlayWrflDnon_1") && (AnimationState _unit != "AmovPknlMstpSrasWrflDnon_AinvPknlMstpSlayWrflDnon")) or (!alive _unit)) |
86 |
| - }; |
87 |
| - IF ("STAND" == stance _unit ) then { |
88 |
| - [_unit,"AmovPercMstpSrasWrflDnon"] remoteExec ["switchMove", 0]; |
89 |
| - } Else { |
90 |
| - [_unit,"AmovPknlMstpSrasWrflDnon"] remoteExec ["switchMove", 0]; |
| 61 | + |
| 62 | + IF ((_shans - (random 18)) >=0) then { |
| 63 | + [{ |
| 64 | + params [ "_unit", "_anim", "_shans", "_shooter"]; |
| 65 | + [_unit, _anim, _shans, _shooter] call Crawl; |
| 66 | + }, [_unit, _anim, _shans, _shooter], 0.05] call CBA_fnc_waitAndExecute; |
| 67 | + } ELSE { |
| 68 | + [{ |
| 69 | + params [ "_unit", "_anim", "_shans", "_shooter"]; |
| 70 | + [_unit, _anim, _shans, _shooter] call Uncondition; |
| 71 | + }, [_unit, _anim, _shans, _shooter], 0.05] call CBA_fnc_waitAndExecute; |
91 | 72 | };
|
| 73 | + |
| 74 | + } ELSE { |
| 75 | + [{((AnimationState (_this select 0) != "AinvPknlMstpSlayWrflDnon_healed") && (AnimationState (_this select 0) != "AinvPknlMstpSlayWrflDnon_healed2") && (AnimationState (_this select 0) != "AmovPpneMstpSrasWrflDnon_healed")) or (!alive (_this select 0)) |
| 76 | + }, { |
| 77 | + params [ "_unit", "_anim", "_shans", "_shooter", "_stanceu"]; |
| 78 | + |
| 79 | + IF (_stanceu == 1) then { |
| 80 | + [_unit,"AinvPknlMstpSlayWrflDnon_AmovPercMstpSrasWrflDnon"] remoteExecCall ["switchMove", 0]; |
| 81 | + [{((AnimationState (_this select 0) != "AinvPknlMstpSlayWrflDnon_AmovPercMstpSrasWrflDnon") && (AnimationState (_this select 0) != "AinvPknlMstpSlayWrflDnon_AmovPknlMstpSrasWrflDnon") && (AnimationState (_this select 0) != "AinvPknlMstpSlayWrflDnon") && (AnimationState (_this select 0) != "AinvPknlMstpSlayWrflDnon_1") && (AnimationState (_this select 0) != "AmovPknlMstpSrasWrflDnon_AinvPknlMstpSlayWrflDnon")) or (!alive (_this select 0)) |
| 82 | + }, { |
| 83 | + [(_this select 0),"AmovPercMstpSrasWrflDnon"] remoteExecCall ["switchMove", 0]; |
| 84 | + }, [_unit]] call CBA_fnc_waitUntilAndExecute; |
| 85 | + }; |
| 86 | + |
| 87 | + IF (_stanceu == 2) then { |
| 88 | + [_unit,"AinvPknlMstpSlayWrflDnon_AmovPknlMstpSrasWrflDnon"] remoteExecCall ["switchMove", 0]; |
| 89 | + [{((AnimationState (_this select 0) != "AinvPknlMstpSlayWrflDnon_AmovPercMstpSrasWrflDnon") && (AnimationState (_this select 0) != "AinvPknlMstpSlayWrflDnon_AmovPknlMstpSrasWrflDnon") && (AnimationState (_this select 0) != "AinvPknlMstpSlayWrflDnon") && (AnimationState (_this select 0) != "AinvPknlMstpSlayWrflDnon_1") && (AnimationState (_this select 0) != "AmovPknlMstpSrasWrflDnon_AinvPknlMstpSlayWrflDnon")) or (!alive (_this select 0)) |
| 90 | + }, { |
| 91 | + |
| 92 | + IF ("STAND" == stance (_this select 0) ) then { |
| 93 | + [(_this select 0),"AmovPercMstpSrasWrflDnon"] remoteExecCall ["switchMove", 0]; |
| 94 | + } Else { |
| 95 | + [(_this select 0),"AmovPknlMstpSrasWrflDnon"] remoteExecCall ["switchMove", 0]; |
| 96 | + }; |
| 97 | + }, [_unit]] call CBA_fnc_waitUntilAndExecute; |
| 98 | + }; |
| 99 | + _unit setVariable ["dam_ignore_injured0",false,true]; |
| 100 | + _unit setVariable ["dam_player_lecitsebia0",false,true]; |
| 101 | + |
| 102 | + PIRjipId = [_unit, { |
| 103 | + _ehId = _this addEventHandler ["HitPart", {(_this select 0) call PiRredirect;}]; |
| 104 | + _this setVariable ["hitPartEhId", _ehId]; |
| 105 | + }] remoteExecCall ["call", 0, true]; |
| 106 | + |
| 107 | + IF !(PiR_captive_on) then { |
| 108 | + _unit setcaptive false; |
| 109 | + }; |
| 110 | + |
| 111 | + }, [_unit, _anim, _shans, _shooter, _stanceu]] call CBA_fnc_waitUntilAndExecute; |
| 112 | + }; |
| 113 | + }; |
92 | 114 |
|
93 |
| - }; |
| 115 | + IF !(alive _unit) then { |
94 | 116 | _unit setVariable ["dam_ignore_injured0",false,true];
|
95 |
| - _unit setVariable ["dam_player_lecitsebia0",false,true]; |
96 | 117 |
|
97 |
| - PIRjipId = [_unit, { |
98 |
| - _ehId = _this addEventHandler ["HitPart", {(_this select 0) call PiRredirect;}]; |
99 |
| - _this setVariable ["hitPartEhId", _ehId]; |
100 |
| - }] remoteExec ["call", 0, true]; |
101 |
| - |
102 |
| - IF !(PiR_captive_on) then { |
103 |
| - _unit setcaptive false; |
104 |
| - }; |
105 |
| - }; |
106 |
| - }; |
| 118 | + IF !(PiR_captive_on) then { |
| 119 | + _unit setcaptive false; |
| 120 | + }; |
| 121 | + }; |
| 122 | + |
| 123 | + }, [_unit, _anim, _shans, _shooter, _stanceu], (3 + random 2)] call CBA_fnc_waitAndExecute; |
| 124 | + }, [_unit, _anim, _shans, _shooter, _stanceu]] call CBA_fnc_waitUntilAndExecute; |
107 | 125 | //_______________________________________________________________________________________________________________________________
|
108 | 126 |
|
109 | 127 | };
|
110 | 128 |
|
111 |
| - |
| 129 | + IF !(alive _unit) then { |
| 130 | + _unit setVariable ["dam_ignore_injured0",false,true]; |
| 131 | + }; |
0 commit comments