From 648da83aa15089b6b9da418040931f07fce5af6e Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Tue, 28 Oct 2025 10:00:43 -0700 Subject: [PATCH] add new patch file --- .../FractionalEXPMultiplier.59NL.patch.s | 63 ------------ .../ServerEXPDisplay.59NL.patch.s | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 63 deletions(-) delete mode 100644 system/client-functions/BlueBurstExclusive/FractionalEXPMultiplier.59NL.patch.s create mode 100644 system/client-functions/BlueBurstExclusive/ServerEXPDisplay.59NL.patch.s diff --git a/system/client-functions/BlueBurstExclusive/FractionalEXPMultiplier.59NL.patch.s b/system/client-functions/BlueBurstExclusive/FractionalEXPMultiplier.59NL.patch.s deleted file mode 100644 index 0d86716e..00000000 --- a/system/client-functions/BlueBurstExclusive/FractionalEXPMultiplier.59NL.patch.s +++ /dev/null @@ -1,63 +0,0 @@ -# This patch changes the 6xDD command to support fractional multipliers. - -.meta name="Fractional EXP multiplier" -.meta description="" -.meta hide_from_patches_menu - -entry_ptr: -reloc0: - .offsetof start -start: - call install_hook - call apply_static_patches - fild st0, dword [0x009F9EE0] - fstp dword [0x009F9EE0], st0 - ret - - - -install_hook: - pop ecx - push 7 - push 0x0078747E - call get_code_size - .deltaof hook_start, hook_end -get_code_size: - pop eax - push dword [eax] - call hook_end -hook_start: # [eax, ebx]() -> void - push edx - fild st0, dword [esp] - fld st0, dword [0x009F9EE0] - fmulp st1, st0 - fistp dword [esp], st0 - pop edx - ret -hook_end: - push ecx - .include WriteCallToCode-59NL - - - -apply_static_patches: - .include WriteCodeBlocksBB - .data 0x00787998 - .deltaof handle_6xDD_start, handle_6xDD_end -handle_6xDD_start: # [std](G_6xDD* cmd @ [esp + 4]) -> void - mov eax, [esp + 4] - test eax, eax - je handle_6xDD_ret - cmp byte [eax + 1], 1 - jg handle_6xDD_use_float - fild st0, word [eax + 2] - jmp handle_6xDD_write_float -handle_6xDD_use_float: - fld st0, dword [eax + 4] -handle_6xDD_write_float: - fstp dword [0x009F9EE0], st0 -handle_6xDD_ret: - ret -handle_6xDD_end: - .data 0x00000000 - .data 0x00000000 diff --git a/system/client-functions/BlueBurstExclusive/ServerEXPDisplay.59NL.patch.s b/system/client-functions/BlueBurstExclusive/ServerEXPDisplay.59NL.patch.s new file mode 100644 index 00000000..91df0b9c --- /dev/null +++ b/system/client-functions/BlueBurstExclusive/ServerEXPDisplay.59NL.patch.s @@ -0,0 +1,99 @@ +# This patch causes the client not to generate its own EXP text and instead use +# the EXP values generated by the server when showing the purple text for enemy +# deaths. This makes EXP gained via EXP share visible, as well as makes +# fractional EXP multiplers (in config.json) display properly. + +.meta name="Server EXP display" +.meta description="" +.meta hide_from_patches_menu + +entry_ptr: +reloc0: + .offsetof start +start: + call install_hook + call apply_static_patches + ret + + + +install_hook: + pop ecx + push 0 # Write address instead of a call/jmp opcode + push 0x00A0FC54 + call get_code_size + .deltaof handle_6xBF_start, handle_6xBF_end +get_code_size: + pop eax + push dword [eax] + call handle_6xBF_end +handle_6xBF_start: # [std](G_6xBF* cmd @ [esp + 4]) -> void + mov edx, [esp + 4] + + cmp byte [edx + 1], 3 + jl skip_text + movzx eax, word [edx + 8] # cmd.from_enemy_id + cmp eax, 0x1000 + jl skip_text + cmp eax, 0x1B50 + jge skip_text + call get_enemy_entity + + test eax, eax + jnz enemy_entity_ok + + # Use player entity if enemy entity is already gone + mov ecx, 0x0068D5AC + mov eax, [0x00A9C4F4] + call ecx # eax = TObjPlayer::for_client_id(local_client_id) + +enemy_entity_ok: + push 0x0000FFFF # entity_id; ignored by TFontSmallTask if not a player + push dword [edx + 4] # amount = cmd.amount + push 0x009783A0 # prefix = L"EXP" + push 0x14 + push 0x14 + push 0xFFFF00FF # color (ARGB) + add eax, 0x300 + push eax # position + mov eax, 0x0078AABC + call eax # TFontSmallTask___new__(...) + add esp, 0x1C + +skip_text: + mov eax, 0x006928C0 # Original handle_6xBF + jmp eax # original_handle_6xBF(cmd) + +get_enemy_entity: + .include GetEnemyEntity-59NL + ret + +handle_6xBF_end: + push ecx + .include WriteCallToCode-59NL + + + +apply_static_patches: + .include WriteCodeBlocksBB + + .data 0x0078749D + .deltaof disable_kill_enemy_callsite_start, disable_kill_enemy_callsite_end +disable_kill_enemy_callsite_start: + nop + nop + nop + nop + nop +disable_kill_enemy_callsite_end: + + .data 0x007765A5 + .deltaof disable_exp_steal_callsite_start, disable_exp_steal_callsite_end +disable_exp_steal_callsite_start: + add esp, 0x0C # Original function has `ret 0x0C` + nop + nop +disable_exp_steal_callsite_end: + + .data 0x00000000 + .data 0x00000000