cemu_graphic_packs/Mods/XenobladeX/XenobladeX_mod_LootMaterialsDrop/patches.txt

63 lines
2.0 KiB
Plaintext
Raw Normal View History

[XCX_LOOT_MATERIALS]
moduleMatches = 0xF882D5CF, 0x30B6E091, 0xAB97DE6B ; 1.0.1E, 1.0.2U, 1.0.1U
codeCaveSize = 0x90
; ----------------------------------------------------------------------------
; WHO : __CPR90__calcItemBronze__Q2_8ItemDrop16CItemDropManagerFRQ3_J19JJ28J9SDropInfoUc
; WHAT : Affect the drop ratio of materials
0x00000000 = .byte $mod
_ratio = 0x00000000
_minDropRate = 0x00000004
0x00000004 = lis r11, _ratio@ha
0x00000008 = lbz r11, _ratio@l(r11)
0x0000000C = li r31, 0
0x00000010 = cmpwi r11, 0
0x00000014 = beqlr
0x00000018 = cmpw r31, r11 ; this value is the default drop ratio under which we want to set a new drop ratio (logically equal or greater)
0x0000001C = blt .+0x8
0x00000020 = b .+0x8
0x00000024 = mr r31, r11 ; here you set the new drop ratio
0x00000028 = cmpw r3, r31
0x0000002C = blr
0x021AF5DC = bla _minDropRate ; modify drop ratio for bronze chests
0x021AF614 = bla _minDropRate ; modify drop ratio for silver chests
0x021AF5F8 = bla _minDropRate ; modify drop ratio for gold chests
; ----------------------------------------------------------------------------
; WHO : __CPR90__calcItemBronze__Q2_8ItemDrop16CItemDropManagerFRQ3_J19JJ28J9SDropInfoUc
; WHAT : random selection when all materials at 100% and more than 5
_saveEquipCnt = 0x00000030
0x00000030 = mr r30, r4
0x00000034 = lwz r13, 0xE0(r30)
0x00000038 = blr
0x021AF334 = bla _saveEquipCnt
_mtRand = 0x030FA650
_fixit = 0x00000040
0x00000040 = li r12, 0
0x00000044 = sub r3, r4, r13 ; r13 = equipment count, r4 = all item count, r3 = material count
0x00000048 = li r8, 4
0x0000004C = sub r8, r8, r13
0x00000050 = cmpw r3, r8 ; slots 0 to 4-r13 are used by equipment
0x00000054 = blelr
0x00000058 = li r3, 6
0x0000005C = mflr r31
0x00000060 = lis r8, _mtRand@ha
0x00000064 = addi r8, r8, _mtRand@l
0x00000068 = mtctr r8
0x0000006C = bctrl
0x00000070 = mtlr r31
0x00000074 = add r3, r3, r13 ; 0+r13 to 4
0x00000078 = cmpwi r3, 4 ; r13 to 4 are the possible slots, others are ignored
0x0000007C = bgtlr
0x00000080 = mr r4, r3
0x00000084 = blr
0x021AF620 = bla _fixit