Skip to content

Commit 578f2dc

Browse files
committed
update
1 parent fd5333b commit 578f2dc

File tree

6 files changed

+89
-4
lines changed

6 files changed

+89
-4
lines changed

source/code/eSettingsManager.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ void eSettingsManager::Init()
3030

3131
iFreeCameraKeyYawPlus = ini.ReadInteger("Settings", "iFreeCameraKeyYawPlus", 0);
3232
iFreeCameraKeyYawMinus = ini.ReadInteger("Settings", "iFreeCameraKeyYawMinus", 0);
33-
//bDisableComboDamageScaling = ini.ReadBoolean("Settings",)
33+
bDisableComboDamageScaling = ini.ReadBoolean("Settings", "bDisableComboDamageScaling", false);
34+
bEnableNPCVictoryPoses = ini.ReadBoolean("Settings", "bEnableNPCVictoryPoses", false);
3435
}

source/code/eSettingsManager.h

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class eSettingsManager {
1414
bool bEnableConsoleWindow;
1515
bool bDisableComboDamageScaling;
1616
bool bDisableSweatEffects;
17+
bool bEnableNPCVictoryPoses;
1718

1819
int iHookMenuOpenKey;
1920
// free camera keys

source/code/mk10.cpp

+51
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,20 @@ void __fastcall MK10Hooks::HookProcessStuff()
163163
{
164164
TheMenu->Process();
165165

166+
// hot keys
167+
168+
if (MK10::GetCharacterObject(PLAYER1) && MK10::GetCharacterObject(PLAYER2))
169+
{
170+
if (GetAsyncKeyState(VK_CONTROL))
171+
{
172+
if (GetAsyncKeyState(VK_F2))
173+
((void(__fastcall*)())GetMKXAddr(0x14055FE90))();
174+
if (GetAsyncKeyState(VK_F3))
175+
MK10::SlowGameTimeForXTicks(TheMenu->fSlowMotionSpeed, TheMenu->iSlowMotionTicks);
176+
}
177+
178+
}
179+
166180
if (TheMenu->bInfiniteHealthPlayer1)
167181
{
168182
if (MK10::GetCharacterObject(PLAYER1))
@@ -225,6 +239,8 @@ void __fastcall MK10Hooks::HookProcessStuff()
225239
MK10::SetCharacterPosition(&TheMenu->plrPos, PLAYER2);
226240
}
227241

242+
243+
228244

229245

230246
((void(__fastcall*)())GetMKXAddr(0x140CB2BA0))();
@@ -487,3 +503,38 @@ void __fastcall MK10Hooks::Hook30To60Swap(int64 game, int a2)
487503
{
488504
((void(__fastcall*)(int,int))GetMKXAddr(0x140495110))(game,a2);
489505
}
506+
507+
void __fastcall MK10Hooks::HookDamageMultiplier(int64 ptr, float mult)
508+
{
509+
if (SettingsMgr->bDisableComboDamageScaling)
510+
mult = 1.0f;
511+
512+
((void(__fastcall*)(int64, float))GetMKXAddr(0x14055D7E0))(ptr, mult);
513+
}
514+
515+
void __fastcall MK10Hooks::HookDamageMultiplierTwo(int64 ptr, float mult)
516+
{
517+
if (SettingsMgr->bDisableComboDamageScaling)
518+
mult = 1.0f;
519+
520+
((void(__fastcall*)(int64, float))GetMKXAddr(0x14055D3B0))(ptr, mult);
521+
}
522+
523+
void __fastcall MK10Hooks::HookDamageMultiplierThree(int64 ptr, float mult)
524+
{
525+
if (SettingsMgr->bDisableComboDamageScaling)
526+
mult = 1.0f;
527+
((void(__fastcall*)(int64, float))GetMKXAddr(0x140549CE0))(ptr, mult);
528+
}
529+
530+
int64 __fastcall MK10Hooks::HookGetCharacterVictory(const char * name, const char * packageID, char * packageName, int packageBuffer)
531+
{
532+
const char* newName = name;
533+
534+
if (strcmp(name, "rain_a") == 0)
535+
{
536+
newName = "char_kunglao_a";
537+
}
538+
539+
return ((int64(__fastcall*)(const char*, const char*, char*, int))GetMKXAddr(0x140553850))(newName,packageID,packageName,packageBuffer);
540+
}

source/code/mk10.h

+5
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ namespace MK10Hooks {
6565
int64 __fastcall HookIsEasyFatalityAvailable(const char* name);
6666

6767
void __fastcall Hook30To60Swap(int64 game, int a2);
68+
69+
void __fastcall HookDamageMultiplier(int64 ptr, float mult);
70+
void __fastcall HookDamageMultiplierTwo(int64 ptr, float mult);
71+
void __fastcall HookDamageMultiplierThree(int64 ptr, float mult);
72+
int64 __fastcall HookGetCharacterVictory(const char* name, const char* packageID, char* packageName, int packageBuffer);
6873
}
6974

7075

source/code/mk10menu.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void MK10Menu::Process()
180180
void MK10Menu::Draw()
181181
{
182182
ImGui::GetIO().MouseDrawCursor = true;
183-
ImGui::Begin("MKXHook by ermaccer (0.5)");
183+
ImGui::Begin("MKXHook by ermaccer (0.5.2)");
184184
if (ImGui::Button("Character Modifier")) iCurrentTab = TAB_CHARACTER_MODIFIER;
185185
ImGui::SameLine();
186186
if (ImGui::Button("Stage Modifier")) iCurrentTab = TAB_STAGE_MODIFIER;
@@ -332,7 +332,7 @@ void MK10Menu::Draw()
332332
if (iCurrentTab == TAB_MISC)
333333
{
334334
bool swap = ImGui::Button("Swap Player Positions");
335-
ImGui::SameLine(); ShowHelpMarker("Shortcut - TODO");
335+
ImGui::SameLine(); ShowHelpMarker("Shortcut - CTRL+F2");
336336
if (swap)
337337
((void(__fastcall*)())GetMKXAddr(0x14055FE90))();
338338

@@ -351,14 +351,15 @@ void MK10Menu::Draw()
351351
ImGui::Text("Gamespeed Control");
352352
ImGui::SameLine();
353353
bool slowmo = ImGui::Button("Apply");
354-
ImGui::SameLine(); ShowHelpMarker("Shortcut - TODO");
354+
ImGui::SameLine(); ShowHelpMarker("Shortcut - CTRL+F3");
355355
if (slowmo)
356356
MK10::SlowGameTimeForXTicks(fSlowMotionSpeed, iSlowMotionTicks);
357357

358358
ImGui::SliderFloat("Speed", &fSlowMotionSpeed, 0.0f, 2.0f);
359359
ImGui::InputInt("Ticks", &iSlowMotionTicks, 1000,10000);
360360

361361

362+
ImGui::Checkbox("Disable Combo Damage Scaling", &SettingsMgr->bDisableComboDamageScaling);
362363

363364
}
364365
if (iCurrentTab == TAB_CHEATS)

source/dllmain.cpp

+26
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,27 @@ void OnInitializeHook()
8888
InjectHook(GetMKXAddr(0x1402082B0), tramp->Jump(GenericDummy), PATCH_JUMP);
8989
}
9090

91+
if (SettingsMgr->bDisableComboDamageScaling)
92+
{
93+
InjectHook(GetMKXAddr(0x1400579EB), tramp->Jump(MK10Hooks::HookDamageMultiplier));
94+
InjectHook(GetMKXAddr(0x1401C27DC), tramp->Jump(MK10Hooks::HookDamageMultiplier));
95+
InjectHook(GetMKXAddr(0x14037791F), tramp->Jump(MK10Hooks::HookDamageMultiplier));
96+
InjectHook(GetMKXAddr(0x14043E5D7), tramp->Jump(MK10Hooks::HookDamageMultiplier));
97+
InjectHook(GetMKXAddr(0x14054B82B), tramp->Jump(MK10Hooks::HookDamageMultiplier));
98+
99+
InjectHook(GetMKXAddr(0x14005AD7B), tramp->Jump(MK10Hooks::HookDamageMultiplierTwo));
100+
InjectHook(GetMKXAddr(0x1401E70C8), tramp->Jump(MK10Hooks::HookDamageMultiplierTwo));
101+
InjectHook(GetMKXAddr(0x140203ADA), tramp->Jump(MK10Hooks::HookDamageMultiplierTwo));
102+
InjectHook(GetMKXAddr(0x1402040BC), tramp->Jump(MK10Hooks::HookDamageMultiplierTwo));
103+
InjectHook(GetMKXAddr(0x14043E5E7), tramp->Jump(MK10Hooks::HookDamageMultiplierTwo));
104+
InjectHook(GetMKXAddr(0x140440BE3), tramp->Jump(MK10Hooks::HookDamageMultiplierTwo));
105+
106+
InjectHook(GetMKXAddr(0x1400561AB), tramp->Jump(MK10Hooks::HookDamageMultiplierThree));
107+
InjectHook(GetMKXAddr(0x14043347F), tramp->Jump(MK10Hooks::HookDamageMultiplierThree));
108+
InjectHook(GetMKXAddr(0x1404334FF), tramp->Jump(MK10Hooks::HookDamageMultiplierThree));
109+
110+
}
111+
91112
InjectHook(GetMKXAddr(0x1400A171A), tramp->Jump(MK10Hooks::HookCamSetRot));
92113
InjectHook(GetMKXAddr(0x14016F579), tramp->Jump(MK10Hooks::HookCamSetRot));
93114
InjectHook(GetMKXAddr(0x14017C81D), tramp->Jump(MK10Hooks::HookCamSetRot));
@@ -119,5 +140,10 @@ void OnInitializeHook()
119140
InjectHook(GetMKXAddr(0x14030ADF3), tramp->Jump(MK10Hooks::HookCamSetPos));
120141
InjectHook(GetMKXAddr(0x14058D161), tramp->Jump(MK10Hooks::HookCamSetPos));
121142

143+
if (SettingsMgr->bEnableNPCVictoryPoses)
144+
{
145+
InjectHook(GetMKXAddr(0x1405543B6), tramp->Jump(MK10Hooks::HookGetCharacterVictory));
146+
}
147+
122148

123149
}

0 commit comments

Comments
 (0)