Difference between revisions of "Ability Usage Checks and MP Reduction"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 0017d850: 27bdff60 addiu r29,r29,0xff60 1ffe70 0017d854: afb5008c sw r21,0x008c(r29) 0017d858: 0080a821 addu r21,r4,r0 0017d85c: afb1007c sw r...")
 
m
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<font face='Courier New'>
+
'''Parameters''' : r4 = Acting unit's data pointer
 
   
 
   
  0017d850: 27bdff60 addiu r29,r29,0xff60 1ffe70
+
  '''Returns''' : r2 = 0x00 if Action can be taken
0017d854: afb5008c sw r21,0x008c(r29)
+
          r2 = 0x08 if Unit is in deep water
0017d858: 0080a821 addu r21,r4,r0
+
          r2 = 0x07 if unit can't act
0017d85c: afb1007c sw r17,0x007c(r29)
+
          r2 = 0x05 if unit is a frog attempting to do non frog things
  0017d860: 00008821 addu r17,r0,r0
+
          r2 = 0x03 if unit does not have enough MP (And action menu = default)
  0017d864: afb20080 sw r18,0x0080(r29)
+
          r2 = 0x02 if unit is silenced and [Action menu = default or monster] and [Ability is silencable]
  0017d868: 00009021 addu r18,r0,r0
+
   
  0017d86c: afb40088 sw r20,0x0088(r29)
+
  If action menu = default : Store MP used/cost at '''0x801938eb''' (Check Half MP too)
0017d870: 27b40010 addiu r20,r29,0x0010
+
  --------------------------------------------------------------------------------------------------
  0017d874: afb30084 sw r19,0x0084(r29)
+
  0017da20: 27bdffd8 addiu r29,r29,-0x0028    |
  0017d878: 00009821 addu r19,r0,r0
+
  0017da24: afb00018 sw r16,0x0018(r29)       |
  0017d87c: afbf0098 sw r31,0x0098(r29)
