MP Healing Item Formula

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
MP Healing Item Formula
00188288: 3c038019 lui r3,0x8019            |
0018828c: 906338db lbu r3,0x38db(r3)        |r3 = Current Ability used Item ID
00188290: 3c048019 lui r4,0x8019            |
00188294: 8c842d90 lw r4,0x2d90(r4)         |r4 = Target Current Action (TCA) data pointer
00188298: 00031040 sll r2,r3,0x01           |Item ID * 2
0018829c: 00431021 addu r2,r2,r3            |Item ID * 3
001882a0: 3c018006 lui r1,0x8006            |
001882a4: 00220821 addu r1,r1,r2            |r1 = 80060000 + ID * 3 (Item Offset in Second Table Data)
001882a8: 90233f99 lbu r3,0x3f99(r1)        |r3 = Item Z value  0x80063f98 + 0x01 + Item Offset
001882ac: 34020010 ori r2,r0,0x0010         |r2 = 0x10
001882b0: a0820025 sb r2,0x0025(r4)         |Set TCA Attack Type as MP recovery
001882b4: 00031080 sll r2,r3,0x02           |Z * 4
001882b8: 00431021 addu r2,r2,r3            |Z * 5
001882bc: 00021040 sll r2,r2,0x01           |Z * 10
001882c0: 03e00008 jr r31                   |
001882c4: a482000a sh r2,0x000a(r4)         |Store Z*10 as TCA MP recovery

Return location

Battle.bin
0018b97c - Pre Formula Setup