Undead Reversal

From Final Fantasy Hacktics Wiki
Revision as of 19:34, 12 April 2022 by Orkney (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
No Parameters - Returns Nothing

Turns HP in HP recovery is Target is not undead
If Target is undead : - Keep HP damage unchanged and 
                      - Nullify 0x80193860 (Current Ability 1st set of canceled status)
----------------------------------------------------------------------------------------
00187350: 3c028019 lui r2,0x8019          
00187354: 8c422d98 lw r2,0x2d98(r2)         |r2 =Target's Data Pointer
00187358: 00000000 nop                      |
0018735c: 90420058 lbu r2,0x0058(r2)        |r2 = Target's 1st set of statuses
00187360: 00000000 nop                      |
00187364: 30420010 andi r2,r2,0x0010        |r2 = 0x10 if Target is undead
00187368: 10400009 beq r2,r0,0x00187390     #If Target is undead
0018736c: 34020080 ori r2,r0,0x0080             |r2 = 0x80
00187370: 3c038019 lui r3,0x8019                |
00187374: 8c632d90 lw r3,0x2d90(r3)             |r3 = Target Current Action (TCA) data pointer 
00187378: 00000000 nop                          |
0018737c: a0620025 sb r2,0x0025(r3)             |Set TCA attack type to HP damage
00187380: 3c018019 lui r1,0x8019                |
00187384: a0203860 sb r0,0x3860(r1)             |Nullify Current Ability 1st set of canceled status (phoenix down ?)
00187388: 08061cf4 j 0x001873d0                 >>jump to  END
0018738c: 00000000 nop                          
00187390: 3c038019 lui r3,0x8019            #Else (Target isn't undead)
00187394: 8c632d90 lw r3,0x2d90(r3)             |r3 = TCA data pointer
00187398: 00000000 nop                          |
0018739c: 90620025 lbu r2,0x0025(r3)            |r2 = TCA Attack type
001873a0: 00000000 nop                          |
001873a4: 3042007f andi r2,r2,0x007f            |r2 = Attack type deprived from HP damage flag (preserves other flags)
001873a8: a0620025 sb r2,0x0025(r3)             |Store TCA updated Attack Type
001873ac: 94620004 lhu r2,0x0004(r3)            |r2 = TCA HP damage
001873b0: 3c048019 lui r4,0x8019                |
001873b4: 8c842d90 lw r4,0x2d90(r4)             |r4 = TCA data pointer
001873b8: a4600004 sh r0,0x0004(r3)             |Nullify TCA HP damage
001873bc: a4620006 sh r2,0x0006(r3)             |Set previous HP damage as HP recovery
001873c0: 90820025 lbu r2,0x0025(r4)            |r2 = TCA Attack type
001873c4: 00000000 nop                          |
001873c8: 34420040 ori r2,r2,0x0040             |r2 = Attack type enhanced with HP recovery
001873cc: a0820025 sb r2,0x0025(r4)             |Store TCA updated Attack Type
001873d0: 03e00008 jr r31                   END
001873d4: 00000000 nop                      

Return Locations

Battle.bin
00188d74: 07 Heal_(Weapon)
00188f28: 0C Heal_F(MA*Y)
00188f80: 0D Heal_(Y)% Hit_F(MA+X)%
001896a4: 23 Heal_(MA*Y)
00189f74: 35 Heal_(Y)% Hit_(PA+X)%
0018a294: 48 Heal_(Z*10)
0018a2dc: 4A Heal_(100)% HealMP_(100)%
0018a390: 4B Heal_(Rdm(1..9)) 100% Status
0018a3c0: 4C Heal_(MA*Y)
0018a774: 57 +Lvl(1) NS 100% Add Status on Caster