Current Action Data Nulling

From Final Fantasy Hacktics Wiki
Revision as of 20:44, 1 December 2021 by Orkney (talk | contribs) (Notes in return links)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Need r4 = Unit data pointer 
Reset most of unit action data from 0x00 to 0x29   --> See Current Action Data
Preserve : - Current action reaction ID (halfword at +0x0e)
           - Last attack recieved ID (halfword at +0x26)
Set hit% to 100% and hit flag to "hit"
----------------------------------------------
0018bd74: 27bdffe8 addiu r29,r29,0xffe8     |
0018bd78: afb00010 sw r16,0x0010(r29)       |
0018bd7c: 00808021 addu r16,r4,r0           |r16 = Unit's Current Action Data ( = UCAD) Pointer  
0018bd80: afbf0014 sw r31,0x0014(r29)       |
0018bd84: 0c017991 jal 0x0005e644           |-->Data Nullifying Nullify data from UCAD 0x00 (hit flag) to UCAD 0x0d (gil stolen)
0018bd88: 3405000e ori r5,r0,0x000e         |r5 = 0x0e (number of byte to delete)
0018bd8c: 26040010 addiu r4,r16,0x0010      |r4 = UCADP + 0x10
0018bd90: 0c017991 jal 0x0005e644           |-->Data Nullifying Nullify data from UCAD 0x10 (special flags) to UCAD 0x25 (Attack type)
0018bd94: 34050016 ori r5,r0,0x0016         |r5 = 0x16 (number of byte to delete)
0018bd98: 26040028 addiu r4,r16,0x0028      |r4 = UCDAP + 0x28
0018bd9c: 0c017991 jal 0x0005e644           |-->Data Nullifying Nullify data from UCAD 0x28 and UCAD 0x29 (stolen xp and jp)
0018bda0: 34050002 ori r5,r0,0x0002         |r5 = 0x02 (number of byte to delete)
0018bda4: 02002021 addu r4,r16,r0           |r4 = Unit's Current Action Data Pointer
0018bda8: 34020064 ori r2,r0,0x0064         |r2 = 0x064 (=100)
0018bdac: a482002a sh r2,0x002a(r4)         |Store UCAD Hit% = 100%
0018bdb0: 34020001 ori r2,r0,0x0001         |r2 = 0x01
0018bdb4: a0800025 sb r0,0x0025(r4)         |Store UCAD Attack Type = 0 (Already done above ?)
0018bdb8: 0c062f75 jal 0x0018bdd4           |-->Null Some Status Data Nullify UCAD Statuses infliction and removal sections - Nullify UCAD status to cancel ( 0x80193860 )
0018bdbc: a0820000 sb r2,0x0000(r4)         |Store UCAD Hit Flag = Hit
0018bdc0: 8fbf0014 lw r31,0x0014(r29)       |End
0018bdc4: 8fb00010 lw r16,0x0010(r29)       
0018bdc8: 27bd0018 addiu r29,r29,0x0018     
0018bdcc: 03e00008 jr r31                   
0018bdd0: 00000000 nop     

Return Locations

0017ced4: Main_ability_loading_routine? - Attacker current action (at 0x801908cc + Attacker ID)
0017cef0: Main_ability_loading_routine? - at 0x80192da0 (copy of attacker action ?)
0017f248: Calculate_Projected_Action_Effect
00180040: Set_target_for_mounted_unit,_move_find_item/trap
00180924: Learn_from_Crystal
00183098: Death_sentence,_crystalization,_treasurization,_etc
0018ae0c: Action data nulling - Target current action
0018ae1c: Action data nulling - Attacker current action
0018da34: Set_Action_Target_Variables
0018db28: Poison_Marsh_Routine 
0018dc2c: Traps_Routine
0018dd7c: Move-HP_Up,_Move-MP_Up,_Gained_Exp_Up