summaryrefslogtreecommitdiffstats
path: root/Client/Init
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:24 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:24 +0300
commit628d33984d9228f1781d13a65fbb80f35facc899 (patch)
treecd909141f87e14f22c3511549a9bc067d9ff8b50 /Client/Init
downloada2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.tar.gz
a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.tar.bz2
a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.zip
init
Diffstat (limited to '')
-rw-r--r--Client/Init/Init_BaseStructure.sqf34
-rw-r--r--Client/Init/Init_Blacklist.sqf15
-rw-r--r--Client/Init/Init_Client.sqf376
-rw-r--r--Client/Init/Init_Coin.sqf91
-rw-r--r--Client/Init/Init_Faction.sqf19
-rw-r--r--Client/Init/Init_Keybind.sqf26
6 files changed, 561 insertions, 0 deletions
diff --git a/Client/Init/Init_BaseStructure.sqf b/Client/Init/Init_BaseStructure.sqf
new file mode 100644
index 0000000..a60bf50
--- /dev/null
+++ b/Client/Init/Init_BaseStructure.sqf
@@ -0,0 +1,34 @@
+waitUntil {commonInitComplete};
+
+if (local player) then {
+ Private["_allies","_color","_hq","_marker","_structure","_text","_type","_side","_voteTime"];
+
+ _structure = _this Select 0;
+ _hq = _this select 1;
+ _side = _this select 2;
+ _allies = if (count _this > 3) then {_this select 3} else {""};
+
+ if (_side != side player) exitWith {};
+
+ sleep random(3);
+
+ while {_voteTime = WF_Logic getVariable "eastCommanderVoteTime";IsNil "_voteTime"} do {sleep 1};
+
+ _marker = Format["BaseMarker%1",buildingMarker];
+ buildingMarker = buildingMarker + 1;
+ createMarkerLocal [_marker,getPos _structure];
+ _type = "mil_box";
+ _color = "ColorBlue";
+ if (_hq) then {_type = "Headquarters";_color = "ColorGreen"};
+ if (_allies != "") then {_type = "mil_box";_color = "ColorGreen"};
+ _marker setMarkerTypeLocal _type;
+ _text = "";
+ if (!_hq && _allies == "") then {_text = [_structure] Call GetStructureMarkerLabel;_marker setMarkerSizeLocal [0.5,0.5]};
+ if (_allies != "") then {_marker setMarkerSizeLocal [0.5,0.5];_text = _allies};
+ if (_text != "") then {_marker setMarkerTextLocal _text};
+ _marker setMarkerColorLocal _color;
+
+ while {!isNull _structure && alive _structure} do {sleep 2};
+
+ deleteMarkerLocal _marker;
+}; \ No newline at end of file
diff --git a/Client/Init/Init_Blacklist.sqf b/Client/Init/Init_Blacklist.sqf
new file mode 100644
index 0000000..8903c5a
--- /dev/null
+++ b/Client/Init/Init_Blacklist.sqf
@@ -0,0 +1,15 @@
+Private ["_blackListID","_id"];
+_id = getPlayerUID (_this select 0);
+
+//--- Griefers ID.
+_blackListID = [
+"4837314",
+"12051782",
+"7148678",
+"4139392",
+"4094594",
+"2992070",
+"823297"
+];
+
+if (_id in _blackListID) then {true} else {false}; \ No newline at end of file
diff --git a/Client/Init/Init_Client.sqf b/Client/Init/Init_Client.sqf
new file mode 100644
index 0000000..dfdce06
--- /dev/null
+++ b/Client/Init/Init_Client.sqf
@@ -0,0 +1,376 @@
+Private ['_HQRadio','_base','_buildings','_condition','_get','_idbl','_isDeployed','_oc','_voteTime','_weat'];
+
+diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Init start at %3",diag_frameno,diag_tickTime,time];
+
+sideJoined = side player;
+sideJoinedText = str sideJoined;
+
+//--- Position the client on the temp spawn (Common is not yet init'd so we call is straigh away).
+player setPos ([getMarkerPos Format["%1TempRespawnMarker",sideJoinedText],1,10] Call Compile preprocessFile "Common\Functions\Common_GetRandomPosition.sqf");
+
+ARTY_HandleILLUM = Compile preprocessFile "Client\Module\Arty\ARTY_HandleILLUM.sqf";
+ARTY_HandleSADARM = Compile preprocessFile "Client\Module\Arty\ARTY_HandleSADARM.sqf";
+if (paramArty) then {
+ ARTY_Prep = Compile preprocessFile "Client\Module\Arty\ARTY_mobileMissionPrep.sqf";
+ ARTY_Finish = Compile preprocessFile "Client\Module\Arty\ARTY_mobileMissionFinish.sqf";
+ RequestFireMission = Compile preprocessFile "Client\Functions\Client_RequestFireMission.sqf"
+};
+if (paramBoundaries) then {
+ BoundariesIsOnMap = Compile preprocessFile "Client\Functions\Client_IsOnMap.sqf";
+ BoundariesHandleOnMap = Compile preprocessFile "Client\Functions\Client_HandleOnMap.sqf";
+};
+BuildUnit = Compile preprocessFile "Client\Functions\Client_BuildUnit.sqf";
+ChangePlayerFunds = Compile preprocessFile "Client\Functions\Client_ChangePlayerFunds.sqf";
+CommandChatMessage = Compile preprocessFile "Client\Functions\Client_CommandChatMessage.sqf";
+if (paramCounterMeasures) then {
+ CM_Countermeasures = Compile preprocessFile "Client\Module\CM\CM_Countermeasures.sqf";
+ CM_Flares = Compile preprocessFile "Client\Module\CM\CM_Flares.sqf";
+ CM_Spoofing = Compile preprocessFile "Client\Module\CM\CM_Spoofing.sqf";
+};
+DebugHint = Compile preprocessFile "Client\Functions\Client_DebugHint.sqf";
+DisplayInventory = Compile preprocessFile "Client\Functions\Client_DisplayInventory.sqf";
+EquipDefaultLoadout = Compile preprocessFile "Client\Functions\Client_EquipDefaultLoadout.sqf";
+FX = Compile preprocessFile "Client\Functions\Client_FX.sqf";
+GetIncome = Compile preprocessFile "Client\Functions\Client_GetIncome.sqf";
+GetMarkerColoration = Compile preprocessFile "Client\Functions\Client_GetMarkerColoration.sqf";
+GetPlayerFunds = Compile preprocessFile "Client\Functions\Client_GetPlayerFunds.sqf";
+GetRespawnAvailable = Compile preprocessFile "Client\Functions\Client_GetRespawnAvailable.sqf";
+GetStructureMarkerLabel = Compile preprocessFile "Client\Functions\Client_GetStructureMarkerLabel.sqf";
+GetTime = Compile preprocessFile "Client\Functions\Client_GetTime.sqf";
+GroupChatMessage = Compile preprocessFile "Client\Functions\Client_GroupChatMessage.sqf";
+HandleHQAction = Compile preprocessFile "Client\Functions\Client_HandleHQAction.sqf";
+HandlePVF = Compile preprocessFile "Client\Functions\Client_HandlePVF.sqf";
+MarkerAnim = Compile preprocessFile "Client\Functions\Client_MarkerAnim.sqf";
+OnRespawnHandler = Compile preprocessFile "Client\Functions\Client_OnRespawnHandler.sqf";
+PlayerKilled = Compile preprocessFile "Client\Client_Killed.sqf";
+PreRespawnHandler = Compile preprocessFile "Client\Functions\Client_PreRespawnHandler.sqf";
+ReplaceArray = Compile preprocessFile "Client\Functions\Client_ReplaceArray.sqf";
+ReplaceInventoryAmmo = Compile preprocessFile "Client\Functions\Client_ReplaceInventoryAmmo.sqf";
+if !(WF_A2_Vanilla) then {
+ RespawningBag = Compile preprocessFile "Client\Functions\Client_RespawnBag.sqf";
+} else {
+ RespawningBag = {};
+};
+SetControlFadeAnim = Compile preprocessFile "Client\Functions\Client_SetControlFadeAnim.sqf";
+SetControlFadeAnimStop = Compile preprocessFile "Client\Functions\Client_SetControlFadeAnimStop.sqf";
+SupportHeal = Compile preprocessFile "Client\Functions\Client_SupportHeal.sqf";
+SupportRearm = Compile preprocessFile "Client\Functions\Client_SupportRearm.sqf";
+SupportRefuel = Compile preprocessFile "Client\Functions\Client_SupportRefuel.sqf";
+SupportRepair = Compile preprocessFile "Client\Functions\Client_SupportRepair.sqf";
+TaskSystem = Compile preprocessFile "Client\Functions\Client_TaskSystem.sqf";
+TitleTextMessage = Compile preprocessFile "Client\Functions\Client_TitleTextMessage.sqf";
+UIAddItem = Compile preprocessFile "Client\Functions\Client_UIAddItem.sqf";
+UIAddMagazine = Compile preprocessFile "Client\Functions\Client_UIAddMagazine.sqf";
+UIChangeComboBuyUnits = Compile preprocessFile "Client\Functions\Client_UIChangeComboBuyUnits.sqf";
+UIFillListBuyUnits = Compile preprocessFile "Client\Functions\Client_UIFillListBuyUnits.sqf";
+UIFillListTeamOrders = Compile preprocessFile "Client\Functions\Client_UIFillListTeamOrders.sqf";
+UIFindLBValue = Compile preprocessFile "Client\Functions\Client_UIFindLBValue.sqf";
+UIGearFillList = Compile preprocessFile "Client\Functions\Client_UIGearFillList.sqf";
+UIGearFillTemplateList = Compile preprocessFile "Client\Functions\Client_UIGearFillTemplateList.sqf";
+if (paramICBM) then {
+ Nuke = Compile preprocessFile "Client\Module\Nuke\nuke.sqf";
+ NukeIncomming = Compile preprocessFile "Client\Module\Nuke\nukeincoming.sqf";
+};
+//--- Namespace related (GUI).
+BIS_FNC_GUIset = {UInamespace setVariable [_this select 0, _this select 1]};
+BIS_FNC_GUIget = {UInamespace getVariable (_this select 0)};
+
+clientInitComplete = true;
+
+//--- Waiting for the common part to be executed.
+waitUntil {commonInitComplete};
+
+diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Common is ready at %3. Executing Client Initialization...",diag_frameno,diag_tickTime,time];
+
+if (('WFBE_ISIS' Call GetNamespace) != 0) then {ISIS_Effects = Compile preProcessFile "Client\Module\ISIS\ISIS_Clientfx.sqf"};
+
+//--- Queue Protection.
+['WFBE_C_QUEUE_BARRACKS',0,true] Call SetNamespace;
+['WFBE_C_QUEUE_BARRACKS_MAX',10,true] Call SetNamespace;
+['WFBE_C_QUEUE_LIGHT',0,true] Call SetNamespace;
+['WFBE_C_QUEUE_LIGHT_MAX',3,true] Call SetNamespace;
+['WFBE_C_QUEUE_HEAVY',0,true] Call SetNamespace;
+['WFBE_C_QUEUE_HEAVY_MAX',3,true] Call SetNamespace;
+['WFBE_C_QUEUE_AIRCRAFT',0,true] Call SetNamespace;
+['WFBE_C_QUEUE_AIRCRAFT_MAX',2,true] Call SetNamespace;
+['WFBE_C_QUEUE_AIRPORT',0,true] Call SetNamespace;
+['WFBE_C_QUEUE_AIRPORT_MAX',2,true] Call SetNamespace;
+['WFBE_C_QUEUE_DEPOT',0,true] Call SetNamespace;
+['WFBE_C_QUEUE_DEPOT_MAX',3,true] Call SetNamespace;
+
+//--- Handle the Fast Time.
+if (('WFBE_FASTTIMERATE' Call GetNamespace) > 0) then {[] ExecFSM "Client\FSM\fasttimecli.fsm"};
+
+//--- Handle the weather.
+_weat = 'WFBE_WEATHER' Call GetNamespace;
+if (_weat == 3) then {
+ [] ExecFSM "Client\FSM\overcast.fsm";
+} else {
+ _oc = 0.05;
+ switch (_weat) do {
+ case 0: {_oc = 0};
+ case 1: {_oc = 0.5};
+ case 2: {_oc = 1};
+ };
+ 60 setOvercast _oc;
+};
+if (paramVolumClouds) then {[] Exec "CA\Modules\clouds\data\scripts\bis_cloudsystem.sqs"};
+
+_idbl = [player] Call Compile preprocessFile "Client\Init\Init_Blacklist.sqf";
+if (_idbl) exitWith {[] Spawn {Private["_txt"];_txt = "INFORMATION:\n\n You are currently blacklisted.";_txt Call DebugHint;sleep 5; disableUserInput true; sleep 60; disableUserInput false; failMission "END1"}};
+
+//--- Global Client Variables.
+sideID = sideJoined Call GetSideID;
+clientID = player Call GetClientID;
+clientIdentification = Format ["%1Slot%2",sideJoinedText,clientID];
+clientTeam = group player;
+clientTeams = (Format['WFBE_%1TEAMS',sideJoinedText] Call GetNamespace);
+playerType = typeOf player;
+playerDead = false;
+paramBoundariesRunning = false;
+
+commanderTeam = objNull;
+buildingMarker = 0;
+gearCost = 0;
+currentTG = 25;
+lastBuilt = [];
+unitQueu = 0;
+fireMissionTime = -1000;
+artyRange = 15;
+artyPos = [0,0,0];
+playerUAV = objNull;
+comTask = objNull;
+voted = false;
+votePopUp = true;
+manningDefense = true;
+currentFX = 0;
+lastParaCall = -1200;
+lastSupplyCall = -1200;
+canBuildWHQ = true;
+WFBE_RespawnDefaultGear = false;
+WFBE_EnablePreload = false;
+WFBE_ForceUpdate = false;
+
+hqInRange = false;
+barracksInRange = false;
+gearInRange = false;
+lightInRange = false;
+heavyInRange = false;
+aircraftInRange = false;
+serviceInRange = false;
+commandInRange = false;
+depotInRange = false;
+antiAirRadarInRange = false;
+hangarInRange = false;
+
+enableTeamSwitch false;
+
+/* Airfields Init */
+if (isNil "Airfields") then {Airfields = []};
+
+/* CIPHER Module - Sorting */
+ExecVM "Common\Module\CIPHER\CIPHER_Sort.sqf";
+
+//--- Disable Artillery Computer.
+if ((('WFBE_ARTILLERYCOMPUTER' Call GetNamespace) != 2) && !WF_A2_Vanilla) then {Call Compile "enableEngineArtillery false;"};
+
+/* Exec SQF|FSM Misc stuff. */
+if (paramTrackPlayer) then {[] ExecFSM "Client\FSM\updateteamsmarkers.fsm"};
+[] ExecFSM "Client\FSM\updateactions.fsm";
+/* Don't pause the client initialization process. */
+[] Spawn {
+ waitUntil {townInit};
+ /* Handle the capture GUI */
+ diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Towns Capture FSM - [Done]",diag_frameno,diag_tickTime];
+ [] ExecFSM "Client\FSM\updatecapture.fsm";
+ /* Handle the map town markers */
+ diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Towns Marker FSM - [Done]",diag_frameno,diag_tickTime];
+ [] ExecFSM "Client\FSM\updatetownmarkers.fsm";
+ waitUntil {!isNil Format["%1BaseStructures",sideJoinedText]};
+ /* Handle the client actions */
+ diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Available Action FSM - [Done]",diag_frameno,diag_tickTime];
+ [] ExecFSM "Client\FSM\updateavailableactions.fsm";
+ /* Resources Handler */
+ if !(('WFBE_INCOMESYSTEM' Call GetNamespace) in [3,4]) then {
+ diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Ressources FSM - [Done]",diag_frameno,diag_tickTime];
+ (sideJoined) ExecFSM "Client\FSM\resources_cli.fsm";
+ };
+};
+[] Spawn {
+ Private ["_commanderTeam"];
+ waitUntil{sleep 0.1;!isNil {(sideJoined) Call GetCommanderTeam}};
+ /* Commander Handling */
+ diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Commander Update FSM - [Done]",diag_frameno,diag_tickTime];
+ [] ExecFSM "Client\FSM\updateclient.fsm";
+};
+
+//--- Add the briefing (notes).
+[] Call Compile preprocessFile "briefing.sqf";
+
+//--- HQ Radio system.
+waitUntil {!isNil Format ["BIS_WF_HQ%1",sideJoinedText]};
+_HQRadio = Call Compile Format ["BIS_WF_HQ%1",sideJoinedText];
+diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Radio Announcer - [Done]",diag_frameno,diag_tickTime];
+waitUntil {!isNil Format ["BIS_WF_HQ%1_TI",sideJoinedText]};
+WFBE_V_HQTopicSide = Call Compile Format ["BIS_WF_HQ%1_TI",sideJoinedText];
+diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Radio Announcer (Identity Synchronization) - [Done]",diag_frameno,diag_tickTime];
+_HQRadio setIdentity WFBE_V_HQTopicSide;
+_HQRadio setRank "COLONEL";
+_HQRadio setGroupId ["HQ"];
+_HQRadio kbAddTopic [WFBE_V_HQTopicSide,"Client\kb\hq.bikb","Client\kb\hq.fsm",{call compile preprocessFileLineNumbers "Client\kb\hq.sqf"}];
+player kbAddTopic [WFBE_V_HQTopicSide,"Client\kb\hq.bikb","Client\kb\hq.fsm",{call compile preprocessFileLineNumbers "Client\kb\hq.sqf"}];
+sideHQ = _HQRadio;
+
+diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Radio Announcers - [Done]",diag_frameno,diag_tickTime];
+
+/* Wait for a valid signal (Teamswaping) with failover */
+if (isMultiplayer && paramKickTeamswappers && time > 7) then {
+ Private ["_get","_timelaps"];
+ _get = true;
+
+ sleep (random 0.1);
+
+ WFBE_RequestJoin = ['SRVFNCREQUESTJOIN',[getPlayerUID(player),sideJoined,name player,vehicleVarName player]];
+ publicVariable 'WFBE_RequestJoin';
+
+ _timelaps = 0;
+ while {true} do {
+ sleep 0.1;
+ _get = 'WFBE_P_CANJOIN' Call GetNamespace;
+ if !(isNil '_get') exitWith {diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Client %3 (side: %4) can join game -> %5",diag_frameno,diag_tickTime,name player,sideJoined,_get]};
+
+ _timelaps = _timelaps + 0.1;
+ if (_timelaps > 5) then {
+ _timelaps = 0;
+ diag_log Format["[WFBE (WARNING)][frameno:%1 | ticktime:%2] Init_Client: Client %3 (side: %4) Pending... no ACK answer from server were received, sending a new request...",diag_frameno,diag_tickTime,name player,sideJoined];
+ WFBE_RequestJoin = ['SRVFNCREQUESTJOIN',[getPlayerUID(player),sideJoined,name player,vehicleVarName player]];
+ publicVariable 'WFBE_RequestJoin';
+ };
+ };
+
+ if !(_get) exitWith {
+ diag_log Format["[WFBE (WARNING)][frameno:%1 | ticktime:%2] Init_Client: Client %3 (side: %4) has teamswapped and was sent back to the lobby...",diag_frameno,diag_tickTime,name player,sideJoined];
+ (localize 'STR_WF_CHAT_Teamswap_Warnning') Call CommandChatMessage;
+ sleep 3;
+ failMission "END1";
+ };
+};
+
+/* Get the client starting location */
+diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Getting the client spawn location - [In Progress]",diag_frameno,diag_tickTime];
+_base = objNull;
+if (time < 30) then {
+ waitUntil {!isNil Format ["%1StartingLocation",sideJoinedText]};
+ _base = Call Compile Format ["%1StartingLocation",sideJoinedText];
+} else {
+ waitUntil {!isNil Format ["%1MHQ",sideJoinedText]};
+ _base = (sideJoinedText) Call GetSideHQ;
+ _buildings = (sideJoinedText) Call GetSideStructures;
+
+ if (count _buildings > 0) then {_base = _buildings select 0};
+};
+
+diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Getting the client spawn location (%3) - [Done]",diag_frameno,diag_tickTime,typeOf _base];
+
+/* Position the client at the previously defined location */
+player setPos ([getPos _base,20,30] Call GetRandomPosition);
+
+/* HQ Building Init. */
+waitUntil {!isNil Format ["%1MHQDeployed",sideJoinedText]};
+diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: CoIn module for HQ - [Done]",diag_frameno,diag_tickTime];
+_isDeployed = (sideJoinedText) Call GetSideHQDeployed;
+if (_isDeployed) then {
+ ['WFBE_AREAHQDEPLOYED' Call GetNamespace,true,MCoin] Call Compile preprocessFile "Client\Init\Init_Coin.sqf";
+} else {
+ ['WFBE_AREAHQUNDEPLOYED' Call GetNamespace,false,MCoin] Call Compile preprocessFile "Client\Init\Init_Coin.sqf";
+};
+
+/* Options menu. */
+Options = player addAction ["<t color='#42b6ff'>" + (localize "STR_WF_Options") + "</t>","Client\Action\Action_Menu.sqf", "", 1, false, true, "", "_target == player"];
+
+/* Zeta Cargo Lifter. */
+[] Call Compile preprocessFile "Client\Module\ZetaCargo\Zeta_Init.sqf";
+/* Set Groups ID. */
+[] Call Compile preprocessFile "Client\Functions\Client_SetGroupsID.sqf";
+
+sleep 1;
+
+//--- Play a tune.
+_music = switch (true) do {
+ case WF_A2_Vanilla: {["Track11_Large_Scale_Assault","Track02_Insertion","Ambient07_Manhattan","Track10_Logistics","Track09_Movement_To_Contact","Track16_Valentine"]};
+ case WF_A2_Arrowhead: {["EP1_Track10","EP1_Track12","EP1_Track14","EP1_Track15"]};
+ case WF_A2_CombinedOps: {["EP1_Track10","EP1_Track15","Track11_Large_Scale_Assault","Track02_Insertion","Ambient07_Manhattan","Track10_Logistics","Track09_Movement_To_Contact","Track16_Valentine"]};
+ default {[]};
+};
+
+if (count _music > 0) then {playMusic (_music select floor(random(count _music)))};
+
+/* Override player's Gear.*/
+player call EquipDefaultLoadout;
+/* Default gear menu filler. */
+WF_Logic setVariable ['filler','primary'];
+
+/* Skill Module. */
+[] Call Compile preprocessFile "Client\Module\Skill\Skill_Init.sqf";
+(player) Call WFBE_SK_FNC_Apply;
+
+/* Vote System, define whether a vote is already running or not */
+_voteTime = 0;
+waitUntil {sleep 0.1;_voteTime = WF_Logic getVariable Format ["%1CommanderVoteTime",sideJoinedText];!(isNil '_voteTime')};
+diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Vote System Initialization - [Done]",diag_frameno,diag_tickTime];
+if (_voteTime > 0) then {createDialog "RscMenu_Voting"};
+
+/* Debug System - Client */
+if (WF_Debug) then {
+ onMapSingleClick {vehicle player setpos _pos;(vehicle player) setVelocity [0,0,-0.1];}; //--- Teleport
+ //player addEventHandler ["HandleDamage", {false}];
+ // player setCaptive true;
+ player addEventHandler ["HandleDamage", {false;if (player != (_this select 3)) then {(_this select 3) setDammage 1}}]; //--- God-Slayer mode.
+};
+
+/* ISIS Module */
+if (('WFBE_ISIS' Call GetNamespace) != 0) then {player addEventHandler['handleDamage',{_this Call ISIS_Wound}]};
+
+/* Artillery UI */
+if (paramArtyUI) then {[] ExecVM "ca\modules\ARTY\data\scripts\init.sqf"};
+
+/* EASA */
+if (paramEASA) then {[] Call Compile preProcessFile "Client\Module\EASA\EASA_Init.sqf"};
+
+/* Key Binding */
+[] Call Compile preprocessFile "Client\Init\Init_Keybind.sqf";
+
+/* JIP Handler */
+waitUntil {townInit};
+diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Towns Initialization - [Done]",diag_frameno,diag_tickTime];
+
+/* Conquest helper */
+if (('WFBE_TOWNCONQUESTMODE' Call GetNamespace) > 0) then {[] ExecFSM "Client\FSM\conquest_helper.fsm"};
+
+sleep 3;
+/* JIP System, initialize the camps and towns properly. */
+[] Spawn {
+ sleep 2;
+ diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: JIP Detected, Updating the markers - [Done]",diag_frameno,diag_tickTime];
+ [] ExecVM "Client\Functions\Client_InitTownsAndCamps.sqf";
+};
+
+/* Repair Truck CoIn Handling. */
+['WFBE_AREAREPAIRTRUCK' Call GetNamespace,false,RCoin,"REPAIR"] Call Compile preprocessFile "Client\Init\Init_Coin.sqf";
+
+/* A new player come to reinforce the battlefield */
+[sideJoinedText,'UnitsCreated',1] Call UpdateStatistics;
+
+/* Towns Task System */
+["TownAddComplete"] Spawn TaskSystem;
+
+/* End Init */
+finishMissionInit;
+
+/* Client death handler. */
+Call Compile Format ["player addEventHandler ['Killed',{[_this select 0,_this select 1] Spawn PlayerKilled;[_this select 0,_this select 1,%1,false] Spawn UnitKilled}]",sideJoined];
+
+/* Client Init Done - Remove the blackout */
+12452 cutText [(localize 'STR_WF_Loading')+"...","BLACK IN",5];
+
+diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Client: Init End at %3",diag_frameno,diag_tickTime,time]; \ No newline at end of file
diff --git a/Client/Init/Init_Coin.sqf b/Client/Init/Init_Coin.sqf
new file mode 100644
index 0000000..7bb4caf
--- /dev/null
+++ b/Client/Init/Init_Coin.sqf
@@ -0,0 +1,91 @@
+Private ['_area','_coin','_coinCategories','_coinItemArray','_curId','_d','_defenseCategories','_defenseCosts','_defenseDescriptions','_defenses','_emptyStructures','_extra','_fix','_i','_indexCategory','_isHQdeployed','_structureCosts','_structureDescriptions','_structures','_updateDefenses','_updateStructures'];
+_area = _this select 0;
+_isHQdeployed = _this select 1;
+_coin = _this select 2;
+_extra = "";
+if (count _this > 3) then {_extra = _this select 3};
+
+_coin setVariable ["BIS_COIN_areasize", _area];
+_coin setVariable ["BIS_COIN_fundsDescription",["$"]];
+if (_extra == "") then {
+ _coin setVariable ["BIS_COIN_funds",if !(paramMoneyOnly) then {[(sideJoined) Call GetSideSupply, Call GetPlayerFunds]} else {Call GetPlayerFunds}];
+ _coin setVariable ["BIS_COIN_fundsDescription",if !(paramMoneyOnly) then {["S ","$ "]} else {["$ "]}];
+};
+
+_defenses = [];
+_defenseCosts = [];
+_defenseDescriptions = [];
+_defenseCategories = [];
+
+_structures = [(Format["WFBE_%1STRUCTURENAMES",sideJoinedText] Call GetNamespace) select 0];
+_structureCosts = [(Format["WFBE_%1STRUCTURECOSTS",sideJoinedText] Call GetNamespace) select 0];
+_structureDescriptions = [(Format["WFBE_%1STRUCTUREDESCRIPTIONS",sideJoinedText] Call GetNamespace) select 0];
+
+_i = 0;
+
+_updateStructures = false;
+_updateDefenses = false;
+_emptyStructures = false;
+
+if (_isHQdeployed && _extra == "") then {_i = 1;_updateStructures = true; _updateDefenses = true};
+if (_extra == "REPAIR") then {_updateDefenses = true; _emptyStructures = true;_coin setVariable ["BIS_COIN_funds",Call GetPlayerFunds]};
+
+if (_updateStructures) then {
+ _structures = Format["WFBE_%1STRUCTURENAMES",sideJoinedText] Call GetNamespace;
+ _structureCosts = Format["WFBE_%1STRUCTURECOSTS",sideJoinedText] Call GetNamespace;
+ _structureDescriptions = Format["WFBE_%1STRUCTUREDESCRIPTIONS",sideJoinedText] Call GetNamespace;
+};
+
+if (_updateDefenses) then {
+ _defenses = Format["WFBE_%1DEFENSENAMES",sideJoinedText] Call GetNamespace;
+ {
+ _d = _x Call GetNamespace;
+ if !(isNil '_d') then {
+ _defenseCosts = _defenseCosts + [(_d select QUERYUNITPRICE)];
+ _defenseDescriptions = _defenseDescriptions + [(_d select QUERYUNITLABEL)];
+ _defenseCategories = _defenseCategories + [(_d select QUERYUNITFACTORY)];
+ };
+ } forEach _defenses;
+};
+
+if (_emptyStructures) then {
+ _structures = [];
+ _structureCosts = [];
+ _structureDescriptions = [];
+};
+
+_indexCategory=0;
+_coinCategories = [];
+_coinItemArray = [];
+if (count _structures > 0) then {_coinCategories = _coinCategories + [localize "strwfbase"];_indexCategory =_indexCategory +1;};
+if (count _defenses > 0) then {if (_extra == "REPAIR") then {_coinCategories = []};_coinCategories = _coinCategories + [localize "str_m04t37_0"] + [localize "STR_WF_Fortification"] + [localize "STR_WF_Strategic"] + [localize "STR_WF_Ammo"]};
+
+if (_isHQdeployed && _i == 1 && _extra == "") then {_coinItemArray = _coinItemArray + [[_structures select 0,0,[0, _structureCosts select 0], (_structureDescriptions select 0) + " " + localize "strwfhqmobilizeme"]]};
+for [{_i=_i}, {_i<count _structures}, {_i = _i+1}] do {
+ _coinItemArray = _coinItemArray + [[_structures select _i,0,[0, _structureCosts select _i], (_structureDescriptions select _i)]];
+};
+
+_fix = if !(paramMoneyOnly) then {1} else {0};
+if (_extra == "REPAIR") then {_coinItemArray = [];_indexCategory=0;_fix = 0};
+for '_i' from 0 to count(_defenses)-1 do {
+ _curId = _indexCategory;
+ switch (_defenseCategories select _i) do {
+ case "Fortification": {_curId = _indexCategory + 1};
+ case "Strategic": {_curId = _indexCategory + 2};
+ case "Ammo": {_curId = _indexCategory + 3};
+ };
+ _coinItemArray = _coinItemArray + [[_defenses select _i,_curId,[_fix, _defenseCosts select _i], _defenseDescriptions select _i]];
+} forEach _defenses;
+
+_coin setVariable ["BIS_COIN_categories",_coinCategories];
+_coin setVariable ["BIS_COIN_items",_coinItemArray];
+
+//--- Logic ID
+if (isnil "BIS_coin_lastID") then {BIS_coin_lastID = -1};
+BIS_coin_lastID = BIS_coin_lastID + 1;
+call compile format ["BIS_coin_%1 = _coin; _coin setvehiclevarname 'BIS_coin_%1';",BIS_coin_lastID];
+
+_coin setVariable ["BIS_COIN_ID",BIS_coin_lastID];
+
+//--- Temporary variables
+_coin setVariable ["BIS_COIN_params",[]]; \ No newline at end of file
diff --git a/Client/Init/Init_Faction.sqf b/Client/Init/Init_Faction.sqf
new file mode 100644
index 0000000..543d68d
--- /dev/null
+++ b/Client/Init/Init_Faction.sqf
@@ -0,0 +1,19 @@
+Private ['_c','_list','_r','_side','_type','_u'];
+_type = _this select 0;
+_side = _this select 1;
+_list = _this select 2;
+
+_r = [localize 'STR_WF_COMMAND_All'];
+_u = [];
+
+{
+ _c = _x Call GetNamespace;
+ if !(isNil '_c') then {
+ if !((_c select QUERYUNITFACTION) in _u) then {
+ _r = _r + [(_c select QUERYUNITFACTION)];
+ _u = _u + [(_c select QUERYUNITFACTION)];
+ };
+ };
+} forEach _list;
+
+[Format["WFBE_%1%2FACTIONS",_side,_type],_r,true] Call SetNamespace; \ No newline at end of file
diff --git a/Client/Init/Init_Keybind.sqf b/Client/Init/Init_Keybind.sqf
new file mode 100644
index 0000000..c9e6c08
--- /dev/null
+++ b/Client/Init/Init_Keybind.sqf
@@ -0,0 +1,26 @@
+/* Gear keybinding */
+WF_Gear_Hotkeys = {
+ Private ['_ctrl','_key'];
+ _key = _this select 1;
+ _ctrl = _this select 3;
+
+ if (_key in (actionKeys "User15")) then {
+ WF_Logic setVariable ['filler','all'];
+ };
+ if (_key in (actionKeys "User16")) then {
+ WF_Logic setVariable ['filler','template'];
+ };
+ if (_key in (actionKeys "User17")) then {
+ WF_Logic setVariable ['filler','primary'];
+ };
+ if (_key in (actionKeys "User18")) then {
+ WF_Logic setVariable ['filler','secondary'];
+ };
+ if (_key in (actionKeys "User19")) then {
+ WF_Logic setVariable ['filler','sidearm'];
+ };
+ if (_key in (actionKeys "User20")) then {
+ WF_Logic setVariable ['filler','misc'];
+ };
+};
+