diff --git a/system/client-functions/HungryMagSound/HungryMagSound.3___.patch.s b/system/client-functions/HungryMagSound/HungryMagSound.3___.patch.s index 4f511be3..f108e7fc 100644 --- a/system/client-functions/HungryMagSound/HungryMagSound.3___.patch.s +++ b/system/client-functions/HungryMagSound/HungryMagSound.3___.patch.s @@ -17,7 +17,12 @@ start: .data 0x8000BF30 .deltaof code_start, code_end .address 0x8000BF30 -code_start: +code_start: # [std] (TItemMag* this @ r3) -> void + lwz r4, [r3 + 0xF0] + lhz r4, [r4 + 0x1C] # r4 = this->owner_player->entity_id + lwz r5, [r13 - ] # local_client_id + cmpl r4, r5 + bnelr lis r3, 0x0002 ori r3, r3, 0x2825 li r4, 0 diff --git a/system/client-functions/HungryMagSound/HungryMagSound.4___.patch.s b/system/client-functions/HungryMagSound/HungryMagSound.4___.patch.s index ad986bb5..01b2ddaa 100644 --- a/system/client-functions/HungryMagSound/HungryMagSound.4___.patch.s +++ b/system/client-functions/HungryMagSound/HungryMagSound.4___.patch.s @@ -14,16 +14,70 @@ start: .include WriteCodeBlocksXB .data - .data 0x0000000A - .binary E998010000CCCC83C410 + .data 0x0A + .address +hook_call: + jmp hook1 + int 3 + int 3 +hook_ret_sound: + add esp, 0x10 +hook_ret_no_sound: + + .data + .deltaof hook1, hook1_end + .address +hook1: + xor eax, eax + mov dword [esi + 0x00000194], eax + jmp hook2 +hook1_end: .data - .data 0x0000000D - .binary 31C0898694010000505050EB52 + .deltaof hook2, hook2_end + .address +hook2: + mov edx, dword [esi + 0x000000F0] + movzx edx, word [edx + 0x0000001C] # edx = this->owner_player->entity_id + jmp hook3 +hook2_end: .data - .data 0x0000000F - .binary + .deltaof hook3, hook3_end + .address +hook3: + cmp [], edx # local_client_id + jmp hook4 +hook3_end: + + .data + .deltaof hook4, hook4_end + .address +hook4: + jne hook_ret_no_sound + jmp hook5 +hook4_end: + + .data + .deltaof hook5, hook5_end + .address +hook5: + push eax + push eax + push eax + add al, 0x8D + push eax + mov edx, # play_sound + jmp hook6 +hook5_end: + + .data + .deltaof hook6, hook6_end + .address +hook6: + call edx + jmp hook_ret_sound +hook6_end: .data 0x00000000 .data 0x00000000 diff --git a/system/client-functions/HungryMagSound/HungryMagSound.59NL.patch.s b/system/client-functions/HungryMagSound/HungryMagSound.59NL.patch.s index 7e65a892..1eb85479 100644 --- a/system/client-functions/HungryMagSound/HungryMagSound.59NL.patch.s +++ b/system/client-functions/HungryMagSound/HungryMagSound.59NL.patch.s @@ -14,8 +14,12 @@ get_code_size: pop eax push dword [eax] call patch_code_end -patch_code: +patch_code: # [eax] (TItemMag* this @ ecx) -> void mov dword [ecx + 0x01B8], eax + mov eax, [ecx + 0x00F8] + movzx eax, word [eax + 0x001C] # eax = this->owner_player->entity_id + cmp [0x00A9C4F4], eax + jne patch_code_skip_sound push 0 push 0 push 0 @@ -23,6 +27,7 @@ patch_code: mov eax, 0x00814298 call eax add esp, 0x10 +patch_code_skip_sound: ret patch_code_end: push ecx