Advertisement
Pr0nogo

Untitled

Sep 8th, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.83 KB | None | 0 0
  1. #include "definitions.h"
  2. #include "Plugin.h"
  3. #include "hook_tools.h"
  4.  
  5. //Hook header files
  6. #include "hooks/game_hooks.h"
  7. #include "graphics/draw_hook.h"
  8.  
  9. #include "hooks/apply_upgrade_flags.h"
  10. #include "hooks/attack_priority.h"
  11. #include "hooks/bunker_hooks.h"
  12. #include "hooks/cloak_nearby_units.h"
  13. #include "hooks/cloak_tech.h"
  14. #include "hooks/detector.h"
  15. #include "hooks/harvest.h"
  16. #include "hooks/rally_point.h"
  17. #include "hooks/recharge_shields.h"
  18. #include "hooks/spider_mine.h"
  19. #include "hooks/stim_packs.h"
  20. #include "hooks/tech_target_check.h"
  21. #include "hooks/transfer_tech_upgrades.h"
  22. #include "hooks/unit_speed.h"
  23. #include "hooks/update_status_effects.h"
  24. #include "hooks/update_unit_state.h"
  25. #include "hooks/weapons/weapon_cooldown.h"
  26. #include "hooks/weapons/weapon_damage.h"
  27. #include "hooks/weapons/weapon_fire.h"
  28.  
  29. #include "hooks/unit_destructor_special.h"
  30. #include "hooks/psi_field.h"
  31.  
  32. #include "hooks/unit_stats/armor_bonus.h"
  33. #include "hooks/unit_stats/sight_range.h"
  34. #include "hooks/unit_stats/max_energy.h"
  35. #include "hooks/unit_stats/weapon_range.h"
  36. #include "hooks/interface/weapon_armor_tooltip.h"
  37.  
  38. //in alphabetical order
  39. #include "hooks/orders/base_orders/attack_orders.h"
  40. #include "hooks/interface/btns_cond.h"
  41. #include "hooks/orders/building_making/building_morph.h"
  42. #include "hooks/interface/buttonsets.h"
  43. #include "hooks/orders/building_making/building_protoss.h"
  44. #include "hooks/orders/building_making/building_terran.h"
  45. #include "hooks/burrow_tech.h"
  46. #include "hooks/orders/spells/cast_order.h"
  47. #include "hooks/orders/base_orders/die_order.h"
  48. #include "hooks/orders/enter_nydus.h"
  49. #include "hooks/orders/spells/feedback_spell.h"
  50. #include "hooks/orders/spells/hallucination_spell.h"
  51. #include "hooks/orders/infestation.h"
  52. #include "hooks/orders/larva_creep_spawn.h"
  53. #include "hooks/orders/liftland.h"
  54. #include "hooks/orders/load_unload_orders.h"
  55. #include "hooks/load_unload_proc.h"
  56. #include "hooks/orders/building_making/make_nydus_exit.h"
  57. #include "hooks/orders/medic_orders.h"
  58. #include "hooks/orders/merge_units.h"
  59. #include "hooks/orders/spells/nuke_orders.h"
  60. #include "hooks/orders/spells/recall_spell.h"
  61. #include "hooks/orders/research_upgrade_orders.h"
  62. #include "hooks/interface/selection.h"
  63. #include "hooks/orders/siege_transform.h"
  64. #include "hooks/orders/base_orders/stopholdpos_orders.h"
  65. #include "hooks/orders/unit_making/unit_morph.h"
  66. #include "hooks/orders/unit_making/unit_train.h"
  67. #include "hooks/interface/wireframe.h"
  68. #include "hooks/weapons/wpnspellhit.h"
  69.  
  70. void runWMode()
  71. {
  72. //KYSXD W-Mode start
  73. /// PLUGIN_NAME is defined in definitions.h
  74. int msgboxID = MessageBox(NULL, "Do you want to play in windowed mode?", PLUGIN_NAME , MB_YESNOCANCEL);
  75. switch (msgboxID) {
  76. case IDYES:
  77. HINSTANCE hDll;
  78. hDll =LoadLibrary("./WMODE.dll");
  79. hDll =LoadLibrary("./WMODE_FIX.dll");
  80. break;
  81. case IDNO:
  82. break;
  83. case IDCANCEL:
  84. exit(0);
  85. break;
  86. default:
  87. exit(0);
  88. } //KYSXD W-Mode end
  89. return;
  90. }
  91.  
  92. //#include "AI/spellcasting.h"
  93.  
  94. /// This function is called when the plugin is loaded into StarCraft.
  95. /// You can enable/disable each group of hooks by commenting them.
  96. /// You can also add custom modifications to StarCraft.exe by using:
  97. /// memoryPatch(address_to_patch, value_to_patch_with);
  98.  
  99. BOOL WINAPI Plugin::InitializePlugin(IMPQDraftServer *lpMPQDraftServer) {
  100.  
  101. //StarCraft.exe version check
  102. char exePath[300];
  103. const DWORD pathLen = GetModuleFileName(NULL, exePath, sizeof(exePath));
  104.  
  105. if (pathLen == sizeof(exePath)) {
  106. MessageBox(NULL, "Error: Cannot check version of StarCraft.exe. The file path is too long.", NULL, MB_OK);
  107. return FALSE;
  108. }
  109.  
  110. if (!checkStarCraftExeVersion(exePath))
  111. return FALSE;
  112.  
  113. hooks::injectGameHooks();
  114. hooks::injectDrawHook();
  115.  
  116. //in order of creation
  117. hooks::injectInfestationHooks();
  118. hooks::injectSiegeTransformHooks();
  119. hooks::injectButtonSetHooks();
  120. hooks::injectSelectMod();
  121. hooks::injectMergeUnitsHooks();
  122. hooks::injectLarvaCreepSpawnHooks();
  123. hooks::injectLiftLandHooks();
  124. hooks::injectAttackOrdersHooks();
  125. hooks::injectStopHoldPosOrdersHooks();
  126. hooks::injectRecallSpellHooks();
  127. hooks::injectEnterNydusHooks();
  128. hooks::injectCastOrderHooks();
  129. hooks::injectWpnSpellHitHooks();
  130. hooks::injectBuildingMorphHooks();
  131. hooks::injectMakeNydusExitHook();
  132. hooks::injectUnitMorphHooks();
  133. hooks::injectWireframeHook();
  134. hooks::injectDieOrderHook();
  135. hooks::injectBuildingTerranHook();
  136. hooks::injectBuildingProtossHooks();
  137. hooks::injectUnitTrainHooks();
  138. hooks::injectLoadUnloadProcHooks();
  139. hooks::injectLoadUnloadOrdersHooks();
  140. hooks::injectNukeOrdersHooks();
  141. hooks::injectBurrowTechHooks();
  142. hooks::injectResearchUpgradeOrdersHooks();
  143. hooks::injectMedicOrdersHooks();
  144. hooks::injectHallucinationSpellHook();
  145. hooks::injectFeedbackSpellHook();
  146. hooks::injectBtnsCondHook();
  147.  
  148. hooks::injectApplyUpgradeFlags();
  149. hooks::injectAttackPriorityHooks();
  150. hooks::injectBunkerHooks();
  151. hooks::injectCloakNearbyUnits();
  152. hooks::injectCloakingTechHooks();
  153. hooks::injectDetectorHooks();
  154. hooks::injectHarvestResource();
  155. hooks::injectRallyHooks();
  156. hooks::injectRechargeShieldsHooks();
  157. hooks::injectSpiderMineHooks();
  158. hooks::injectStimPacksHooks();
  159. hooks::injectTechTargetCheckHooks();
  160. hooks::injectTransferTechAndUpgradesHooks();
  161. hooks::injectUnitSpeedHooks();
  162. hooks::injectUpdateStatusEffects();
  163. hooks::injectUpdateUnitState();
  164. hooks::injectWeaponCooldownHook();
  165. hooks::injectWeaponDamageHook();
  166. hooks::injectWeaponFireHooks();
  167.  
  168. hooks::injectUnitDestructorSpecial();
  169. hooks::injectPsiFieldHooks();
  170.  
  171. hooks::injectArmorBonusHook();
  172. hooks::injectSightRangeHook();
  173. hooks::injectUnitMaxEnergyHook();
  174. hooks::injectWeaponRangeHooks();
  175.  
  176. hooks::injectUnitTooltipHook();
  177.  
  178. //hooks::injectSpellcasterAI();
  179.  
  180. return TRUE;
  181. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement