XEH_postinit.sqf 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. #include "config_macros.hpp"
  2. #include "\a3\editor_f\Data\Scripts\dikCodes.h"
  3. //Run the jumppack script
  4. [] spawn {
  5. [] spawn compile preprocessFileLineNumbers 'macro_mod_script_path\jumppack\jumppack.sqf';
  6. sleep 0.5;
  7. call compile preprocessFileLineNumbers 'macro_mod_script_path\jumppack\jumppack_effects.sqf';
  8. };
  9. // Add nightvision event handler
  10. call macro_fnc_name(nightvision);
  11. #define QWEAP_NOFAM(name) macro_quote(macro_new_weapon_nofam(name))
  12. #define QWEAP_LAUNCH(name) macro_quote(macro_new_weapon(launcher,name))
  13. // Drone Recharge
  14. RD501_DRONE_BATTERY = "RD501_r2_charge_pack_x10_mag";
  15. private _refuelAction = [
  16. "RD501_Drone_Refuel",
  17. "Refuel Drone",
  18. "",
  19. rd501_fnc_refuelUAVDrone,
  20. rd501_fnc_canRefuel,[],
  21. {call ace_interaction_fnc_getVehiclePos},
  22. 4
  23. ] call ACE_interact_menu_fnc_createAction;
  24. ["RD501_Drone_Clone_Recon_Droid", 0, ["ACE_MainActions"], _refuelAction, true] call ACE_interact_menu_fnc_addActionToClass;
  25. //Force Walk
  26. RD501_FORCE_WALK_WEAPONS = [macro_quote(macro_new_weapon_nofam(z1000))];
  27. ["weapon", macro_fnc_name(heavyWeaponHandlePlayerWeaponChanged)] call CBA_fnc_addPlayerEventHandler;
  28. //Auto Reload On Equip
  29. RD501_AUTO_RELOAD_ON_EQUIP = [QWEAP_NOFAM(z1000),QWEAP_LAUNCH(rps1)];
  30. ["weapon", macro_fnc_name(reloadWeaponOnFirstSelected)] call CBA_fnc_addPlayerEventHandler;
  31. // Magclamp
  32. call macro_fnc_name(magclamp);
  33. // Check every second for if the Loading Screen is still up and forcibly end it.
  34. _fnc_endLoadingScreen = {
  35. params ["_args", "_handle"];
  36. systemChat format["Ending LoadingScreen [Handle %1]", _handle];
  37. endLoadingScreen;
  38. _stillLoading = call BIS_fnc_isLoading;
  39. if(!_stillLoading) exitWith {
  40. [_handle] call CBA_fnc_removePerFrameHandler;
  41. };
  42. };
  43. [_fnc_endLoadingScreen, 5, []] call CBA_fnc_addPerFrameHandler;
  44. // Flip Backpack
  45. rd501_flip_vehicle_validBackpacks = ["RD501_JLTS_Clone_Flip_backpack"];
  46. ["rd501_external_reload", { _this call rd501_fnc_onReloadExternalHandler }, []] call CBA_fnc_addEventHandlerArgs;
  47. // Fortify Tool Adjustments
  48. call macro_fnc_name(fortify_tool);
  49. // Medical CCP Building
  50. rd501_medical_ccp_building = "Land_Medevac_house_V1_F";
  51. rd501_medical_ccp_classes = ["Land_Medevac_house_V1_F"];
  52. rd501_medical_ccp_truck = "rd501_mash_truck";
  53. rd501_medical_ccp_stitchDurationSeconds = 5;
  54. rd501_medical_ccp_bandageDurationSeconds = 5;
  55. ["rd501_medical_ccp_incrementStitch",{
  56. _this call rd501_fnc_incrementStitchProgress
  57. }] call CBA_fnc_addEventHandler;
  58. ["rd501_medical_ccp_incrementBandage",{
  59. _this call rd501_fnc_incrementBandageProgress
  60. }] call CBA_fnc_addEventHandler;
  61. ["rd501_medical_ccp_deployCCPLocal", {
  62. _this call rd501_fnc_deployCCPLocal;
  63. }] call CBA_fnc_addEventHandler;
  64. ["rd501_medical_ccp_deployCCPServer", {
  65. _this call rd501_fnc_deployCCPServer;
  66. }] call CBA_fnc_addEventHandler;
  67. ["rd501_medical_ccp_packupCCPServer", {
  68. _this call rd501_fnc_packupCCPServer;
  69. }] call CBA_fnc_addEventHandler;
  70. if(!isDedicated) then {
  71. [
  72. "RD501 Miscellaneous",
  73. "rd501_misc",
  74. [
  75. "Mark Dot",
  76. "Place a black dot in global at your current position"
  77. ],
  78. {
  79. [] call rd501_fnc_placeDotMarkerAtSelf;
  80. },
  81. "",
  82. [
  83. DIK_CALCULATOR,
  84. [false,false,false]
  85. ],
  86. false
  87. ] call cba_fnc_addKeybind;
  88. };
  89. // Surrender stun
  90. call macro_fnc_name(stun);
  91. // Jammers
  92. ["rd501_jammersClear", {
  93. _this call rd501_fnc_jammersClear;
  94. }] call CBA_fnc_addEventHandler;
  95. ["rd501_jammersAddServer", {
  96. _this call rd501_fnc_jammersAddServer;
  97. }] call CBA_fnc_addEventHandler;
  98. ["rd501_jammersRemoveServer", {
  99. _this call rd501_fnc_jammersRemoveServer;
  100. }] call CBA_fnc_addEventHandler;
  101. ["rd501_jammersUpdateLocal", {
  102. _this call rd501_fnc_jammersUpdateLocal;
  103. }] call CBA_fnc_addEventHandler;
  104. // Fired Deployables
  105. if(isServer) then {
  106. ["rd501_fired_deployable_deployServer", {
  107. _this call rd501_fnc_fired_deployable_deployServer
  108. }] call CBA_fnc_addEventHandler;
  109. ["rd501_fired_deployable_personalShieldDeployServer", {
  110. _this call rd501_fnc_fired_deployable_personalShieldDeployServer
  111. }] call CBA_fnc_addEventHandler;
  112. };
  113. if(hasInterface) then {
  114. ["ace_firedPlayer", {
  115. _this call rd501_fnc_fired_deployable_firedHandler
  116. }] call CBA_fnc_addEventHandler;
  117. ["rd501_fired_deployable_soundLoop", {
  118. _this call rd501_fnc_fired_deployable_loopSoundLocal
  119. }] call CBA_fnc_addEventHandler;
  120. ["rd501_fired_deployable_soundEnd", {
  121. _this call rd501_fnc_fired_deployable_endSoundLocal
  122. }] call CBA_fnc_addEventHandler;
  123. };
  124. // Volatile
  125. ["rd501_volatile_destroy", {
  126. _this call rd501_fnc_volatile_destroy;
  127. }] call CBA_fnc_addEventHandler;
  128. ["rd501_volatile_create", {
  129. _this call rd501_fnc_volatile_create;
  130. }] call CBA_fnc_addEventHandler;
  131. // Shield
  132. ["rd501_shield_destroy", {
  133. _this call rd501_fnc_shield_onDestroy;
  134. }] call CBA_fnc_addEventHandler;
  135. ["rd501_shield_lowHealth", {
  136. _this call rd501_fnc_shield_onLowHealth;
  137. }] call CBA_fnc_addEventHandler;
  138. ["rd501_shield_normalHealth", {
  139. _this call rd501_fnc_shield_onNormalHealth;
  140. }] call CBA_fnc_addEventHandler;