XEH_postinit.sqf 4.8 KB

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