├── Addons ├── AntiHackv11_Free.j └── WenHaoPlugin │ ├── APIMemoryWenHao.j │ └── wenhao_plugin.tga ├── JassHelper └── pjass.exe ├── MapFiles ├── map │ ├── UI │ │ └── Data │ │ │ ├── BaseFrames.fdf │ │ │ ├── List.toc │ │ │ └── NewFrames.fdf │ ├── war3map.doo │ ├── war3map.j │ ├── war3map.mmp │ ├── war3map.shd │ ├── war3map.w3c │ ├── war3map.w3e │ ├── war3map.w3r │ ├── war3map.wpm │ └── war3mapUnits.doo ├── resource │ └── war3mapMap.blp ├── table │ ├── ability.ini │ ├── imp.ini │ ├── item.ini │ ├── unit.ini │ └── w3i.ini ├── trigger │ ├── 1-MemoryHack API │ │ ├── 02-APIBasicUtils.j │ │ ├── 03-APITypecast.j │ │ ├── 04-APIMemory.j │ │ ├── 05-APIMemoryCalls.j │ │ ├── 06-APIMemoryBitwise.j │ │ ├── 07-APIMemoryString.j │ │ ├── 08-APIMemoryKernel.j │ │ ├── 09-APIMemoryRestorer.j │ │ ├── 10-APIMemoryStormDLL.j │ │ ├── 11-APIMemoryMPQ.j │ │ ├── 11-APIMemoryMPQ.txt │ │ ├── 12-APIMemoryFrameData.j │ │ ├── 13-APIMemoryGameData.j │ │ ├── 14-APIMemoryGameUI.j │ │ ├── 15-APIMemoryGameUIButton.j │ │ ├── 16-APIMemoryGameWindow.j │ │ ├── 17-APIMemoryUtilityLibraryAPI.j │ │ ├── 17-APIMemoryUtilityLibraryAPI.txt │ │ ├── 20-MemHackConstantsAPI.j │ │ ├── 22-MemHackCFrameAPI.j │ │ ├── 23-Frame Types.txt │ │ ├── 24-MemHackCLayerAPI.j │ │ ├── 25-MemHackCLayoutFrameAPI.j │ │ ├── 26-MemHackCBackDropFrameAPI.j │ │ ├── 27-MemHackCEditBoxAPI.j │ │ ├── 28-MemHackCModelFrameAPI.j │ │ ├── 29-MemHackCSimpleButtonAPI.j │ │ ├── 30-MemHackCSimpleFontAPI.j │ │ ├── 31-MemHackCSimpleGlueAPI.j │ │ ├── 32-MemHackCSimpleFrameAPI.j │ │ ├── 33-MemHackCSimpleConsoleAPI.j │ │ ├── 34-MemHackCSpriteFrameAPI.j │ │ ├── 35-MemHackCSimpleMessageFrameAPI.j │ │ ├── 36-MemHackCSliderAPI.j │ │ ├── 37-MemHackCTextAreaAPI.j │ │ ├── 38-MemHackCTextFrameAPI.j │ │ ├── 39-MemHackCSimpleStatusBarAPI.j │ │ ├── 40-MemHackCStatusBarAPI.j │ │ ├── 41-MemHackCSimpleTextureAPI.j │ │ ├── 42-MemHackCSimpleRegionAPI.j │ │ ├── 43-MemHackFrameAPI.j │ │ ├── 45-MemHackUIAPI.j │ │ ├── 48-MemHackCSpriteBaseAPI.j │ │ ├── 49-MemHackCSpriteMiniAPI.j │ │ ├── 50-MemHackCSpriteUberAPI.j │ │ ├── 52-MemHackCObjectAPI.j │ │ ├── 52-MemHackCObjectAPI.txt │ │ ├── 55-MemHackPlayerAPI.j │ │ ├── 57-MemHackAbilityAddressAPI.j │ │ ├── 57-MemHackTimerAPI.j │ │ ├── 58-MemHackAbilityBaseAPI.j │ │ ├── 59-MemHackAbilityAddressAPI.j │ │ ├── 59-MemHackAbilityNormalAPI.j │ │ ├── 60-MemHackAbilityBaseAPI.j │ │ ├── 60-MemHackAbilityUnitAPI.j │ │ ├── 61-MemHackAbilityNormalAPI.j │ │ ├── 61-MemHackCastAbility.j │ │ ├── 62-MemHackAbilityUnitAPI.j │ │ ├── 63-MemHackCastAbility.j │ │ ├── 64-MemHackWidgetBaseAPI.j │ │ ├── 65-MemHackWidgetNormalAPI.j │ │ ├── 66-MemHackWidgetBaseAPI.j │ │ ├── 67-MemHackWidgetNormalAPI.j │ │ ├── 68-MemHackEffectAPI.j │ │ ├── 69-MemHackTrackableAPI.j │ │ ├── 70-MemHackEffectAPI.j │ │ ├── 71-MemHackTrackableAPI.j │ │ ├── 72-MemHackItemBaseAPI.j │ │ ├── 73-MemHackItemNormalAPI.j │ │ ├── 74-MemHackItemBaseAPI.j │ │ ├── 75-MemHackItemNormalAPI.j │ │ ├── 76-MemHackUnitBaseAPI.j │ │ ├── 77-MemHackUnitNormalAPI.j │ │ ├── 78-MemHackUnitBaseAPI.j │ │ ├── 79-MemHackUnitNormalAPI.j │ │ ├── 80-MemHackGroupAPI.j │ │ ├── 82-MemHackGroupAPI.j │ │ ├── 83-MemHackMouseAPI.j │ │ ├── 83-MemHackMouseAPI.txt │ │ ├── 85-InitMemoryHack.j │ │ ├── 85-MemHackMouseAPI.j │ │ ├── 85-MemHackMouseAPI.txt │ │ ├── 86-InitMainHook.j │ │ ├── 86-InitMainHook.txt │ │ ├── 87-InitMemoryHack.j │ │ ├── 88-InitMainHook.j │ │ └── 88-InitMainHook.txt │ ├── 2-Misc_Examples │ │ ├── 1-TestHookedDamageEvent.j │ │ └── 1-TestHookedDamageEvent.txt │ ├── 3-Hooks │ │ ├── 1-MemHackDrawCooldown.j │ │ ├── 2-MemHackDamageHook.j │ │ ├── 2-MemHackDamageHook.txt │ │ ├── 3-MemHackBerserkHook.j │ │ ├── 3-MemHackBerserkHook.txt │ │ ├── 4-MemHackCustomAbilityChargesHook.j │ │ └── 4-MemHackCustomAbilityChargesHook.txt │ ├── 4-Useless_Testing │ │ ├── 1-Testing.j │ │ ├── 1-Testing.txt │ │ └── 2-HandleAPI.j │ ├── catalog.lml │ └── code.txt └── w3x2lni │ ├── locale │ ├── lml.lng │ └── w3i.lng │ └── version │ └── lml ├── MemHackLite.w3m └── README.md /Addons/WenHaoPlugin/wenhao_plugin.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnryzeC/MemHackAPI/e75856a4f871b29611bc0a7fee9781b3e93289fe/Addons/WenHaoPlugin/wenhao_plugin.tga -------------------------------------------------------------------------------- /JassHelper/pjass.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnryzeC/MemHackAPI/e75856a4f871b29611bc0a7fee9781b3e93289fe/JassHelper/pjass.exe -------------------------------------------------------------------------------- /MapFiles/map/UI/Data/List.toc: -------------------------------------------------------------------------------- 1 | UI\Data\NewFrames.fdf 2 | -------------------------------------------------------------------------------- /MapFiles/map/UI/Data/NewFrames.fdf: -------------------------------------------------------------------------------- 1 | IncludeFile "UI\FrameDef\UI\EscMenuTemplates.fdf", //Frames from that fdf can be inherited in this file 2 | IncludeFile "UI\FrameDef\UI\QuestDialog.fdf", 3 | 4 | Frame "SPRITE" "Selector1" { 5 | BackgroundArt "selecter1.mdx", 6 | } 7 | Frame "SPRITE" "Selector2" { 8 | BackgroundArt "selecter2.mdx", 9 | } 10 | Frame "SPRITE" "Selector3" { 11 | BackgroundArt "selecter3.mdx", 12 | } 13 | Frame "SPRITE" "Selector4" { 14 | BackgroundArt "selecter4.mdx", 15 | } 16 | Frame "SPRITE" "Selector5" { 17 | BackgroundArt "selecter5.mdx", 18 | } 19 | 20 | 21 | Frame "BACKDROP" "HeroBackdrop" { 22 | BackdropBackground "ReplaceableTextures\CommandButtons\BTNRallyPoint.blp", 23 | BackdropCornerFlags "UL|UR|BL|BR|T|L|B|R", 24 | BackdropCornerSize 0.0125, 25 | BackdropBackgroundInsets 0.005 0.005 0.005 0.005, 26 | BackdropEdgeFile "UI\Widgets\ToolTips\Human\human-tooltip-border.blp", 27 | } 28 | 29 | Frame "BACKDROP" "ChatHistoryBackdrop" { 30 | DecorateFileNames, 31 | BackdropTileBackground, 32 | BackdropBackground "EscMenuBackground", 33 | BackdropCornerFlags "UL|UR|BL|BR|T|L|B|R", 34 | BackdropCornerSize 0.0125, 35 | BackdropBackgroundSize 0.256, 36 | BackdropBackgroundInsets 0.005 0.005 0.005 0.005, 37 | BackdropEdgeFile "EscMenuBorder", 38 | } 39 | 40 | Frame "GLUETEXTBUTTON" "ButtonChat" INHERITS WITHCHILDREN "EscMenuButtonTemplate" { 41 | UseActiveContext, 42 | ButtonText "ScriptDialogButtonText", 43 | Frame "TEXT" "ScriptDialogButtonText" INHERITS "EscMenuButtonTextTemplate" { 44 | Text "", 45 | } 46 | } 47 | 48 | Frame "TEXT" "ChatText1" { 49 | DecorateFileNames, 50 | FrameFont "EscMenuTextFont", 0.011, "", 51 | FontJustificationH JUSTIFYCENTER, 52 | FontJustificationV JUSTIFYMIDDLE, 53 | FontFlags "FIXEDSIZE", 54 | FontColor 0.99 0.827 0.0705 1.0, 55 | FontHighlightColor 1.0 1.0 1.0 1.0, 56 | FontDisabledColor 0.5 0.5 0.5 1.0, 57 | FontShadowColor 0.0 0.0 0.0 0.9, 58 | FontShadowOffset 0.002 -0.002, 59 | } 60 | 61 | Frame "TEXT" "ChatText2" { 62 | DecorateFileNames, 63 | FrameFont "EscMenuTextFont", 0.015, "", 64 | FontJustificationH JUSTIFYLEFT, 65 | FontJustificationV JUSTIFYMIDDLE, 66 | FontFlags "FIXEDSIZE", 67 | FontColor 0.99 0.827 0.0705 1.0, 68 | FontHighlightColor 1.0 1.0 1.0 1.0, 69 | FontDisabledColor 0.2 0.2 0.2 1.0, 70 | FontShadowColor 0.0 0.0 0.0 0.9, 71 | FontShadowOffset 0.002 -0.002, 72 | } 73 | 74 | Frame "TEXT" "ChatText3" { 75 | DecorateFileNames, 76 | FrameFont "EscMenuTextFont", 0.011, "", 77 | FontJustificationH JUSTIFYLEFT, 78 | FontJustificationV JUSTIFYLEFT, 79 | FontFlags "FIXEDSIZE", 80 | FontColor 0.99 0.827 0.0705 1.0, 81 | FontHighlightColor 1.0 1.0 1.0 1.0, 82 | FontDisabledColor 0.5 0.5 0.5 1.0, 83 | FontShadowColor 0.0 0.0 0.0 0.9, 84 | FontShadowOffset 0.002 -0.002, 85 | } 86 | 87 | Frame "BACKDROP" "UI_Dialog_NEsmall" { 88 | BackdropTileBackground, 89 | BackdropBackground "UI\Widgets\EscMenu\NightElf\nightelf-options-menu-background.blp", 90 | BackdropCornerFlags "UL|UR|BL|BR|T|L|B|R", 91 | BackdropCornerSize 0.016, 92 | BackdropBackgroundSize 0.032, 93 | BackdropBackgroundInsets 0.004 0.004 0.004 0.004, 94 | BackdropEdgeFile "UI\Widgets\EscMenu\NightElf\nightelf-options-menu-border.blp", 95 | } 96 | 97 | Frame "BACKDROP" "UI_Dialog_NE" { 98 | BackdropTileBackground, 99 | BackdropBackground "UI\Widgets\EscMenu\NightElf\nightelf-options-menu-background.blp", 100 | BackdropCornerFlags "UL|UR|BL|BR|T|L|B|R", 101 | BackdropCornerSize 0.032, 102 | BackdropBackgroundSize 0.032, 103 | BackdropBackgroundInsets 0.01 0.01 0.01 0.01, 104 | BackdropEdgeFile "UI\Widgets\EscMenu\NightElf\nightelf-options-menu-border.blp", 105 | } 106 | 107 | -------------------------------------------------------------------------------- /MapFiles/map/war3map.doo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnryzeC/MemHackAPI/e75856a4f871b29611bc0a7fee9781b3e93289fe/MapFiles/map/war3map.doo -------------------------------------------------------------------------------- /MapFiles/map/war3map.mmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnryzeC/MemHackAPI/e75856a4f871b29611bc0a7fee9781b3e93289fe/MapFiles/map/war3map.mmp -------------------------------------------------------------------------------- /MapFiles/map/war3map.w3c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MapFiles/map/war3map.w3e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnryzeC/MemHackAPI/e75856a4f871b29611bc0a7fee9781b3e93289fe/MapFiles/map/war3map.w3e -------------------------------------------------------------------------------- /MapFiles/map/war3map.w3r: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /MapFiles/map/war3map.wpm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnryzeC/MemHackAPI/e75856a4f871b29611bc0a7fee9781b3e93289fe/MapFiles/map/war3map.wpm -------------------------------------------------------------------------------- /MapFiles/map/war3mapUnits.doo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnryzeC/MemHackAPI/e75856a4f871b29611bc0a7fee9781b3e93289fe/MapFiles/map/war3mapUnits.doo -------------------------------------------------------------------------------- /MapFiles/resource/war3mapMap.blp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnryzeC/MemHackAPI/e75856a4f871b29611bc0a7fee9781b3e93289fe/MapFiles/resource/war3mapMap.blp -------------------------------------------------------------------------------- /MapFiles/table/ability.ini: -------------------------------------------------------------------------------- 1 | [Aslo] 2 | _parent = "Aslo" 3 | -- Targets Allowed 4 | targs = "air,ground" 5 | 6 | [A000] 7 | _parent = "Absk" 8 | -- Buffs 9 | BuffID = { 10 | "Bbsk", 11 | "Bbsk", 12 | "Bbsk", 13 | } 14 | -- Cooldown 15 | Cool = {30.0, 30.0, 30.0} 16 | -- Duration - Normal 17 | Dur = {12.0, 12.0, 12.0} 18 | -- Duration - Hero 19 | HeroDur = {30.0, 30.0, 30.0} 20 | -- Name 21 | Name = "Berserk 0" 22 | -- Levels 23 | levels = 3 24 | 25 | [A001] 26 | _parent = "Absk" 27 | -- Mana Cost 28 | Cost = 50 29 | -- Name 30 | Name = "Berserk 1" 31 | 32 | [A002] 33 | _parent = "Absk" 34 | -- Mana Cost 35 | Cost = 50 36 | -- Name 37 | Name = "Berserk 2" 38 | 39 | [A004] 40 | _parent = "ANcl" 41 | -- Caster 42 | CasterArt = "" 43 | -- Follow Through Time 44 | DataA = 0.0 45 | -- Target Type 46 | DataB = 1 47 | -- Options 48 | DataC = 1 49 | -- Art Duration 50 | DataD = 0.0 51 | -- Disable Other Abilities 52 | DataE = 0 53 | -- Base Order ID 54 | DataF = "curse" 55 | -- Effect 56 | EffectArt = "" 57 | -- Order String - Use/Turn On 58 | Order = "" 59 | -- Cast Range 60 | Rng = 2000.0 61 | -- Target 62 | TargetArt = "" 63 | -- Check Dependencies 64 | checkDep = 0 65 | -- Levels 66 | levels = 1 67 | -- Race 68 | race = "orc" 69 | -------------------------------------------------------------------------------- /MapFiles/table/imp.ini: -------------------------------------------------------------------------------- 1 | import = { 2 | "FlippyChest.mdx", 3 | "UI\\Data\\BaseFrames.fdf", 4 | "UI\\Data\\List.toc", 5 | "UI\\Data\\NewFrames.fdf", 6 | } -------------------------------------------------------------------------------- /MapFiles/table/item.ini: -------------------------------------------------------------------------------- 1 | [I000] 2 | _parent = "afac" 3 | -- Abilities 4 | abilList = "AId1,AId2,AId3,AId4,AId5" 5 | -------------------------------------------------------------------------------- /MapFiles/table/unit.ini: -------------------------------------------------------------------------------- 1 | [H000] 2 | _parent = "Hpal" 3 | -- Caster Upgrade Names 4 | Casterupgradename = "CasterUpgradeNames" 5 | -- Caster Upgrade Tips 6 | Casterupgradetip = "CasterUpgradeTips" 7 | -- Hero 8 | heroAbilList = " " 9 | 10 | [u000] 11 | _parent = "uloc" 12 | -- Height Minimum 13 | moveFloor = 0.0 14 | -- Height 15 | moveHeight = 0.0 16 | -- Race 17 | race = "human" 18 | -- Speed Base 19 | spd = 0 20 | -- Turn Rate 21 | turnRate = 3.0 22 | -------------------------------------------------------------------------------- /MapFiles/table/w3i.ini: -------------------------------------------------------------------------------- 1 | [map] 2 | file_version = 25 3 | map_version = 8665 4 | we_version = 6052 5 | map_name = "MemHackAPI v1.7" 6 | author_name = "Unryze & quq_CCCP" 7 | map_desc = [=[ 8 | A map dedicated for testing MemHack vast API, preferably test before you decide on using this API. 9 | 10 | Thanks to leandrotp and Dracol1ch for creating the foundation of MemHack. Addtional thanks to quq_CCCP for helping and testing.]=] 11 | player_desc = "Testing" 12 | 13 | [camera] 14 | camera_bound = { 15 | -2816.0000, 16 | -3328.0000, 17 | 2816.0000, 18 | 2816.0000, 19 | -2816.0000, 20 | 2816.0000, 21 | 2816.0000, 22 | -3328.0000 23 | } 24 | camera_complement = {6, 6, 4, 8} 25 | 26 | [map_info] 27 | map_width = 52 28 | map_height = 52 29 | map_main_ground = "L" 30 | 31 | [config] 32 | game_data_setting = 0 33 | disable_preview = 0 34 | custom_ally = 1 35 | melee_map = 0 36 | large_map = 0 37 | masked_area_show_terrain = 1 38 | fix_force_setting = 1 39 | custom_force = 1 40 | custom_techtree = 0 41 | custom_ability = 0 42 | custom_upgrade = 0 43 | map_menu_mark = 1 44 | show_wave_on_cliff = 1 45 | show_wave_on_rolling = 1 46 | unknown_1 = 0 47 | unknown_2 = 1 48 | unknown_3 = 1 49 | unknown_4 = 0 50 | unknown_5 = 0 51 | unknown_6 = 0 52 | unknown_7 = 0 53 | unknown_8 = 0 54 | unknown_9 = 0 55 | 56 | [loading_screen] 57 | id = -1 58 | path = "" 59 | text = "" 60 | title = "" 61 | subtitle = "" 62 | 63 | [prologue] 64 | path = "" 65 | text = "" 66 | title = "" 67 | subtitle = "" 68 | 69 | [fog] 70 | type = 0 71 | start_z = 3000.0000 72 | end_z = 5000.0000 73 | density = 0.5000 74 | color = {0, 0, 0, 255} 75 | 76 | [environment] 77 | weather = "\0\0\0\0" 78 | sound = "" 79 | light = "\0" 80 | water_color = {255, 255, 255, 255} 81 | 82 | [player] 83 | player_count = 4 84 | 85 | [player1] 86 | player = 0 87 | type = 1 88 | race = 1 89 | fix_start_position = 1 90 | name = "Player 1" 91 | start_position = {-2560.0000, -128.0000} 92 | ally_low_flag = {} 93 | ally_high_flag = {} 94 | 95 | [player2] 96 | player = 1 97 | type = 1 98 | race = 1 99 | fix_start_position = 1 100 | name = "Player 2" 101 | start_position = {-2560.0000, 832.0000} 102 | ally_low_flag = {} 103 | ally_high_flag = {} 104 | 105 | [player3] 106 | player = 2 107 | type = 1 108 | race = 1 109 | fix_start_position = 1 110 | name = "Player 3" 111 | start_position = {2368.0000, -192.0000} 112 | ally_low_flag = {} 113 | ally_high_flag = {} 114 | 115 | [player4] 116 | player = 3 117 | type = 1 118 | race = 1 119 | fix_start_position = 1 120 | name = "Player 4" 121 | start_position = {2368.0000, 832.0000} 122 | ally_low_flag = {} 123 | ally_high_flag = {} 124 | 125 | [force] 126 | force_count = 2 127 | 128 | [force1] 129 | ally = 1 130 | ally_win = 1 131 | share_visible = 1 132 | share_control = 0 133 | share_advance = 0 134 | player_list = {1} 135 | force_name = "Force 1" 136 | 137 | [force2] 138 | ally = 1 139 | ally_win = 1 140 | share_visible = 1 141 | share_control = 0 142 | share_advance = 0 143 | player_list = {2, 3, 4} 144 | force_name = "Force 2" -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/02-APIBasicUtils.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library APIBasicUtils 5 | globals 6 | boolean IsPrint = false 7 | constant string sLetters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 8 | endglobals 9 | 10 | function absI takes integer number returns integer 11 | if number < 0 then 12 | return -number 13 | endif 14 | 15 | return number 16 | endfunction 17 | 18 | function absF takes real r returns real 19 | if r < 0. then 20 | return -r 21 | endif 22 | 23 | return r 24 | endfunction 25 | 26 | function floorF takes real r returns real 27 | if r < 0. then 28 | return -I2R( R2I( -r ) ) 29 | endif 30 | 31 | return I2R( R2I( r ) ) 32 | endfunction 33 | 34 | function floorI takes integer i returns integer 35 | return R2I( floorF( I2R( i ) ) ) 36 | endfunction 37 | 38 | function ceilF takes real r returns real 39 | if floorF( r ) == r then 40 | return r 41 | elseif r < 0. then 42 | return -( I2R( R2I( -r ) ) + 1. ) 43 | endif 44 | 45 | return I2R( R2I( r ) ) + 1. 46 | endfunction 47 | 48 | function ceilI takes integer i returns integer 49 | return R2I( ceilF( I2R( i ) ) ) 50 | endfunction 51 | 52 | function roundF takes real r returns real 53 | if r > 0. then 54 | return I2R( R2I( r + .5 ) ) 55 | endif 56 | 57 | return I2R( R2I( r - .5 ) ) 58 | endfunction 59 | 60 | function roundI takes integer i returns integer 61 | return R2I( roundF( I2R( i ) ) ) 62 | endfunction 63 | 64 | function log takes integer number, integer base returns integer 65 | local integer id = 1 66 | 67 | if number > 0 then 68 | loop 69 | exitwhen number / base <= 1 70 | set id = id + 1 71 | set number = number / base 72 | endloop 73 | 74 | return id 75 | endif 76 | 77 | return 0 78 | endfunction 79 | 80 | function PowI takes integer x, integer power returns integer 81 | local integer y = x 82 | 83 | if power == 0 then 84 | set x = 1 85 | elseif power > 1 then 86 | loop 87 | set power = power - 1 88 | exitwhen power == 0 89 | set x = x * y 90 | endloop 91 | endif 92 | 93 | return x 94 | endfunction 95 | 96 | function B2S takes boolean flag returns string 97 | if flag then 98 | return "yes" 99 | endif 100 | 101 | return "no" 102 | endfunction 103 | 104 | function CharToId takes string input returns integer 105 | local integer pos = 0 106 | local string char 107 | 108 | loop 109 | set char = SubString( sLetters, pos, pos + 1 ) 110 | exitwhen char == null or char == input 111 | set pos = pos + 1 112 | endloop 113 | 114 | if pos < 10 then 115 | return pos + 48 116 | elseif pos < 36 then 117 | return pos + 65 - 10 118 | endif 119 | 120 | return pos + 97 - 36 121 | endfunction 122 | 123 | function StringToId takes string input returns integer 124 | return ( ( CharToId( SubString( input, 0, 1 ) ) * 256 + CharToId( SubString( input, 1, 2 ) ) ) * 256 + CharToId( SubString( input, 2, 3 ) ) ) * 256 + CharToId( SubString( input, 3, 4 ) ) 125 | endfunction 126 | 127 | function IdToChar takes integer input returns string 128 | local integer pos = input - 48 129 | 130 | if input >= 97 then 131 | set pos = input - 97 + 36 132 | elseif input >= 65 then 133 | set pos = input - 65 + 10 134 | endif 135 | 136 | return SubString( sLetters, pos, pos + 1 ) 137 | endfunction 138 | 139 | function IdToString takes integer input returns string 140 | local integer result = input / 256 141 | local string char = IdToChar( input - 256 * result ) 142 | 143 | set input = result / 256 144 | set char = IdToChar( result - 256 * input ) + char 145 | set result = input / 256 146 | 147 | return IdToChar( result ) + IdToChar( input - 256 * result ) + char 148 | endfunction 149 | 150 | function GetIntHex takes integer i returns string 151 | local string result = "" 152 | local integer numb = absI( i ) 153 | 154 | if numb >= 0 and numb <= 15 then 155 | if numb <= 9 then 156 | set result = I2S( numb ) 157 | elseif numb == 10 then 158 | set result = "A" 159 | elseif numb == 11 then 160 | set result = "B" 161 | elseif numb == 12 then 162 | set result = "C" 163 | elseif numb == 13 then 164 | set result = "D" 165 | elseif numb == 14 then 166 | set result = "E" 167 | elseif numb == 15 then 168 | set result = "F" 169 | endif 170 | endif 171 | 172 | return result 173 | endfunction 174 | 175 | function IntToHex takes integer i returns string 176 | local string result = "" 177 | local boolean ispos = i >= 0 178 | local integer numb = absI( i ) 179 | local integer j = 0 180 | 181 | if numb != 0 then 182 | loop 183 | exitwhen numb == 0 184 | set j = numb - ( numb / 16 ) * 16 185 | set result = GetIntHex( j ) + result 186 | set numb = ( numb - j ) / 16 187 | endloop 188 | 189 | set result = "0x" + result 190 | 191 | if not ispos then 192 | set result = "-" + result 193 | endif 194 | else 195 | set result = "0x00" 196 | endif 197 | 198 | return result 199 | endfunction 200 | 201 | function PrintData takes string path, string s, boolean flag returns nothing 202 | if not IsPrint then 203 | call PreloadGenClear( ) 204 | call PreloadGenStart( ) 205 | set IsPrint = true 206 | endif 207 | 208 | if IsPrint then 209 | call Preload( s ) 210 | 211 | if flag then 212 | call PreloadGenEnd( path ) 213 | set IsPrint = false 214 | endif 215 | endif 216 | endfunction 217 | endlibrary 218 | 219 | //=========================================================================== 220 | function InitTrig_APIBasicUtils takes nothing returns nothing 221 | //set gg_trg_APIBasicUtils = CreateTrigger( ) 222 | endfunction 223 | //! endnocjass 224 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/06-APIMemoryBitwise.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=30 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library APIMemoryBitwise 5 | function GetGameTypeSupported takes nothing returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CGameWar3" ), StringHash( "GameState" ) ) 7 | 8 | if addr != 0 then 9 | return ReadRealPointer2LVL( addr, 0x30, 0x30 ) 10 | endif 11 | 12 | return 0 13 | endfunction 14 | 15 | function Player2Flag takes player p returns integer 16 | return R2I( Pow( 2, GetPlayerId( p ) ) ) 17 | endfunction 18 | 19 | function IsFlagBitSet takes integer flags, integer bit returns boolean 20 | return flags / bit * 2147483648 != 0 21 | endfunction 22 | 23 | function ShiftLeftForBits takes integer byte, integer shiftval returns integer 24 | return byte * ( PowI( 2, shiftval ) ) 25 | endfunction 26 | 27 | function ShiftRightForBits takes integer byte, integer shiftval returns integer 28 | return byte / ( PowI( 2, shiftval ) ) 29 | endfunction 30 | 31 | function ShiftLeftForBytes takes integer byte, integer shiftval returns integer 32 | return ShiftLeftForBits( byte, shiftval * 8 ) 33 | endfunction 34 | 35 | function ShiftRightForBytes takes integer byte, integer shiftval returns integer 36 | return ShiftRightForBits( byte, shiftval * 8 ) 37 | endfunction 38 | 39 | function BitwiseOr takes integer arg1, integer arg2 returns integer 40 | local integer addr = LoadInteger( MemHackTable, StringHash( "Bitwise" ), StringHash( "OR" ) ) 41 | 42 | if not LoadBoolean( MemHackTable, StringHash( "Bitwise" ), StringHash( "isOR" ) ) then 43 | call SaveBoolean( MemHackTable, StringHash( "Bitwise" ), StringHash( "isOR" ), true ) 44 | call WriteRealMemory( addr + 0x0, 0x0424448B ) 45 | call WriteRealMemory( addr + 0x4, 0x0824548B ) 46 | call WriteRealMemory( addr + 0x8, 0xCCC3D009 ) 47 | endif 48 | 49 | return BitwiseOperation( addr, arg1, arg2 ) 50 | endfunction 51 | 52 | function BitwiseXor takes integer arg1, integer arg2 returns integer 53 | local integer addr = LoadInteger( MemHackTable, StringHash( "Bitwise" ), StringHash( "XOR" ) ) 54 | 55 | if not LoadBoolean( MemHackTable, StringHash( "Bitwise" ), StringHash( "isXOR" ) ) then 56 | call SaveBoolean( MemHackTable, StringHash( "Bitwise" ), StringHash( "isXOR" ), true ) 57 | call WriteRealMemory( addr + 0x0, 0x0424448B ) 58 | call WriteRealMemory( addr + 0x4, 0x0824548B ) 59 | call WriteRealMemory( addr + 0x8, 0xCCC3D031 ) 60 | endif 61 | 62 | return BitwiseOperation( addr, arg1, arg2 ) 63 | endfunction 64 | 65 | function BitwiseAnd takes integer arg1, integer arg2 returns integer 66 | local integer addr = LoadInteger( MemHackTable, StringHash( "Bitwise" ), StringHash( "AND" ) ) 67 | 68 | if not LoadBoolean( MemHackTable, StringHash( "Bitwise" ), StringHash( "isAND" ) ) then 69 | call SaveBoolean( MemHackTable, StringHash( "Bitwise" ), StringHash( "isAND" ), true ) 70 | call WriteRealMemory( addr + 0x0, 0x0424448B ) 71 | call WriteRealMemory( addr + 0x4, 0x0824548B ) 72 | call WriteRealMemory( addr + 0x8, 0xCCC3D021 ) 73 | endif 74 | 75 | return BitwiseOperation( addr, arg1, arg2 ) 76 | endfunction 77 | 78 | function Init_APIMemoryBitwise takes nothing returns nothing 79 | local integer i = 0 80 | 81 | if PatchVersion != "" then 82 | if PatchVersion == "1.24e" then 83 | elseif PatchVersion == "1.26a" then 84 | elseif PatchVersion == "1.27a" then 85 | elseif PatchVersion == "1.27b" then 86 | elseif PatchVersion == "1.28f" then 87 | endif 88 | 89 | call AllocExecMemEx( "Bitwise", "OR", 0xC ) 90 | call AllocExecMemEx( "Bitwise", "XOR", 0xC ) 91 | call AllocExecMemEx( "Bitwise", "AND", 0xC ) 92 | endif 93 | endfunction 94 | endlibrary 95 | 96 | //=========================================================================== 97 | function InitTrig_APIMemoryBitwise takes nothing returns nothing 98 | //set gg_trg_APIMemoryBitwise = CreateTrigger( ) 99 | endfunction 100 | //! endnocjass 101 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/10-APIMemoryStormDLL.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library APIMemoryHStormDLL 5 | globals 6 | integer pStormDLL = 0 7 | endglobals 8 | 9 | function StormLoadFile takes string filename, integer ppBuffer, integer pSize, integer extraSizeToAllocate, integer pOverlapped returns integer 10 | local integer addr = LoadInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SFile::Load" ) ) 11 | local integer arg = LoadInteger( MemHackTable, StringHash( "PointerArray" ), 0 ) 12 | 13 | if addr != 0 and arg != 0 then 14 | call WriteRealMemory( arg + 0x0, ppBuffer ) 15 | call WriteRealMemory( arg + 0x4, pSize ) 16 | return std_call_5( addr, GetStringAddress( filename ), arg + 0x0, arg + 0x4, 1, 0 ) 17 | endif 18 | 19 | return 0 20 | endfunction 21 | 22 | function StormAllocateMemory takes integer size, string name, integer unk_1, integer unk_2 returns integer 23 | local integer addr = LoadInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::Alloc" ) ) 24 | 25 | if addr != 0 and size > 0 then 26 | return std_call_4( addr, size, GetStringAddress( name ), unk_1, unk_2 ) 27 | endif 28 | 29 | return 0 30 | endfunction 31 | 32 | function StormFreeMemory takes integer memaddr, string name, integer unk_1, integer unk_2 returns integer 33 | local integer addr = LoadInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::Free" ) ) 34 | 35 | if addr != 0 and memaddr != 0 then 36 | return std_call_4( addr, memaddr, GetStringAddress( name ), unk_1, unk_2 ) 37 | endif 38 | 39 | return 0 40 | endfunction 41 | 42 | function StormGetMemorySize takes integer memaddr, string name, integer unk_1 returns integer 43 | local integer addr = LoadInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::GetSize" ) ) 44 | 45 | if addr != 0 and memaddr != 0 then 46 | return std_call_3( addr, memaddr, GetStringAddress( name ), unk_1 ) 47 | endif 48 | 49 | return 0 50 | endfunction 51 | 52 | function StormReallocateMemory takes integer memaddr, integer size, string name, integer unk_1, integer unk_2 returns integer 53 | local integer addr = LoadInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::ReAlloc" ) ) 54 | 55 | if addr != 0 and memaddr != 0 and size > 0 then 56 | return std_call_5( addr, memaddr, size, GetStringAddress( name ), unk_1, unk_2 ) 57 | endif 58 | 59 | return 0 60 | endfunction 61 | 62 | function Init_APIMemoryStormDLL takes nothing returns nothing 63 | if PatchVersion != "" then 64 | set pStormDLL = GetModuleHandle( "Storm.dll" ) 65 | 66 | if pStormDLL != 0 then 67 | if PatchVersion == "1.24e" then 68 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SFile::Load" ), pStormDLL + 0x01CF30 ) 69 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::Alloc" ), pStormDLL + 0x025F30 ) 70 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::Free" ), pStormDLL + 0x024880 ) 71 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::GetSize" ), pStormDLL + 0x024AD0 ) 72 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::ReAlloc" ), pStormDLL + 0x026230 ) 73 | elseif PatchVersion == "1.26a" then 74 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SFile::Load" ), pStormDLL + 0x01CF30 ) 75 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::Alloc" ), pStormDLL + 0x025F30 ) 76 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::Free" ), pStormDLL + 0x024880 ) 77 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::GetSize" ), pStormDLL + 0x024AD0 ) 78 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::ReAlloc" ), pStormDLL + 0x026230 ) 79 | elseif PatchVersion == "1.27a" then 80 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SFile::Load" ), pStormDLL + 0x022660 ) 81 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::Alloc" ), pStormDLL + 0x02B830 ) 82 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::Free" ), pStormDLL + 0x02BE40 ) 83 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::GetSize" ), pStormDLL + 0x02C000 ) 84 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::ReAlloc" ), pStormDLL + 0x02C8B0 ) 85 | elseif PatchVersion == "1.27b" then 86 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SFile::Load" ), pStormDLL + 0x0224E0 ) 87 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::Alloc" ), pStormDLL + 0x02B6D0 ) 88 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::Free" ), pStormDLL + 0x02BCE0 ) 89 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::GetSize" ), pStormDLL + 0x02BEA0 ) 90 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::ReAlloc" ), pStormDLL + 0x02C760 ) 91 | elseif PatchVersion == "1.28f" then 92 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SFile::Load" ), pStormDLL + 0x022A50 ) 93 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::Alloc" ), pStormDLL + 0x02BC10 ) 94 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::Free" ), pStormDLL + 0x02C220 ) 95 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::GetSize" ), pStormDLL + 0x02C3E0 ) 96 | call SaveInteger( MemHackTable, StringHash( "StormDll" ), StringHash( "SMem::ReAlloc" ), pStormDLL + 0x02CC90 ) 97 | endif 98 | endif 99 | endif 100 | endfunction 101 | endlibrary 102 | 103 | //=========================================================================== 104 | function InitTrig_APIMemoryStormDLL takes nothing returns nothing 105 | //set gg_trg_APIMemoryStormDLL = CreateTrigger( ) 106 | endfunction 107 | //! endnocjass 108 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/11-APIMemoryMPQ.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=6 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library APIMemoryMPQ 5 | function FileExists takes string s returns boolean 6 | return GetFileAttributes( s ) != -1 7 | endfunction 8 | 9 | function GetFileSizeFromMPQ takes string source returns integer 10 | return StormLoadFile( source, 0, 0, 1, 0 ) 11 | endfunction 12 | 13 | function ExportFileFromMPQByAddr takes integer saddr, integer daddr returns integer 14 | local integer addr = LoadInteger( MemHackTable, StringHash( "MPQAPI" ), StringHash( "ExportFile" ) ) 15 | 16 | if addr != 0 and saddr != 0 and daddr != 0 then 17 | return fast_call_2( addr, saddr, daddr ) 18 | endif 19 | 20 | return 0 21 | endfunction 22 | 23 | function ExportFileFromMPQ takes string source, string dest returns boolean 24 | return ExportFileFromMPQByAddr( GetStringAddress( source ), GetStringAddress( dest ) ) > 0 25 | endfunction 26 | 27 | function LoadDllFromMPQEx takes string source, string dest, string dllname returns boolean 28 | if ExportFileFromMPQ( source, dest ) then 29 | call LoadLibrary( dllname ) 30 | return true 31 | endif 32 | 33 | return false 34 | endfunction 35 | 36 | function LoadDllFromMPQ takes string dllname returns boolean 37 | return LoadDllFromMPQEx( dllname, dllname, dllname ) 38 | endfunction 39 | 40 | function Init_APIMemoryMPQ takes nothing returns nothing 41 | if PatchVersion != "" then 42 | if PatchVersion == "1.24e" then 43 | call SaveInteger( MemHackTable, StringHash( "MPQAPI" ), StringHash( "ExportFile" ), pGameDLL + 0x7386A0 ) 44 | elseif PatchVersion == "1.26a" then 45 | call SaveInteger( MemHackTable, StringHash( "MPQAPI" ), StringHash( "ExportFile" ), pGameDLL + 0x737F00 ) 46 | elseif PatchVersion == "1.27a" then 47 | call SaveInteger( MemHackTable, StringHash( "MPQAPI" ), StringHash( "ExportFile" ), pGameDLL + 0x702C50 ) 48 | elseif PatchVersion == "1.27b" then 49 | call SaveInteger( MemHackTable, StringHash( "MPQAPI" ), StringHash( "ExportFile" ), pGameDLL + 0x720390 ) 50 | elseif PatchVersion == "1.28f" then 51 | call SaveInteger( MemHackTable, StringHash( "MPQAPI" ), StringHash( "ExportFile" ), pGameDLL + 0x754560 ) 52 | endif 53 | endif 54 | endfunction 55 | endlibrary 56 | 57 | //=========================================================================== 58 | function InitTrig_APIMemoryMPQ takes nothing returns nothing 59 | //set gg_trg_APIMemoryMPQ = CreateTrigger( ) 60 | endfunction 61 | //! endnocjass 62 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/11-APIMemoryMPQ.txt: -------------------------------------------------------------------------------- 1 | This trigger can be safely removed, since it is not really used at all. -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/16-APIMemoryGameWindow.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=21 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library APIMemoryWC3GameWindow 5 | // Window API Engine 6 | function GetWindowWidth takes nothing returns real 7 | local integer addr = LoadInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Width" ) ) 8 | 9 | if addr != 0 then 10 | return ReadRealFloat( addr ) 11 | endif 12 | 13 | return 0. 14 | endfunction 15 | 16 | function GetWindowHeight takes nothing returns real 17 | local integer addr = LoadInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Height" ) ) 18 | 19 | if addr != 0 then 20 | return ReadRealFloat( addr ) 21 | endif 22 | 23 | return 0. 24 | endfunction 25 | 26 | function GetWindowCenterX takes nothing returns real 27 | return GetWindowX( LoadInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Window" ) ) ) + GetWindowWidth( ) * 0.5 28 | endfunction 29 | 30 | function GetWindowCenterY takes nothing returns real 31 | return GetWindowY( LoadInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Window" ) ) ) + GetWindowHeight( ) * 0.5 32 | endfunction 33 | 34 | function GetWarcraftWindow takes nothing returns integer 35 | local integer addr = LoadInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "GetWindow" ) ) 36 | local integer hwnd = 0 37 | 38 | if addr != 0 then 39 | set hwnd = this_call_1( addr, 0 ) 40 | else 41 | set hwnd = FindWindow( "Warcraft III", "Warcraft III" ) 42 | endif 43 | 44 | return hwnd 45 | endfunction 46 | 47 | function FromPixelX takes integer i returns real 48 | return i * 0.8 / GetWindowWidth( ) 49 | endfunction 50 | 51 | function FromPixelY takes integer i returns real 52 | return i * 0.6 / GetWindowHeight( ) 53 | endfunction 54 | //=========================================== 55 | 56 | function Init_APIMemoryGameWindow takes nothing returns nothing 57 | if PatchVersion != "" then 58 | if PatchVersion == "1.24e" then 59 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Width" ), pGameDLL + 0xAF577C ) 60 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Height" ), pGameDLL + 0xAF5778 ) 61 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "GetWindow" ), pGameDLL + 0x6BB510 ) 62 | elseif PatchVersion == "1.26a" then 63 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Width" ), pGameDLL + 0xADE91C ) 64 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Height" ), pGameDLL + 0xADE918 ) 65 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "GetWindow" ), pGameDLL + 0x6BAD70 ) 66 | elseif PatchVersion == "1.27a" then 67 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Width" ), pGameDLL + 0xBBA22C ) 68 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Height" ), pGameDLL + 0xBBA228 ) 69 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "GetWindow" ), pGameDLL + 0x14D670 ) 70 | elseif PatchVersion == "1.27b" then 71 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Width" ), pGameDLL + 0xD47CC4 ) 72 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Height" ), pGameDLL + 0xD47CC0 ) 73 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "GetWindow" ), pGameDLL + 0x08B0A0 ) 74 | elseif PatchVersion == "1.28f" then 75 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Width" ), pGameDLL + 0xD0FAB4 ) 76 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Height" ), pGameDLL + 0xD0FAB0 ) 77 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "GetWindow" ), pGameDLL + 0x0B49B0 ) 78 | endif 79 | 80 | call SaveInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Window" ), GetWarcraftWindow( ) ) 81 | endif 82 | endfunction 83 | endlibrary 84 | 85 | //=========================================================================== 86 | function InitTrig_APIMemoryGameWindow takes nothing returns nothing 87 | //set gg_trg_APIMemoryGameWindow = CreateTrigger( ) 88 | endfunction 89 | //! endnocjass 90 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/17-APIMemoryUtilityLibraryAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=9 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library APIMemoryUtilityLibraryAPI 5 | function GetUtilityLibraryHashtable takes nothing returns hashtable 6 | return LoadHashtableHandle( MemHackTable, StringHash( "UtilityLibrary.dll" ), StringHash( "HashTable" ) ) 7 | endfunction 8 | 9 | function InitHashtableListener takes hashtable ht returns boolean 10 | local integer addr = GetFuncFromDll( "UtilityLibrary.dll", "InitHashtableListener", true ) 11 | 12 | if addr != 0 and ht != null then 13 | call c_call_1( addr, GetHandleId( ht ) ) 14 | return true 15 | endif 16 | 17 | return false 18 | endfunction 19 | 20 | function RemoveHashtableListeners takes nothing returns boolean 21 | local integer addr = GetFuncFromDll( "UtilityLibrary.dll", "RemoveHashtableListeners", true ) 22 | 23 | if addr != 0 then 24 | call c_call_0( addr ) 25 | return true 26 | endif 27 | 28 | return false 29 | endfunction 30 | 31 | function Init_APIMemoryUtilityLibraryAPI takes nothing returns nothing 32 | if PatchVersion != "" then 33 | if LoadDllFromMPQ( "UtilityLibrary.dll" ) then 34 | call SaveHashtableHandle( MemHackTable, StringHash( "UtilityLibrary.dll" ), StringHash( "HashTable" ), InitHashtable( ) ) 35 | // call SaveInteger( MemHackTable, StringHash( "UtilityLibrary.dll" ), StringHash( "Module" ), GetModuleHandle( "UtilityLibrary.dll" ) ) 36 | call InitHashtableListener( GetUtilityLibraryHashtable( ) ) 37 | endif 38 | endif 39 | endfunction 40 | endlibrary 41 | 42 | //=========================================================================== 43 | function InitTrig_APIMemoryUtilityLibraryAPI takes nothing returns nothing 44 | //set gg_trg_APIMemoryUtilityLibraryAPI = CreateTrigger( ) 45 | endfunction 46 | //! endnocjass 47 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/17-APIMemoryUtilityLibraryAPI.txt: -------------------------------------------------------------------------------- 1 | Currently under development, considering its usefulness. -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/23-Frame Types.txt: -------------------------------------------------------------------------------- 1 | 1 = BackdropFrame 2 | 2 = ButtonFrame 3 | 3 = ChatMode 4 | 4 = CommandButton 5 | 5 = CursorFrame 6 | 6 = EditBox 7 | 7 = Frame 8 | 8 = FloatingFrame 9 | 9 = GameUI 10 | 10 = HeroBarButton 11 | 11 = HighlightFrame 12 | 12 = LayoutFrame 13 | 13 = MessageFrame 14 | 14 = Minimap 15 | 15 = ModelFrame 16 | 16 = PortraitButton 17 | 17 = ScreenFrame 18 | 18 = SimpleButton 19 | 19 = SimpleFontString 20 | 20 = SimpleFrame 21 | 21 = SimpleGlueFrame 22 | 22 = ??? 23 | 23 = SimpleMessageFrame 24 | 24 = Slider 25 | 25 = SpriteFrame 26 | 26 = StatBar 27 | 27 = TextArea 28 | 28 = TextButtonFrame 29 | 29 = TextFrame 30 | 30 = UberToolTipWar3 31 | 31 = WorldFrameWar3 32 | 32 = GlueButtonWar3 33 | 33 = GlueTextButtonWar3 34 | 34 = GlueCheckBoxWar3 35 | 35 = GluePopupMenuWar3 36 | 36 = GlueEditBoxWar3 37 | 37 = SlashChatBox 38 | 38 = TimerTextFrame 39 | 39 = SimpleStatusBar 40 | 40 = StatusBar 41 | 41 = UpperButtonBar 42 | 42 = ResourceBar 43 | 43 = SimpleConsole 44 | 44 = PeonBar 45 | 45 = HeroBar 46 | 46 = TimeOfDayIndicator 47 | 47 = InfoBar 48 | 48 = TimeCover 49 | 49 = ProgressIndicator 50 | 50 = HeroLevelBar 51 | 51 = BuildTimeIndicator 52 | 52 = InfoPanelDestructableDetail 53 | 53 = InfoPanelItemDetail 54 | 54 = InfoPanelIconAlly 55 | 55 = InfoPanelIconHero 56 | 56 = InfoPanelIconGold 57 | 57 = InfoPanelIconFood 58 | 58 = InfoPanelIconRank 59 | 59 = InfoPanelIconArmor 60 | 60 = InfoPanelIconDamage 61 | 61 = InfoPanelCargoDetail 62 | 62 = InfoPanelBuildingDetail 63 | 63 = InfoPanelUnitDetail 64 | 64 = SimpleTexture -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/26-MemHackCBackDropFrameAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=27 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCFrameBackDropAPI 5 | function AllocateCBackdropFrameMemory takes nothing returns integer 6 | return StormAllocateMemory( 0x1DC, "MemHackCBackdropFrame", 4, 0 ) 7 | endfunction 8 | 9 | function CreateCBackdropFrameEx takes integer pBackDrop, integer pParent, integer createContext, integer priority returns integer 10 | local integer addr = LoadInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "Create" ) ) 11 | 12 | if addr != 0 and pBackDrop != 0 then 13 | return this_call_4( addr, pBackDrop, pParent, createContext, priority ) 14 | endif 15 | 16 | return 0 17 | endfunction 18 | 19 | function CreateCBackdropFrame takes integer pParent, integer priority returns integer 20 | return CreateCBackdropFrameEx( AllocateCBackdropFrameMemory( ), pParent, 0, priority ) 21 | endfunction 22 | 23 | function LoadCBackDropFrameTexture takes string texturepath, boolean create returns integer 24 | local integer addr = LoadInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "LoadTexture" ) ) 25 | 26 | if addr != 0 and texturepath != "" then 27 | return std_call_2( addr, GetStringAddress( texturepath ), B2I( create ) ) 28 | endif 29 | 30 | return 0 31 | endfunction 32 | 33 | function SetCBackDropFrameTexture takes integer pFrame, string texturepath, boolean flag returns integer 34 | local integer addr = LoadInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "SetTexture" ) ) 35 | local string f_name = "" 36 | 37 | if addr != 0 and pFrame != 0 then 38 | set f_name = GetFrameTypeName( pFrame ) 39 | 40 | if f_name == "CBackdropFrame" then // 1 41 | return this_call_6( addr, pFrame, GetStringAddress( texturepath ), 0, B2I( flag ), 0, 1 ) 42 | endif 43 | endif 44 | 45 | return 0 46 | endfunction 47 | 48 | function Init_MemHackCBackDropFrameAPI takes nothing returns nothing 49 | if PatchVersion != "" then 50 | if PatchVersion == "1.24e" then 51 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "Create" ), pGameDLL + 0x621670 ) 52 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "LoadTexture" ), pGameDLL + 0x621780 ) 53 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "SetTexture" ), pGameDLL + 0x621A70 ) 54 | elseif PatchVersion == "1.26a" then 55 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "Create" ), pGameDLL + 0x620ED0 ) 56 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "LoadTexture" ), pGameDLL + 0x620FE0 ) 57 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "SetTexture" ), pGameDLL + 0x6212D0 ) 58 | elseif PatchVersion == "1.27a" then 59 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "Create" ), pGameDLL + 0x0A4700 ) 60 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "LoadTexture" ), pGameDLL + 0x0A4AE0 ) 61 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "SetTexture" ), pGameDLL + 0x0A62A0 ) 62 | elseif PatchVersion == "1.27b" then 63 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "Create" ), pGameDLL + 0x0F8460 ) 64 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "LoadTexture" ), pGameDLL + 0x0F8840 ) 65 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "SetTexture" ), pGameDLL + 0x0FA000 ) 66 | elseif PatchVersion == "1.28f" then 67 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "Create" ), pGameDLL + 0x126AD0 ) 68 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "LoadTexture" ), pGameDLL + 0x126EB0 ) 69 | call SaveInteger( MemHackTable, StringHash( "CBackDropFrame" ), StringHash( "SetTexture" ), pGameDLL + 0x128670 ) 70 | endif 71 | endif 72 | endfunction 73 | endlibrary 74 | 75 | //=========================================================================== 76 | function InitTrig_MemHackCBackDropFrameAPI takes nothing returns nothing 77 | //set gg_trg_MemHackCBackDropFrameAPI = CreateTrigger( ) 78 | endfunction 79 | //! endnocjass 80 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/27-MemHackCEditBoxAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCFrameEditBoxAPI 5 | function SetCEditBoxFocus takes integer pFrame, boolean flag returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetFocus" ) ) 7 | local string f_name = "" 8 | 9 | if addr != 0 and pFrame != 0 then 10 | set f_name = GetFrameTypeName( pFrame ) 11 | 12 | if f_name == "CEditBox" then // 6 13 | return this_call_2( addr, pFrame, B2I( flag ) ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function SetCEditBoxFont takes integer pFrame, string filename, real height, integer flag returns integer 21 | local integer addr = LoadInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetFont" ) ) 22 | local string f_name = "" 23 | 24 | if addr != 0 and pFrame != 0 then 25 | set f_name = GetFrameTypeName( pFrame ) 26 | 27 | if f_name == "CEditBox" then // 6 28 | return this_call_4( addr, pFrame, GetStringAddress( filename ), SetRealIntoMemory( height ), flag ) 29 | endif 30 | endif 31 | 32 | return 0 33 | endfunction 34 | 35 | function GetCEditBoxText takes integer pFrame returns string 36 | local integer addr = LoadInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "GetText" ) ) 37 | local string f_name = "" 38 | 39 | if addr != 0 and pFrame != 0 then 40 | set f_name = GetFrameTypeName( pFrame ) 41 | 42 | if f_name == "CEditBox" then // 6 43 | return ToJString( this_call_1( addr, pFrame ) ) 44 | endif 45 | endif 46 | 47 | return "" 48 | endfunction 49 | 50 | function SetCEditBoxText takes integer pFrame, string text returns integer 51 | local integer addr = LoadInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetText" ) ) 52 | local string f_name = "" 53 | 54 | if addr != 0 and pFrame != 0 then 55 | set f_name = GetFrameTypeName( pFrame ) 56 | 57 | if f_name == "CEditBox" or f_name == "CGlueEditBoxWar3" or f_name == "CSlashChatBox" then // 6 | 36 | 37 58 | return B2I( this_call_3( addr, pFrame, GetStringAddress( text ), 1 ) > 0 ) 59 | endif 60 | endif 61 | 62 | return 0 63 | endfunction 64 | 65 | function Init_MemHackCEditBoxAPI takes nothing returns nothing 66 | if PatchVersion != "" then 67 | if PatchVersion == "1.24e" then 68 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "GetText" ), pGameDLL + 0x614640 ) 69 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetText" ), pGameDLL + 0x6162F0 ) 70 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetFont" ), pGameDLL + 0x614440 ) 71 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetFocus" ), pGameDLL + 0x615920 ) 72 | elseif PatchVersion == "1.26a" then 73 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "GetText" ), pGameDLL + 0x613EA0 ) 74 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetText" ), pGameDLL + 0x615B50 ) 75 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetFont" ), pGameDLL + 0x613CA0 ) 76 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetFocus" ), pGameDLL + 0x615180 ) 77 | elseif PatchVersion == "1.27a" then 78 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "GetText" ), pGameDLL + 0x0AEDF0 ) 79 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetText" ), pGameDLL + 0x0B0450 ) 80 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetFont" ), pGameDLL + 0x0B0350 ) 81 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetFocus" ), pGameDLL + 0x0B0260 ) 82 | elseif PatchVersion == "1.27b" then 83 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "GetText" ), pGameDLL + 0x102B50 ) 84 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetText" ), pGameDLL + 0x1041B0 ) 85 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetFont" ), pGameDLL + 0x1040B0 ) 86 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetFocus" ), pGameDLL + 0x103FC0 ) 87 | elseif PatchVersion == "1.28f" then 88 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "GetText" ), pGameDLL + 0x1311C0 ) 89 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetText" ), pGameDLL + 0x132820 ) 90 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetFont" ), pGameDLL + 0x132720 ) 91 | call SaveInteger( MemHackTable, StringHash( "CEditBox" ), StringHash( "SetFocus" ), pGameDLL + 0x132630 ) 92 | endif 93 | endif 94 | endfunction 95 | endlibrary 96 | 97 | //=========================================================================== 98 | function InitTrig_MemHackCEditBoxAPI takes nothing returns nothing 99 | //set gg_trg_MemHackCEditBoxAPI = CreateTrigger( ) 100 | endfunction 101 | //! endnocjass 102 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/28-MemHackCModelFrameAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCModelFrameAPI 5 | function AddCModelFrameModel takes integer pFrame, string model, integer modeltype returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CModelFrame" ), StringHash( "AddModel" ) ) 7 | local string f_name = "" 8 | 9 | if addr != 0 and pFrame != 0 then 10 | set f_name = GetFrameTypeName( pFrame ) 11 | 12 | if f_name == "CModelFrame" then // 15 13 | return this_call_3( addr, pFrame, GetStringAddress( model ), modeltype ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function GetCModelFrameHeight takes integer pFrame returns real 21 | local integer addr = LoadInteger( MemHackTable, StringHash( "CModelFrame" ), StringHash( "GetHeight" ) ) 22 | local string f_name = "" 23 | 24 | if addr != 0 and pFrame != 0 then 25 | set f_name = GetFrameTypeName( pFrame ) 26 | 27 | if f_name == "CModelFrame" then // 15 28 | return GetRealFromMemory( this_call_1( addr, pFrame ) ) 29 | endif 30 | endif 31 | 32 | return 0. 33 | endfunction 34 | 35 | function Init_MemHackCModelFrameAPI takes nothing returns nothing 36 | if PatchVersion != "" then 37 | if PatchVersion == "1.24e" then 38 | call SaveInteger( MemHackTable, StringHash( "CModelFrame" ), StringHash( "AddModel" ), pGameDLL + 0x621D70 ) 39 | call SaveInteger( MemHackTable, StringHash( "CModelFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x622100 ) 40 | elseif PatchVersion == "1.26a" then 41 | call SaveInteger( MemHackTable, StringHash( "CModelFrame" ), StringHash( "AddModel" ), pGameDLL + 0x6215D0 ) 42 | call SaveInteger( MemHackTable, StringHash( "CModelFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x621960 ) 43 | elseif PatchVersion == "1.27a" then 44 | call SaveInteger( MemHackTable, StringHash( "CModelFrame" ), StringHash( "AddModel" ), pGameDLL + 0x0A3FA0 ) 45 | call SaveInteger( MemHackTable, StringHash( "CModelFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x0A4180 ) 46 | elseif PatchVersion == "1.27b" then 47 | call SaveInteger( MemHackTable, StringHash( "CModelFrame" ), StringHash( "AddModel" ), pGameDLL + 0x0F7D00 ) 48 | call SaveInteger( MemHackTable, StringHash( "CModelFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x0F7EE0 ) 49 | elseif PatchVersion == "1.28f" then 50 | call SaveInteger( MemHackTable, StringHash( "CModelFrame" ), StringHash( "AddModel" ), pGameDLL + 0x126370 ) 51 | call SaveInteger( MemHackTable, StringHash( "CModelFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x126550 ) 52 | endif 53 | endif 54 | endfunction 55 | endlibrary 56 | 57 | //=========================================================================== 58 | function InitTrig_MemHackCModelFrameAPI takes nothing returns nothing 59 | //set gg_trg_MemHackCModelFrameAPI = CreateTrigger( ) 60 | endfunction 61 | //! endnocjass 62 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/29-MemHackCSimpleButtonAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=51 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCSimpleButtonAPI 5 | function CreateCSimpleButton takes integer pParent returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "Create" ) ) 7 | local integer baseobj = 0 8 | 9 | if addr != 0 then 10 | set baseobj = StormAllocateMemory( 0x168, "MemHackCSimpleButton", 14, 0 ) 11 | 12 | if baseobj > 0 then 13 | return this_call_2( addr, baseobj, pParent ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function DestroyCSimpleButton takes integer pButton returns boolean 21 | if pButton > 0 then 22 | return this_call_2( ReadRealMemory( pButton + 0x8 ), pButton, 1 ) > 0 23 | endif 24 | 25 | return false 26 | endfunction 27 | 28 | function SetCSimpleButtonStateTexture takes integer pButton, integer state, string texturepath returns boolean 29 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "SetStateTexture" ) ) 30 | 31 | if addr != 0 and pButton != 0 then 32 | return this_call_3( addr, pButton, state, GetStringAddress( texturepath ) ) > 0 33 | endif 34 | 35 | return false 36 | endfunction 37 | 38 | function SetCSimpleButtonState takes integer pButton, integer state returns boolean 39 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "SetState" ) ) 40 | 41 | if addr != 0 and pButton != 0 then 42 | return this_call_2( addr, pButton, state ) > 0 43 | endif 44 | 45 | return false 46 | endfunction 47 | 48 | function ClickCSimpleButton takes integer pButton, integer buttonType returns integer 49 | // 0x1 = LButton | 0x4 = RButton 50 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "Click" ) ) 51 | 52 | if addr != 0 and pButton != 0 then 53 | return this_call_2( addr, pButton, buttonType ) 54 | endif 55 | 56 | return 0 57 | endfunction 58 | 59 | function ClickCSimpleButtonEx takes integer pButton, integer buttonType returns boolean 60 | // 0x1 = LButton | 0x4 = RButton 61 | local integer oldflag = 0 62 | local integer retval = 0 63 | 64 | if pButton != 0 then 65 | set oldflag = ReadRealMemory( pButton + 0x138 ) 66 | 67 | if not IsFlagBitSet( oldflag, 0x2 ) then 68 | call WriteRealMemory( pButton + 0x138, BitwiseXor( oldflag, 0x2 ) ) 69 | endif 70 | 71 | set retval = ClickCSimpleButton( pButton, buttonType ) 72 | call WriteRealMemory( pButton + 0x138, oldflag ) 73 | endif 74 | 75 | return retval != 0 76 | endfunction 77 | 78 | function Init_MemHackCSimpleButtonAPI takes nothing returns nothing 79 | if PatchVersion != "" then 80 | if PatchVersion == "1.24e" then 81 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "Create" ), pGameDLL + 0x603880 ) 82 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "SetState" ), pGameDLL + 0x603780 ) 83 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "SetStateTexture" ), pGameDLL + 0x6039C0 ) 84 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "Click" ), pGameDLL + 0x603BE0 ) 85 | elseif PatchVersion == "1.26a" then 86 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "Create" ), pGameDLL + 0x6030E0 ) 87 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "SetState" ), pGameDLL + 0x602FE0 ) 88 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "SetStateTexture" ), pGameDLL + 0x603220 ) 89 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "Click" ), pGameDLL + 0x603440 ) 90 | elseif PatchVersion == "1.27a" then 91 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "Create" ), pGameDLL + 0x0BB2A0 ) 92 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "SetState" ), pGameDLL + 0x0BB4E0 ) 93 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "SetStateTexture" ), pGameDLL + 0x0BBA40 ) 94 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "Click" ), pGameDLL + 0x0BB560 ) 95 | elseif PatchVersion == "1.27b" then 96 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "Create" ), pGameDLL + 0x3A1620 ) 97 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "SetState" ), pGameDLL + 0x10F240 ) 98 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "SetStateTexture" ), pGameDLL + 0x10F7A0 ) 99 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "Click" ), pGameDLL + 0x10F2C0 ) 100 | elseif PatchVersion == "1.28f" then 101 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "Create" ), pGameDLL + 0x3D5730 ) 102 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "SetState" ), pGameDLL + 0x13D770 ) 103 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "SetStateTexture" ), pGameDLL + 0x13DCD0 ) 104 | call SaveInteger( MemHackTable, StringHash( "CSimpleButton" ), StringHash( "Click" ), pGameDLL + 0x13D7F0 ) 105 | endif 106 | endif 107 | endfunction 108 | endlibrary 109 | 110 | //=========================================================================== 111 | function InitTrig_MemHackCSimpleButtonAPI takes nothing returns nothing 112 | //set gg_trg_MemHackCSimpleButtonAPI = CreateTrigger( ) 113 | endfunction 114 | //! endnocjass 115 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/31-MemHackCSimpleGlueAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCSimpleGlueAPI 5 | function SetCSimpleGlueFrameScale takes integer pGlueFrame, real scale returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleGlueFrame" ), StringHash( "SetScale" ) ) 7 | local string f_name = "" 8 | 9 | if addr != 0 and pGlueFrame != 0 then 10 | set f_name = GetFrameTypeName( pGlueFrame ) 11 | 12 | if f_name == "CSimpleGlueFrame" then // 21 13 | return this_call_2( addr, pGlueFrame, SetRealIntoMemory( scale ) ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function Init_MemHackCSimpleGlueAPI takes nothing returns nothing 21 | if PatchVersion != "" then 22 | if PatchVersion == "1.24e" then 23 | call SaveInteger( MemHackTable, StringHash( "CSimpleGlueFrame" ), StringHash( "SetScale" ), pGameDLL + 0x617270 ) 24 | elseif PatchVersion == "1.26a" then 25 | call SaveInteger( MemHackTable, StringHash( "CSimpleGlueFrame" ), StringHash( "SetScale" ), pGameDLL + 0x616AD0 ) 26 | elseif PatchVersion == "1.27a" then 27 | call SaveInteger( MemHackTable, StringHash( "CSimpleGlueFrame" ), StringHash( "SetScale" ), pGameDLL + 0x0C19C0 ) 28 | elseif PatchVersion == "1.27b" then 29 | call SaveInteger( MemHackTable, StringHash( "CSimpleGlueFrame" ), StringHash( "SetScale" ), pGameDLL + 0x115720 ) 30 | elseif PatchVersion == "1.28f" then 31 | call SaveInteger( MemHackTable, StringHash( "CSimpleGlueFrame" ), StringHash( "SetScale" ), pGameDLL + 0x143DD0 ) 32 | endif 33 | endif 34 | endfunction 35 | endlibrary 36 | 37 | //=========================================================================== 38 | function InitTrig_MemHackCSimpleGlueAPI takes nothing returns nothing 39 | //set gg_trg_MemHackCSimpleGlueAPI = CreateTrigger( ) 40 | endfunction 41 | //! endnocjass 42 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/33-MemHackCSimpleConsoleAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCSimpleConsoleAPI 5 | function CreateCSimpleConsoleByTagName takes string tagName, integer parent, integer id returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleConsole" ), StringHash( "CreateByTagName" ) ) 7 | 8 | if addr != 0 and tagName != "" then 9 | return fast_call_3( addr, GetStringAddress( tagName ), parent, id ) 10 | endif 11 | 12 | return 0 13 | endfunction 14 | 15 | function Init_MemHackCSimpleConsoleAPI takes nothing returns nothing 16 | if PatchVersion != "" then 17 | if PatchVersion == "1.24e" then 18 | call SaveInteger( MemHackTable, StringHash( "CSimpleConsole" ), StringHash( "CreateByTagName" ), pGameDLL + 0x5C9DB0 ) 19 | elseif PatchVersion == "1.26a" then 20 | call SaveInteger( MemHackTable, StringHash( "CSimpleConsole" ), StringHash( "CreateByTagName" ), pGameDLL + 0x5C9610 ) 21 | elseif PatchVersion == "1.27a" then 22 | call SaveInteger( MemHackTable, StringHash( "CSimpleConsole" ), StringHash( "CreateByTagName" ), pGameDLL + 0x090A60 ) 23 | elseif PatchVersion == "1.27b" then 24 | call SaveInteger( MemHackTable, StringHash( "CSimpleConsole" ), StringHash( "CreateByTagName" ), pGameDLL + 0x0E47E0 ) 25 | elseif PatchVersion == "1.28f" then 26 | call SaveInteger( MemHackTable, StringHash( "CSimpleConsole" ), StringHash( "CreateByTagName" ), pGameDLL + 0x112E30 ) 27 | endif 28 | endif 29 | endfunction 30 | endlibrary 31 | 32 | //=========================================================================== 33 | function InitTrig_MemHackCSimpleConsoleAPI takes nothing returns nothing 34 | //set gg_trg_MemHackCSimpleConsoleAPI = CreateTrigger( ) 35 | endfunction 36 | //! endnocjass 37 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/34-MemHackCSpriteFrameAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCSpriteFrameAPI 5 | function SetCSpriteFrameArt takes integer pFrame, string model, integer modeltype, boolean flag returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "SetArt" ) ) 7 | local string f_name = "" 8 | 9 | if addr != 0 and pFrame != 0 then 10 | set f_name = GetFrameTypeName( pFrame ) 11 | 12 | if f_name == "CSpriteFrame" then // 25 13 | return this_call_4( addr, pFrame, GetStringAddress( model ), modeltype, B2I( flag ) ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function GetCSpriteFrameHeight takes integer pFrame returns real 21 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "GetHeight" ) ) 22 | local string f_name = "" 23 | 24 | if addr != 0 and pFrame != 0 then 25 | set f_name = GetFrameTypeName( pFrame ) 26 | 27 | if f_name == "CSpriteFrame" then // 25 28 | return GetRealFromMemory( this_call_1( addr, pFrame ) ) 29 | endif 30 | endif 31 | 32 | return 0. 33 | endfunction 34 | 35 | function SetCSpriteFrameScale takes integer pFrame, real scale returns integer 36 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "SetScale" ) ) 37 | local string f_name = "" 38 | 39 | if addr != 0 and pFrame != 0 then 40 | set f_name = GetFrameTypeName( pFrame ) 41 | 42 | if f_name == "CSpriteFrame" then // 25 43 | return this_call_2( addr, pFrame, SetRealIntoMemory( scale ) ) 44 | endif 45 | endif 46 | 47 | return 0 48 | endfunction 49 | 50 | function Init_MemHackCSpriteFrameAPI takes nothing returns nothing 51 | if PatchVersion != "" then 52 | if PatchVersion == "1.24e" then 53 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "SetArt" ), pGameDLL + 0x60FB00 ) 54 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x60F2A0 ) 55 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "SetScale" ), pGameDLL + 0x60F600 ) 56 | elseif PatchVersion == "1.26a" then 57 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "SetArt" ), pGameDLL + 0x60F360 ) 58 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x60EB00 ) 59 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "SetScale" ), pGameDLL + 0x60EE60 ) 60 | elseif PatchVersion == "1.27a" then 61 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "SetArt" ), pGameDLL + 0x0A38C0 ) 62 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x0A3260 ) 63 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "SetScale" ), pGameDLL + 0x0A39A0 ) 64 | elseif PatchVersion == "1.27b" then 65 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "SetArt" ), pGameDLL + 0x0F7620 ) 66 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x0F6FC0 ) 67 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "SetScale" ), pGameDLL + 0x0F7700 ) 68 | elseif PatchVersion == "1.28f" then 69 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "SetArt" ), pGameDLL + 0x125C90 ) 70 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x125630 ) 71 | call SaveInteger( MemHackTable, StringHash( "CSpriteFrame" ), StringHash( "SetScale" ), pGameDLL + 0x125D70 ) 72 | endif 73 | endif 74 | endfunction 75 | endlibrary 76 | 77 | //=========================================================================== 78 | function InitTrig_MemHackCSpriteFrameAPI takes nothing returns nothing 79 | //set gg_trg_MemHackCSpriteFrameAPI = CreateTrigger( ) 80 | endfunction 81 | //! endnocjass 82 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/35-MemHackCSimpleMessageFrameAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCSimpleMessageFrameAPI 5 | function SetCSimpleMessageFrameFont takes integer pFrame, string filename, real height, integer flag returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleMessageFrame" ), StringHash( "SetFont" ) ) 7 | local string f_name = "" 8 | 9 | if addr != 0 and pFrame != 0 then 10 | set f_name = GetFrameTypeName( pFrame ) 11 | 12 | if f_name == "CSimpleMessageFrame" then // 23 13 | return this_call_4( addr, pFrame, GetStringAddress( filename ), SetRealIntoMemory( height ), flag ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function Init_MemHackCSimpleMessageFrameAPI takes nothing returns nothing 21 | if PatchVersion != "" then 22 | if PatchVersion == "1.24e" then 23 | call SaveInteger( MemHackTable, StringHash( "CSimpleMessageFrame" ), StringHash( "SetFont" ), pGameDLL + 0x6042B0 ) 24 | elseif PatchVersion == "1.26a" then 25 | call SaveInteger( MemHackTable, StringHash( "CSimpleMessageFrame" ), StringHash( "SetFont" ), pGameDLL + 0x603B10 ) 26 | elseif PatchVersion == "1.27a" then 27 | call SaveInteger( MemHackTable, StringHash( "CSimpleMessageFrame" ), StringHash( "SetFont" ), pGameDLL + 0x0C2E80 ) 28 | elseif PatchVersion == "1.27b" then 29 | call SaveInteger( MemHackTable, StringHash( "CSimpleMessageFrame" ), StringHash( "SetFont" ), pGameDLL + 0x116BE0 ) 30 | elseif PatchVersion == "1.28f" then 31 | call SaveInteger( MemHackTable, StringHash( "CSimpleMessageFrame" ), StringHash( "SetFont" ), pGameDLL + 0x145290 ) 32 | endif 33 | endif 34 | endfunction 35 | endlibrary 36 | 37 | //=========================================================================== 38 | function InitTrig_MemHackCSimpleMessageFrameAPI takes nothing returns nothing 39 | //set gg_trg_MemHackCSimpleMessageFrameAPI = CreateTrigger( ) 40 | endfunction 41 | //! endnocjass 42 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/36-MemHackCSliderAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCSliderAPI 5 | function SetCSliderCurrentValue takes integer pFrame, real value returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSlider" ), StringHash( "SetCurrentValue" ) ) 7 | local string f_name = "" 8 | 9 | if addr != 0 and pFrame != 0 then 10 | set f_name = GetFrameTypeName( pFrame ) 11 | 12 | if f_name == "CSlider" then // 24 13 | return this_call_3( addr, pFrame, SetRealIntoMemory( value ), 1 ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function Init_MemHackCSliderAPI takes nothing returns nothing 21 | if PatchVersion != "" then 22 | if PatchVersion == "1.24e" then 23 | call SaveInteger( MemHackTable, StringHash( "CSlider" ), StringHash( "SetCurrentValue" ), pGameDLL + 0x61F610 ) 24 | elseif PatchVersion == "1.26a" then 25 | call SaveInteger( MemHackTable, StringHash( "CSlider" ), StringHash( "SetCurrentValue" ), pGameDLL + 0x61EE70 ) 26 | elseif PatchVersion == "1.27a" then 27 | call SaveInteger( MemHackTable, StringHash( "CSlider" ), StringHash( "SetCurrentValue" ), pGameDLL + 0x0AB3B0 ) 28 | elseif PatchVersion == "1.27b" then 29 | call SaveInteger( MemHackTable, StringHash( "CSlider" ), StringHash( "SetCurrentValue" ), pGameDLL + 0x0FF110 ) 30 | elseif PatchVersion == "1.28f" then 31 | call SaveInteger( MemHackTable, StringHash( "CSlider" ), StringHash( "SetCurrentValue" ), pGameDLL + 0x12D780 ) 32 | endif 33 | endif 34 | endfunction 35 | endlibrary 36 | 37 | //=========================================================================== 38 | function InitTrig_MemHackCSliderAPI takes nothing returns nothing 39 | //set gg_trg_MemHackCSliderAPI = CreateTrigger( ) 40 | endfunction 41 | //! endnocjass 42 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/37-MemHackCTextAreaAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCTextAreaAPI 5 | function SetCTextAreaText takes integer pFrame, string text returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CTextArea" ), StringHash( "SetText" ) ) 7 | local string f_name = "" 8 | 9 | if addr != 0 and pFrame != 0 then 10 | set f_name = GetFrameTypeName( pFrame ) 11 | 12 | if f_name == "CTextArea" then // 27 13 | return B2I( this_call_2( addr, pFrame, GetStringAddress( text ) ) > 0 ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function Init_MemHackCTextAreaAPI takes nothing returns nothing 21 | if PatchVersion != "" then 22 | if PatchVersion == "1.24e" then 23 | call SaveInteger( MemHackTable, StringHash( "CTextArea" ), StringHash( "SetText" ), pGameDLL + 0x61E830 ) 24 | elseif PatchVersion == "1.26a" then 25 | call SaveInteger( MemHackTable, StringHash( "CTextArea" ), StringHash( "SetText" ), pGameDLL + 0x61E090 ) 26 | elseif PatchVersion == "1.27a" then 27 | call SaveInteger( MemHackTable, StringHash( "CTextArea" ), StringHash( "SetText" ), pGameDLL + 0x0B6500 ) 28 | elseif PatchVersion == "1.27b" then 29 | call SaveInteger( MemHackTable, StringHash( "CTextArea" ), StringHash( "SetText" ), pGameDLL + 0x10A260 ) 30 | elseif PatchVersion == "1.28f" then 31 | call SaveInteger( MemHackTable, StringHash( "CTextArea" ), StringHash( "SetText" ), pGameDLL + 0x138790 ) 32 | endif 33 | endif 34 | endfunction 35 | endlibrary 36 | //! endnocjass 37 | 38 | //=========================================================================== 39 | function InitTrig_MemHackCTextAreaAPI takes nothing returns nothing 40 | //set gg_trg_MemHackCTextAreaAPI = CreateTrigger( ) 41 | endfunction 42 | //! endnocjass 43 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/38-MemHackCTextFrameAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCTextFrameAPI 5 | function SetCTextFrameTextColour takes integer pFrame, integer colour returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "SetTextColour" ) ) 7 | local string f_name = "" 8 | 9 | if addr != 0 and pFrame != 0 then 10 | set f_name = GetFrameTypeName( pFrame ) 11 | 12 | if f_name == "CEditBox" or f_name == "CTextFrame" then // 6 | 29 13 | return this_call_2( addr, pFrame, colour ) // ARGB colour 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function SetCTextFrameTextColourEx takes integer pFrame, integer alpha, integer red, integer blue, integer green returns integer 21 | return SetCTextFrameTextColour( pFrame, CreateInteger1( alpha, red, green, blue ) ) 22 | endfunction 23 | 24 | function GetCTextFrameHeight takes integer pFrame returns real 25 | local integer addr = LoadInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "GetHeight" ) ) 26 | local string f_name = "" 27 | 28 | if addr != 0 and pFrame != 0 then 29 | set f_name = GetFrameTypeName( pFrame ) 30 | 31 | if f_name == "CTextFrame" then // 29 32 | return GetRealFromMemory( this_call_1( addr, pFrame ) ) 33 | endif 34 | endif 35 | 36 | return 0. 37 | endfunction 38 | 39 | function SetCTextFrameText takes integer pFrame, string text returns integer 40 | local integer addr = LoadInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "SetText" ) ) 41 | local string f_name = "" 42 | 43 | if addr != 0 and pFrame != 0 then 44 | set f_name = GetFrameTypeName( pFrame ) 45 | 46 | if f_name == "CTextButtonFrame" or f_name == "CTextFrame" or f_name == "CGlueTextButtonWar3" or f_name == "CTimerTextFrame" then // 28 | 29 | 33 | 38 47 | if f_name == "CTextButtonFrame" or f_name == "CGlueTextButtonWar3" then // 28 | 33 48 | // if 1.29.2+ then 0x1F4 49 | set pFrame = ReadRealMemory( pFrame + 0x1E4 ) 50 | endif 51 | 52 | return B2I( this_call_2( addr, pFrame, GetStringAddress( text ) ) > 0 ) 53 | endif 54 | endif 55 | 56 | return 0 57 | endfunction 58 | 59 | function Init_MemHackCTextFrameAPI takes nothing returns nothing 60 | if PatchVersion != "" then 61 | if PatchVersion == "1.24e" then 62 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x612040 ) 63 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "SetText" ), pGameDLL + 0x6124E0 ) 64 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "SetTextColour" ), pGameDLL + 0x611D30 ) 65 | elseif PatchVersion == "1.26a" then 66 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x6118A0 ) 67 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "SetText" ), pGameDLL + 0x611D40 ) 68 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "SetTextColour" ), pGameDLL + 0x611590 ) 69 | elseif PatchVersion == "1.27a" then 70 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x0A9770 ) 71 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "SetText" ), pGameDLL + 0x0AA130 ) 72 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "SetTextColour" ), pGameDLL + 0x0AA210 ) 73 | elseif PatchVersion == "1.27b" then 74 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x0FD4D0 ) 75 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "SetText" ), pGameDLL + 0x0FDE90 ) 76 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "SetTextColour" ), pGameDLL + 0x0FDF70 ) 77 | elseif PatchVersion == "1.28f" then 78 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "GetHeight" ), pGameDLL + 0x12BB40 ) 79 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "SetText" ), pGameDLL + 0x12C500 ) 80 | call SaveInteger( MemHackTable, StringHash( "CTextFrame" ), StringHash( "SetTextColour" ), pGameDLL + 0x12C5E0 ) 81 | endif 82 | endif 83 | endfunction 84 | endlibrary 85 | 86 | //=========================================================================== 87 | function InitTrig_MemHackCTextFrameAPI takes nothing returns nothing 88 | //set gg_trg_MemHackCTextFrameAPI = CreateTrigger( ) 89 | endfunction 90 | //! endnocjass 91 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/39-MemHackCSimpleStatusBarAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCSimpleStatusBarAPI 5 | function SetCSimpleStatusBarTexture takes integer pFrame, string texturepath, boolean flag returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetTexture" ) ) 7 | local string f_name = "" 8 | 9 | if addr != 0 and pFrame != 0 then 10 | set f_name = GetFrameTypeName( pFrame ) 11 | 12 | if f_name == "CSimpleStatusBar" then // 39 13 | return this_call_3( addr, pFrame, GetStringAddress( texturepath ), B2I( flag ) ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function SetCSimpleStatusBarValue takes integer pFrame, real value returns integer 21 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetValue" ) ) 22 | local string f_name = "" 23 | 24 | if addr != 0 and pFrame != 0 then 25 | set f_name = GetFrameTypeName( pFrame ) 26 | 27 | if f_name == "CSimpleStatusBar" then // 39 28 | return this_call_2( addr, pFrame, SetRealIntoMemory( value ) ) 29 | endif 30 | endif 31 | 32 | return 0 33 | endfunction 34 | 35 | function SetCSimpleStatusBarMinMaxValue takes integer pFrame, real minval, real maxval returns integer 36 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetMinMaxValue" ) ) 37 | local string f_name = "" 38 | 39 | if addr != 0 and pFrame != 0 then 40 | set f_name = GetFrameTypeName( pFrame ) 41 | 42 | if f_name == "CSimpleStatusBar" then // 39 43 | return this_call_3( addr, pFrame, SetRealIntoMemory( minval ), SetRealIntoMemory( maxval ) ) 44 | endif 45 | endif 46 | 47 | return 0 48 | endfunction 49 | 50 | function Init_MemHackCSimpleStatusBarAPI takes nothing returns nothing 51 | if PatchVersion != "" then 52 | if PatchVersion == "1.24e" then 53 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetTexture" ), pGameDLL + 0x60EDB0 ) 54 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetValue" ), pGameDLL + 0x60EBD0 ) 55 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetMinMaxValue" ), pGameDLL + 0x60EB50 ) 56 | elseif PatchVersion == "1.26a" then 57 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetTexture" ), pGameDLL + 0x60E610 ) 58 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetValue" ), pGameDLL + 0x60E430 ) 59 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetMinMaxValue" ), pGameDLL + 0x60E3B0 ) 60 | elseif PatchVersion == "1.27a" then 61 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetTexture" ), pGameDLL + 0x0BC130 ) 62 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetValue" ), pGameDLL + 0x0BC2E0 ) 63 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetMinMaxValue" ), pGameDLL + 0x0BC270 ) 64 | elseif PatchVersion == "1.27b" then 65 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetTexture" ), pGameDLL + 0x10FE90 ) 66 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetValue" ), pGameDLL + 0x110040 ) 67 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetMinMaxValue" ), pGameDLL + 0x10FFD0 ) 68 | elseif PatchVersion == "1.28f" then 69 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetTexture" ), pGameDLL + 0x13E3C0 ) 70 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetValue" ), pGameDLL + 0x13E570 ) 71 | call SaveInteger( MemHackTable, StringHash( "CSimpleStatusBar" ), StringHash( "SetMinMaxValue" ), pGameDLL + 0x13E500 ) 72 | endif 73 | endif 74 | endfunction 75 | endlibrary 76 | 77 | //=========================================================================== 78 | function InitTrig_MemHackCSimpleStatusBarAPI takes nothing returns nothing 79 | //set gg_trg_MemHackCSimpleStatusBarAPI = CreateTrigger( ) 80 | endfunction 81 | //! endnocjass 82 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/40-MemHackCStatusBarAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCStatusBarAPI 5 | function SetCStatusBarArt takes integer pFrame, string model, integer modeltype returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CStatusBar" ), StringHash( "SetArt" ) ) 7 | local string f_name = "" 8 | 9 | if addr != 0 and pFrame != 0 then 10 | set f_name = GetFrameTypeName( pFrame ) 11 | 12 | if f_name == "CStatusBar" then // 40 13 | return this_call_3( addr, pFrame, GetStringAddress( model ), modeltype ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function SetCStatusBarValue takes integer pFrame, real value returns integer 21 | local real minval = 0. 22 | local real maxval = 0. 23 | local real curval = 0. 24 | local real newval = 0. 25 | local string f_name = "" 26 | 27 | if pFrame != 0 then 28 | set f_name = GetFrameTypeName( pFrame ) 29 | 30 | if f_name == "CStatusBar" then // 40 // FUNCTION_CStatusBar__SetValue => 1.27a = 0x0AA870 31 | set minval = GetRealFromMemory( ReadRealMemory( pFrame + 0x1B4 ) ) 32 | set maxval = GetRealFromMemory( ReadRealMemory( pFrame + 0x1B8 ) ) 33 | set curval = GetRealFromMemory( ReadRealMemory( pFrame + 0x1BC ) ) 34 | 35 | if value <= minval then 36 | set value = minval 37 | endif 38 | 39 | call WriteRealMemory( pFrame + 0x1BC, SetRealIntoMemory( value ) ) 40 | return 1 41 | //return CallThisCallWith2Args( ReadRealMemory( pFrame + 0xEC ), pFrame, 0 ) ? 42 | endif 43 | endif 44 | 45 | return 0 46 | endfunction 47 | 48 | function SetCStatusBarMinMaxValue takes integer pFrame, real minval, real maxval returns integer 49 | local integer addr = LoadInteger( MemHackTable, StringHash( "CStatusBar" ), StringHash( "SetMinMaxValue" ) ) 50 | local string f_name = "" 51 | 52 | if addr != 0 and pFrame != 0 then 53 | set f_name = GetFrameTypeName( pFrame ) 54 | 55 | if f_name == "CStatusBar" then // 40 56 | return this_call_3( addr, pFrame, SetRealIntoMemory( minval ), SetRealIntoMemory( maxval ) ) 57 | endif 58 | endif 59 | 60 | return 0 61 | endfunction 62 | 63 | function Init_MemHackCStatusBarAPI takes nothing returns nothing 64 | if PatchVersion != "" then 65 | if PatchVersion == "1.24e" then 66 | call SaveInteger( MemHackTable, StringHash( "CStatusBar" ), StringHash( "SetArt" ), pGameDLL + 0x628140 ) 67 | call SaveInteger( MemHackTable, StringHash( "CStatusBar" ), StringHash( "SetMinMaxValue" ), pGameDLL + 0x627F60 ) 68 | elseif PatchVersion == "1.26a" then 69 | call SaveInteger( MemHackTable, StringHash( "CStatusBar" ), StringHash( "SetArt" ), pGameDLL + 0x6279A0 ) 70 | call SaveInteger( MemHackTable, StringHash( "CStatusBar" ), StringHash( "SetMinMaxValue" ), pGameDLL + 0x6277C0 ) 71 | elseif PatchVersion == "1.27a" then 72 | call SaveInteger( MemHackTable, StringHash( "CStatusBar" ), StringHash( "SetArt" ), pGameDLL + 0x0AA760 ) 73 | call SaveInteger( MemHackTable, StringHash( "CStatusBar" ), StringHash( "SetMinMaxValue" ), pGameDLL + 0x0AA7F0 ) 74 | elseif PatchVersion == "1.27b" then 75 | call SaveInteger( MemHackTable, StringHash( "CStatusBar" ), StringHash( "SetArt" ), pGameDLL + 0x0FE4C0 ) 76 | call SaveInteger( MemHackTable, StringHash( "CStatusBar" ), StringHash( "SetMinMaxValue" ), pGameDLL + 0x0FE550 ) 77 | elseif PatchVersion == "1.28f" then 78 | call SaveInteger( MemHackTable, StringHash( "CStatusBar" ), StringHash( "SetArt" ), pGameDLL + 0x12CB30 ) 79 | call SaveInteger( MemHackTable, StringHash( "CStatusBar" ), StringHash( "SetMinMaxValue" ), pGameDLL + 0x12CBC0 ) 80 | endif 81 | endif 82 | endfunction 83 | endlibrary 84 | //! endnocjass 85 | 86 | //=========================================================================== 87 | function InitTrig_MemHackCStatusBarAPI takes nothing returns nothing 88 | //set gg_trg_MemHackCStatusBarAPI = CreateTrigger( ) 89 | endfunction 90 | //! endnocjass 91 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/41-MemHackCSimpleTextureAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCSimpleTextureAPI 5 | function AllocCSimpleTexture takes nothing returns integer 6 | return StormAllocateMemory( 0xE8, "MemHackCSimpleTexture", 4, 0 ) 7 | endfunction 8 | 9 | function CreateCSimpleTexture takes integer pParent returns integer 10 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "Create" ) ) 11 | local integer baseobj = 0 12 | 13 | if addr != 0 then 14 | set baseobj = AllocCSimpleTexture( ) 15 | 16 | if baseobj > 0 then 17 | return this_call_4( addr, baseobj, pParent, 2, 1 ) 18 | endif 19 | endif 20 | 21 | return 0 22 | endfunction 23 | 24 | function FillCSimpleTexture takes integer pFrame, integer colour returns integer 25 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "Fill" ) ) 26 | local integer arg = LoadInteger( MemHackTable, StringHash( "PointerArray" ), 0 ) 27 | 28 | if addr != 0 and arg != 0 and pFrame != 0 then 29 | call WriteRealMemory( arg + 0x0, colour ) 30 | return B2I( this_call_2( addr, pFrame, arg + 0x0 ) == 0 ) 31 | endif 32 | 33 | return 0 34 | endfunction 35 | 36 | function GetCSimpleTextureByName takes string name, integer id returns integer 37 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "GetByName" ) ) 38 | 39 | if addr != 0 and name != "" then 40 | return fast_call_2( addr, GetStringAddress( name ), id ) 41 | endif 42 | 43 | return 0 44 | endfunction 45 | 46 | function SetCSimpleTextureTexture takes integer pFrame, string texturepath, boolean flag returns integer 47 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "SetTexture" ) ) 48 | local string f_name = "" 49 | 50 | if addr != 0 and pFrame != 0 then 51 | set f_name = GetFrameTypeName( pFrame ) 52 | 53 | if f_name == "CSimpleTexture" then // 64 54 | return this_call_3( addr, pFrame, GetStringAddress( texturepath ), B2I( flag ) ) 55 | endif 56 | endif 57 | 58 | return 0 59 | endfunction 60 | 61 | function Init_MemHackCSimpleTextureAPI takes nothing returns nothing 62 | if PatchVersion != "" then 63 | if PatchVersion == "1.24e" then 64 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "Create" ), pGameDLL + 0x60E0A0 ) 65 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "Fill" ), pGameDLL + 0x60DB50 ) 66 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "GetByName" ), pGameDLL + 0x61CF30 ) 67 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "SetTexture" ), pGameDLL + 0x60E830 ) 68 | elseif PatchVersion == "1.26a" then 69 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "Create" ), pGameDLL + 0x60D900 ) 70 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "Fill" ), pGameDLL + 0x60D3B0 ) 71 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "GetByName" ), pGameDLL + 0x61C790 ) 72 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "SetTexture" ), pGameDLL + 0x60E090 ) 73 | elseif PatchVersion == "1.27a" then 74 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "Create" ), pGameDLL + 0x0C90B0 ) 75 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "Fill" ), pGameDLL + 0x324AD0 ) 76 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "GetByName" ), pGameDLL + 0x0C1170 ) 77 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "SetTexture" ), pGameDLL + 0x0C11E0 ) 78 | elseif PatchVersion == "1.27b" then 79 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "Create" ), pGameDLL + 0x113930 ) 80 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "Fill" ), pGameDLL + 0x342220 ) 81 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "GetByName" ), pGameDLL + 0x114ED0 ) 82 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "SetTexture" ), pGameDLL + 0x114F40 ) 83 | elseif PatchVersion == "1.28f" then 84 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "Create" ), pGameDLL + 0x141FE0 ) 85 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "Fill" ), pGameDLL + 0x3761E0 ) 86 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "GetByName" ), pGameDLL + 0x143580 ) 87 | call SaveInteger( MemHackTable, StringHash( "CSimpleTexture" ), StringHash( "SetTexture" ), pGameDLL + 0x1435F0 ) 88 | endif 89 | endif 90 | endfunction 91 | endlibrary 92 | 93 | //=========================================================================== 94 | function InitTrig_MemHackCSimpleTextureAPI takes nothing returns nothing 95 | //set gg_trg_MemHackCSimpleTextureAPI = CreateTrigger( ) 96 | endfunction 97 | //! endnocjass 98 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/42-MemHackCSimpleRegionAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=27 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCSimpleRegionAPI 5 | // CSimpleRegion is baseline frame type for CSimpleTexture, CSimpleFontString. So you can use this API on them as well. 6 | 7 | function ShowCSimpleRegion takes integer pSimpleRegion returns nothing 8 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "Show" ) ) 9 | 10 | if addr != 0 and pSimpleRegion != 0 then 11 | call this_call_1( addr, pSimpleRegion ) 12 | endif 13 | endfunction 14 | 15 | function HideCSimpleRegion takes integer pSimpleRegion returns nothing 16 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "Hide" ) ) 17 | 18 | if addr != 0 and pSimpleRegion != 0 then 19 | call this_call_1( addr, pSimpleRegion ) 20 | endif 21 | endfunction 22 | 23 | function SetCSimpleRegionVisibility takes integer pSimpleRegion, boolean flag returns nothing 24 | if flag then 25 | call ShowCSimpleRegion( pSimpleRegion ) 26 | else 27 | call HideCSimpleRegion( pSimpleRegion ) 28 | endif 29 | endfunction 30 | 31 | function SetCSimpleRegionVertexColour takes integer pFrame, integer colour returns integer 32 | local integer addr = LoadInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "SetVertexColour" ) ) 33 | local integer arg = LoadInteger( MemHackTable, StringHash( "PointerArray" ), 0 ) 34 | local string f_name = "" 35 | 36 | if addr != 0 and arg != 0 then 37 | set f_name = GetFrameTypeName( pFrame ) 38 | 39 | if SubString( f_name, 0, 7 ) == "CSimple" then 40 | // old check f_name == "CSimpleFontString" or f_name == "CSimpleStatusBar" or f_name == "CSimpleTexture" => 19 | 39 | 64 41 | if f_name == "CSimpleStatusBar" then // 39 42 | set pFrame = ReadRealMemory( pFrame + 0x134 ) // if 1.29+ then 0x138 43 | endif 44 | 45 | if pFrame != 0 then 46 | call WriteRealMemory( arg + 0x0, colour ) 47 | return this_call_2( addr, pFrame, arg + 0x0 ) 48 | endif 49 | endif 50 | endif 51 | 52 | return 0 53 | endfunction 54 | 55 | function SetCSimpleRegionVertexColourEx takes integer pFrame, integer alpha, integer red, integer blue, integer green returns integer 56 | return SetCSimpleRegionVertexColour( pFrame, GetARGBColour( alpha, red, blue, green ) ) 57 | endfunction 58 | 59 | function Init_MemHackCSimpleRegionAPI takes nothing returns nothing 60 | if PatchVersion != "" then 61 | if PatchVersion == "1.24e" then 62 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "Show" ), pGameDLL + 0x60EF60 ) 63 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "Hide" ), pGameDLL + 0x60EF80 ) 64 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "SetVertexColour" ), pGameDLL + 0x60EEE0 ) 65 | elseif PatchVersion == "1.26a" then 66 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "Show" ), pGameDLL + 0x60E7C0 ) 67 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "Hide" ), pGameDLL + 0x60E7E0 ) 68 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "SetVertexColour" ), pGameDLL + 0x60E740 ) 69 | elseif PatchVersion == "1.27a" then 70 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "Show" ), pGameDLL + 0x0BFA70 ) 71 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "Hide" ), pGameDLL + 0x0BF8D0 ) 72 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "SetVertexColour" ), pGameDLL + 0x0BFA30 ) 73 | elseif PatchVersion == "1.27b" then 74 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "Show" ), pGameDLL + 0x1137D0 ) 75 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "Hide" ), pGameDLL + 0x113630 ) 76 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "SetVertexColour" ), pGameDLL + 0x113790 ) 77 | elseif PatchVersion == "1.28f" then 78 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "Show" ), pGameDLL + 0x141E80 ) 79 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "Hide" ), pGameDLL + 0x141CE0 ) 80 | call SaveInteger( MemHackTable, StringHash( "CSimpleRegion" ), StringHash( "SetVertexColour" ), pGameDLL + 0x141E40 ) 81 | endif 82 | endif 83 | endfunction 84 | endlibrary 85 | 86 | //=========================================================================== 87 | function InitTrig_MemHackCSimpleRegionAPI takes nothing returns nothing 88 | //set gg_trg_MemHackCSimpleRegionAPI = CreateTrigger( ) 89 | endfunction 90 | //! endnocjass 91 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/52-MemHackCObjectAPI.txt: -------------------------------------------------------------------------------- 1 | API for CSpriteUber, which are Effects/Trackables which are also inherited by Units. 2 | Handles such as items/destructabls/doodads use CSpriteMini instead. -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/55-MemHackPlayerAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackPlayerAPI 5 | function GetCGameObjectStruct takes nothing returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CGameWar3" ), StringHash( "Instance" ) ) 7 | 8 | if addr != 0 then 9 | return ReadRealMemory( addr ) 10 | endif 11 | 12 | return 0 13 | endfunction 14 | 15 | function GetRealPlayerById takes integer i returns integer 16 | local integer addr = GetCGameObjectStruct( ) 17 | 18 | if addr != 0 then 19 | return ReadRealMemory( addr + ( i * 4 ) + 0x58 ) 20 | endif 21 | 22 | return 0 23 | endfunction 24 | 25 | function GetLocalPlayerIdReal takes nothing returns integer 26 | local integer addr = GetCGameObjectStruct( ) 27 | 28 | if addr != 0 then 29 | return ReadRealMemory( addr + 0xA ) 30 | endif 31 | 32 | return -1 33 | endfunction 34 | 35 | function GetLocalPlayerReal takes nothing returns integer 36 | return GetRealPlayerById( GetLocalPlayerIdReal( ) ) 37 | endfunction 38 | 39 | function GetPlayerSelectedUnitReal takes integer cplayer returns integer 40 | local integer addr = 0 41 | 42 | if cplayer != 0 then 43 | set addr = ReadRealMemory( addr + 0x34 ) 44 | 45 | if addr != 0 then 46 | return ReadRealMemory( addr + 0x1E0 ) 47 | endif 48 | endif 49 | 50 | return -1 51 | endfunction 52 | 53 | function SetPlayerSelectedUnitReal takes integer cplayer, integer pConvertedHandle returns nothing 54 | local integer addr = 0 55 | 56 | if cplayer != 0 and pConvertedHandle != 0 then 57 | set addr = ReadRealMemory( addr + 0x34 ) 58 | 59 | if addr != 0 then 60 | call WriteRealMemory( addr + 0x1E0, pConvertedHandle ) 61 | endif 62 | endif 63 | endfunction 64 | 65 | function GetOrderPlayerId takes unit u returns integer 66 | local integer pHandle = ConvertHandle( u ) 67 | local integer pAddr1 68 | local integer pAddr2 69 | 70 | if pHandle > 0 then 71 | set pAddr1 = ReadRealMemory( pHandle + 0x1A8 ) 72 | set pAddr2 = ReadRealMemory( pHandle + 0x1AC ) 73 | 74 | if pAddr1 > 0 and pAddr2 > 0 then 75 | return ReadRealMemory( GetCAgentFromHash( pAddr1, pAddr2 ) + 0x28 ) 76 | endif 77 | endif 78 | 79 | return 0xF 80 | endfunction 81 | 82 | function Init_MemHackPlayerAPI takes nothing returns nothing 83 | if PatchVersion != "" then 84 | if PatchVersion == "1.24e" then 85 | 86 | elseif PatchVersion == "1.26a" then 87 | 88 | elseif PatchVersion == "1.27a" then 89 | 90 | elseif PatchVersion == "1.27b" then 91 | 92 | elseif PatchVersion == "1.28f" then 93 | 94 | endif 95 | endif 96 | endfunction 97 | endlibrary 98 | 99 | //=========================================================================== 100 | function InitTrig_MemHackPlayerAPI takes nothing returns nothing 101 | //set gg_trg_MemHackPlayerAPI = CreateTrigger( ) 102 | endfunction 103 | //! endnocjass 104 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/57-MemHackTimerAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackTimerAPI 5 | function TimerRestart takes timer tmr returns boolean 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CTimerWar3" ), StringHash( "Restart" ) ) 7 | local integer data = ConvertHandle( tmr ) 8 | 9 | if addr != 0 and data != 0 then 10 | return this_call_1( addr, data ) != 0 11 | endif 12 | 13 | return false 14 | endfunction 15 | 16 | function TimerGetCallbackName takes timer tmr returns string 17 | return "" 18 | endfunction 19 | 20 | function Init_MemHackTimerAPI takes nothing returns nothing 21 | if PatchVersion != "" then 22 | if PatchVersion == "1.24e" then 23 | call SaveInteger( MemHackTable, StringHash( "CTimerWar3" ), StringHash( "Restart" ), pGameDLL + 0x3F7480 ) 24 | elseif PatchVersion == "1.26a" then 25 | call SaveInteger( MemHackTable, StringHash( "CTimerWar3" ), StringHash( "Restart" ), pGameDLL + 0x3F6940 ) 26 | elseif PatchVersion == "1.27a" then 27 | call SaveInteger( MemHackTable, StringHash( "CTimerWar3" ), StringHash( "Restart" ), pGameDLL + 0x2227C0 ) 28 | elseif PatchVersion == "1.27b" then 29 | call SaveInteger( MemHackTable, StringHash( "CTimerWar3" ), StringHash( "Restart" ), pGameDLL + 0x2403F0 ) 30 | elseif PatchVersion == "1.28f" then 31 | call SaveInteger( MemHackTable, StringHash( "CTimerWar3" ), StringHash( "Restart" ), pGameDLL + 0x272900 ) 32 | endif 33 | endif 34 | endfunction 35 | endlibrary 36 | 37 | //=========================================================================== 38 | function InitTrig_MemHackTimerAPI takes nothing returns nothing 39 | //set gg_trg_MemHackTimerAPI = CreateTrigger( ) 40 | endfunction 41 | //! endnocjass 42 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/59-MemHackAbilityNormalAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackAbilityNormalAPI 5 | // jAbility API 6 | function GetAbilityOrderId takes ability a returns integer 7 | return GetAddressAbilityOrderId( ConvertHandle( a ) ) 8 | endfunction 9 | 10 | function IsAbilityOnCooldown takes ability a returns boolean 11 | return IsAddressAbilityOnCooldown( ConvertHandle( a ) ) 12 | endfunction 13 | 14 | function IsAbilitySafe takes ability a returns boolean 15 | return IsAddressAbilitySafe( ConvertHandle( a ) ) 16 | endfunction 17 | 18 | function IsAbilityUsable takes ability a returns boolean 19 | return IsAddressAbilityUsable( ConvertHandle( a ) ) 20 | endfunction 21 | 22 | function GetAbilityCastpoint takes ability a returns real 23 | return GetAddressAbilityCastpoint( ConvertHandle( a ) ) 24 | endfunction 25 | 26 | function SetAbilityCastpoint takes ability a, real dur returns nothing 27 | call SetAddressAbilityCastpoint( ConvertHandle( a ), dur ) 28 | endfunction 29 | 30 | function GetAbilityBackswing takes ability a returns real 31 | return GetAddressAbilityBackswing( ConvertHandle( a ) ) 32 | endfunction 33 | 34 | function SetAbilityBackswing takes ability a, real dur returns nothing 35 | call SetAddressAbilityBackswing( ConvertHandle( a ), dur ) 36 | endfunction 37 | 38 | function GetAbilityManaCost takes ability a, integer level returns integer 39 | return GetAddressAbilityManaCost( ConvertHandle( a ), level ) 40 | endfunction 41 | 42 | function SetAbilityManaCost takes ability a, integer level, integer mc returns nothing 43 | call SetAddressAbilityManaCost( ConvertHandle( a ), level, mc ) 44 | endfunction 45 | 46 | function GetAbilityCooldownStamp takes ability a returns real 47 | //This actually returns the timestamp, not the cooldown. To get the real cooldown you need to subtract this from the current game time. 48 | return GetAddressAbilityCooldownStamp( ConvertHandle( a ) ) 49 | endfunction 50 | 51 | function GetAbilityCurrentCooldown takes ability a returns real 52 | //This value holds the base cooldown of the ability at the last time it was casted. It’s used to calculate the % of elapsed cooldown. 53 | //This is completely irrelevant for the gameplay, it’s used only to determine which frame of the cooldown model will be displayed. 54 | return GetAddressAbilityCurrentCooldown( ConvertHandle( a ) ) 55 | endfunction 56 | 57 | function SetAbilityCooldown takes ability a, real seconds, string mode returns nothing 58 | call SetAddressAbilityCooldown( ConvertHandle( a ), seconds, mode ) 59 | endfunction 60 | 61 | function AddAbilityCooldown takes ability a, real seconds returns nothing 62 | call SetAbilityCooldown( a, seconds, "+" ) 63 | endfunction 64 | 65 | function ReduceAbilityCooldown takes ability a, real seconds returns nothing 66 | call SetAbilityCooldown( a, seconds, "-" ) 67 | endfunction 68 | 69 | function ResetAbilityCooldown takes ability a returns nothing 70 | call SetAbilityCooldown( a, -1., "" ) 71 | endfunction 72 | 73 | function StartAbilityCooldown takes ability a, real cd returns nothing 74 | call StartAddressAbilityCooldown( ConvertHandle( a ), cd ) 75 | endfunction 76 | 77 | function GetAbilityCastTime takes ability a returns real 78 | return GetAddressAbilityCastTime( ConvertHandle( a ) ) 79 | endfunction 80 | 81 | function SetAbilityCastTime takes ability a, real r returns nothing 82 | call SetAddressAbilityCastTime( ConvertHandle( a ), r ) 83 | endfunction 84 | 85 | function SetAbilityDisabled takes ability a, integer count returns nothing 86 | // not safe unless used with PauseUnit. Button will be blacked, but current casts of that ability won’t be interrupted. 87 | call SetAddressAbilityDisabled( ConvertHandle( a ), count ) 88 | endfunction 89 | 90 | function GetAbilityDisabled takes ability a returns integer 91 | return GetAddressAbilityDisabled( ConvertHandle( a ) ) 92 | endfunction 93 | 94 | function SetAbilityHidden takes ability a, integer count returns nothing 95 | // This one is 100% safe. This hides the ability button, and order can’t be issued. 96 | call SetAddressAbilityHidden( ConvertHandle( a ), count ) // -1 = unhide | 1 = hide 97 | endfunction 98 | 99 | function AddAbilityHidden takes ability a, integer count returns nothing 100 | call AddAddressAbilityHidden( ConvertHandle( a ), count ) 101 | endfunction 102 | 103 | function GetAbilityDisabledEx takes ability a returns integer 104 | // This one is used by Orb of Slow. Button is blacked, but cooldown is stil displayed. 105 | return GetAddressAbilityDisabledEx( ConvertHandle( a ) ) 106 | endfunction 107 | 108 | function SetAbilityDisabledEx takes ability a, integer count returns nothing 109 | // This one is used by Orb of Slow. Button is blacked, but cooldown is stil displayed. 110 | call SetAddressAbilityDisabledEx( ConvertHandle( a ), count ) // -1 = unhide | 1 = hide 111 | endfunction 112 | 113 | function SilenceAbility takes ability a returns nothing 114 | call SilenceAddressAbility( ConvertHandle( a ) ) 115 | endfunction 116 | 117 | function UnsilenceAbility takes ability a returns nothing 118 | call UnsilenceAddressAbility( ConvertHandle( a ) ) 119 | endfunction 120 | 121 | function ShowAbility takes ability a, boolean flag returns nothing 122 | call ShowAddressAbility( ConvertHandle( a ), flag ) 123 | endfunction 124 | //=========================================== 125 | 126 | // Buff API 127 | function GetBuffLevel takes buff b returns integer 128 | return GetAddressBuffLevel( ConvertHandle( b ) ) 129 | endfunction 130 | //=========================================== 131 | 132 | function Init_MemHackAbilityNormalAPI takes nothing returns nothing 133 | if PatchVersion != "" then 134 | if PatchVersion == "1.24e" then 135 | elseif PatchVersion == "1.26a" then 136 | elseif PatchVersion == "1.27a" then 137 | elseif PatchVersion == "1.27b" then 138 | elseif PatchVersion == "1.28f" then 139 | endif 140 | endif 141 | endfunction 142 | endlibrary 143 | 144 | //=========================================================================== 145 | function InitTrig_MemHackAbilityNormalAPI takes nothing returns nothing 146 | //set gg_trg_MemHackAbilityNormalAPI = CreateTrigger( ) 147 | endfunction 148 | //! endnocjass 149 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/61-MemHackAbilityNormalAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=110 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackAbilityNormalAPI 5 | // jAbility API 6 | function GetAbilityOrderId takes ability a returns integer 7 | return GetAddressAbilityOrderId( ConvertHandle( a ) ) 8 | endfunction 9 | 10 | function IsAbilityOnCooldown takes ability a returns boolean 11 | return IsAddressAbilityOnCooldown( ConvertHandle( a ) ) 12 | endfunction 13 | 14 | function IsAbilitySafe takes ability a returns boolean 15 | return IsAddressAbilitySafe( ConvertHandle( a ) ) 16 | endfunction 17 | 18 | function IsAbilityUsable takes ability a returns boolean 19 | return IsAddressAbilityUsable( ConvertHandle( a ) ) 20 | endfunction 21 | 22 | function GetAbilityCastpoint takes ability a returns real 23 | return GetAddressAbilityCastpoint( ConvertHandle( a ) ) 24 | endfunction 25 | 26 | function SetAbilityCastpoint takes ability a, real dur returns nothing 27 | call SetAddressAbilityCastpoint( ConvertHandle( a ), dur ) 28 | endfunction 29 | 30 | function GetAbilityBackswing takes ability a returns real 31 | return GetAddressAbilityBackswing( ConvertHandle( a ) ) 32 | endfunction 33 | 34 | function SetAbilityBackswing takes ability a, real dur returns nothing 35 | call SetAddressAbilityBackswing( ConvertHandle( a ), dur ) 36 | endfunction 37 | 38 | function GetAbilityManaCost takes ability a, integer level returns integer 39 | return GetAddressAbilityManaCost( ConvertHandle( a ), level ) 40 | endfunction 41 | 42 | function SetAbilityManaCost takes ability a, integer level, integer mc returns nothing 43 | call SetAddressAbilityManaCost( ConvertHandle( a ), level, mc ) 44 | endfunction 45 | 46 | function GetAbilityCooldownStamp takes ability a returns real 47 | //This actually returns the timestamp, not the cooldown. To get the real cooldown you need to subtract this from the current game time. 48 | return GetAddressAbilityCooldownStamp( ConvertHandle( a ) ) 49 | endfunction 50 | 51 | function GetAbilityCurrentCooldown takes ability a returns real 52 | //This value holds the base cooldown of the ability at the last time it was casted. It’s used to calculate the % of elapsed cooldown. 53 | //This is completely irrelevant for the gameplay, it’s used only to determine which frame of the cooldown model will be displayed. 54 | return GetAddressAbilityCurrentCooldown( ConvertHandle( a ) ) 55 | endfunction 56 | 57 | function SetAbilityCooldown takes ability a, real seconds, string mode returns nothing 58 | call SetAddressAbilityCooldown( ConvertHandle( a ), seconds, mode ) 59 | endfunction 60 | 61 | function AddAbilityCooldown takes ability a, real seconds returns nothing 62 | call SetAbilityCooldown( a, seconds, "+" ) 63 | endfunction 64 | 65 | function ReduceAbilityCooldown takes ability a, real seconds returns nothing 66 | call SetAbilityCooldown( a, seconds, "-" ) 67 | endfunction 68 | 69 | function ResetAbilityCooldown takes ability a returns nothing 70 | call SetAbilityCooldown( a, -1., "" ) 71 | endfunction 72 | 73 | function StartAbilityCooldown takes ability a, real cd returns nothing 74 | call StartAddressAbilityCooldown( ConvertHandle( a ), cd ) 75 | endfunction 76 | 77 | function GetAbilityCastTime takes ability a returns real 78 | return GetAddressAbilityCastTime( ConvertHandle( a ) ) 79 | endfunction 80 | 81 | function SetAbilityCastTime takes ability a, real r returns nothing 82 | call SetAddressAbilityCastTime( ConvertHandle( a ), r ) 83 | endfunction 84 | 85 | function SetAbilityDisabled takes ability a, integer count returns nothing 86 | // not safe unless used with PauseUnit. Button will be blacked, but current casts of that ability won’t be interrupted. 87 | call SetAddressAbilityDisabled( ConvertHandle( a ), count ) 88 | endfunction 89 | 90 | function GetAbilityDisabled takes ability a returns integer 91 | return GetAddressAbilityDisabled( ConvertHandle( a ) ) 92 | endfunction 93 | 94 | function SetAbilityHidden takes ability a, integer count returns nothing 95 | // This one is 100% safe. This hides the ability button, and order can’t be issued. 96 | call SetAddressAbilityHidden( ConvertHandle( a ), count ) // -1 = unhide | 1 = hide 97 | endfunction 98 | 99 | function AddAbilityHidden takes ability a, integer count returns nothing 100 | call AddAddressAbilityHidden( ConvertHandle( a ), count ) 101 | endfunction 102 | 103 | function GetAbilityDisabledEx takes ability a returns integer 104 | // This one is used by Orb of Slow. Button is blacked, but cooldown is stil displayed. 105 | return GetAddressAbilityDisabledEx( ConvertHandle( a ) ) 106 | endfunction 107 | 108 | function SetAbilityDisabledEx takes ability a, integer count returns nothing 109 | // This one is used by Orb of Slow. Button is blacked, but cooldown is stil displayed. 110 | call SetAddressAbilityDisabledEx( ConvertHandle( a ), count ) // -1 = unhide | 1 = hide 111 | endfunction 112 | 113 | function SilenceAbility takes ability a returns nothing 114 | call SilenceAddressAbility( ConvertHandle( a ) ) 115 | endfunction 116 | 117 | function UnsilenceAbility takes ability a returns nothing 118 | call UnsilenceAddressAbility( ConvertHandle( a ) ) 119 | endfunction 120 | 121 | function ShowAbility takes ability a, boolean flag returns nothing 122 | call ShowAddressAbility( ConvertHandle( a ), flag ) 123 | endfunction 124 | //=========================================== 125 | 126 | // Buff API 127 | function GetBuffLevel takes buff b returns integer 128 | return GetAddressBuffLevel( ConvertHandle( b ) ) 129 | endfunction 130 | //=========================================== 131 | 132 | function Init_MemHackAbilityNormalAPI takes nothing returns nothing 133 | if PatchVersion != "" then 134 | if PatchVersion == "1.24e" then 135 | elseif PatchVersion == "1.26a" then 136 | elseif PatchVersion == "1.27a" then 137 | elseif PatchVersion == "1.27b" then 138 | elseif PatchVersion == "1.28f" then 139 | endif 140 | endif 141 | endfunction 142 | endlibrary 143 | 144 | //=========================================================================== 145 | function InitTrig_MemHackAbilityNormalAPI takes nothing returns nothing 146 | //set gg_trg_MemHackAbilityNormalAPI = CreateTrigger( ) 147 | endfunction 148 | //! endnocjass 149 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/61-MemHackCastAbility.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCastAbility 5 | function CastAbilityBasic takes integer pAbil returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CAbility" ), StringHash( "Cast" ) ) 7 | 8 | if addr != 0 and pAbil != 0 then 9 | return this_call_1( addr, pAbil ) 10 | endif 11 | 12 | return 0 13 | endfunction 14 | 15 | function CastAbilityPosition takes integer aid, unit source, real targX, real targY returns nothing 16 | // Fits for non-target spells, i.e. Was Stomp and such... 17 | local integer pData = ConvertHandle( source ) 18 | 19 | if pData > 0 then 20 | set pData = GetUnitAbility( source, aid ) 21 | 22 | if pData > 0 then 23 | call WriteRealMemory( pData + 0xF8, SetRealIntoMemory( targX ) ) 24 | call WriteRealMemory( pData + 0x100, SetRealIntoMemory( targY ) ) 25 | call WriteRealMemory( pData + 0x20, 0x9800 ) 26 | set pData = CastAbilityBasic( pData ) 27 | endif 28 | endif 29 | endfunction 30 | 31 | function CastAbilityTarget takes integer aid, unit source, widget target returns nothing 32 | // Due to memory issues requires std/this calls to use different memory allocation 33 | // else spells which deals damage immediately on cast will interference with damage-related functions 34 | // hence why we use separate memory addresses for each unique stdcall and such. 35 | local integer pData = 0 36 | local integer unitHashA = 0 37 | local integer unitHashB = 0 38 | local integer flags = 0 39 | 40 | if GetUnitAbilityLevel( source, aid ) > 0 and target != null then 41 | set pData = ConvertHandle( target ) 42 | 43 | if pData > 0 then 44 | set unitHashA = ReadRealMemory( pData + 0x0C ) 45 | set unitHashB = ReadRealMemory( pData + 0x10 ) 46 | 47 | if unitHashA > 0 and unitHashB > 0 then 48 | set pData = ConvertHandle( source ) 49 | 50 | if pData > 0 then 51 | set pData = GetUnitAbility( source, aid ) 52 | 53 | if pData > 0 then 54 | // Widget is saved via HashGroup, hence we grab our units HashA and HashB and save them to TargetHashGroup 55 | call WriteRealMemory( pData + 0xE4, unitHashA ) 56 | call WriteRealMemory( pData + 0xE8, unitHashB ) 57 | set flags = ReadRealMemory( pData + 0x20 ) 58 | 59 | if not IsFlagBitSet( flags, 0x10000 ) then 60 | // 0x19804 stands for "target", 0x1F020 stands for "target item", 0x9800 stands for point target 61 | call WriteRealMemory( pData + 0x20, flags + 0x10000 ) 62 | set flags = flags + 0x10000 63 | if not IsFlagBitSet( flags, 0x1 ) then 64 | call WriteRealMemory( pData + 0x20, flags + 0x1 ) 65 | endif 66 | endif 67 | 68 | set pData = CastAbilityBasic( pData ) // If value > 0 then cast has been successful. 69 | endif 70 | endif 71 | endif 72 | endif 73 | endif 74 | endfunction 75 | 76 | function CastAbilityTargetGround takes integer aid, unit source, integer lvl, real targX, real targY, boolean remove returns nothing 77 | call UnitAddAbility( source, aid ) 78 | 79 | if lvl > 1 then 80 | call SetUnitAbilityLevel( source, aid, lvl ) 81 | endif 82 | 83 | call CastAbilityPosition( aid, source, targX, targY ) 84 | if remove then 85 | // Note: channeled abilities stop as soon as ability is removed! 86 | // This Applies to Chain Lightning and such. 87 | call UnitRemoveAbility( source, aid ) 88 | endif 89 | endfunction 90 | 91 | function CastAbilityTargetWidget takes integer aid, unit source, widget target, integer lvl, boolean remove returns nothing 92 | call UnitAddAbility( source, aid ) 93 | 94 | if lvl > 1 then 95 | call SetUnitAbilityLevel( source, aid, lvl ) 96 | endif 97 | 98 | call CastAbilityTarget( aid, source, target ) 99 | if remove then 100 | // Note: channeled abilities stop as soon as ability is removed! 101 | // This Applies to Chain Lightning and such. 102 | call UnitRemoveAbility( source, aid ) 103 | endif 104 | endfunction 105 | 106 | function CastAbilityTargetSelf takes integer aid, unit source, integer lvl returns nothing 107 | call CastAbilityTargetWidget( aid, source, source, lvl, true ) 108 | endfunction 109 | 110 | function Init_MemHackCastAbility takes nothing returns nothing 111 | if PatchVersion != "" then 112 | if PatchVersion == "1.24e" then 113 | call SaveInteger( MemHackTable, StringHash( "CAbility" ), StringHash( "Cast" ), pGameDLL + 0x05CFD0 ) 114 | elseif PatchVersion == "1.26a" then 115 | call SaveInteger( MemHackTable, StringHash( "CAbility" ), StringHash( "Cast" ), pGameDLL + 0x05C3A0 ) 116 | elseif PatchVersion == "1.27a" then 117 | call SaveInteger( MemHackTable, StringHash( "CAbility" ), StringHash( "Cast" ), pGameDLL + 0x3ECB70 ) 118 | elseif PatchVersion == "1.27b" then 119 | call SaveInteger( MemHackTable, StringHash( "CAbility" ), StringHash( "Cast" ), pGameDLL + 0x40A2B0 ) 120 | elseif PatchVersion == "1.28f" then 121 | call SaveInteger( MemHackTable, StringHash( "CAbility" ), StringHash( "Cast" ), pGameDLL + 0x43E390 ) 122 | endif 123 | endif 124 | endfunction 125 | endlibrary 126 | 127 | //=========================================================================== 128 | function InitTrig_MemHackCastAbility takes nothing returns nothing 129 | //set gg_trg_MemHackCastAbility = CreateTrigger( ) 130 | endfunction 131 | //! endnocjass 132 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/63-MemHackCastAbility.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCastAbility 5 | function CastAbilityBasic takes integer pAbil returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "CAbility" ), StringHash( "Cast" ) ) 7 | 8 | if addr != 0 and pAbil != 0 then 9 | return this_call_1( addr, pAbil ) 10 | endif 11 | 12 | return 0 13 | endfunction 14 | 15 | function CastAbilityPosition takes integer aid, unit source, real targX, real targY returns nothing 16 | // Fits for non-target spells, i.e. Was Stomp and such... 17 | local integer pData = ConvertHandle( source ) 18 | 19 | if pData > 0 then 20 | set pData = GetUnitAbility( source, aid ) 21 | 22 | if pData > 0 then 23 | call WriteRealMemory( pData + 0xF8, SetRealIntoMemory( targX ) ) 24 | call WriteRealMemory( pData + 0x100, SetRealIntoMemory( targY ) ) 25 | call WriteRealMemory( pData + 0x20, 0x9800 ) 26 | set pData = CastAbilityBasic( pData ) 27 | endif 28 | endif 29 | endfunction 30 | 31 | function CastAbilityTarget takes integer aid, unit source, widget target returns nothing 32 | // Due to memory issues requires std/this calls to use different memory allocation 33 | // else spells which deals damage immediately on cast will interference with damage-related functions 34 | // hence why we use separate memory addresses for each unique stdcall and such. 35 | local integer pData = 0 36 | local integer unitHashA = 0 37 | local integer unitHashB = 0 38 | local integer flags = 0 39 | 40 | if GetUnitAbilityLevel( source, aid ) > 0 and target != null then 41 | set pData = ConvertHandle( target ) 42 | 43 | if pData > 0 then 44 | set unitHashA = ReadRealMemory( pData + 0x0C ) 45 | set unitHashB = ReadRealMemory( pData + 0x10 ) 46 | 47 | if unitHashA > 0 and unitHashB > 0 then 48 | set pData = ConvertHandle( source ) 49 | 50 | if pData > 0 then 51 | set pData = GetUnitAbility( source, aid ) 52 | 53 | if pData > 0 then 54 | // Widget is saved via HashGroup, hence we grab our units HashA and HashB and save them to TargetHashGroup 55 | call WriteRealMemory( pData + 0xE4, unitHashA ) 56 | call WriteRealMemory( pData + 0xE8, unitHashB ) 57 | set flags = ReadRealMemory( pData + 0x20 ) 58 | 59 | if not IsFlagBitSet( flags, 0x10000 ) then 60 | // 0x19804 stands for "target", 0x1F020 stands for "target item", 0x9800 stands for point target 61 | call WriteRealMemory( pData + 0x20, flags + 0x10000 ) 62 | set flags = flags + 0x10000 63 | if not IsFlagBitSet( flags, 0x1 ) then 64 | call WriteRealMemory( pData + 0x20, flags + 0x1 ) 65 | endif 66 | endif 67 | 68 | set pData = CastAbilityBasic( pData ) // If value > 0 then cast has been successful. 69 | endif 70 | endif 71 | endif 72 | endif 73 | endif 74 | endfunction 75 | 76 | function CastAbilityTargetGround takes integer aid, unit source, integer lvl, real targX, real targY, boolean remove returns nothing 77 | call UnitAddAbility( source, aid ) 78 | 79 | if lvl > 1 then 80 | call SetUnitAbilityLevel( source, aid, lvl ) 81 | endif 82 | 83 | call CastAbilityPosition( aid, source, targX, targY ) 84 | if remove then 85 | // Note: channeled abilities stop as soon as ability is removed! 86 | // This Applies to Chain Lightning and such. 87 | call UnitRemoveAbility( source, aid ) 88 | endif 89 | endfunction 90 | 91 | function CastAbilityTargetWidget takes integer aid, unit source, widget target, integer lvl, boolean remove returns nothing 92 | call UnitAddAbility( source, aid ) 93 | 94 | if lvl > 1 then 95 | call SetUnitAbilityLevel( source, aid, lvl ) 96 | endif 97 | 98 | call CastAbilityTarget( aid, source, target ) 99 | if remove then 100 | // Note: channeled abilities stop as soon as ability is removed! 101 | // This Applies to Chain Lightning and such. 102 | call UnitRemoveAbility( source, aid ) 103 | endif 104 | endfunction 105 | 106 | function CastAbilityTargetSelf takes integer aid, unit source, integer lvl returns nothing 107 | call CastAbilityTargetWidget( aid, source, source, lvl, true ) 108 | endfunction 109 | 110 | function Init_MemHackCastAbility takes nothing returns nothing 111 | if PatchVersion != "" then 112 | if PatchVersion == "1.24e" then 113 | call SaveInteger( MemHackTable, StringHash( "CAbility" ), StringHash( "Cast" ), pGameDLL + 0x05CFD0 ) 114 | elseif PatchVersion == "1.26a" then 115 | call SaveInteger( MemHackTable, StringHash( "CAbility" ), StringHash( "Cast" ), pGameDLL + 0x05C3A0 ) 116 | elseif PatchVersion == "1.27a" then 117 | call SaveInteger( MemHackTable, StringHash( "CAbility" ), StringHash( "Cast" ), pGameDLL + 0x3ECB70 ) 118 | elseif PatchVersion == "1.27b" then 119 | call SaveInteger( MemHackTable, StringHash( "CAbility" ), StringHash( "Cast" ), pGameDLL + 0x40A2B0 ) 120 | elseif PatchVersion == "1.28f" then 121 | call SaveInteger( MemHackTable, StringHash( "CAbility" ), StringHash( "Cast" ), pGameDLL + 0x43E390 ) 122 | endif 123 | endif 124 | endfunction 125 | endlibrary 126 | 127 | //=========================================================================== 128 | function InitTrig_MemHackCastAbility takes nothing returns nothing 129 | //set gg_trg_MemHackCastAbility = CreateTrigger( ) 130 | endfunction 131 | //! endnocjass 132 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/64-MemHackWidgetBaseAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCWidgetBaseAPI 5 | // Widget API Engine 6 | function GetWidgetTypeId takes widget w returns integer 7 | local integer pWidget = 0 8 | 9 | if w != null then 10 | set pWidget = ConvertHandle( w ) 11 | 12 | if pWidget != 0 then 13 | return ReadRealMemory( pWidget + 0x30 ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function GetWidgetBaseDataById takes integer pDataNode, integer wid returns integer 21 | return GetAgileDataNodeById( pDataNode, wid ) 22 | endfunction 23 | 24 | function GetWidgetBaseUIDataById takes integer id returns integer 25 | return GetWidgetUIDefById( id ) 26 | endfunction 27 | 28 | function GetWidgetBaseData takes integer pDataNode, widget w returns integer 29 | return GetAgileDataNodeById( pDataNode, GetWidgetTypeId( w ) ) 30 | endfunction 31 | 32 | function GetWidgetBaseDataByIdCachingEx takes integer pDataNode, integer index, integer id, integer mode returns integer 33 | local integer pData = 0 34 | 35 | if id > 0 then 36 | if HaveSavedInteger( htObjectDataPointers, index, id ) then 37 | return LoadInteger( htObjectDataPointers, index, id ) 38 | endif 39 | 40 | if mode == 0 then 41 | set pData = GetWidgetBaseDataById( pDataNode, id ) 42 | elseif mode == 1 then 43 | set pData = GetWidgetBaseUIDataById( id ) 44 | endif 45 | 46 | if pData > 0 then 47 | call SaveInteger( htObjectDataPointers, index, id, pData ) 48 | endif 49 | 50 | return pData 51 | endif 52 | 53 | return 0 54 | endfunction 55 | 56 | function GetWidgetBaseDataByIdCaching takes integer pDataNode, integer id returns integer 57 | return GetWidgetBaseDataByIdCachingEx( pDataNode, 2, id, 0 ) // DEF_ADR_UNIT_DATA = 2 | BaseData = 0 58 | endfunction 59 | 60 | function GetWidgetBaseDataCaching takes integer pDataNode, widget w returns integer 61 | return GetWidgetBaseDataByIdCaching( pDataNode, GetWidgetTypeId( w ) ) 62 | endfunction 63 | 64 | function GetWidgetBaseUIData takes widget w returns integer 65 | return GetWidgetBaseUIDataById( GetWidgetTypeId( w ) ) 66 | endfunction 67 | 68 | function GetWidgetBaseUIDataByIdCaching takes integer id returns integer 69 | return GetWidgetBaseDataByIdCachingEx( 0, 3, id, 1 ) // DEF_ADR_UNIT_UI = 3 | UI = 1 70 | endfunction 71 | 72 | function GetWidgetBaseUIDataCaching takes widget w returns integer 73 | return GetWidgetBaseUIDataByIdCaching( GetWidgetTypeId( w ) ) 74 | endfunction 75 | //=========================================== 76 | 77 | // Widget Base UI Data Engine 78 | function GetWidgetBaseUIIntegerParamById takes integer id, integer pointerlevel, integer offset returns integer 79 | local integer pData = 0 80 | 81 | if id > 0 then 82 | set pData = GetWidgetBaseUIDataByIdCaching( id ) 83 | 84 | if pData > 0 then 85 | set pData = ReadRealMemory( pData + offset ) 86 | 87 | if pData > 0 then 88 | if pointerlevel == 0 then 89 | return pData 90 | elseif pointerlevel == 1 then 91 | return ReadRealMemory( pData ) 92 | endif 93 | endif 94 | endif 95 | endif 96 | 97 | return 0 98 | endfunction 99 | 100 | function SetWidgetBaseUIIntegerParamById takes integer id, integer pointerlevel, integer offset, integer val returns nothing 101 | local integer pData = 0 102 | 103 | if id > 0 then 104 | set pData = GetWidgetBaseUIDataByIdCaching( id ) 105 | 106 | if pData > 0 then 107 | set pData = pData + offset 108 | 109 | if offset == 0x274 then 110 | call WriteRealMemory( pData, pData - 0x4 ) 111 | else 112 | if pointerlevel == 0 then 113 | call WriteRealMemory( pData, val ) 114 | elseif pointerlevel == 1 then 115 | if ReadRealMemory( pData ) == 0 then 116 | call WriteRealMemory( pData, GetStringAddress( I2S( val ) ) ) 117 | endif 118 | call WriteRealMemory( ReadRealMemory( pData ), val ) 119 | endif 120 | endif 121 | endif 122 | endif 123 | endfunction 124 | 125 | function GetWidgetBaseUIStringParamById takes integer id, integer pointerlevel, integer offset returns string 126 | local integer pData = 0 127 | 128 | if id > 0 then 129 | set pData = GetWidgetBaseUIDataByIdCaching( id ) 130 | 131 | if pData > 0 then 132 | set pData = ReadRealMemory( pData + offset ) 133 | 134 | if pData > 0 then 135 | if pointerlevel == 1 then 136 | set pData = ReadRealMemory( pData ) 137 | endif 138 | 139 | if pData > 0 then 140 | return ToJString( pData ) 141 | endif 142 | endif 143 | endif 144 | endif 145 | 146 | return null 147 | endfunction 148 | 149 | function SetWidgetBaseUIStringParamById takes integer id, integer pointerlevel, integer offset, string val returns nothing 150 | local integer pData = 0 151 | 152 | if id > 0 then 153 | set pData = GetWidgetBaseUIDataByIdCaching( id ) 154 | 155 | if pData > 0 then 156 | set pData = pData + offset 157 | 158 | if pointerlevel == 0 then 159 | call WriteRealMemory( pData, GetStringAddress( val ) ) 160 | elseif pointerlevel == 1 then 161 | if ReadRealMemory( pData ) == 0 then 162 | call WriteRealMemory( pData, GetStringAddress( val ) ) 163 | endif 164 | call WriteRealMemory( ReadRealMemory( pData ), GetStringAddress( val ) ) 165 | endif 166 | endif 167 | endif 168 | endfunction 169 | 170 | function Init_MemHackCWidgetBaseAPI takes nothing returns nothing 171 | if PatchVersion != "" then 172 | 173 | endif 174 | endfunction 175 | endlibrary 176 | 177 | //=========================================================================== 178 | function InitTrig_MemHackWidgetBaseAPI takes nothing returns nothing 179 | //set gg_trg_MemHackWidgetBaseAPI = CreateTrigger( ) 180 | endfunction 181 | //! endnocjass 182 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/66-MemHackWidgetBaseAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackCWidgetBaseAPI 5 | // Widget API Engine 6 | function GetWidgetTypeId takes widget w returns integer 7 | local integer pWidget = 0 8 | 9 | if w != null then 10 | set pWidget = ConvertHandle( w ) 11 | 12 | if pWidget != 0 then 13 | return ReadRealMemory( pWidget + 0x30 ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function GetWidgetBaseDataById takes integer pDataNode, integer wid returns integer 21 | return GetAgileDataNodeById( pDataNode, wid ) 22 | endfunction 23 | 24 | function GetWidgetBaseUIDataById takes integer id returns integer 25 | return GetWidgetUIDefById( id ) 26 | endfunction 27 | 28 | function GetWidgetBaseData takes integer pDataNode, widget w returns integer 29 | return GetAgileDataNodeById( pDataNode, GetWidgetTypeId( w ) ) 30 | endfunction 31 | 32 | function GetWidgetBaseDataByIdCachingEx takes integer pDataNode, integer index, integer id, integer mode returns integer 33 | local integer pData = 0 34 | 35 | if id > 0 then 36 | if HaveSavedInteger( htObjectDataPointers, index, id ) then 37 | return LoadInteger( htObjectDataPointers, index, id ) 38 | endif 39 | 40 | if mode == 0 then 41 | set pData = GetWidgetBaseDataById( pDataNode, id ) 42 | elseif mode == 1 then 43 | set pData = GetWidgetBaseUIDataById( id ) 44 | endif 45 | 46 | if pData > 0 then 47 | call SaveInteger( htObjectDataPointers, index, id, pData ) 48 | endif 49 | 50 | return pData 51 | endif 52 | 53 | return 0 54 | endfunction 55 | 56 | function GetWidgetBaseDataByIdCaching takes integer pDataNode, integer id returns integer 57 | return GetWidgetBaseDataByIdCachingEx( pDataNode, 2, id, 0 ) // DEF_ADR_UNIT_DATA = 2 | BaseData = 0 58 | endfunction 59 | 60 | function GetWidgetBaseDataCaching takes integer pDataNode, widget w returns integer 61 | return GetWidgetBaseDataByIdCaching( pDataNode, GetWidgetTypeId( w ) ) 62 | endfunction 63 | 64 | function GetWidgetBaseUIData takes widget w returns integer 65 | return GetWidgetBaseUIDataById( GetWidgetTypeId( w ) ) 66 | endfunction 67 | 68 | function GetWidgetBaseUIDataByIdCaching takes integer id returns integer 69 | return GetWidgetBaseDataByIdCachingEx( 0, 3, id, 1 ) // DEF_ADR_UNIT_UI = 3 | UI = 1 70 | endfunction 71 | 72 | function GetWidgetBaseUIDataCaching takes widget w returns integer 73 | return GetWidgetBaseUIDataByIdCaching( GetWidgetTypeId( w ) ) 74 | endfunction 75 | //=========================================== 76 | 77 | // Widget Base UI Data Engine 78 | function GetWidgetBaseUIIntegerParamById takes integer id, integer pointerlevel, integer offset returns integer 79 | local integer pData = 0 80 | 81 | if id > 0 then 82 | set pData = GetWidgetBaseUIDataByIdCaching( id ) 83 | 84 | if pData > 0 then 85 | set pData = ReadRealMemory( pData + offset ) 86 | 87 | if pData > 0 then 88 | if pointerlevel == 0 then 89 | return pData 90 | elseif pointerlevel == 1 then 91 | return ReadRealMemory( pData ) 92 | endif 93 | endif 94 | endif 95 | endif 96 | 97 | return 0 98 | endfunction 99 | 100 | function SetWidgetBaseUIIntegerParamById takes integer id, integer pointerlevel, integer offset, integer val returns nothing 101 | local integer pData = 0 102 | 103 | if id > 0 then 104 | set pData = GetWidgetBaseUIDataByIdCaching( id ) 105 | 106 | if pData > 0 then 107 | set pData = pData + offset 108 | 109 | if offset == 0x274 then 110 | call WriteRealMemory( pData, pData - 0x4 ) 111 | else 112 | if pointerlevel == 0 then 113 | call WriteRealMemory( pData, val ) 114 | elseif pointerlevel == 1 then 115 | if ReadRealMemory( pData ) == 0 then 116 | call WriteRealMemory( pData, GetStringAddress( I2S( val ) ) ) 117 | endif 118 | call WriteRealMemory( ReadRealMemory( pData ), val ) 119 | endif 120 | endif 121 | endif 122 | endif 123 | endfunction 124 | 125 | function GetWidgetBaseUIStringParamById takes integer id, integer pointerlevel, integer offset returns string 126 | local integer pData = 0 127 | 128 | if id > 0 then 129 | set pData = GetWidgetBaseUIDataByIdCaching( id ) 130 | 131 | if pData > 0 then 132 | set pData = ReadRealMemory( pData + offset ) 133 | 134 | if pData > 0 then 135 | if pointerlevel == 1 then 136 | set pData = ReadRealMemory( pData ) 137 | endif 138 | 139 | if pData > 0 then 140 | return ToJString( pData ) 141 | endif 142 | endif 143 | endif 144 | endif 145 | 146 | return null 147 | endfunction 148 | 149 | function SetWidgetBaseUIStringParamById takes integer id, integer pointerlevel, integer offset, string val returns nothing 150 | local integer pData = 0 151 | 152 | if id > 0 then 153 | set pData = GetWidgetBaseUIDataByIdCaching( id ) 154 | 155 | if pData > 0 then 156 | set pData = pData + offset 157 | 158 | if pointerlevel == 0 then 159 | call WriteRealMemory( pData, GetStringAddress( val ) ) 160 | elseif pointerlevel == 1 then 161 | if ReadRealMemory( pData ) == 0 then 162 | call WriteRealMemory( pData, GetStringAddress( val ) ) 163 | endif 164 | call WriteRealMemory( ReadRealMemory( pData ), GetStringAddress( val ) ) 165 | endif 166 | endif 167 | endif 168 | endfunction 169 | 170 | function Init_MemHackCWidgetBaseAPI takes nothing returns nothing 171 | if PatchVersion != "" then 172 | 173 | endif 174 | endfunction 175 | endlibrary 176 | 177 | //=========================================================================== 178 | function InitTrig_MemHackWidgetBaseAPI takes nothing returns nothing 179 | //set gg_trg_MemHackWidgetBaseAPI = CreateTrigger( ) 180 | endfunction 181 | //! endnocjass 182 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/73-MemHackItemNormalAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=60 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackItemNormalAPI 5 | function CItemGetAbilityByIndex takes integer pItem, integer index returns ability 6 | local integer pData = pItem 7 | local integer pAbil = 0 8 | local integer i = 0 9 | 10 | if pData != 0 then 11 | set pAbil = GetCAgentFromHashGroup( pData + 0x9C + 0x8 * index ) 12 | 13 | if pAbil != 0 then 14 | return ObjectToAbility( pAbil ) 15 | endif 16 | endif 17 | 18 | return null 19 | endfunction 20 | 21 | function CItemStartCooldown takes integer pUnit, integer pItem, real cd returns nothing 22 | local integer addr = LoadInteger( MemHackTable, StringHash( "CItem" ), StringHash( "StatCooldown" ) ) 23 | local integer mem = LoadInteger( MemHackTable, StringHash( "PointerArray" ), 0 ) 24 | local integer pInv = 0 25 | 26 | if addr != 0 and mem != 0 and pUnit != 0 and pItem != 0 then 27 | set pInv = ReadRealMemory( pUnit + 0x1F8 ) 28 | 29 | if pInv != 0 then 30 | call WriteRealFloat( mem, cd ) 31 | call this_call_4( addr, pInv, pItem, mem, mem ) 32 | endif 33 | endif 34 | endfunction 35 | 36 | function CItemSetTypeId takes integer pItem, integer id returns nothing 37 | local integer oldId = 0 38 | 39 | if pItem > 0 then 40 | set oldId = ReadRealMemory( pItem + 0x30 ) 41 | 42 | if oldId > 0 then 43 | call WriteRealMemory( pItem + 0x30, id ) 44 | endif 45 | endif 46 | endfunction 47 | 48 | function CItemSetModel takes integer pItem, string model, boolean flag returns nothing 49 | call SetObjectModel( pItem, model, flag ) 50 | endfunction 51 | 52 | function CItemGetLife takes integer pItem returns real 53 | if pItem > 0 then 54 | return GetRealFromMemory( ReadRealMemory( pItem + 0x58 ) ) 55 | endif 56 | 57 | return 0. 58 | endfunction 59 | 60 | function CItemSetLife takes integer pItem, real life returns nothing 61 | if pItem > 0 then 62 | call WriteRealMemory( pItem + 0x58, SetRealIntoMemory( life ) ) 63 | endif 64 | endfunction 65 | 66 | function CItemGetMaxLife takes integer pItem returns real 67 | if pItem > 0 then 68 | return GetRealFromMemory( ReadRealMemory( pItem + 0x60 ) ) 69 | endif 70 | 71 | return 0. 72 | endfunction 73 | 74 | function CItemSetMaxLife takes integer pItem, real life returns nothing 75 | if pItem > 0 then 76 | call WriteRealMemory( pItem + 0x60, SetRealIntoMemory( life ) ) 77 | endif 78 | endfunction 79 | // 80 | 81 | // jitem API 82 | function GetItemAbilityByIndex takes item it, integer index returns ability 83 | return CItemGetAbilityByIndex( ConvertHandle( it ), index ) 84 | endfunction 85 | 86 | function StartItemCooldown takes unit u, item it, real cd returns nothing 87 | call CItemStartCooldown( ConvertHandle( u ), ConvertHandle( it ), cd ) 88 | endfunction 89 | 90 | function SetItemIdType takes item it, integer id returns nothing 91 | call CItemSetTypeId( ConvertHandle( it ), id ) 92 | endfunction 93 | 94 | function SetItemModel takes item it, string model, boolean flag returns nothing 95 | call CItemSetModel( ConvertHandle( it ), model, flag ) 96 | endfunction 97 | 98 | function GetItemLife takes item it returns real 99 | return CItemGetLife( ConvertHandle( it ) ) 100 | endfunction 101 | 102 | function SetItemLife takes item it, real life returns nothing 103 | call CItemSetLife( ConvertHandle( it ), life ) 104 | endfunction 105 | 106 | function GetItemMaxLife takes item it returns real 107 | return CItemGetMaxLife( ConvertHandle( it ) ) 108 | endfunction 109 | 110 | function SetItemMaxLife takes item it, real life returns nothing 111 | call CItemSetMaxLife( ConvertHandle( it ), life ) 112 | endfunction 113 | 114 | function Init_MemHackItemNormalAPI takes nothing returns nothing 115 | if PatchVersion != "" then 116 | if PatchVersion == "1.24e" then 117 | call SaveInteger( MemHackTable, StringHash( "CItem" ), StringHash( "StatCooldown" ), pGameDLL + 0x0E4B50 ) 118 | elseif PatchVersion == "1.26a" then 119 | call SaveInteger( MemHackTable, StringHash( "CItem" ), StringHash( "StatCooldown" ), pGameDLL + 0x0E3F30 ) 120 | elseif PatchVersion == "1.27a" then 121 | call SaveInteger( MemHackTable, StringHash( "CItem" ), StringHash( "StatCooldown" ), pGameDLL + 0x54C2E0 ) 122 | elseif PatchVersion == "1.27b" then 123 | call SaveInteger( MemHackTable, StringHash( "CItem" ), StringHash( "StatCooldown" ), pGameDLL + 0x569A40 ) 124 | elseif PatchVersion == "1.28f" then 125 | call SaveInteger( MemHackTable, StringHash( "CItem" ), StringHash( "StatCooldown" ), pGameDLL + 0x59DB70 ) 126 | endif 127 | endif 128 | endfunction 129 | endlibrary 130 | 131 | //=========================================================================== 132 | function InitTrig_MemHackItemNormalAPI takes nothing returns nothing 133 | //set gg_trg_MemHackItemNormalAPI = CreateTrigger( ) 134 | endfunction 135 | //! endnocjass -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/75-MemHackItemNormalAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=60 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackItemNormalAPI 5 | function CItemGetAbilityByIndex takes integer pItem, integer index returns ability 6 | local integer pData = pItem 7 | local integer pAbil = 0 8 | local integer i = 0 9 | 10 | if pData != 0 then 11 | set pAbil = GetCAgentFromHashGroup( pData + 0x9C + 0x8 * index ) 12 | 13 | if pAbil != 0 then 14 | return ObjectToAbility( pAbil ) 15 | endif 16 | endif 17 | 18 | return null 19 | endfunction 20 | 21 | function CItemStartCooldown takes integer pUnit, integer pItem, real cd returns nothing 22 | local integer addr = LoadInteger( MemHackTable, StringHash( "CItem" ), StringHash( "StatCooldown" ) ) 23 | local integer mem = LoadInteger( MemHackTable, StringHash( "PointerArray" ), 0 ) 24 | local integer pInv = 0 25 | 26 | if addr != 0 and mem != 0 and pUnit != 0 and pItem != 0 then 27 | set pInv = ReadRealMemory( pUnit + 0x1F8 ) 28 | 29 | if pInv != 0 then 30 | call WriteRealFloat( mem, cd ) 31 | call this_call_4( addr, pInv, pItem, mem, mem ) 32 | endif 33 | endif 34 | endfunction 35 | 36 | function CItemSetTypeId takes integer pItem, integer id returns nothing 37 | local integer oldId = 0 38 | 39 | if pItem > 0 then 40 | set oldId = ReadRealMemory( pItem + 0x30 ) 41 | 42 | if oldId > 0 then 43 | call WriteRealMemory( pItem + 0x30, id ) 44 | endif 45 | endif 46 | endfunction 47 | 48 | function CItemSetModel takes integer pItem, string model, boolean flag returns nothing 49 | call SetObjectModel( pItem, model, flag ) 50 | endfunction 51 | 52 | function CItemGetLife takes integer pItem returns real 53 | if pItem > 0 then 54 | return GetRealFromMemory( ReadRealMemory( pItem + 0x58 ) ) 55 | endif 56 | 57 | return 0. 58 | endfunction 59 | 60 | function CItemSetLife takes integer pItem, real life returns nothing 61 | if pItem > 0 then 62 | call WriteRealMemory( pItem + 0x58, SetRealIntoMemory( life ) ) 63 | endif 64 | endfunction 65 | 66 | function CItemGetMaxLife takes integer pItem returns real 67 | if pItem > 0 then 68 | return GetRealFromMemory( ReadRealMemory( pItem + 0x60 ) ) 69 | endif 70 | 71 | return 0. 72 | endfunction 73 | 74 | function CItemSetMaxLife takes integer pItem, real life returns nothing 75 | if pItem > 0 then 76 | call WriteRealMemory( pItem + 0x60, SetRealIntoMemory( life ) ) 77 | endif 78 | endfunction 79 | // 80 | 81 | // jitem API 82 | function GetItemAbilityByIndex takes item it, integer index returns ability 83 | return CItemGetAbilityByIndex( ConvertHandle( it ), index ) 84 | endfunction 85 | 86 | function StartItemCooldown takes unit u, item it, real cd returns nothing 87 | call CItemStartCooldown( ConvertHandle( u ), ConvertHandle( it ), cd ) 88 | endfunction 89 | 90 | function SetItemIdType takes item it, integer id returns nothing 91 | call CItemSetTypeId( ConvertHandle( it ), id ) 92 | endfunction 93 | 94 | function SetItemModel takes item it, string model, boolean flag returns nothing 95 | call CItemSetModel( ConvertHandle( it ), model, flag ) 96 | endfunction 97 | 98 | function GetItemLife takes item it returns real 99 | return CItemGetLife( ConvertHandle( it ) ) 100 | endfunction 101 | 102 | function SetItemLife takes item it, real life returns nothing 103 | call CItemSetLife( ConvertHandle( it ), life ) 104 | endfunction 105 | 106 | function GetItemMaxLife takes item it returns real 107 | return CItemGetMaxLife( ConvertHandle( it ) ) 108 | endfunction 109 | 110 | function SetItemMaxLife takes item it, real life returns nothing 111 | call CItemSetMaxLife( ConvertHandle( it ), life ) 112 | endfunction 113 | 114 | function Init_MemHackItemNormalAPI takes nothing returns nothing 115 | if PatchVersion != "" then 116 | if PatchVersion == "1.24e" then 117 | call SaveInteger( MemHackTable, StringHash( "CItem" ), StringHash( "StatCooldown" ), pGameDLL + 0x0E4B50 ) 118 | elseif PatchVersion == "1.26a" then 119 | call SaveInteger( MemHackTable, StringHash( "CItem" ), StringHash( "StatCooldown" ), pGameDLL + 0x0E3F30 ) 120 | elseif PatchVersion == "1.27a" then 121 | call SaveInteger( MemHackTable, StringHash( "CItem" ), StringHash( "StatCooldown" ), pGameDLL + 0x54C2E0 ) 122 | elseif PatchVersion == "1.27b" then 123 | call SaveInteger( MemHackTable, StringHash( "CItem" ), StringHash( "StatCooldown" ), pGameDLL + 0x569A40 ) 124 | elseif PatchVersion == "1.28f" then 125 | call SaveInteger( MemHackTable, StringHash( "CItem" ), StringHash( "StatCooldown" ), pGameDLL + 0x59DB70 ) 126 | endif 127 | endif 128 | endfunction 129 | endlibrary 130 | 131 | //=========================================================================== 132 | function InitTrig_MemHackItemNormalAPI takes nothing returns nothing 133 | //set gg_trg_MemHackItemNormalAPI = CreateTrigger( ) 134 | endfunction 135 | //! endnocjass -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/80-MemHackGroupAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=14 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackGroupAPI 5 | function GetAddressGroupUnitCount takes integer pObj returns integer 6 | if pObj > 0 then 7 | return ReadRealMemory( pObj + 0x34 ) 8 | endif 9 | 10 | return 0 11 | endfunction 12 | 13 | function GetAddressGroupAddressUnitByIndex takes integer pObj, integer index returns integer 14 | local integer addr = LoadInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "GetUnitByIndex" ) ) 15 | 16 | if addr != 0 and pObj != 0 then 17 | return this_call_2( addr, pObj + 0x24, index ) 18 | endif 19 | 20 | return 0 21 | endfunction 22 | 23 | function GetGroupUnitCount takes group g returns integer 24 | return GetAddressGroupUnitCount( ConvertHandle( g ) ) 25 | endfunction 26 | 27 | function GetUnitFromGroupByIndex takes group g, integer index returns unit 28 | local integer pObj = GetAddressGroupAddressUnitByIndex( ConvertHandle( g ), index ) 29 | 30 | if pObj != 0 then 31 | set pObj = ObjectToHandleId( pObj ) 32 | 33 | if pObj != 0 then 34 | return I2U( pObj ) 35 | endif 36 | endif 37 | 38 | return null 39 | endfunction 40 | 41 | function GetRandomUnitFromGroup takes group g returns unit 42 | local integer pObj = ConvertHandle( g ) 43 | local integer count = 0 44 | 45 | if pObj != 0 then 46 | set count = GetAddressGroupUnitCount( pObj ) 47 | 48 | if count != 0 then 49 | set pObj = GetAddressGroupAddressUnitByIndex( pObj, GetRandomInt( 0, count - 1 ) ) 50 | 51 | if pObj != 0 then 52 | set pObj = ObjectToHandleId( pObj ) 53 | 54 | if pObj != 0 then 55 | return I2U( pObj ) 56 | endif 57 | endif 58 | endif 59 | endif 60 | 61 | return null 62 | endfunction 63 | 64 | function ForEach takes group g returns unit 65 | local integer iterator = LoadInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "Iterator" ) ) 66 | local integer pObj = GetAddressGroupAddressUnitByIndex( ConvertHandle( g ), iterator ) 67 | 68 | if pObj != 0 then 69 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "Iterator" ), iterator + 1 ) 70 | set pObj = ObjectToHandleId( pObj ) 71 | 72 | if pObj != 0 then 73 | return I2U( pObj ) 74 | endif 75 | else 76 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "Iterator" ), 0 ) 77 | endif 78 | 79 | return null 80 | endfunction 81 | 82 | function Init_MemHackGroupAPI takes nothing returns nothing 83 | if PatchVersion != "" then 84 | if PatchVersion == "1.24e" then 85 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "GetUnitByIndex" ), pGameDLL + 0x422560 ) 86 | elseif PatchVersion == "1.26a" then 87 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "GetUnitByIndex" ), pGameDLL + 0x421A20 ) 88 | elseif PatchVersion == "1.27a" then 89 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "GetUnitByIndex" ), pGameDLL + 0x272910 ) 90 | elseif PatchVersion == "1.27b" then 91 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "GetUnitByIndex" ), pGameDLL + 0x290570 ) 92 | elseif PatchVersion == "1.28f" then 93 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "GetUnitByIndex" ), pGameDLL + 0x230AA0 ) 94 | endif 95 | 96 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "Iterator" ), 0 ) 97 | endif 98 | endfunction 99 | endlibrary 100 | 101 | //=========================================================================== 102 | function InitTrig_MemHackGroupAPI takes nothing returns nothing 103 | //set gg_trg_MemHackGroupAPI = CreateTrigger( ) 104 | endfunction 105 | //! endnocjass 106 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/82-MemHackGroupAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=14 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackGroupAPI 5 | function GetAddressGroupUnitCount takes integer pObj returns integer 6 | if pObj > 0 then 7 | return ReadRealMemory( pObj + 0x34 ) 8 | endif 9 | 10 | return 0 11 | endfunction 12 | 13 | function GetAddressGroupAddressUnitByIndex takes integer pObj, integer index returns integer 14 | local integer addr = LoadInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "GetUnitByIndex" ) ) 15 | 16 | if addr != 0 and pObj != 0 then 17 | return this_call_2( addr, pObj + 0x24, index ) 18 | endif 19 | 20 | return 0 21 | endfunction 22 | 23 | function GetGroupUnitCount takes group g returns integer 24 | return GetAddressGroupUnitCount( ConvertHandle( g ) ) 25 | endfunction 26 | 27 | function GetUnitFromGroupByIndex takes group g, integer index returns unit 28 | local integer pObj = GetAddressGroupAddressUnitByIndex( ConvertHandle( g ), index ) 29 | 30 | if pObj != 0 then 31 | set pObj = ObjectToHandleId( pObj ) 32 | 33 | if pObj != 0 then 34 | return I2U( pObj ) 35 | endif 36 | endif 37 | 38 | return null 39 | endfunction 40 | 41 | function GetRandomUnitFromGroup takes group g returns unit 42 | local integer pObj = ConvertHandle( g ) 43 | local integer count = 0 44 | 45 | if pObj != 0 then 46 | set count = GetAddressGroupUnitCount( pObj ) 47 | 48 | if count != 0 then 49 | set pObj = GetAddressGroupAddressUnitByIndex( pObj, GetRandomInt( 0, count - 1 ) ) 50 | 51 | if pObj != 0 then 52 | set pObj = ObjectToHandleId( pObj ) 53 | 54 | if pObj != 0 then 55 | return I2U( pObj ) 56 | endif 57 | endif 58 | endif 59 | endif 60 | 61 | return null 62 | endfunction 63 | 64 | function ForEach takes group g returns unit 65 | local integer iterator = LoadInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "Iterator" ) ) 66 | local integer pObj = GetAddressGroupAddressUnitByIndex( ConvertHandle( g ), iterator ) 67 | 68 | if pObj != 0 then 69 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "Iterator" ), iterator + 1 ) 70 | set pObj = ObjectToHandleId( pObj ) 71 | 72 | if pObj != 0 then 73 | return I2U( pObj ) 74 | endif 75 | else 76 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "Iterator" ), 0 ) 77 | endif 78 | 79 | return null 80 | endfunction 81 | 82 | function Init_MemHackGroupAPI takes nothing returns nothing 83 | if PatchVersion != "" then 84 | if PatchVersion == "1.24e" then 85 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "GetUnitByIndex" ), pGameDLL + 0x422560 ) 86 | elseif PatchVersion == "1.26a" then 87 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "GetUnitByIndex" ), pGameDLL + 0x421A20 ) 88 | elseif PatchVersion == "1.27a" then 89 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "GetUnitByIndex" ), pGameDLL + 0x272910 ) 90 | elseif PatchVersion == "1.27b" then 91 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "GetUnitByIndex" ), pGameDLL + 0x290570 ) 92 | elseif PatchVersion == "1.28f" then 93 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "GetUnitByIndex" ), pGameDLL + 0x230AA0 ) 94 | endif 95 | 96 | call SaveInteger( MemHackTable, StringHash( "CGroup" ), StringHash( "Iterator" ), 0 ) 97 | endif 98 | endfunction 99 | endlibrary 100 | 101 | //=========================================================================== 102 | function InitTrig_MemHackGroupAPI takes nothing returns nothing 103 | //set gg_trg_MemHackGroupAPI = CreateTrigger( ) 104 | endfunction 105 | //! endnocjass 106 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/83-MemHackMouseAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackMouseAPI 5 | function GetCMouseEvent takes nothing returns integer 6 | return LoadInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "Event" ) ) 7 | endfunction 8 | 9 | function GetCursorX takes nothing returns integer 10 | local integer pMouse = GetCursorPosStruct( ) 11 | 12 | if pMouse != 0 then 13 | return ReadRealMemory( pMouse + 0x0 ) 14 | endif 15 | 16 | return 0 17 | endfunction 18 | 19 | function GetCursorY takes nothing returns integer 20 | local integer pMouse = GetCursorPosStruct( ) 21 | 22 | if pMouse != 0 then 23 | return ReadRealMemory( pMouse + 0x4 ) 24 | endif 25 | 26 | return 0 27 | endfunction 28 | 29 | function GetCursorRelativeAxis takes nothing returns integer 30 | local integer window = LoadInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Window" ) ) 31 | local integer pMouse = 0 32 | 33 | if window != 0 then 34 | set pMouse = GetCursorPosStruct( ) 35 | 36 | if pMouse != 0 then 37 | if ScreenToClient( window, pMouse ) > 0 then 38 | return pMouse 39 | endif 40 | endif 41 | endif 42 | 43 | return 0 44 | endfunction 45 | 46 | function GetCursorXRelative takes nothing returns integer 47 | local integer pMouse = GetCursorRelativeAxis( ) 48 | 49 | if pMouse != 0 then 50 | return ReadRealMemory( pMouse + 0x0 ) 51 | endif 52 | 53 | return 0 54 | endfunction 55 | 56 | function GetCursorYRelative takes nothing returns integer 57 | local integer pMouse = GetCursorRelativeAxis( ) 58 | 59 | if pMouse != 0 then 60 | return ReadRealMemory( pMouse + 0x4 ) 61 | endif 62 | 63 | return 0 64 | endfunction 65 | 66 | function GetMouseWorldEnv takes nothing returns integer 67 | local integer addr = LoadInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "CGameUIObject" ) ) 68 | 69 | if addr != 0 then 70 | set addr = ReadRealMemory( addr ) 71 | 72 | if addr != 0 then 73 | set addr = ReadRealMemory( addr + 0x3BC ) 74 | 75 | if addr != 0 then 76 | return addr + 0x310 77 | endif 78 | endif 79 | endif 80 | 81 | return 0 82 | endfunction 83 | 84 | function GetMouseWorldAxis takes integer offset returns real 85 | local integer addr = GetMouseWorldEnv( ) 86 | 87 | if addr != 0 then 88 | return ReadRealFloat( GetMouseWorldEnv( ) + offset ) 89 | endif 90 | 91 | return 0. 92 | endfunction 93 | 94 | function GetMouseWorldX takes nothing returns real 95 | return GetMouseWorldAxis( 0x0 ) 96 | endfunction 97 | 98 | function GetMouseWorldY takes nothing returns real 99 | return GetMouseWorldAxis( 0x4 ) 100 | endfunction 101 | 102 | function GetMouseWorldZ takes nothing returns real 103 | return GetMouseWorldAxis( 0x8 ) 104 | endfunction 105 | 106 | function Init_MemHackMouseAPI takes nothing returns nothing 107 | if PatchVersion != "" then 108 | if PatchVersion == "1.24e" then 109 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "CGameUIObject" ), pGameDLL + 0xACBDD8 ) 110 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "Event" ), pGameDLL + 0xAB0454 ) 111 | elseif PatchVersion == "1.26a" then 112 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "CGameUIObject" ), pGameDLL + 0xAB4F80 ) 113 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "Event" ), pGameDLL + 0xA9A434 ) 114 | elseif PatchVersion == "1.27a" then 115 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "CGameUIObject" ), pGameDLL + 0xBE6350 ) 116 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "Event" ), pGameDLL + 0xB66308 ) 117 | elseif PatchVersion == "1.27b" then 118 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "CGameUIObject" ), pGameDLL + 0xD6A8B8 ) 119 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "Event" ), pGameDLL + 0xCE3A8C ) 120 | elseif PatchVersion == "1.28f" then 121 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "CGameUIObject" ), pGameDLL + 0xD326F0 ) 122 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "Event" ), pGameDLL + 0xCB1AD4 ) 123 | endif 124 | endif 125 | endfunction 126 | endlibrary 127 | 128 | //=========================================================================== 129 | function InitTrig_MemHackMouseAPI takes nothing returns nothing 130 | //set gg_trg_MemHackMouseAPI = CreateTrigger( ) 131 | endfunction 132 | //! endnocjass 133 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/83-MemHackMouseAPI.txt: -------------------------------------------------------------------------------- 1 | This trigger can be safely removed, since it provides probably no use to a normal mapmaker, since the data is local anyways. -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/85-MemHackMouseAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackMouseAPI 5 | function GetCMouseEvent takes nothing returns integer 6 | return LoadInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "Event" ) ) 7 | endfunction 8 | 9 | function GetCursorX takes nothing returns integer 10 | local integer pMouse = GetCursorPosStruct( ) 11 | 12 | if pMouse != 0 then 13 | return ReadRealMemory( pMouse + 0x0 ) 14 | endif 15 | 16 | return 0 17 | endfunction 18 | 19 | function GetCursorY takes nothing returns integer 20 | local integer pMouse = GetCursorPosStruct( ) 21 | 22 | if pMouse != 0 then 23 | return ReadRealMemory( pMouse + 0x4 ) 24 | endif 25 | 26 | return 0 27 | endfunction 28 | 29 | function GetCursorRelativeAxis takes nothing returns integer 30 | local integer window = LoadInteger( MemHackTable, StringHash( "GameWindowAPI" ), StringHash( "Window" ) ) 31 | local integer pMouse = 0 32 | 33 | if window != 0 then 34 | set pMouse = GetCursorPosStruct( ) 35 | 36 | if pMouse != 0 then 37 | if ScreenToClient( window, pMouse ) > 0 then 38 | return pMouse 39 | endif 40 | endif 41 | endif 42 | 43 | return 0 44 | endfunction 45 | 46 | function GetCursorXRelative takes nothing returns integer 47 | local integer pMouse = GetCursorRelativeAxis( ) 48 | 49 | if pMouse != 0 then 50 | return ReadRealMemory( pMouse + 0x0 ) 51 | endif 52 | 53 | return 0 54 | endfunction 55 | 56 | function GetCursorYRelative takes nothing returns integer 57 | local integer pMouse = GetCursorRelativeAxis( ) 58 | 59 | if pMouse != 0 then 60 | return ReadRealMemory( pMouse + 0x4 ) 61 | endif 62 | 63 | return 0 64 | endfunction 65 | 66 | function GetMouseWorldEnv takes nothing returns integer 67 | local integer addr = LoadInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "CGameUIObject" ) ) 68 | 69 | if addr != 0 then 70 | set addr = ReadRealMemory( addr ) 71 | 72 | if addr != 0 then 73 | set addr = ReadRealMemory( addr + 0x3BC ) 74 | 75 | if addr != 0 then 76 | return addr + 0x310 77 | endif 78 | endif 79 | endif 80 | 81 | return 0 82 | endfunction 83 | 84 | function GetMouseWorldAxis takes integer offset returns real 85 | local integer addr = GetMouseWorldEnv( ) 86 | 87 | if addr != 0 then 88 | return ReadRealFloat( GetMouseWorldEnv( ) + offset ) 89 | endif 90 | 91 | return 0. 92 | endfunction 93 | 94 | function GetMouseWorldX takes nothing returns real 95 | return GetMouseWorldAxis( 0x0 ) 96 | endfunction 97 | 98 | function GetMouseWorldY takes nothing returns real 99 | return GetMouseWorldAxis( 0x4 ) 100 | endfunction 101 | 102 | function GetMouseWorldZ takes nothing returns real 103 | return GetMouseWorldAxis( 0x8 ) 104 | endfunction 105 | 106 | function Init_MemHackMouseAPI takes nothing returns nothing 107 | if PatchVersion != "" then 108 | if PatchVersion == "1.24e" then 109 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "CGameUIObject" ), pGameDLL + 0xACBDD8 ) 110 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "Event" ), pGameDLL + 0xAB0454 ) 111 | elseif PatchVersion == "1.26a" then 112 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "CGameUIObject" ), pGameDLL + 0xAB4F80 ) 113 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "Event" ), pGameDLL + 0xA9A434 ) 114 | elseif PatchVersion == "1.27a" then 115 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "CGameUIObject" ), pGameDLL + 0xBE6350 ) 116 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "Event" ), pGameDLL + 0xB66308 ) 117 | elseif PatchVersion == "1.27b" then 118 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "CGameUIObject" ), pGameDLL + 0xD6A8B8 ) 119 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "Event" ), pGameDLL + 0xCE3A8C ) 120 | elseif PatchVersion == "1.28f" then 121 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "CGameUIObject" ), pGameDLL + 0xD326F0 ) 122 | call SaveInteger( MemHackTable, StringHash( "CMouse" ), StringHash( "Event" ), pGameDLL + 0xCB1AD4 ) 123 | endif 124 | endif 125 | endfunction 126 | endlibrary 127 | 128 | //=========================================================================== 129 | function InitTrig_MemHackMouseAPI takes nothing returns nothing 130 | //set gg_trg_MemHackMouseAPI = CreateTrigger( ) 131 | endfunction 132 | //! endnocjass 133 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/85-MemHackMouseAPI.txt: -------------------------------------------------------------------------------- 1 | This trigger can be safely removed, since it provides probably no use to a normal mapmaker, since the data is local anyways. -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/86-InitMainHook.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=9 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library ZzendOpMap 5 | 6 | function main2 takes nothing returns nothing 7 | // Map specific data, remove it and replace with your things, etc... 8 | local real map_min_x = -3328. 9 | local real map_min_y = -3584. 10 | local real map_max_x = 3328. 11 | local real map_max_y = 3072. 12 | local real c_m_l = GetCameraMargin( CAMERA_MARGIN_LEFT ) 13 | local real c_m_b = GetCameraMargin( CAMERA_MARGIN_BOTTOM ) 14 | local real c_m_r = GetCameraMargin( CAMERA_MARGIN_RIGHT ) 15 | local real c_m_t = GetCameraMargin( CAMERA_MARGIN_TOP ) 16 | call SetCameraBounds( map_min_x + c_m_l, map_min_y + c_m_b, map_max_x - c_m_r, map_max_y - c_m_t, map_min_x + c_m_l, map_max_y - c_m_t, map_max_x - c_m_r, map_min_y + c_m_b ) 17 | call SetDayNightModels( "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" ) 18 | 19 | call InitTrig_Testing( ) 20 | // All of the above is just map specific data, replace it with yours! 21 | 22 | // Your stuff goes here... 23 | 24 | // This is just to init testing code, feel free to remove it! 25 | endfunction 26 | 27 | endlibrary 28 | 29 | library InitMain 30 | // This is where we hook "main" function that World Editor generates, so we have full control over it. 31 | //! inject main 32 | //! dovjassinit 33 | // We are calling for MemHack FIRST, to ensure that it works (this is crucial on patches 1.27b and above). 34 | // The reason is simple, apparently locals sometimes occupy the memory that we need to open WRITE functionality, hence causing a crash. 35 | // Also, this allows you as a user to freely control what is and what is NOT needed in your map. 36 | call InitTrig_InitMemoryHack( ) 37 | call CreateAllUnits( ) 38 | call CreateAllItems( ) 39 | // Now that MemHack is loaded, you can call whatever functions you need. Initialisers and such, but remember, do NOT put ANYTHING above MemHack execution. 40 | // Your stuff goes here... 41 | // Note, if you are too lazy to re-do everything, you can check what your main function currently contains. 42 | // Rename it to let's say main2 and just call main2 right below InitTrig_InitMemoryHack function. 43 | call main2( ) // this is an example you can also do: call ExecuteFunc( "main2" ) 44 | 45 | // Note: If you use ExecuteFunc, make sure that there are NO SUBSEQUENT ExecuteFunc inside of main2, this could cause the threading issue. 46 | //! endinject 47 | 48 | // You can also hook config function in the same way and modify it if needed (which is suggested for direct control over slots and such). 49 | endlibrary 50 | 51 | //=========================================================================== 52 | function InitTrig_InitMainHook takes nothing returns nothing 53 | // set gg_trg_InitMainHook = CreateTrigger( ) 54 | endfunction 55 | //! endnocjass 56 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/86-InitMainHook.txt: -------------------------------------------------------------------------------- 1 | This is a specific trigger/code made for versions 1.27b and above, more information about it will be explained in the comments in the code itself. 2 | For those who are below 1.27b (1.27a and lower) can ignore this "main" function hook, meaning all you have to do is disable this trigger. 3 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/88-InitMainHook.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=9 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library ZzendOpMap 5 | 6 | function main2 takes nothing returns nothing 7 | // Map specific data, remove it and replace with your things, etc... 8 | local real map_min_x = -3328. 9 | local real map_min_y = -3584. 10 | local real map_max_x = 3328. 11 | local real map_max_y = 3072. 12 | local real c_m_l = GetCameraMargin( CAMERA_MARGIN_LEFT ) 13 | local real c_m_b = GetCameraMargin( CAMERA_MARGIN_BOTTOM ) 14 | local real c_m_r = GetCameraMargin( CAMERA_MARGIN_RIGHT ) 15 | local real c_m_t = GetCameraMargin( CAMERA_MARGIN_TOP ) 16 | call SetCameraBounds( map_min_x + c_m_l, map_min_y + c_m_b, map_max_x - c_m_r, map_max_y - c_m_t, map_min_x + c_m_l, map_max_y - c_m_t, map_max_x - c_m_r, map_min_y + c_m_b ) 17 | call SetDayNightModels( "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" ) 18 | 19 | call InitTrig_Testing( ) 20 | // All of the above is just map specific data, replace it with yours! 21 | 22 | // Your stuff goes here... 23 | 24 | // This is just to init testing code, feel free to remove it! 25 | endfunction 26 | 27 | endlibrary 28 | 29 | library InitMain 30 | // This is where we hook "main" function that World Editor generates, so we have full control over it. 31 | //! inject main 32 | //! dovjassinit 33 | // We are calling for MemHack FIRST, to ensure that it works (this is crucial on patches 1.27b and above). 34 | // The reason is simple, apparently locals sometimes occupy the memory that we need to open WRITE functionality, hence causing a crash. 35 | // Also, this allows you as a user to freely control what is and what is NOT needed in your map. 36 | call InitTrig_InitMemoryHack( ) 37 | call CreateAllUnits( ) 38 | call CreateAllItems( ) 39 | // Now that MemHack is loaded, you can call whatever functions you need. Initialisers and such, but remember, do NOT put ANYTHING above MemHack execution. 40 | // Your stuff goes here... 41 | // Note, if you are too lazy to re-do everything, you can check what your main function currently contains. 42 | // Rename it to let's say main2 and just call main2 right below InitTrig_InitMemoryHack function. 43 | call main2( ) // this is an example you can also do: call ExecuteFunc( "main2" ) 44 | 45 | // Note: If you use ExecuteFunc, make sure that there are NO SUBSEQUENT ExecuteFunc inside of main2, this could cause the threading issue. 46 | //! endinject 47 | 48 | // You can also hook config function in the same way and modify it if needed (which is suggested for direct control over slots and such). 49 | endlibrary 50 | 51 | //=========================================================================== 52 | function InitTrig_InitMainHook takes nothing returns nothing 53 | // set gg_trg_InitMainHook = CreateTrigger( ) 54 | endfunction 55 | //! endnocjass 56 | -------------------------------------------------------------------------------- /MapFiles/trigger/1-MemoryHack API/88-InitMainHook.txt: -------------------------------------------------------------------------------- 1 | This is a specific trigger/code made for versions 1.27b and above, more information about it will be explained in the comments in the code itself. 2 | For those who are below 1.27b (1.27a and lower) can ignore this "main" function hook, meaning all you have to do is disable this trigger. 3 | -------------------------------------------------------------------------------- /MapFiles/trigger/2-Misc_Examples/1-TestHookedDamageEvent.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=67 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library TestHookedDamageEvent 5 | function GetDamageId takes integer dmg_t returns integer 6 | return log( dmg_t, 2 ) // Gets base 2 logarithm of WeaponType. 7 | endfunction 8 | 9 | function OnUnitDamagedHandlerEx takes integer eventData, unit source, unit target, real dmg returns boolean 10 | local real init_dmg = CleanReal( IndexToReal( ReadRealMemory( eventData + 0x04 ) ) ) 11 | local integer phys = ReadRealMemory( eventData + 0x08 ) // Pointer to parametres or flag saved by damage source, results may vary! 12 | local integer unk_1 = ReadRealMemory( eventData + 0x0C ) // ?? 13 | local integer pTarg = ReadRealMemory( eventData + 0x10 ) // Target 14 | local integer data = ReadRealMemory( eventData + 0x00 ) // CDamageData 15 | local integer src_u = ReadRealMemory( data + 0x00 ) // CUnit source 16 | local integer wpn_t = ReadRealMemory( data + 0x04 ) // weapon_type 17 | local integer flags = ReadRealMemory( data + 0x0C ) // flags 18 | local real real_dmg = CleanReal( IndexToReal( ReadRealMemory( data + 0x10 ) ) ) // damage 19 | local integer dmg_t = ReadRealMemory( data + 0x14 ) // Use GetDamageTypeByAddr( dmg_t ) to get Damage Type id. 20 | local integer atk_t = ReadRealMemory( data + 0x20 ) 21 | local boolean retval = false // set this value to true, if you handled what you needed in here so OnUnitDamagedHandler will simply end. 22 | 23 | // Attack Types: Spell = 0, Normal = 1, Piercing = 2, Siege = 3, Magic = 4, Chaos = 5, Hero = 6 24 | // Weapon Types: Melee = 0, Instant = 1, Ranged = 2, ?? = 3, ?? = 4, Splash = 5, Bounce = 6, ?? = 7, ?? = 8 25 | // 0x4 - DO NOT DEAL DAMAGE (?) | 0x8 - Multishot | 0x10 - Projectile | 0x20 - Penetrates invulnerability 26 | // 0x40 - DO NOT cause "unit attacked" for the owner (red blinking) (cleave & splash use it!) 27 | // 0x100 - Melee | 0x101 - Ranged 28 | // 0x200 - DO NOT cause "unit attacked" for the owner (minimap ping, etc) used in Cyclone (land), hex (end), etc, not sure 29 | // plain 0x40 == cleave, 0x141 == splash | 0x80 - autocast modifier? | 0x10 - slow aura flag (not a relevant damage? nullify any damage value) 30 | // Damage Types: ConvertDamageType( i ) = 2 ^ i => ConvertDamageType( 5 ) = 2 ^ 5 = 32 = DAMAGE_TYPE_ENHANCED | Thus reverse is MathLog( 32, 2 ) => 5 31 | 32 | if false then // Miscellaneous Checks 33 | if flags == 0x10 and phys == ConvertHandle( target ) then // Check WindWalk | Thunderbolt 34 | //call DisplayTextToPlayer( GetLocalPlayer( ), 0, 0, "WindWalk" ) 35 | endif 36 | 37 | if flags == 0x1 and atk_t == 0 and dmg_t == 0x20 and GetUnitAbilityLevel( source, 'NONE' ) > 0 then // Check Fan of Knives based on Id. 38 | // Change 'NONE' to your Fan of Knives id, to check if damage was caused by it. 39 | endif 40 | endif 41 | 42 | if phys == 1 then // Non-Spell Damage || ( IsFlagBitSet( flags, 0x100 ) or IsFlagBitSet( flags, 0x101 ) ) and atk_t != 0 43 | //call ClearTextMessages( ) 44 | call DisplayTextToPlayer( GetLocalPlayer( ), 0, 0, "Physical Damage" ) 45 | else 46 | call DisplayTextToPlayer( GetLocalPlayer( ), 0, 0, "Magical Damage" ) 47 | endif 48 | 49 | //call DisplayTextToPlayer( GetLocalPlayer( ), 0, 0, "Attack Type: " + I2S( atk_t ) + "\n" + "Damage Type: " + I2S( dmg_t ) + "\n" + "Weapon Type: " + I2S( wpn_t ) ) 50 | return retval 51 | endfunction 52 | 53 | function OnUnitDamagedHandler takes unit source, unit target, real dmg returns nothing 54 | local integer evntData = GetDamageEventESPData( ) 55 | local boolean skipBasic = false 56 | 57 | if evntData != 0 then // Check if we had hooked OnDamage data, if not we skip it to not cause a fatal error. 58 | set skipBasic = OnUnitDamagedHandlerEx( evntData, source, target, dmg ) 59 | call DisplayTextToPlayer( GetLocalPlayer( ), 0, 0, "OnUnitDamagedHandlerEx" ) 60 | else 61 | call DisplayTextToPlayer( GetLocalPlayer( ), 0, 0, "OnUnitDamagedHandler" ) 62 | endif 63 | 64 | if not skipBasic then 65 | // Here you can put anything related to EVENT_UNIT_DAMAGED that does not need MemHack. 66 | // Edit return value in the function in conditions you set to true, if you wish to skip it reaching this part of the code 67 | 68 | endif 69 | endfunction 70 | 71 | function OnUnitDamagedAction takes nothing returns nothing 72 | call DisableTrigger( GetTriggeringTrigger( ) ) 73 | call OnUnitDamagedHandler( GetEventDamageSource( ), GetTriggerUnit( ), GetEventDamage( ) ) 74 | call EnableTrigger( GetTriggeringTrigger( ) ) 75 | endfunction 76 | endlibrary 77 | //=========================================================================== 78 | function TestHookedDamageEventEnumUnits takes nothing returns nothing 79 | local unit u = null 80 | local group g = null 81 | local trigger t = LoadTriggerHandle( MemHackTable, StringHash( "OnDamage" ), StringHash( "Trigger" ) ) 82 | 83 | if t != null then 84 | set g = CreateGroup( ) 85 | call GroupEnumUnitsInRect( g, GetWorldBounds( ), null ) 86 | loop 87 | set u = FirstOfGroup( g ) 88 | exitwhen u == null 89 | call TriggerRegisterUnitEvent( t, u, EVENT_UNIT_DAMAGED ) 90 | call GroupRemoveUnit( g, u ) 91 | endloop 92 | 93 | call DestroyGroup( g ) 94 | set u = null 95 | set g = null 96 | endif 97 | 98 | set t = null 99 | endfunction 100 | 101 | function InitTrig_TestHookedDamageEvent takes nothing returns nothing 102 | local trigger t = null 103 | 104 | if LoadTriggerHandle( MemHackTable, StringHash( "OnDamage" ), StringHash( "Trigger" ) ) == null then 105 | set t = CreateTrigger( ) 106 | call TriggerAddAction( t, function OnUnitDamagedAction ) 107 | call SaveTriggerHandle( MemHackTable, StringHash( "OnDamage" ), StringHash( "Trigger" ), t ) 108 | call TestHookedDamageEventEnumUnits( ) 109 | endif 110 | 111 | set t = null 112 | //set gg_trg_TestHookedDamageEvent = CreateTrigger( ) 113 | endfunction 114 | //! endnocjass 115 | -------------------------------------------------------------------------------- /MapFiles/trigger/2-Misc_Examples/1-TestHookedDamageEvent.txt: -------------------------------------------------------------------------------- 1 | This trigger can be removed, as it serves only for demonstration of how to use a modified Damaged Event. 2 | You can freely remove/disable this trigger. -------------------------------------------------------------------------------- /MapFiles/trigger/3-Hooks/1-MemHackDrawCooldown.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackzDrawCooldowns 5 | function GetCDTable takes nothing returns hashtable 6 | return LoadHashtableHandle( MemHackTable, StringHash( "DrawCooldown" ), StringHash( "HashTable" ) ) 7 | endfunction 8 | 9 | function GetBTableShadow takes integer buttonId, integer id returns integer 10 | return LoadInteger( GetCDTable( ), StringHash( "Button_" + I2S( buttonId ) ), StringHash( "Shadow_" + I2S( id ) ) ) 11 | endfunction 12 | 13 | function GetBTableText takes integer buttonId returns integer 14 | return LoadInteger( GetCDTable( ), StringHash( "Button_" + I2S( buttonId ) ), StringHash( "Text" ) ) 15 | endfunction 16 | 17 | function DrawButtonCooldown takes integer id, integer pButton returns boolean 18 | local integer i = 0 19 | local real cd 20 | local string text = "" 21 | 22 | if pButton > 0 then 23 | set cd = GetButtonCooldown( pButton, false ) //GetButtonCooldown 24 | 25 | if cd > 0. then 26 | if cd >= 10. then 27 | set text = I2S( R2I( cd ) ) 28 | else 29 | set text = R2SW( cd, 1, 1 ) 30 | endif 31 | endif 32 | 33 | loop 34 | exitwhen i > 7 35 | //if i == 0 or i == 3 or i == 7 then 36 | call SetCSimpleFontText( GetBTableShadow( id, i ), text ) 37 | //endif 38 | set i = i + 1 39 | endloop 40 | 41 | call SetCSimpleFontText( GetBTableText( id ), text ) 42 | return true 43 | endif 44 | 45 | return false 46 | endfunction 47 | 48 | function CreateButtonCooldown takes integer id, integer pButton returns boolean 49 | local integer pFrame = 0 50 | local integer i = 0 51 | 52 | if pButton != 0 then 53 | loop 54 | exitwhen i > 7 55 | //if i == 0 or i == 3 or i == 7 then 56 | set pFrame = CreateCSimpleFont( pButton ) 57 | call SetCSimpleRegionVertexColourEx( pFrame, 0xFF, 0x00, 0x00, 0x00 ) 58 | call SetCSimpleFontStringFont( pFrame, "Fonts\\FRIZQT__.TTF", .1, 0 ) 59 | call SetCSimpleFontText( pFrame, "" ) 60 | call SetCSimpleFontStringScale( pFrame, 1.5 ) 61 | call SaveInteger( GetCDTable( ), StringHash( "Button_" + I2S( id ) ), StringHash( "Shadow_" + I2S( i ) ), pFrame ) 62 | //endif 63 | set i = i + 1 64 | endloop 65 | 66 | set pFrame = CreateCSimpleFont( pButton ) 67 | call SetCSimpleRegionVertexColourEx( pFrame, 0xFF, 0xFF, 0xFF, 0xFF ) 68 | call SetCSimpleFontStringFont( pFrame, "Fonts\\FRIZQT__.TTF", .095, 0 ) 69 | call SetCSimpleFontText( pFrame, "" ) 70 | call SetFramePoint( pFrame, ANCHOR_CENTER, pButton, ANCHOR_CENTER, 0., 0. ) 71 | call SaveInteger( GetCDTable( ), StringHash( "Button_" + I2S( id ) ), StringHash( "Text" ), pFrame ) 72 | 73 | call SetFramePoint( GetBTableShadow( id, 0 ), ANCHOR_CENTER, pFrame, ANCHOR_CENTER, 0.0003, -0.0003 ) // + 74 | call SetFramePoint( GetBTableShadow( id, 1 ), ANCHOR_CENTER, pFrame, ANCHOR_CENTER, 0.0003, 0. ) 75 | call SetFramePoint( GetBTableShadow( id, 2 ), ANCHOR_CENTER, pFrame, ANCHOR_CENTER, 0.0003, 0.0003 ) 76 | call SetFramePoint( GetBTableShadow( id, 3 ), ANCHOR_CENTER, pFrame, ANCHOR_CENTER, 0., 0.0003 ) // + 77 | call SetFramePoint( GetBTableShadow( id, 4 ), ANCHOR_CENTER, pFrame, ANCHOR_CENTER, -0.0003, 0.0003 ) 78 | call SetFramePoint( GetBTableShadow( id, 5 ), ANCHOR_CENTER, pFrame, ANCHOR_CENTER, -0.0003, 0. ) 79 | call SetFramePoint( GetBTableShadow( id, 6 ), ANCHOR_CENTER, pFrame, ANCHOR_CENTER, -0.0003, -0.0003 ) 80 | call SetFramePoint( GetBTableShadow( id, 7 ), ANCHOR_CENTER, pFrame, ANCHOR_CENTER, 0., -0.0003 ) // + 81 | return true 82 | endif 83 | 84 | return false 85 | endfunction 86 | 87 | function DrawAllButtonCooldowns takes nothing returns nothing 88 | local integer i = 0 89 | local integer p = 0 90 | 91 | if not HaveSavedBoolean( GetCDTable( ), StringHash( "pCDTable" ), StringHash( "IsInit" ) ) then 92 | call SaveBoolean( GetCDTable( ), StringHash( "pCDTable" ), StringHash( "IsInit" ), true ) 93 | 94 | loop 95 | exitwhen i > 17 96 | if i < 12 then 97 | set p = GetSkillBarButton( i ) 98 | else 99 | set p = GetItemBarButton( i - 12 ) 100 | endif 101 | 102 | call CreateButtonCooldown( i, p ) 103 | set i = i + 1 104 | endloop 105 | endif 106 | 107 | set i = 0 108 | loop 109 | exitwhen i > 17 110 | if i < 12 then 111 | set p = GetSkillBarButton( i ) 112 | else 113 | set p = GetItemBarButton( i - 12 ) 114 | endif 115 | 116 | call DrawButtonCooldown( i, p ) 117 | set i = i + 1 118 | endloop 119 | endfunction 120 | 121 | function DrawAllCooldownSetDelay takes real delay returns nothing 122 | if GetCDTable( ) == null then 123 | call SaveHashtableHandle( MemHackTable, StringHash( "DrawCooldown" ), StringHash( "HashTable" ), InitHashtable( ) ) 124 | call SaveTimerHandle( GetCDTable( ), StringHash( "DrawCooldown" ), StringHash( "Timer" ), CreateTimer( ) ) 125 | endif 126 | 127 | call TimerStart( LoadTimerHandle( GetCDTable( ), StringHash( "DrawCooldown" ), StringHash( "Timer" ) ), delay, true, function DrawAllButtonCooldowns ) 128 | endfunction 129 | 130 | function Init_DrawAllCooldowns takes nothing returns nothing 131 | call DrawAllCooldownSetDelay( .1 ) 132 | endfunction 133 | endlibrary 134 | 135 | //=========================================================================== 136 | function InitTrig_MemHackDrawCooldown takes nothing returns nothing 137 | //set gg_trg_MemHackDrawCooldown = CreateTrigger( ) 138 | endfunction 139 | //! endnocjass 140 | -------------------------------------------------------------------------------- /MapFiles/trigger/3-Hooks/2-MemHackDamageHook.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library MemoryHackDamageEventHook 5 | function GetDamageEventESPData takes nothing returns integer 6 | local integer addr = LoadInteger( MemHackTable, StringHash( "OnDamageHook" ), StringHash( "Stack" ) ) 7 | local integer len = 0 8 | 9 | if addr != 0 then 10 | set len = ReadRealMemory( addr ) 11 | 12 | if len > 0 then 13 | return ReadRealMemory( addr + 0x04 + 0x04 * ( len - 1 ) ) 14 | endif 15 | endif 16 | 17 | return 0 18 | endfunction 19 | 20 | function Init_DamageEventHook takes nothing returns nothing 21 | // This simply grabs data from CDamageData in CUnitOnDamage. 22 | // To replicate this in C++, we simply save data before calling the function and after. 23 | // Hence we will have predamage and postdamage data. 24 | // WriteRealMemorys below simply write asm code to replicate this method. 25 | 26 | local integer vtable = LoadInteger( MemHackTable, StringHash( "CUnit" ), StringHash( "vtable" ) ) 27 | local integer pOnDamageOffset = vtable + 0x120 // 1.26a = 6F2A40D0 | CUnitOnDamage | 0x4 * 0x48 28 | local integer pOnDamage = 0 29 | local integer oldprot = 0 30 | local integer pDamageStack = 0 31 | local integer pDamageHook = 0 32 | 33 | if vtable != 0 then 34 | set oldprot = ChangeOffsetProtection( pOnDamageOffset, 4, 0x04 ) 35 | set pOnDamage = ReadRealMemory( pOnDamageOffset ) 36 | set pDamageStack = Malloc( 0x4 + 0x4 * 1024 ) // MAX_DAMAGE_STACK_SIZE = 1024 37 | set pDamageHook = AllocateExecutableMemory( 0x60 ) // due to call WriteRealMemory( pDamageHook + 0x5C, 0x0010C2C9 ) 38 | 39 | call SaveInteger( MemHackTable, StringHash( "OnDamageHook" ), StringHash( "Stack" ), pDamageStack ) 40 | call SaveInteger( MemHackTable, StringHash( "OnDamageHook" ), StringHash( "Hook" ), pDamageHook ) 41 | 42 | call WriteRealMemory( pOnDamageOffset, pDamageHook ) 43 | call ChangeOffsetProtection( pOnDamageOffset, 0x4, oldprot ) 44 | 45 | call WriteRealMemory( pDamageHook + 0x00, 0x8DE58955 ) 46 | call WriteRealMemory( pDamageHook + 0x04, 0x53E82464 ) 47 | call WriteRealMemory( pDamageHook + 0x08, 0xB8F84D89 ) 48 | call WriteRealMemory( pDamageHook + 0x0C, pDamageStack ) 49 | call WriteRealMemory( pDamageHook + 0x10, 0x890C558B ) 50 | call WriteRealMemory( pDamageHook + 0x14, 0x558BE855 ) 51 | call WriteRealMemory( pDamageHook + 0x18, 0x10528B0C ) 52 | call WriteRealMemory( pDamageHook + 0x1C, 0x8BEC5589 ) 53 | call WriteRealMemory( pDamageHook + 0x20, 0x55891055 ) 54 | call WriteRealMemory( pDamageHook + 0x24, 0x14558BF0 ) 55 | call WriteRealMemory( pDamageHook + 0x28, 0x8DF45589 ) 56 | call WriteRealMemory( pDamageHook + 0x2C, 0xC389E84D ) 57 | call WriteRealMemory( pDamageHook + 0x30, 0x4C89138B ) 58 | call WriteRealMemory( pDamageHook + 0x34, 0x03830490 ) 59 | call WriteRealMemory( pDamageHook + 0x38, 0x4D8B9001 ) 60 | 61 | call WriteRealMemory( pDamageHook + 0x3C, 0x1475FFF8 ) 62 | call WriteRealMemory( pDamageHook + 0x40, 0x8B1075FF ) 63 | call WriteRealMemory( pDamageHook + 0x44, 0x8B500C45 ) 64 | call WriteRealMemory( pDamageHook + 0x48, 0xB8500845 ) 65 | call WriteRealMemory( pDamageHook + 0x4C, pOnDamage ) 66 | call WriteRealMemory( pDamageHook + 0x50, 0x4589D0FF ) // call eax (PreviousMethod) 67 | call WriteRealMemory( pDamageHook + 0x54, 0x012B83FC ) 68 | call WriteRealMemory( pDamageHook + 0x58, 0x5BFC458B ) 69 | call WriteRealMemory( pDamageHook + 0x5C, 0x0010C2C9 ) 70 | endif 71 | endfunction 72 | 73 | function Init_MemHackDamageEventHook takes nothing returns nothing 74 | if PatchVersion != "" then 75 | call Init_DamageEventHook( ) 76 | endif 77 | endfunction 78 | endlibrary 79 | 80 | //=========================================================================== 81 | function InitTrig_MemHackDamageHook takes nothing returns nothing 82 | //set gg_trg_MemHackDamageHook = CreateTrigger( ) 83 | endfunction 84 | //! endnocjass 85 | -------------------------------------------------------------------------------- /MapFiles/trigger/3-Hooks/2-MemHackDamageHook.txt: -------------------------------------------------------------------------------- 1 | This trigger is required if you want to generate damage event hook to enhance its capabilities. 2 | If you remove Init_MemHackDamageEventHook, and still use GetDamageEventESPData, it may cause fatal error! -------------------------------------------------------------------------------- /MapFiles/trigger/3-Hooks/3-MemHackBerserkHook.txt: -------------------------------------------------------------------------------- 1 | This trigger can be safely removed, since you need to configure Init_BerserkAbilityHook for it to actually do anything. 2 | Make sure you read the instructions CAREFULLY, mistake is NOT an option! -------------------------------------------------------------------------------- /MapFiles/trigger/3-Hooks/4-MemHackCustomAbilityChargesHook.txt: -------------------------------------------------------------------------------- 1 | Hook to add/substract "charges" from abilities, these "charges" are only visual, meaning you are forcing the game to simply draw the amount of "charges" you specify. 2 | Had to rewrite a bit original code and clean it out, also I have added 1.27a support (duh). -------------------------------------------------------------------------------- /MapFiles/trigger/4-Useless_Testing/1-Testing.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=58 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library SystemDebug 5 | globals 6 | group gTemp = null 7 | unit uTemp = null 8 | effect eTemp = null 9 | item itTemp = null 10 | integer iTemp = 0 11 | trigger tTemp = null 12 | //hashtable htTemp = InitHashtable( ) 13 | 14 | boolean testout = true 15 | endglobals 16 | endlibrary 17 | 18 | library ZzATestCode 19 | function PrintMemHackData takes nothing returns nothing 20 | call BJDebugMsg( "pGameDLL: " + IntToHex( pGameDLL ) ) 21 | call BJDebugMsg( "iGameVersion: " + IntToHex( iGameVersion ) ) 22 | call BJDebugMsg( "pJassEnvAddress: " + IntToHex( pJassEnvAddress ) ) 23 | call BJDebugMsg( "pJassVmAddress: " + IntToHex( GetJassVM( 1 ) ) ) 24 | call BJDebugMsg( "pJassHandleTable: " + IntToHex( GetJassTable( ) ) ) 25 | endfunction 26 | 27 | function SomeFunction takes nothing returns nothing 28 | 29 | endfunction 30 | 31 | function TestBenchmarking takes nothing returns nothing 32 | local integer p = 0 33 | local integer i = 0 34 | local integer j = 0 35 | local real r = 0. 36 | local integer time1 = 0 37 | local integer time2 = 0 38 | local integer sum = 0 39 | 40 | set i = 0 41 | set time1 = GetLocalTime( 0 ) 42 | 43 | 44 | 45 | loop 46 | exitwhen i == 10000 47 | // Some stuff here 48 | 49 | set i = i + 1 50 | endloop 51 | set time1 = GetLocalTime( 0 ) - time1 52 | 53 | set i = 0 54 | set time2 = GetLocalTime( 0 ) 55 | loop 56 | exitwhen i == 10000 57 | // Some other stuff here 58 | 59 | set i = i + 1 60 | endloop 61 | set time2 = GetLocalTime( 0 ) - time2 62 | 63 | if time1 < 0 then 64 | set time1 = 1000 + time1 65 | endif 66 | 67 | if time2 < 0 then 68 | set time2 = 1000 + time2 69 | endif 70 | 71 | call BJDebugMsg( "First Delay: " + I2S( time1 ) + "ms" ) 72 | call BJDebugMsg( "Second Delay: " + I2S( time2 ) + "ms" ) 73 | 74 | set eTemp = AddSpecialEffect( "Units\\Human\\Footman\\Footman.mdx", 0., 0. ) 75 | 76 | call SetEffectPosition( eTemp, 1500., 100., 100. ) 77 | //call fast_call_3( pGameDLL + 0x4D3200, GetObjectSprite( ConvertHandle( eTemp ) ), 0xFFFF, 0 ) 78 | call BJDebugMsg( "eTemp: " + IntToHex( ConvertHandle( eTemp ) ) + " pos-> " + R2S( GetEffectX( eTemp ) ) + " | " + R2S( GetEffectY( eTemp ) ) + " | " + R2S( GetEffectZ( eTemp ) ) ) 79 | endfunction 80 | 81 | function Init_TestCode takes nothing returns nothing 82 | local integer i = 0 83 | local integer mem = 0 84 | 85 | call BJDebugMsg( "IsOPLimitRemoved = " + B2S( IsOPLimitRemoved( ) ) ) 86 | call EnableOPLimit( false ) // This removes operation limit, hence allowing us to use benchmark method above. 87 | // Since it has over 20000 complex operations, we need to remove limit to complete benchmark without exiting the thread until it fully completes. 88 | //call LoadTOCFile( "UI\\Data\\List.toc" ) // not needed for code testing, you can however load your own TOCs. 89 | call BJDebugMsg( "IsOPLimitRemoved = " + B2S( IsOPLimitRemoved( ) ) ) 90 | 91 | 92 | 93 | if true then 94 | set uTemp = CreateUnit( Player( 0 ), 'H000', 0., 0., 270. ) 95 | call SetUnitMaxLife( uTemp, 99999. ) 96 | call SetUnitLifeRegen( uTemp, 9999. ) 97 | call SetUnitMaxMana( uTemp, 99999. ) 98 | call SetUnitManaRegen( uTemp, 9999. ) 99 | call SetUnitAttackSpeed( uTemp, 6. ) 100 | call SetUnitBaseDamage( uTemp, 10000 ) 101 | //call SetUnitScale( uTemp, .8, .8, .8 ) 102 | 103 | //call UnitAddAbility( uTemp, 'AIsr' ) 104 | //call UnitAddAbility( uTemp, 'Aroc' ) 105 | //call BJDebugMsg( "'Aroc' = " + IntToHex( GetUnitAbility( uTemp, 'Aroc' ) ) ) 106 | 107 | //call UnitAddAbility( uTemp, 'A000' ) 108 | //call SetAbilityBaseHotkeyIdById( 'A000', 'K' ) 109 | //call BJDebugMsg( "'K' hotkey == A000 hotkey: " + I2S( GetAbilityBaseHotkeyIdById( 'A000' ) ) ) 110 | //call UnitAddAbility( uTemp, 'A001' ) 111 | //call UnitAddAbility( uTemp, 'A002' ) 112 | endif 113 | 114 | //call UnitAddAbility( uTemp, 'A003' ) 115 | 116 | //call UnitAddAbility( uTemp, 'AOsh' ) 117 | //call UnitAddAbility( uTemp, 'AOws' ) 118 | //call UnitAddAbility( uTemp, 'AUcs' ) 119 | //call UnitAddAbility( uTemp, 'AHbz' ) 120 | 121 | call TimerStart( GetExpiredTimer( ), .1, false, function TestBenchmarking ) 122 | //call TimerStart( CreateTimer( ), .0, true, function TestTimerSpeed ) 123 | endfunction 124 | 125 | //=========================================================================== 126 | function InitTrig_Testing takes nothing returns nothing 127 | //set gg_trg_Testing = CreateTrigger( ) 128 | call PanCameraToTimed( 0., 0., 0. ) 129 | call FogEnable( false ) 130 | call FogMaskEnable( false ) 131 | call TimerStart( CreateTimer( ), .1, false, function Init_TestCode ) 132 | endfunction 133 | 134 | endlibrary 135 | //! endnocjass 136 | -------------------------------------------------------------------------------- /MapFiles/trigger/4-Useless_Testing/1-Testing.txt: -------------------------------------------------------------------------------- 1 | This code can be removed, as it is only is needed for tests it yields no benefits or usage elsewise. -------------------------------------------------------------------------------- /MapFiles/trigger/4-Useless_Testing/2-HandleAPI.j: -------------------------------------------------------------------------------- 1 | //TESH.scrollpos=0 2 | //TESH.alwaysfold=0 3 | //! nocjass 4 | library HandleAPI // Deprecated, but, you can refer to APIMemoryObjectData to see which functions will work or no. 5 | function GetSpriteDataOffsetR takes handle h, integer offset returns real 6 | return GetSpriteDataOffsetAddressR( ConvertHandle( h ), offset ) 7 | endfunction 8 | 9 | function SetSpriteDataOffsetR takes handle h, integer offset, real r returns nothing 10 | call SetSpriteDataOffsetAddressR( ConvertHandle( h ), offset, r ) 11 | endfunction 12 | 13 | function GetHandleColour takes handle h returns integer 14 | return GetObjectColour( ConvertHandle( h ) ) 15 | endfunction 16 | 17 | function SetHandleColour takes handle h, integer colour returns nothing 18 | call SetObjectColour( ConvertHandle( h ), colour ) 19 | endfunction 20 | 21 | function SetHandleColourEx takes handle h, integer red, integer green, integer blue, integer alpha returns nothing 22 | call SetObjectColourEx( ConvertHandle( h ), red, green, blue, alpha ) 23 | endfunction 24 | 25 | function UpdateHandleColour takes handle h returns nothing 26 | call UpdateObjectColour( ConvertHandle( h ) ) 27 | endfunction 28 | 29 | function GetHandleColourA takes handle h returns integer 30 | return GetObjectColourA( ConvertHandle( h ) ) 31 | endfunction 32 | 33 | function SetHandleColourA takes handle h, integer alpha returns nothing 34 | call SetObjectColourA( ConvertHandle( h ), alpha ) 35 | endfunction 36 | 37 | function GetHandleColourR takes handle h returns integer 38 | return GetObjectColourR( ConvertHandle( h ) ) 39 | endfunction 40 | 41 | function SetHandleColourR takes handle h, integer red returns nothing 42 | call SetObjectColourR( ConvertHandle( h ), red ) 43 | endfunction 44 | 45 | function GetHandleColourG takes handle h returns integer 46 | return GetObjectColourG( ConvertHandle( h ) ) 47 | endfunction 48 | 49 | function SetHandleColourG takes handle h, integer green returns nothing 50 | call SetObjectColourG( ConvertHandle( h ), green ) 51 | endfunction 52 | 53 | function GetHandleColourB takes handle h returns integer 54 | return GetObjectColourB( ConvertHandle( h ) ) 55 | endfunction 56 | 57 | function SetHandleColourB takes handle h, integer blue returns nothing 58 | call SetObjectColourB( ConvertHandle( h ), blue ) 59 | endfunction 60 | endlibrary 61 | 62 | //=========================================================================== 63 | function InitTrig_HandleAPI takes nothing returns nothing 64 | //set gg_trg_HandleAPI = CreateTrigger( ) 65 | endfunction 66 | //! endnocjass 67 | -------------------------------------------------------------------------------- /MapFiles/trigger/catalog.lml: -------------------------------------------------------------------------------- 1 | '1-MemoryHack API': 'MemoryHack API' 2 | '01-----------Core API----------': '----------Core API----------' 3 | Comment 4 | 02-APIBasicUtils: APIBasicUtils 5 | 03-APITypecast: APITypecast 6 | 04-APIMemory: APIMemory 7 | 05-APIMemoryCalls: APIMemoryCalls 8 | 06-APIMemoryBitwise: APIMemoryBitwise 9 | 07-APIMemoryString: APIMemoryString 10 | 08-APIMemoryKernel: APIMemoryKernel 11 | 09-APIMemoryRestorer: APIMemoryRestorer 12 | 10-APIMemoryStormDLL: APIMemoryStormDLL 13 | 11-APIMemoryMPQ: APIMemoryMPQ 14 | 12-APIMemoryFrameData: APIMemoryFrameData 15 | 13-APIMemoryGameData: APIMemoryGameData 16 | 14-APIMemoryGameUI: APIMemoryGameUI 17 | 15-APIMemoryGameUIButton: APIMemoryGameUIButton 18 | 16-APIMemoryGameWindow: APIMemoryGameWindow 19 | 17-APIMemoryUtilityLibraryAPI: APIMemoryUtilityLibraryAPI 20 | 18----------------------------: --------------------------- 21 | Comment 22 | '19-----------MH Constants API----------': '----------MH Constants API----------' 23 | Comment 24 | 20-MemHackConstantsAPI: MemHackConstantsAPI 25 | '21-----------Frame API----------': '----------Frame API----------' 26 | Comment 27 | 22-MemHackCFrameAPI: MemHackCFrameAPI 28 | '23-Frame Types': ' Frame Types ' 29 | Comment 30 | 24-MemHackCLayerAPI: MemHackCLayerAPI 31 | 25-MemHackCLayoutFrameAPI: MemHackCLayoutFrameAPI 32 | 26-MemHackCBackDropFrameAPI: MemHackCBackDropFrameAPI 33 | 27-MemHackCEditBoxAPI: MemHackCEditBoxAPI 34 | 28-MemHackCModelFrameAPI: MemHackCModelFrameAPI 35 | 29-MemHackCSimpleButtonAPI: MemHackCSimpleButtonAPI 36 | 30-MemHackCSimpleFontAPI: MemHackCSimpleFontAPI 37 | 31-MemHackCSimpleGlueAPI: MemHackCSimpleGlueAPI 38 | 32-MemHackCSimpleFrameAPI: MemHackCSimpleFrameAPI 39 | 33-MemHackCSimpleConsoleAPI: MemHackCSimpleConsoleAPI 40 | 34-MemHackCSpriteFrameAPI: MemHackCSpriteFrameAPI 41 | 35-MemHackCSimpleMessageFrameAPI: MemHackCSimpleMessageFrameAPI 42 | 36-MemHackCSliderAPI: MemHackCSliderAPI 43 | 37-MemHackCTextAreaAPI: MemHackCTextAreaAPI 44 | 38-MemHackCTextFrameAPI: MemHackCTextFrameAPI 45 | 39-MemHackCSimpleStatusBarAPI: MemHackCSimpleStatusBarAPI 46 | 40-MemHackCStatusBarAPI: MemHackCStatusBarAPI 47 | 41-MemHackCSimpleTextureAPI: MemHackCSimpleTextureAPI 48 | 42-MemHackCSimpleRegionAPI: MemHackCSimpleRegionAPI 49 | 43-MemHackFrameAPI: MemHackFrameAPI 50 | '44-----------UI API----------': '----------UI API----------' 51 | Comment 52 | 45-MemHackUIAPI: MemHackUIAPI 53 | 46----------------------------: --------------------------- 54 | Comment 55 | '47-----------CSprite API----------': '----------CSprite API----------' 56 | Comment 57 | 48-MemHackCSpriteBaseAPI: MemHackCSpriteBaseAPI 58 | 49-MemHackCSpriteMiniAPI: MemHackCSpriteMiniAPI 59 | 50-MemHackCSpriteUberAPI: MemHackCSpriteUberAPI 60 | '51-----------CObject API----------': '----------CObject API----------' 61 | Comment 62 | 52-MemHackCObjectAPI: MemHackCObjectAPI 63 | 53----------------------------: --------------------------- 64 | Comment 65 | '54-----------Player API----------': '----------Player API----------' 66 | Comment 67 | 55-MemHackPlayerAPI: MemHackPlayerAPI 68 | '56-----------Ability_Buff API----------': '----------Ability/Buff API----------' 69 | Comment 70 | 57-MemHackAbilityAddressAPI: MemHackAbilityAddressAPI 71 | 58-MemHackAbilityBaseAPI: MemHackAbilityBaseAPI 72 | 59-MemHackAbilityNormalAPI: MemHackAbilityNormalAPI 73 | 60-MemHackAbilityUnitAPI: MemHackAbilityUnitAPI 74 | 61-MemHackCastAbility: MemHackCastAbility 75 | 62----------------------------: --------------------------- 76 | Comment 77 | '63-----------Widget API----------': '----------Widget API----------' 78 | Comment 79 | 64-MemHackWidgetBaseAPI: MemHackWidgetBaseAPI 80 | 65-MemHackWidgetNormalAPI: MemHackWidgetNormalAPI 81 | 66----------------------------: --------------------------- 82 | Comment 83 | '67-----------Agent API----------': '----------Agent API----------' 84 | Comment 85 | 68-MemHackEffectAPI: MemHackEffectAPI 86 | 69-MemHackTrackableAPI: MemHackTrackableAPI 87 | 70----------------------------: --------------------------- 88 | Comment 89 | '71-----------Item API----------': '----------Item API----------' 90 | Comment 91 | 72-MemHackItemBaseAPI: MemHackItemBaseAPI 92 | 73-MemHackItemNormalAPI: MemHackItemNormalAPI 93 | 74----------------------------: --------------------------- 94 | Comment 95 | '75-----------Unit API----------': '----------Unit API----------' 96 | Comment 97 | 76-MemHackUnitBaseAPI: MemHackUnitBaseAPI 98 | 77-MemHackUnitNormalAPI: MemHackUnitNormalAPI 99 | 78----------------------------: --------------------------- 100 | Comment 101 | '79-----------Group API----------': '----------Group API----------' 102 | Comment 103 | 80-MemHackGroupAPI: MemHackGroupAPI 104 | 81----------------------------: --------------------------- 105 | Comment 106 | '82-----------Mouse API----------': '----------Mouse API----------' 107 | Comment 108 | 83-MemHackMouseAPI: MemHackMouseAPI 109 | 84-----------Init----------: ----------Init---------- 110 | Comment 111 | 85-InitMemoryHack: InitMemoryHack 112 | 86-InitMainHook: InitMainHook 113 | 87----------------------------: --------------------------- 114 | Comment 115 | 2-Misc_Examples: Misc/Examples 116 | 1-TestHookedDamageEvent: TestHookedDamageEvent 117 | 3-Hooks: Hooks 118 | 1-MemHackDrawCooldown: MemHackDrawCooldown 119 | 2-MemHackDamageHook: MemHackDamageHook 120 | 3-MemHackBerserkHook: MemHackBerserkHook 121 | 4-MemHackCustomAbilityChargesHook: MemHackCustomAbilityChargesHook 122 | 4-Useless_Testing: Useless/Testing 123 | 1-Testing: Testing 124 | 2-HandleAPI: HandleAPI 125 | Disab 126 | -------------------------------------------------------------------------------- /MapFiles/trigger/code.txt: -------------------------------------------------------------------------------- 1 | This version of memory hack has been assembled by Sandro Takaishvili (Unryze) aka me, which I wanted to do ages ago, but simply disliked the very idea of working with MemoryHack. 2 | Special thanks to quq_CCCP for helping with testing and providing useful information, probably without him I would have scraped this idea of making a full-blown MemoryHack based WE-openable map. 3 | Additional thanks to ENAlexey, Karaul0v, Dracol1ch, and leandrotp for all their help and for their contributions to the original MemoryHack and much more. 4 | 5 | You are free to use the API however you like, but make sure you are editing with great causion, since this code is not for child's play, it may break in so many ways that you would start hating your life. 6 | Remember, things that are here, are still a small part of the possibilities of Warcraft 3 Engine, it is capable of so much more. 7 | 8 | Anyhow, if you have any suggestions or you wish to report a bug, you can contact me, here is my contact list: 9 | 10 | Discord: Unyze#4087 11 | VK: https://vk.com/unryze 12 | FB: https://www.facebook.com/sandro.takaishvili.7 13 | 14 | Good luck and have fun! -------------------------------------------------------------------------------- /MapFiles/w3x2lni/locale/lml.lng: -------------------------------------------------------------------------------- 1 | [NAME] 2 | Name 3 | [COMMENT] 4 | Comment 5 | [DISABLE] 6 | Disab 7 | [CLOSE] 8 | Closed 9 | [RUN] 10 | Run 11 | [LIST] 12 | List 13 | [EVENT] 14 | Event 15 | [CONDITION] 16 | Condition 17 | [ACTION] 18 | Action 19 | [CALL] 20 | Call 21 | [PRESET] 22 | Preset 23 | [CONSTANT] 24 | Const 25 | [VARIABLE] 26 | Var 27 | [ARRAY] 28 | Array 29 | [DEFAULT] 30 | Def 31 | [CHILD] 32 | ---Subdirectory--- -------------------------------------------------------------------------------- /MapFiles/w3x2lni/locale/w3i.lng: -------------------------------------------------------------------------------- 1 | [MAP] 2 | map 3 | [FILE_VERSION] 4 | file_version 5 | [MAP_VERSION] 6 | map_version 7 | [WE_VERSION] 8 | we_version 9 | [WAR3_VERSION] 10 | wc3_version 11 | [MAP_NAME] 12 | map_name 13 | [AUTHOR_NAME] 14 | author_name 15 | [MAP_DESC] 16 | map_desc 17 | [PLAYER_DESC] 18 | player_desc 19 | [SCRIPT_TYPE] 20 | script_type 21 | [CAMERA] 22 | camera 23 | [CAMERA_BOUND] 24 | camera_bound 25 | [CAMERA_COMPLEMENT] 26 | camera_complement 27 | [MAP_INFO] 28 | map_info 29 | [MAP_WIDTH] 30 | map_width 31 | [MAP_HEIGHT] 32 | map_height 33 | [MAP_MAIN_GROUND] 34 | map_main_ground 35 | [CONFIG] 36 | config 37 | [GAME_DATA_SETTING] 38 | game_data_setting 39 | [DISABLE_PREVIEW] 40 | disable_preview 41 | [CUSTOM_ALLY] 42 | custom_ally 43 | [MELEE_MAP] 44 | melee_map 45 | [LARGE_MAP] 46 | large_map 47 | [MASKED_AREA_SHOW_TERRAIN] 48 | masked_area_show_terrain 49 | [FIX_FORCE_SETTING] 50 | fix_force_setting 51 | [CUSTOM_FORCE] 52 | custom_force 53 | [CUSTOM_TECHTREE] 54 | custom_techtree 55 | [CUSTOM_ABILITY] 56 | custom_ability 57 | [CUSTOM_UPGRADE] 58 | custom_upgrade 59 | [MAP_MENU_MARK] 60 | map_menu_mark 61 | [SHOW_WAVE_ON_CLIFF] 62 | show_wave_on_cliff 63 | [SHOW_WAVE_ON_ROLLING] 64 | show_wave_on_rolling 65 | [UNKNOWN_1] 66 | unknown_1 67 | [UNKNOWN_2] 68 | unknown_2 69 | [UNKNOWN_3] 70 | unknown_3 71 | [UNKNOWN_4] 72 | unknown_4 73 | [UNKNOWN_5] 74 | unknown_5 75 | [UNKNOWN_6] 76 | unknown_6 77 | [UNKNOWN_7] 78 | unknown_7 79 | [UNKNOWN_8] 80 | unknown_8 81 | [UNKNOWN_9] 82 | unknown_9 83 | [UNKNOWN_10] 84 | unknown_10 85 | [UNKNOWN_11] 86 | unknown_11 87 | [UNKNOWN_12] 88 | unknown_12 89 | [UNKNOWN_13] 90 | unknown_13 91 | [LOADING_SCREEN] 92 | loading_screen 93 | [ID] 94 | id 95 | [PATH] 96 | path 97 | [TEXT] 98 | text 99 | [TITLE] 100 | title 101 | [SUBTITLE] 102 | subtitle 103 | [PROLOGUE] 104 | prologue 105 | [FOG] 106 | fog 107 | [TYPE] 108 | type 109 | [START_Z] 110 | start_z 111 | [END_Z] 112 | end_z 113 | [DENSITY] 114 | density 115 | [COLOR] 116 | color 117 | [ENVIRONMENT] 118 | environment 119 | [WEATHER] 120 | weather 121 | [SOUND] 122 | sound 123 | [LIGHT] 124 | light 125 | [WATER_COLOR] 126 | water_color 127 | [PLAYER] 128 | player 129 | [PLAYER_COUNT] 130 | player_count 131 | [RACE] 132 | race 133 | [FIX_START_POSITION] 134 | fix_start_position 135 | [NAME] 136 | name 137 | [START_POSITION] 138 | start_position 139 | [ALLY_LOW_FLAG] 140 | ally_low_flag 141 | [ALLY_HIGH_FLAG] 142 | ally_high_flag 143 | [FORCE] 144 | force 145 | [FORCE_COUNT] 146 | force_count 147 | [ALLY] 148 | ally 149 | [ALLY_WIN] 150 | ally_win 151 | [SHARE_VISIBLE] 152 | share_visible 153 | [SHARE_CONTROL] 154 | share_control 155 | [SHARE_ADVANCE] 156 | share_advance 157 | [PLAYER_LIST] 158 | player_list 159 | [FORCE_NAME] 160 | force_name 161 | [UPGRADE] 162 | upgrade 163 | [LEVEL] 164 | level 165 | [AVAILABLE] 166 | available 167 | [TECH] 168 | tech 169 | [RANDOM_GROUP] 170 | random_group 171 | [RANDOM_GROUP_NAME] 172 | random_group_name 173 | [POSITION_TYPE] 174 | position_type 175 | [SETTING] 176 | setting 177 | [CHANCE] 178 | chance 179 | [RANDOM_ITEM] 180 | random_item 181 | [RANDOM_ITEM_NAME] 182 | random_item_name -------------------------------------------------------------------------------- /MapFiles/w3x2lni/version/lml: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /MemHackLite.w3m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnryzeC/MemHackAPI/e75856a4f871b29611bc0a7fee9781b3e93289fe/MemHackLite.w3m -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MemHackAPI / Memory Hack API 2 | Jass-language based API to enhance Warcraft 3 3 | 4 | What is MemHack? 5 | - Memory Hack or its shorter name "MemHack" is a simple exploit that allows us to escape Jass Virtual Machine and gain access to game's memory directly. This means it's possible to roughly reach a C++ like access via Jass. However, the limitation is Jass itself and the necessity of using bytecode, as we can't really directly invoke C++ code, unless we compile a library (dll) and invoke its code. 6 | 7 | What do I need to compile it? 8 | - https://www.hiveworkshop.com/threads/w3x2lni-v2-7-2.305201/ 9 | - After you download JNPG, download pjass.exe from my project's folder JassHelper and replace it in JassHelper folder where JNPG was installed. 10 | 11 | What World Editor do you suggest for it? 12 | - https://xgm.guru/p/wc3/jassnewgenpack-r 13 | 14 | Which version of Warcraft 3 do you suggest? 15 | - 1.26a 16 | 17 | Does it work on Reforged? 18 | - No 19 | 20 | Will it ever work on Reforged? 21 | - Most likely no, unless someone is kind enough to help me disassemble it, so I can find the needed offsets. And if the memory "exploit" still works. 22 | 23 | What's the point of MemHack? 24 | - It allows any developer to add new functions that do not exist in older versions of Warcraft 3, like the Effect API that I added, or changing unit's model in-game, and so on. 25 | 26 | Credits: 27 | - Unryze 28 | - leandrotp (Hiveworkshop) 29 | - Dracol1ch 30 | - Karaul0v 31 | - ENAlexey 32 | - Lord of the Ding (Hiveworkshop) 33 | - Aniki (Hiveworkshop) 34 | - LeP (Hiveworkshop) 35 | - Vexorian (Hiveworkshop) 36 | --------------------------------------------------------------------------------