+
  0017da28: 00808021 addu r16,r4,r0           |{{f/adr|<nowiki>r16 = Acting Unit's Data Pointer</nowiki>}}
  0017d880: afb70094 sw r23,0x0094(r29)
+
  0017da2c: afbf0024 sw r31,0x0024(r29)       |
  0017d884: afb60090 sw r22,0x0090(r29)
+
  0017da30: afb20020 sw r18,0x0020(r29)       |
  0017d888: afb00078 sw r16,0x0078(r29)
+
  0017da34: afb1001c sw r17,0x001c(r29)       |
0017d88c: 90b70047 lbu r23,0x0047(r5)
+
  0017da38: 9202016f lbu r2,0x016f(r16)       |{{f/load|<nowiki>r2 = Acting unit's used skillset</nowiki>}}
  0017d890: 90b60048 lbu r22,0x0048(r5)
+
  0017da3c: 96110170 lhu r17,0x0170(r16)     |{{f/load|<nowiki>r17 = Acting unit's used ability</nowiki>}}
  0017d894: 3c028019 lui r2,0x8019
+
  0017da40: 3c018006 lui r1,0x8006            |
  0017d898: 244208cc addiu r2,r2,0x08cc
+
  0017da44: 00220821 addu r1,r1,r2           |
0017d89c: 02628021 addu r16,r19,r2 r16 = unit data
+
  0017da48: 90325cb4 lbu r18,0x5cb4(r1)       |{{f/load|<nowiki>r18 = Acting units used action menu</nowiki>}} {{f/std|<nowiki> 0x80065cb4 + skillset offset /80065cb4</nowiki>}}
  0017d8a0: 92030001 lbu r3,0x0001(r16)
+
  0017da4c: 3c028019 lui r2,0x8019            |
  0017d8a4: 340200ff ori r2,r0,0x00ff
+
  0017da50: 8c42f5f0 lw r2,-0x0a10(r2)        |{{f/adr|<nowiki>r2 = Action type</nowiki>}} {{f/std|<nowiki> 0x8018f5f0 / 8018f5f0</nowiki>}}
  0017d8a8: 10620042 beq r3,r2,0x0017d9b4 doesn't exist check
+
  0017da54: 3c018019 lui r1,0x8019            |
  0017d8ac: 02402021 addu r4,r18,r0
+
  0017da58: a02038eb sb r0,0x38eb(r1)        |{{f/store|<nowiki>Nullify Current ability used MP ( 0x801938eb)</nowiki>}} {{f/std|<nowiki>801938eb</nowiki>}}
  0017d8b0: 0c05ef74 jal 0x0017bdd0 Check if unit can be targeted
+
  0017da5c: 14400003 bne r2,r0,0x0017da6c    {{f/Cond|<nowiki>If Action type = 0x00 (not reacting)</nowiki>}}
0017d8b4: 27a50068 addiu r5,r29,0x0068
+
  0017da60: 00000000 nop                           |
  0017d8b8: 1440003e bne r2,r0,0x0017d9b4
+
  0017da64: 0c0179ea jal 0x0005e7a8                |{{f/jal|Status_infliction/removal%3F|<nowiki>Status Infliction/Removal?</nowiki>}} store CT and remove every status from set 1 (keeps performing if unit is performing)  
  0017d8bc: 00000000 nop
+
  0017da68: 340500ff ori r5,r0,0x00ff              |{{f/std|<nowiki>r5 = 0x0ff</nowiki>}}
  0017d8c0: 8fa20068 lw r2,0x0068(r29)
+
  0017da6c: 0c0604c3 jal 0x0018130c          |{{f/jal|Weapon_Guard_Usability|<nowiki>Weapon_Guard_Usability</nowiki>}} Returns r2 = 0x00 if unit can react/evade
  0017d8c4: 00000000 nop
+
  0017da70: 02002021 addu r4,r16,r0          |{{f/std|<nowiki>r4 = Unit's Data Pointer</nowiki>}}
0017d8c8: 000210c0 sll r2,r2,0x03
+
  0017da74: 9203005c lbu r3,0x005c(r16)       |{{f/load|<nowiki>r3 = Acting Unit's Current Statuses 5</nowiki>}}
  0017d8cc: 3c018019 lui r1,0x8019
+
  0017da78: 00000000 nop                     |
  0017d8d0: 00220821 addu r1,r1,r2
+
  0017da7c: 30630004 andi r3,r3,0x0004        |{{f/std|<nowiki>r3 = 0x04 if unit has don't act / Else 0x00</nowiki>}}
  0017d8d4: 9022f8d1 lbu r2,-0x072f(r1) load enemy in range flag
+
  0017da80: 10600002 beq r3,r0,0x0017da8c    {{f/Cond|<nowiki>If Acting unit can't act</nowiki>}} /Else branch keeping r2 as returned by above routine
  0017d8d8: 00000000 nop
+
  0017da84: 00000000 nop                           |{{f/std|<nowiki> </nowiki>}}
  0017d8dc: 30420080 andi r2,r2,0x0080
+
  0017da88: 34020001 ori r2,r0,0x0001              |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
  0017d8e0: 10400034 beq r2,r0,0x0017d9b4 branch if not
+
  0017da8c: 14400047 bne r2,r0,0x0017dbac    {{f/Cond|<nowiki>If unit can act</nowiki>}} /Else branch to {{f/loc|<nowiki>END</nowiki>}}
  0017d8e4: 00000000 nop
+
  0017da90: 24420006 addiu r2,r2,0x0006      |{{f/std|<nowiki>r2 = returned value + 0x06 (0x07 or 0x08)</nowiki>}}
  0017d8e8: 3c028019 lui r2,0x8019
+
  0017da94: 9202005a lbu r2,0x005a(r16)           |{{f/load|<nowiki>r2 = Acting unit current status 3</nowiki>}}
0017d8ec: 8c42f4f8 lw r2,-0x0b08(r2) linear attack thing?
+
  0017da98: 00000000 nop                           |
  0017d8f0: 00000000 nop
+
  0017da9c: 30420002 andi r2,r2,0x0002            |{{f/std|<nowiki>r2 = 0x02 if unit is a frog / else 0x00</nowiki>}}
0017d8f4: 1040002b beq r2,r0,0x0017d9a4 branch if not?
+
  0017daa0: 1040000e beq r2,r0,0x0017dadc          {{f/Cond|<nowiki>If acting unit is a frog</nowiki>}} /Else avoid frog section
  0017d8f8: 00000000 nop
+
0017daa4: 00111400 sll r2,r17,0x10                  |
  0017d8fc: 92020047 lbu r2,0x0047(r16) load X
+
  0017daa8: 00021c03 sra r3,r2,0x10                    |{{f/std|<nowiki>r3 = Used Ability ID</nowiki>}}
  0017d900: 00000000 nop
+
  0017daac: 10600005 beq r3,r0,0x0017dac4              {{f/Cond|<nowiki>If used ability <> 0x00</nowiki>}} / If 0x00 branch to skillset check
  0017d904: 02e21823 subu r3,r23,r2
+
  0017dab0: 3402016f ori r2,r0,0x016f                      |{{f/std|<nowiki>r2 = 0x16f (frog attack ID)</nowiki>}}
  0017d908: 04610002 bgez r3,0x0017d914 branch if X distance >= 0
+
  0017dab4: 10620003 beq r3,r2,0x0017dac4                  {{f/Cond|<nowiki>If Used ability <> Frog Attack</nowiki>}} / if frog attack branch to skillset check
  0017d90c: 00000000 nop
+
  0017dab8: 3402001d ori r2,r0,0x001d                          |{{f/std|<nowiki>r2 = 0x01d (Frog ID (spell))</nowiki>}}
  0017d910: 00031823 subu r3,r0,r3
+
  0017dabc: 1462003b bne r3,r2,0x0017dbac                      {{f/Cond|<nowiki>If used ability is Frog (checlk skillset)</nowiki>}} /Else branch to {{f/loc|<nowiki>END</nowiki>}} - r2 = 0x05 (frog using illegal action ?)
  0017d914: 92020048 lbu r2,0x0048(r16)
+
  0017dac0: 34020005 ori r2,r0,0x0005                          |{{f/std|<nowiki>r2 = 5</nowiki>}}
  0017d918: 00000000 nop
+
  0017dac4: 324300ff andi r3,r18,0x00ff                |{{f/std|<nowiki>r3 = Used Action menu</nowiki>}}
  0017d91c: 02c21023 subu r2,r22,r2
+
  0017dac8: 3402000a ori r2,r0,0x000a                  |{{f/std|<nowiki>r2 = 0x0a</nowiki>}}
  0017d920: 04410002 bgez r2,0x0017d92c
+
  0017dacc: 14620004 bne r3,r2,0x0017dae0              {{f/Cond|<nowiki>If Action menu is aim (charge)</nowiki>}}
  0017d924: 00002821 addu r5,r0,r0
+
  0017dad0: 2e220170 sltiu r2,r17,0x0170              |{{f/std|<nowiki>r2 = 0x01 if ability ID < Potion</nowiki>}}
  0017d928: 00021023 subu r2,r0,r2
+
  0017dad4: 0805f6eb j 0x0017dbac                          {{f/jump|<nowiki>jump to </nowiki>{{f/loc|<nowiki>END</nowiki>}}<nowiki> - with r2 = 0x05 (frog using illegal skillset)</nowiki>}}
  0017d92c: 1a20000b blez r17,0x0017d95c
+
  0017dad8: 34020005 ori r2,r0,0x0005                  |{{f/std|<nowiki>r2 = 5</nowiki>}}
  0017d930: 00623821 addu r7,r3,r2
+
  0017dadc: 2e220170 sltiu r2,r17,0x0170          |{{f/std|<nowiki>r2 = 0x01 if ability ID < Potion</nowiki>}}
  0017d934: 02801821 addu r3,r20,r0
+
  0017dae0: 10400031 beq r2,r0,0x0017dba8          {{f/Cond|<nowiki>If Used ability is an ability with data 2 section (< potion)</nowiki>}} /Else branch to {{f/loc|<nowiki>END</nowiki>}} (r2 = 0x00)
  0017d938: 8c620000 lw r2,0x0000(r3)
+
  0017dae4: 00111400 sll r2,r17,0x10                  |
  0017d93c: 00000000 nop
+
  0017dae8: 00021403 sra r2,r2,0x10                    |{{f/std|<nowiki>r2 = Used ability ID</nowiki>}}
  0017d940: 00e2102a slt r2,r7,r2
+
  0017daec: 000218c0 sll r3,r2,0x03                    |{{f/std|<nowiki>r3 = Used ability ID * 8</nowiki>}}
  0017d944: 14400006 bne r2,r0,0x0017d960
+
  0017daf0: 00621823 subu r3,r3,r2                    |{{f/std|<nowiki>r3 = Used ability ID * 7</nowiki>}}
  0017d948: 28a20014 slti r2,r5,0x0014
+
  0017daf4: 00031840 sll r3,r3,0x01                    |{{f/std|<nowiki>r3 = Used ability ID * 14 (Ability data 2 offset)</nowiki>}}
  0017d94c: 24a50001 addiu r5,r5,0x0001
+
  0017daf8: 3c028006 lui r2,0x8006                    |
  0017d950: 00b1102a slt r2,r5,r17
+
  0017dafc: 2442fbf0 addiu r2,r2,-0x0410              |{{f/std|<nowiki>r2 = 0x8005fbf0 (start of ability data 2)</nowiki>}}
  0017d954: 1440fff8 bne r2,r0,0x0017d938
+
  0017db00: 00622021 addu r4,r3,r2                    |{{f/adr|<nowiki>r4 = Acting unit's last used Ability's Data 2 Pointer</nowiki>}}
  0017d958: 24630004 addiu r3,r3,0x0004
+
  0017db04: 324300ff andi r3,r18,0x00ff                |{{f/std|<nowiki>r3 = Used Action menu</nowiki>}}
  0017d95c: 28a20014 slti r2,r5,0x0014
+
  0017db08: 10600003 beq r3,r0,0x0017db18              {{f/Cond|<nowiki>If Used Action menu <> Default</nowiki>}} /Else check silencable abilities
  0017d960: 1040000c beq r2,r0,0x0017d994
+
  0017db0c: 34020006 ori r2,r0,0x0006                      |{{f/std|<nowiki>r2 = 0x06 (Monster menu ID)</nowiki>}}
  0017d964: 34060014 ori r6,r0,0x0014
+
  0017db10: 1462000b bne r3,r2,0x0017db40                  {{f/Cond|<nowiki>If Used Action Menu = Monster</nowiki>}} /Else if menu is not Default nor Monster skip silence checking
  0017d968: 26840050 addiu r4,r20,0x0050
+
  0017db14: 00000000 nop                                      |
  0017d96c: 26a30014 addiu r3,r21,0x0014
+
  0017db18: 90820005 lbu r2,0x0005(r4)                 {{f/Cond|<nowiki>E </nowiki>}}    |{{f/load|<nowiki>r2 = used Ability data 2 Flags 3</nowiki>}}
  0017d970: 9062ffff lbu r2,-0x0001(r3)
+
  0017db1c: 00000000 nop                                      |
  0017d974: 24c6ffff addiu r6,r6,0xffff
+
  0017db20: 30420020 andi r2,r2,0x0020                        |{{f/std|<nowiki>r2 = 0x20</nowiki>}}
  0017d978: a0620000 sb r2,0x0000(r3)
+
  0017db24: 10400006 beq r2,r0,0x0017db40                      {{f/Cond|<nowiki>If Ability is affected by silence</nowiki>}} /Else skip silence checking
  0017d97c: 8c82fffc lw r2,-0x0004(r4)
+
  0017db28: 00000000 nop                                          |{{f/std|<nowiki> </nowiki>}}
  0017d980: 2463ffff addiu r3,r3,0xffff
+
  0017db2c: 92020059 lbu r2,0x0059(r16)                            |{{f/load|<nowiki>r2 = Acting Unit's Current Statuses 2</nowiki>}}
  0017d984: ac820000 sw r2,0x0000(r4)
+
0017db30: 00000000 nop                                          |
0017d988: 00a6102a slt r2,r5,r6
+
  0017db34: 30420008 andi r2,r2,0x0008                            |{{f/std|<nowiki>r2 = 0x08 if acting unit is silenced / Else 0x00</nowiki>}}
  0017d98c: 1440fff8 bne r2,r0,0x0017d970
+
  0017db38: 1440001c bne r2,r0,0x0017dbac                          {{f/Cond|<nowiki>If Unit don't have silence</nowiki>}} /Else if Unit has Silence branch to {{f/loc|<nowiki>END</nowiki>}} - r2 = 0x02
  0017d990: 2484fffc addiu r4,r4,0xfffc
+
  0017db3c: 34020002 ori r2,r0,0x0002                              |{{f/std|<nowiki>r2 = 0x02</nowiki>}}
  0017d994: 00051080 sll r2,r5,0x02
+
  0017db40: 1640001a bne r18,r0,0x0017dbac            {{f/Cond|<nowiki>If Acting unit's used action menu is default</nowiki>}} /If not default branch to {{f/loc|<nowiki>END</nowiki>}} - r2 = 0x00
  0017d998: 00541021 addu r2,r2,r20
+
  0017db44: 00001021 addu r2,r0,r0                    |{{f/std|<nowiki>r2 = 0x00</nowiki>}}
  0017d99c: 0805f66a j 0x0017d9a8
+
  0017db48: 92030003 lbu r3,0x0003(r16)                   |{{f/load|<nowiki>r3 = Acting Unit's Job ID</nowiki>}}
  0017d9a0: ac470000 sw r7,0x0000(r2)
+
  0017db4c: 3402005d ori r2,r0,0x005d                      |{{f/std|<nowiki>r2 = 0x5d (mime job ID)</nowiki>}}
  0017d9a4: 02202821 addu r5,r17,r0
+
  0017db50: 10620016 beq r3,r2,0x0017dbac                  {{f/Cond|<nowiki>If Job is not Mime</nowiki>}} /If unit is a mime branch to {{f/loc|<nowiki>END</nowiki>}} - r2 = 0x00
  0017d9a8: 02a51021 addu r2,r21,r5
+
  0017db54: 00001021 addu r2,r0,r0                        |{{f/std|<nowiki>r2 = 0x00</nowiki>}}
  0017d9ac: a0520000 sb r18,0x0000(r2)
+
  0017db58: 92020090 lbu r2,0x0090(r16)                        |{{f/load|<nowiki>r2 = Acting Unit's Support 2</nowiki>}}
  0017d9b0: 26310001 addiu r17,r17,0x0001
+
  0017db5c: 9084000d lbu r4,0x000d(r4)                        |{{f/load|<nowiki>r4 = used Ability's MP Cost</nowiki>}}
  0017d9b4: 26520001 addiu r18,r18,0x0001
+
  0017db60: 30420080 andi r2,r2,0x0080                        |{{f/std|<nowiki>r2 = 0x80 if Acting unit uses Half MP</nowiki>}}
  0017d9b8: 2a420015 slti r2,r18,0x0015
+
  0017db64: 10400002 beq r2,r0,0x0017db70                      {{f/Cond|<nowiki>If Unit has Half MP</nowiki>}}
  0017d9bc: 1440ffb5 bne r2,r0,0x0017d894
+
  0017db68: 00000000 nop                                          |
  0017d9c0: 267301c0 addiu r19,r19,0x01c0
+
  0017db6c: 00042042 srl r4,r4,0x01                                |{{f/std|<nowiki>r4 = MP cost / 2</nowiki>}}
  0017d9c4: 2a220015 slti r2,r17,0x0015
+
  0017db70: 3c018019 lui r1,0x8019                            |{{f/std|<nowiki>r1 = 0x80190000</nowiki>}}
  0017d9c8: 10400009 beq r2,r0,0x0017d9f0
+
  0017db74: a02438eb sb r4,0x38eb(r1)                          |{{f/store|<nowiki>Store MP Used in current ability MP used</nowiki>}}
  0017d9cc: 02201021 addu r2,r17,r0
+
  0017db78: 8602002c lh r2,0x002c(r16)                         |{{f/load|<nowiki>r2 = Acting unit's current MP</nowiki>}}
  0017d9d0: 340500ff ori r5,r0,0x00ff
+
  0017db7c: 00000000 nop                                      |
  0017d9d4: 02351821 addu r3,r17,r21
+
0017db80: 00402821 addu r5,r2,r0                            |{{f/std|<nowiki>r5 = Acting unit current MP</nowiki>}}
  0017d9d8: 26a40015 addiu r4,r21,0x0015
+
  0017db84: 0044102a slt r2,r2,r4                             |{{f/std|<nowiki>r2 = 0x01 if Unit current MP < Ability MP cost</nowiki>}}
  0017d9dc: a0650000 sb r5,0x0000(r3)
+
  0017db88: 14400008 bne r2,r0,0x0017dbac                      {{f/Cond|<nowiki>If Unit has enough MP</nowiki>}} /Else not enough MP, branch to {{f/loc|<nowiki>END</nowiki>}} With r2 = 0x03
  0017d9e0: 24630001 addiu r3,r3,0x0001
+
  0017db8c: 34020003 ori r2,r0,0x0003                          |{{f/std|<nowiki>r2 = 0x03</nowiki>}}
  0017d9e4: 0064102a slt r2,r3,r4
+
0017db90: 3c038019 lui r3,0x8019                                |{{f/std|<nowiki>r3 = 0x80190000</nowiki>}}
  0017d9e8: 1440fffc bne r2,r0,0x0017d9dc
+
  0017db94: 8c63f5fc lw r3,-0x0a04(r3)                             |{{f/adr|<nowiki>r3 = Action state</nowiki>}} {{f/std|<nowiki> 0x8018f5fc / 8018f5fc</nowiki>}}
  0017d9ec: 02201021 addu r2,r17,r0
+
  0017db98: 34020002 ori r2,r0,0x0002                              |{{f/std|<nowiki>r2 = 0x02</nowiki>}}
  0017d9f0: 8fbf0098 lw r31,0x0098(r29)
+
0017db9c: 10620002 beq r3,r2,0x0017dba8                          {{f/Cond|<nowiki>If Action is not in Preview</nowiki>}}
  0017d9f4: 8fb70094 lw r23,0x0094(r29)
+
  0017dba0: 00a41023 subu r2,r5,r4                                |{{f/std|<nowiki>r2 = Acting unit MP - MP cost</nowiki>}}
  0017d9f8: 8fb60090 lw r22,0x0090(r29)
+
  0017dba4: a602002c sh r2,0x002c(r16)                             |{{f/store|<nowiki>Store Unit new MP</nowiki>}}
  0017d9fc: 8fb5008c lw r21,0x008c(r29)
+
  0017dba8: 00001021 addu r2,r0,r0                '''#E'''          |{{f/std|<nowiki>r2 = 0x00</nowiki>}}
  0017da00: 8fb40088 lw r20,0x0088(r29)
+
  0017dbac: 8fbf0024 lw r31,0x0024(r29)                      
  0017da04: 8fb30084 lw r19,0x0084(r29)
+
  0017dbb0: 8fb20020 lw r18,0x0020(r29)                      
  0017da08: 8fb20080 lw r18,0x0080(r29)
+
  0017dbb4: 8fb1001c lw r17,0x001c(r29)                      
  0017da0c: 8fb1007c lw r17,0x007c(r29)
+
  0017dbb8: 8fb00018 lw r16,0x0018(r29)                      
  0017da10: 8fb00078 lw r16,0x0078(r29)
+
  0017dbbc: 27bd0028 addiu r29,r29,0x0028                     
  0017da14: 27bd00a0 addiu r29,r29,0x00a0
+
  0017dbc0: 03e00008 jr r31                                  
  0017da18: 03e00008 jr r31
+
  0017dbc4: 00000000 nop
  0017da1c: 00000000 nop
+
=== Return locations ===
</font>
+
'''Battle.bin'''
 +
0017ca4c: [[Prep_Current_Action_Data]]
 +
0017df60: [[Big..._Contains_Hamedo_check]]
 +
0017e0f0: [[Big..._Contains_Hamedo_check]]
 +
0017e430: [[Main_reaction_routine%3F]]

Latest revision as of 16:59, 11 May 2024

Parameters : r4 = Acting unit's data pointer

Returns : r2 = 0x00 if Action can be taken
          r2 = 0x08 if Unit is in deep water
          r2 = 0x07 if unit can't act
          r2 = 0x05 if unit is a frog attempting to do non frog things
          r2 = 0x03 if unit does not have enough MP (And action menu = default)
          r2 = 0x02 if unit is silenced and [Action menu = default or monster] and [Ability is silencable]

If action menu = default : Store MP used/cost at 0x801938eb (Check Half MP too)
--------------------------------------------------------------------------------------------------
0017da20: 27bdffd8 addiu r29,r29,-0x0028    |
0017da24: afb00018 sw r16,0x0018(r29)       |
0017da28: 00808021 addu r16,r4,r0           |r16 = Acting Unit's Data Pointer
0017da2c: afbf0024 sw r31,0x0024(r29)       |
0017da30: afb20020 sw r18,0x0020(r29)       |
0017da34: afb1001c sw r17,0x001c(r29)       |
0017da38: 9202016f lbu r2,0x016f(r16)       |r2 = Acting unit's used skillset
0017da3c: 96110170 lhu r17,0x0170(r16)      |r17 = Acting unit's used ability
0017da40: 3c018006 lui r1,0x8006            |
0017da44: 00220821 addu r1,r1,r2            |
0017da48: 90325cb4 lbu r18,0x5cb4(r1)       |r18 = Acting units used action menu  0x80065cb4 + skillset offset /80065cb4
0017da4c: 3c028019 lui r2,0x8019            |
0017da50: 8c42f5f0 lw r2,-0x0a10(r2)        |r2 = Action type  0x8018f5f0 / 8018f5f0
0017da54: 3c018019 lui r1,0x8019            |
0017da58: a02038eb sb r0,0x38eb(r1)         |Nullify Current ability used MP ( 0x801938eb) 801938eb
0017da5c: 14400003 bne r2,r0,0x0017da6c     #If Action type = 0x00 (not reacting)
0017da60: 00000000 nop                           |
0017da64: 0c0179ea jal 0x0005e7a8                |-->Status Infliction/Removal? store CT and remove every status from set 1 (keeps performing if unit is performing) 
0017da68: 340500ff ori r5,r0,0x00ff              |r5 = 0x0ff
0017da6c: 0c0604c3 jal 0x0018130c           |-->Weapon_Guard_Usability Returns r2 = 0x00 if unit can react/evade
0017da70: 02002021 addu r4,r16,r0           |r4 = Unit's Data Pointer
0017da74: 9203005c lbu r3,0x005c(r16)       |r3 = Acting Unit's Current Statuses 5
0017da78: 00000000 nop                      |
0017da7c: 30630004 andi r3,r3,0x0004        |r3 = 0x04 if unit has don't act / Else 0x00
0017da80: 10600002 beq r3,r0,0x0017da8c     #If Acting unit can't act /Else branch keeping r2 as returned by above routine
0017da84: 00000000 nop                           | 
0017da88: 34020001 ori r2,r0,0x0001              |r2 = 0x01
0017da8c: 14400047 bne r2,r0,0x0017dbac     #If unit can act /Else branch to END
0017da90: 24420006 addiu r2,r2,0x0006       |r2 = returned value + 0x06 (0x07 or 0x08)
0017da94: 9202005a lbu r2,0x005a(r16)            |r2 = Acting unit current status 3
0017da98: 00000000 nop                           |
0017da9c: 30420002 andi r2,r2,0x0002             |r2 = 0x02 if unit is a frog / else 0x00
0017daa0: 1040000e beq r2,r0,0x0017dadc          #If acting unit is a frog /Else avoid frog section
0017daa4: 00111400 sll r2,r17,0x10                   |
0017daa8: 00021c03 sra r3,r2,0x10                    |r3 = Used Ability ID
0017daac: 10600005 beq r3,r0,0x0017dac4              #If used ability <> 0x00 / If 0x00 branch to skillset check
0017dab0: 3402016f ori r2,r0,0x016f                      |r2 = 0x16f (frog attack ID)
0017dab4: 10620003 beq r3,r2,0x0017dac4                  #If Used ability <> Frog Attack / if frog attack branch to skillset check
0017dab8: 3402001d ori r2,r0,0x001d                          |r2 = 0x01d (Frog ID (spell))
0017dabc: 1462003b bne r3,r2,0x0017dbac                      #If used ability is Frog (checlk skillset) /Else branch to END - r2 = 0x05 (frog using illegal action ?)
0017dac0: 34020005 ori r2,r0,0x0005                          |r2 = 5
0017dac4: 324300ff andi r3,r18,0x00ff                |r3 = Used Action menu
0017dac8: 3402000a ori r2,r0,0x000a                  |r2 = 0x0a
0017dacc: 14620004 bne r3,r2,0x0017dae0              #If Action menu is aim (charge)
0017dad0: 2e220170 sltiu r2,r17,0x0170               |r2 = 0x01 if ability ID < Potion
0017dad4: 0805f6eb j 0x0017dbac                          >>jump to END - with r2 = 0x05 (frog using illegal skillset)
0017dad8: 34020005 ori r2,r0,0x0005                  |r2 = 5
0017dadc: 2e220170 sltiu r2,r17,0x0170           |r2 = 0x01 if ability ID < Potion
0017dae0: 10400031 beq r2,r0,0x0017dba8          #If Used ability is an ability with data 2 section (< potion) /Else branch to END (r2 = 0x00)
0017dae4: 00111400 sll r2,r17,0x10                   |
0017dae8: 00021403 sra r2,r2,0x10                    |r2 = Used ability ID
0017daec: 000218c0 sll r3,r2,0x03                    |r3 = Used ability ID * 8
0017daf0: 00621823 subu r3,r3,r2                     |r3 = Used ability ID * 7
0017daf4: 00031840 sll r3,r3,0x01                    |r3 = Used ability ID * 14 (Ability data 2 offset)
0017daf8: 3c028006 lui r2,0x8006                     |
0017dafc: 2442fbf0 addiu r2,r2,-0x0410               |r2 = 0x8005fbf0 (start of ability data 2)
0017db00: 00622021 addu r4,r3,r2                     |r4 = Acting unit's last used Ability's Data 2 Pointer
0017db04: 324300ff andi r3,r18,0x00ff                |r3 = Used Action menu
0017db08: 10600003 beq r3,r0,0x0017db18              #If Used Action menu <> Default /Else check silencable abilities
0017db0c: 34020006 ori r2,r0,0x0006                      |r2 = 0x06 (Monster menu ID)
0017db10: 1462000b bne r3,r2,0x0017db40                  #If Used Action Menu = Monster /Else if menu is not Default nor Monster skip silence checking
0017db14: 00000000 nop                                       |
0017db18: 90820005 lbu r2,0x0005(r4)                 #E      |r2 = used Ability data 2 Flags 3
0017db1c: 00000000 nop                                       |
0017db20: 30420020 andi r2,r2,0x0020                         |r2 = 0x20
0017db24: 10400006 beq r2,r0,0x0017db40                      #If Ability is affected by silence /Else skip silence checking
0017db28: 00000000 nop                                           | 
0017db2c: 92020059 lbu r2,0x0059(r16)                            |r2 = Acting Unit's Current Statuses 2
0017db30: 00000000 nop                                           |
0017db34: 30420008 andi r2,r2,0x0008                             |r2 = 0x08 if acting unit is silenced / Else 0x00
0017db38: 1440001c bne r2,r0,0x0017dbac                          #If Unit don't have silence /Else if Unit has Silence branch to END - r2 = 0x02
0017db3c: 34020002 ori r2,r0,0x0002                              |r2 = 0x02
0017db40: 1640001a bne r18,r0,0x0017dbac             #If Acting unit's used action menu is default /If not default branch to END - r2 = 0x00
0017db44: 00001021 addu r2,r0,r0                     |r2 = 0x00
0017db48: 92030003 lbu r3,0x0003(r16)                    |r3 = Acting Unit's Job ID
0017db4c: 3402005d ori r2,r0,0x005d                      |r2 = 0x5d (mime job ID)
0017db50: 10620016 beq r3,r2,0x0017dbac                  #If Job is not Mime /If unit is a mime branch to END - r2 = 0x00
0017db54: 00001021 addu r2,r0,r0                         |r2 = 0x00
0017db58: 92020090 lbu r2,0x0090(r16)                        |r2 = Acting Unit's Support 2
0017db5c: 9084000d lbu r4,0x000d(r4)                         |r4 = used Ability's MP Cost
0017db60: 30420080 andi r2,r2,0x0080                         |r2 = 0x80 if Acting unit uses Half MP
0017db64: 10400002 beq r2,r0,0x0017db70                      #If Unit has Half MP
0017db68: 00000000 nop                                           |
0017db6c: 00042042 srl r4,r4,0x01                                |r4 = MP cost / 2
0017db70: 3c018019 lui r1,0x8019                             |r1 = 0x80190000
0017db74: a02438eb sb r4,0x38eb(r1)                          |Store MP Used in current ability MP used
0017db78: 8602002c lh r2,0x002c(r16)                         |r2 = Acting unit's current MP
0017db7c: 00000000 nop                                       |
0017db80: 00402821 addu r5,r2,r0                             |r5 = Acting unit current MP
0017db84: 0044102a slt r2,r2,r4                              |r2 = 0x01 if Unit current MP < Ability MP cost
0017db88: 14400008 bne r2,r0,0x0017dbac                      #If Unit has enough MP /Else not enough MP, branch to END With r2 = 0x03
0017db8c: 34020003 ori r2,r0,0x0003                          |r2 = 0x03
0017db90: 3c038019 lui r3,0x8019                                 |r3 = 0x80190000
0017db94: 8c63f5fc lw r3,-0x0a04(r3)                             |r3 = Action state  0x8018f5fc / 8018f5fc
0017db98: 34020002 ori r2,r0,0x0002                              |r2 = 0x02
0017db9c: 10620002 beq r3,r2,0x0017dba8                          #If Action is not in Preview
0017dba0: 00a41023 subu r2,r5,r4                                 |r2 = Acting unit MP - MP cost
0017dba4: a602002c sh r2,0x002c(r16)                             |Store Unit new MP
0017dba8: 00001021 addu r2,r0,r0                #E           |r2 = 0x00
0017dbac: 8fbf0024 lw r31,0x0024(r29)                        
0017dbb0: 8fb20020 lw r18,0x0020(r29)                        
0017dbb4: 8fb1001c lw r17,0x001c(r29)                        
0017dbb8: 8fb00018 lw r16,0x0018(r29)                        
0017dbbc: 27bd0028 addiu r29,r29,0x0028                      
0017dbc0: 03e00008 jr r31                                    
0017dbc4: 00000000 nop

Return locations

Battle.bin 
0017ca4c: Prep_Current_Action_Data
0017df60: Big..._Contains_Hamedo_check
0017e0f0: Big..._Contains_Hamedo_check
0017e430: Main_reaction_routine?