diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:58:31 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:58:31 +0300 |
| commit | e670b4ed55c459a21090bd0178ceaaaf12d87989 (patch) | |
| tree | b6833d5e842475f0ee27f5f617096445fdd4e4a1 /Client/Module/Skill/Skill_SpecOps.sqf | |
| download | a2wf_fallujah-e670b4ed55c459a21090bd0178ceaaaf12d87989.tar.gz a2wf_fallujah-e670b4ed55c459a21090bd0178ceaaaf12d87989.tar.bz2 a2wf_fallujah-e670b4ed55c459a21090bd0178ceaaaf12d87989.zip | |
init
Diffstat (limited to 'Client/Module/Skill/Skill_SpecOps.sqf')
| -rw-r--r-- | Client/Module/Skill/Skill_SpecOps.sqf | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Client/Module/Skill/Skill_SpecOps.sqf b/Client/Module/Skill/Skill_SpecOps.sqf new file mode 100644 index 0000000..4456815 --- /dev/null +++ b/Client/Module/Skill/Skill_SpecOps.sqf @@ -0,0 +1,52 @@ +/*
+ Script: Spec Ops Skill System by Benny.
+ Description: Add special skills to the defined spec ops unit.
+*/
+Private ['_min','_ran','_skip','_sorted','_vehicle','_vehicles','_z'];
+
+
+private ["_x","_skip","_min","_ran","_vehicles","_sorted","_vehicle"];
+_vehicles = player nearEntities [["Car","Motorcycle","Tank","Ship","Air"],5];
+if (count _vehicles < 1) exitWith {};
+
+if (isNil "WFBE_SK_V_LockpickChance") then {WFBE_SK_V_LockpickChance = 0};
+
+_sorted = [player,_vehicles] Call SortByDistance;
+_vehicle = _sorted select 0;
+
+if (!locked _vehicle) exitWith {};
+
+WFBE_SK_V_LastUse_Lockpick = time;
+
+_skip = false;
+for [{_z = 0},{_z < 2},{_z = _z + 1}] do {
+ sleep 0.5;
+ player playMove "AinvPknlMstpSlayWrflDnon_medic";
+ sleep 0.5;
+ waitUntil {animationState player == "ainvpknlmstpslaywrfldnon_amovpknlmstpsraswrfldnon" || !alive player || vehicle player != player || !alive _vehicle || _vehicle distance player > 5};
+ if (!alive player || vehicle player != player || !alive _vehicle || _vehicle distance player > 5) exitWith {_skip = true};
+};
+
+if (!locked _vehicle) exitWith {};
+
+if (!_skip) then {
+ _min = 30;
+ switch (typeOf _vehicle) do {
+ case "Motorcycle": {_min = 40};
+ case "Car": {_min = 30};
+ case "Tank": {_min = 20};
+ case "Ship": {_min = 25};
+ case "Air": {_min = 15};
+ };
+ _ran = ((random 100)-WFBE_SK_V_LockpickChance);
+ if (_ran <= _min) then {
+ //--- Unlocked, gain experience.
+ if (WFBE_SK_V_LockpickChance > -51) then {WFBE_SK_V_LockpickChance = WFBE_SK_V_LockpickChance - 1};
+ WFBE_RequestVehicleLock = ['SRVFNCREQUESTVEHICLELOCK',[_vehicle,false]];
+ publicVariable 'WFBE_RequestVehicleLock';
+ if (isHostedServer) then {['SRVFNCREQUESTVEHICLELOCK',[_vehicle,false]] Spawn HandleSPVF};
+ hint (localize "STR_WF_INFO_Lockpick_Succeed");
+ } else {
+ hint (localize "STR_WF_INFO_Lockpick_Failed");
+ };
+};
|
