diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:57:23 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:57:23 +0300 |
| commit | 3533c3aa9393fc6350178b196c813dc636ec9cf6 (patch) | |
| tree | 2f96a879c3935dea18e73410926b03c7eef1a751 /Client/Module/Skill | |
| download | a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.gz a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.bz2 a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.zip | |
init
Diffstat (limited to 'Client/Module/Skill')
| -rw-r--r-- | Client/Module/Skill/Actions/Officer_Undeploy_MASH.sqf | 22 | ||||
| -rw-r--r-- | Client/Module/Skill/Skill_Apply.sqf | 66 | ||||
| -rw-r--r-- | Client/Module/Skill/Skill_Engineer.sqf | 32 | ||||
| -rw-r--r-- | Client/Module/Skill/Skill_Init.sqf | 41 | ||||
| -rw-r--r-- | Client/Module/Skill/Skill_Officer.sqf | 32 | ||||
| -rw-r--r-- | Client/Module/Skill/Skill_Sniper.sqf | 31 | ||||
| -rw-r--r-- | Client/Module/Skill/Skill_SpecOps.sqf | 52 |
7 files changed, 276 insertions, 0 deletions
diff --git a/Client/Module/Skill/Actions/Officer_Undeploy_MASH.sqf b/Client/Module/Skill/Actions/Officer_Undeploy_MASH.sqf new file mode 100644 index 0000000..99b92e8 --- /dev/null +++ b/Client/Module/Skill/Actions/Officer_Undeploy_MASH.sqf @@ -0,0 +1,22 @@ +/*
+ Script: Officer Skill MASH Undeploy
+ Description: Undeploy the MASH
+*/
+
+Private ["_MASH"];
+
+_MASH = _this select 0;
+
+_skip = false;
+for '_z' from 0 to 3 do {
+ sleep 0.5;
+ player playMove "AinvPknlMstpSlayWrflDnon_medic";
+ sleep 0.5;
+ waitUntil {animationState player == "ainvpknlmstpslaywrfldnon_amovpknlmstpsraswrfldnon" || !alive player || vehicle player != player};
+ if (!alive player || vehicle player != player) exitWith {_skip = true};
+};
+
+if (!_skip) then {
+ deleteVehicle _MASH;
+ WFBE_SK_V_LastUse_MASH = -2000;
+};
\ No newline at end of file diff --git a/Client/Module/Skill/Skill_Apply.sqf b/Client/Module/Skill/Skill_Apply.sqf new file mode 100644 index 0000000..ddd8f20 --- /dev/null +++ b/Client/Module/Skill/Skill_Apply.sqf @@ -0,0 +1,66 @@ +/*
+ Script: Skill Application System by Benny.
+ Description: Skill Application.
+*/
+
+Private ["_unit"];
+
+_unit = _this;
+
+switch (WFBE_SK_V_Type) do {
+ case 'Engineer': {
+ /* Repair Ability */
+ _unit addAction [
+ ("<t color='#f8d664'>" + localize 'STR_WF_ACTION_Repair'+ "</t>"),
+ (WFBE_SK_V_Root + 'Engineer' + '.sqf'),
+ [],
+ 80,
+ false,
+ true,
+ "",
+ "time - WFBE_SK_V_LastUse_Repair > WFBE_SK_V_Reload_Repair"
+ ];
+ };
+ case 'Officer': {
+ /* MASH Ability require that the MASH parameter is enabled */
+ if (paramRespawnMASH) then {
+ /* MASH Ability */
+ _unit addAction [
+ ("<t color='#f8d664'>" + localize 'STR_WF_ACTION_DeployMASH'+ "</t>"),
+ (WFBE_SK_V_Root + 'Officer' + '.sqf'),
+ [],
+ 80,
+ false,
+ true,
+ "",
+ "time - WFBE_SK_V_LastUse_MASH > WFBE_SK_V_Reload_MASH"
+ ];
+ };
+ };
+ case 'SpecOps': {
+ /* Lockpicking Ability */
+ _unit addAction [
+ ("<t color='#f8d664'>" + localize 'STR_WF_ACTION_Lockpick'+ "</t>"),
+ (WFBE_SK_V_Root + 'SpecOps' + '.sqf'),
+ [],
+ 80,
+ false,
+ true,
+ "",
+ "time - WFBE_SK_V_LastUse_Lockpick > WFBE_SK_V_Reload_Lockpick"
+ ];
+ };
+ case 'Spotter': {
+ /* Spotting Ability */
+ _unit addAction [
+ ("<t color='#f8d664'>" + localize 'STR_WF_ACTION_Spot'+ "</t>"),
+ (WFBE_SK_V_Root + 'Sniper' + '.sqf'),
+ [],
+ 80,
+ false,
+ true,
+ "",
+ "time - WFBE_SK_V_LastUse_Spot > WFBE_SK_V_Reload_Spot"
+ ];
+ };
+};
\ No newline at end of file diff --git a/Client/Module/Skill/Skill_Engineer.sqf b/Client/Module/Skill/Skill_Engineer.sqf new file mode 100644 index 0000000..ec65cde --- /dev/null +++ b/Client/Module/Skill/Skill_Engineer.sqf @@ -0,0 +1,32 @@ +/*
+ Script: Engineer Skill System by Benny.
+ Description: Add special skills to the defined engineer.
+*/
+Private ['_dammages','_skip','_sorted','_vehicle','_vehicles','_z'];
+
+
+private ["_x","_skip","_dammages","_vehicles","_sorted","_vehicle"];
+_vehicles = player nearEntities [["Car","Motorcycle","Tank","Ship","Air","StaticWeapon"],5];
+if (count _vehicles < 1) exitWith {};
+
+_sorted = [player,_vehicles] Call SortByDistance;
+_vehicle = _sorted select 0;
+
+_dammages = getDammage _vehicle;
+if (_dammages <= 0) exitWith {};
+WFBE_SK_V_LastUse_Repair = time;
+
+_skip = false;
+for [{_z = 0},{_z < 5},{_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 (!_skip) then {
+ _dammages = _dammages - 0.15;
+ if (_dammages < 0) then {_dammages = 0};
+ _vehicle setDammage _dammages;
+};
\ No newline at end of file diff --git a/Client/Module/Skill/Skill_Init.sqf b/Client/Module/Skill/Skill_Init.sqf new file mode 100644 index 0000000..6318bfe --- /dev/null +++ b/Client/Module/Skill/Skill_Init.sqf @@ -0,0 +1,41 @@ +/*
+ Script: Skill System by Benny.
+ Description: Skill Initialization.
+*/
+
+/* Skills Root */
+WFBE_SK_V_Root = 'Client\Module\Skill\Skill_';
+
+/* Functions */
+WFBE_SK_FNC_Apply = Compile preprocessFile "Client\Module\Skill\Skill_Apply.sqf";
+
+/* Define which classname belong to which skill group */
+WFBE_SK_V_Engineers = ['USMC_SoldierS_Engineer','MVD_Soldier_TL','US_Soldier_Engineer_EP1','TK_Soldier_Engineer_EP1','CDF_Soldier_Engineer','Ins_Soldier_Sapper'];
+WFBE_SK_V_Officers = ['FR_Commander','RUS_Commander','US_Soldier_SL_EP1','TK_Soldier_SL_EP1','CDF_Soldier_Officer','Ins_Commander'];
+WFBE_SK_V_Soldiers = ['FR_R','RUS_Soldier1','US_Delta_Force_EP1','TK_Special_Forces_EP1','CDF_Soldier','Ins_Soldier_1'];
+WFBE_SK_V_SpecsOps = ['FR_TL','RUS_Soldier_TL','US_Delta_Force_TL_EP1','TK_Special_Forces_TL_EP1','CDF_Soldier_TL','Ins_Soldier_2'];
+WFBE_SK_V_Spotters = ['USMC_SoldierS_Sniper','RU_Soldier_Sniper','US_Soldier_Sniper_EP1','TK_Soldier_Sniper_EP1','CDF_Soldier_Sniper','Ins_Soldier_Sniper'];
+
+/* Skills Variables */
+WFBE_SK_V_LastUse_Repair = -1200;
+WFBE_SK_V_LastUse_MASH = -1200;
+WFBE_SK_V_LastUse_Lockpick = -1200;
+WFBE_SK_V_LastUse_Spot = -1200;
+
+/* Skills Timeout */
+WFBE_SK_V_Reload_Repair = 65;
+WFBE_SK_V_Reload_MASH = 600;
+WFBE_SK_V_Reload_Lockpick = 25;
+WFBE_SK_V_Reload_Spot = 8;
+
+/* Find the player type */
+WFBE_SK_V_Type = "";
+if (playerType in WFBE_SK_V_Engineers) then {WFBE_SK_V_Type = "Engineer"};
+if (playerType in WFBE_SK_V_Officers) then {WFBE_SK_V_Type = "Officer"};
+if (playerType in WFBE_SK_V_Soldiers) then {WFBE_SK_V_Type = "Soldier"};
+if (playerType in WFBE_SK_V_SpecsOps) then {WFBE_SK_V_Type = "SpecOps"};
+if (playerType in WFBE_SK_V_Spotters) then {WFBE_SK_V_Type = "Spotter"};
+
+/* Special one time init */
+/* The soldier can hire more units than the others leader */
+if (WFBE_SK_V_Type == 'Soldier') then {['WFBE_MAXGROUPSIZE',('WFBE_MAXGROUPSIZE' Call GetNameSpace) + ('WFBE_MAXGZBONUSSKILL' Call GetNamespace),true] Call SetNamespace};
\ No newline at end of file diff --git a/Client/Module/Skill/Skill_Officer.sqf b/Client/Module/Skill/Skill_Officer.sqf new file mode 100644 index 0000000..3048459 --- /dev/null +++ b/Client/Module/Skill/Skill_Officer.sqf @@ -0,0 +1,32 @@ +/*
+ Script: Officer Skill System by Benny.
+ Description: Add special skills to the defined officer.
+*/
+Private ['_array','_exist','_skip','_tent','_toWorld','_type','_z'];
+
+
+private ["_x","_skip","_array","_toWorld","_tent","_type","_exist"];
+_type = Format ["WFBE_%1FARP",sideJoinedText] Call GetNamespace;
+_exist = WF_Logic getVariable Format ["%1MASH",sideJoinedText];
+if !(isNull _exist) then {deleteVehicle _exist};
+
+WFBE_SK_V_LastUse_MASH = time;
+
+_skip = false;
+for [{_z = 0},{_z < 7},{_z = _z + 1}] do {
+ sleep 0.5;
+ player playMove "AinvPknlMstpSlayWrflDnon_medic";
+ sleep 0.5;
+ waitUntil {animationState player == "ainvpknlmstpslaywrfldnon_amovpknlmstpsraswrfldnon" || !alive player || vehicle player != player};
+ if (!alive player || vehicle player != player) exitWith {_skip = true};
+};
+
+if (!_skip) then {
+ _array = [((player worldToModel (getPos player)) select 0),((player worldToModel (getPos player)) select 1) + 10];
+ _toWorld = player modelToWorld _array;
+ _tent = _type createVehicle _toWorld;
+ WF_Logic setVariable [Format["%1MASH",sideJoinedText],_tent,true];
+ _tent addAction ["<t color='#f8d664'>" + localize 'STR_WF_ACTION_UndeployMASH'+ "</t>", "Client\Module\Skill\Actions\Officer_Undeploy_MASH.sqf", [], 75, false, true, "", "alive _target && time - WFBE_SK_V_LastUse_MASH > 240"];
+} else {
+ WF_Logic setVariable [Format["%1MASH",sideJoinedText],objNull,true];
+};
\ No newline at end of file diff --git a/Client/Module/Skill/Skill_Sniper.sqf b/Client/Module/Skill/Skill_Sniper.sqf new file mode 100644 index 0000000..19bbfb1 --- /dev/null +++ b/Client/Module/Skill/Skill_Sniper.sqf @@ -0,0 +1,31 @@ +/*
+ Script: Sniper Skill System by Benny.
+ Description: Add special skills to the defined sniper.
+*/
+Private ['_binoculars','_markerName','_markertime','_screenPos'];
+
+
+private ["_binoculars","_screenPos","_markerName","_markertime"];
+_binoculars = 'WFBE_BINOCULARS' Call GetNamespace;
+if !((currentWeapon player) in _binoculars) exitWith {hint (localize "STR_WF_INFO_Spot_Info")};
+
+if (isNil "markerID") then {markerID = 1};
+_screenPos = screenToWorld [0.5,0.5];
+
+_markerName = Format ["Spot%1",markerID];
+createMarkerLocal [_markerName,_screenPos];
+_markertime = [daytime] call bis_fnc_timetostring;
+_markerName setMarkerText Format ['SPOTTED: %1',_markertime];
+_markerName setMarkerTypeLocal "mil_destroy";
+_markerName setMarkerColorLocal "ColorRed";
+_markerName setMarkerSizeLocal [0.5,0.5];
+markerID = markerID + 1;
+
+WFBE_SK_V_LastUse_Spot = time;
+
+[_markerName] Spawn {
+ Private ["_marker"];
+ _marker = _this select 0;
+ sleep 180;
+ deleteMarkerLocal _marker;
+};
\ No newline at end of file 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");
+ };
+};
|
