Difference between revisions of "Steal Gil"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 00186744: 3c028019 lui r2,0x8019 00186748: 8c422d94 lw r2,0x2d94(r2) load attacker stats 0018674c: 27bdffe8 addiu r29,r29,0xffe8 00186750: a...")
 
m
 
Line 1: Line 1:
<font face='Courier New'>
+
No Parameters - Returns Nothing
 
   
 
   
  00186744: 3c028019 lui r2,0x8019
+
Set the amount of stolen gils (Speed * Level)
  00186748: 8c422d94 lw r2,0x2d94(r2) load attacker stats
+
If Target is in Player Team : If war funds are insufficient, Stole gils = War Funds
  0018674c: 27bdffe8 addiu r29,r29,0xffe8
+
                                If War Funds = 0 : force attack to miss
  00186750: afbf0014 sw r31,0x0014(r29)
+
Set Stolen gil value in Attacker Action 0x0c
  00186754: afb00010 sw r16,0x0010(r29)
+
Set lost gil value (same as above but negative) in Target Action 0x0c
  00186758: 90430038 lbu r3,0x0038(r2) load speed
+
Set both Action Type to pseudostatus (disables other flags) 
  0018675c: 90420022 lbu r2,0x0022(r2) load level
+
--------------------------------------------------------------------------------------------
  00186760: 00000000 nop
+
  00186744: 3c028019 lui r2,0x8019           |
  00186764: 00620018 mult r3,r2
+
  00186748: 8c422d94 lw r2,0x2d94(r2)         |{{f/adr|<nowiki>r2 = Attacker data pointer</nowiki>}}
  00186768: 3c028019 lui r2,0x8019
+
  0018674c: 27bdffe8 addiu r29,r29,-0x0018    |
  0018676c: 8c422d98 lw r2,0x2d98(r2) load target stats
+
  00186750: afbf0014 sw r31,0x0014(r29)       |
  00186770: 00000000 nop
+
  00186754: afb00010 sw r16,0x0010(r29)       |
  00186774: 90420005 lbu r2,0x0005(r2) load ENTD
+
  00186758: 90430038 lbu r3,0x0038(r2)       |{{f/load|<nowiki>r3 = Attacker's Speed</nowiki>}}
  00186778: 00000000 nop
+
  0018675c: 90420022 lbu r2,0x0022(r2)       |{{f/load|<nowiki>r2 = Attacker's Level</nowiki>}}
  0018677c: 30420030 andi r2,r2,0x0030
+
  00186760: 00000000 nop                     |
  00186780: 00008012 mflo r16
+
  00186764: 00620018 mult r3,r2               |{{f/std|Speed * Level}}
  00186784: 14400008 bne r2,r0,0x001867a8 branch if not on player team
+
  00186768: 3c028019 lui r2,0x8019           |
  00186788: 00000000 nop
+
  0018676c: 8c422d98 lw r2,0x2d98(r2)         |{{f/adr|<nowiki>r2 = Target data pointer</nowiki>}}
  0018678c: 0c04ed64 jal 0x0013b590 apply inventory change?
+
  00186770: 00000000 nop                     |
  00186790: 3404002c ori r4,r0,0x002c
+
  00186774: 90420005 lbu r2,0x0005(r2)       |{{f/load|<nowiki>r2 = Target ENTD flags</nowiki>}}
  00186794: 00401821 addu r3,r2,r0
+
  00186778: 00000000 nop                     |
  00186798: 0070102a slt r2,r3,r16
+
  0018677c: 30420030 andi r2,r2,0x0030       |{{f/std|<nowiki>r2 = Target Team </nowiki>}}
  0018679c: 10400002 beq r2,r0,0x001867a8
+
  00186780: 00008012 mflo r16                 |{{f/std|<nowiki>r16 = Attacker's Speed*Level</nowiki>}}
  001867a0: 00000000 nop
+
  00186784: 14400008 bne r2,r0,0x001867a8     {{f/Cond|If Target is in Player Team}}
  001867a4: 00608021 addu r16,r3,r0
+
  00186788: 00000000 nop                         |
  001867a8: 16000005 bne r16,r0,0x001867c0
+
  0018678c: 0c04ed64 jal 0x0013b590               |{{f/jal|Get_Script_Variable|Get_Script_Variable}} Returns r2 = War Funds Variable Value
  001867ac: 34030001 ori r3,r0,0x0001
+
  00186790: 3404002c ori r4,r0,0x002c             |{{f/std|<nowiki>r4 = 0x2c (Variable : War Funds)</nowiki>}}
  001867b0: 0c0610c3 jal 0x0018430c force attack miss
+
  00186794: 00401821 addu r3,r2,r0               |{{f/std|<nowiki>r3 = War Funds value</nowiki>}}
  001867b4: 00000000 nop
+
  00186798: 0070102a slt r2,r3,r16               |{{f/std|<nowiki>r2 = 0x01 if Stolen Gils amount > War Funds</nowiki>}}
  001867b8: 08061a00 j 0x00186800
+
  0018679c: 10400002 beq r2,r0,0x001867a8         {{f/Cond|If Stolen Gils amount > War Funds}}
  001867bc: 00000000 nop
+
  001867a0: 00000000 nop                             |
  001867c0: 3c048019 lui r4,0x8019
+
  001867a4: 00608021 addu r16,r3,r0                   |{{f/std|<nowiki>r16 = War Funds Value</nowiki>}}
  001867c4: 8c842d8c lw r4,0x2d8c(r4) load attacker action
+
  001867a8: 16000005 bne r16,r0,0x001867c0   {{f/Cond|<nowiki>If Stolen Gils = 0 Gils (No more money in player War funds)</nowiki>}}
  001867c8: 00000000 nop
+
  001867ac: 34030001 ori r3,r0,0x0001         |{{f/std|<nowiki>r3 = 0x01 </nowiki>}}
  001867cc: a0830000 sb r3,0x0000(r4) store hit
+
  001867b0: 0c0610c3 jal 0x0018430c                   |{{f/jal|Force_Attack_Miss|Force_Attack_Miss}} {{f/std|<nowiki>Hit Flag = Miss Hit% = 0 - Evade type = 0x07</nowiki>}}
  001867d0: 3c028019 lui r2,0x8019
+
  001867b4: 00000000 nop                             |
  001867d4: 8c422d8c lw r2,0x2d8c(r2)
+
  001867b8: 08061a00 j 0x00186800                     {{f/jump|jump to }} {{f/loc|END}}
  001867d8: a490000c sh r16,0x000c(r4) store gil stolen/lost
+
  001867bc: 00000000 nop                             |
  001867dc: a0430025 sb r3,0x0025(r2) store psuedo-status change
+
  001867c0: 3c048019 lui r4,0x8019           {{f/Cond|Else : Stolen Gils > 0}}
  001867e0: 3c028019 lui r2,0x8019
+
  001867c4: 8c842d8c lw r4,0x2d8c(r4)         |{{f/adr|<nowiki>r4 = Attacker Current Action (ACA) data pointer</nowiki>}}
  001867e4: 8c422d8c lw r2,0x2d8c(r2)
+
  001867c8: 00000000 nop                     |
  001867e8: 3c048019 lui r4,0x8019
+
  001867cc: a0830000 sb r3,0x0000(r4)         |{{f/store|Set ACA hit flag to HIT}}
  001867ec: 8c842d90 lw r4,0x2d90(r4)
+
  001867d0: 3c028019 lui r2,0x8019           |
  001867f0: 9442000c lhu r2,0x000c(r2) load gil stolen
+
  001867d4: 8c422d8c lw r2,0x2d8c(r2)         |{{f/adr|<nowiki>r2 = ACA data pointer</nowiki>}}
  001867f4: a0830025 sb r3,0x0025(r4) store in attacker action
+
  001867d8: a490000c sh r16,0x000c(r4)       |{{f/store|Store Stolen Gils amount in ACA stolen gil (0x0c)}}
  001867f8: 00021023 subu r2,r0,r2
+
  001867dc: a0430025 sb r3,0x0025(r2)         |{{f/store|Set ACA Attack type to pseudo status (disables other flags)}}
  001867fc: a482000c sh r2,0x000c(r4) store negative gil amount?
+
  001867e0: 3c028019 lui r2,0x8019           |
  00186800: 8fbf0014 lw r31,0x0014(r29)
+
  001867e4: 8c422d8c lw r2,0x2d8c(r2)         |{{f/adr|<nowiki>r2 = ACA data pointer</nowiki>}}
  00186804: 8fb00010 lw r16,0x0010(r29)
+
  001867e8: 3c048019 lui r4,0x8019           |
  00186808: 27bd0018 addiu r29,r29,0x0018
+
  001867ec: 8c842d90 lw r4,0x2d90(r4)         |{{f/adr|<nowiki>r4 = TCA data pointer</nowiki>}}
  0018680c: 03e00008 jr r31
+
  001867f0: 9442000c lhu r2,0x000c(r2)       |{{f/load|<nowiki>r2 = Gils stolen</nowiki>}}
  00186810: 00000000 nop
+
  001867f4: a0830025 sb r3,0x0025(r4)         |{{f/store|Set TCA Attack type to pseudostatus (disables other flags)}}
</font>
+
  001867f8: 00021023 subu r2,r0,r2           |{{f/std|<nowiki>r2 = Stolen gils (negative value)</nowiki>}}
 +
  001867fc: a482000c sh r2,0x000c(r4)         |{{f/store|Store Lost gils in TCA 0x0c (Stolen/Lost gils)}}
 +
  00186800: 8fbf0014 lw r31,0x0014(r29)      
 +
  00186804: 8fb00010 lw r16,0x0010(r29)      
 +
  00186808: 27bd0018 addiu r29,r29,0x0018    
 +
  0018680c: 03e00008 jr r31                  
 +
  00186810: 00000000 nop                    
 +
=== Return locations ===
 +
'''Battle.bin'''
 +
00186c44: [[Talk_Skill]]
 +
00189860: [[27_StealGil_(CasLVL*SP)_Hit_(SP%2BX)%25]]

Latest revision as of 20:16, 21 April 2022

No Parameters - Returns Nothing

Set the amount of stolen gils (Speed * Level)
If Target is in Player Team : If war funds are insufficient, Stole gils = War Funds
                               If War Funds = 0 : force attack to miss
Set Stolen gil value in Attacker Action 0x0c
Set lost gil value (same as above but negative) in Target Action 0x0c
Set both Action Type to pseudostatus (disables other flags)  
--------------------------------------------------------------------------------------------
00186744: 3c028019 lui r2,0x8019            |
00186748: 8c422d94 lw r2,0x2d94(r2)         |r2 = Attacker data pointer
0018674c: 27bdffe8 addiu r29,r29,-0x0018    |
00186750: afbf0014 sw r31,0x0014(r29)       |
00186754: afb00010 sw r16,0x0010(r29)       |
00186758: 90430038 lbu r3,0x0038(r2)        |r3 = Attacker's Speed
0018675c: 90420022 lbu r2,0x0022(r2)        |r2 = Attacker's Level
00186760: 00000000 nop                      |
00186764: 00620018 mult r3,r2               |Speed * Level
00186768: 3c028019 lui r2,0x8019            |
0018676c: 8c422d98 lw r2,0x2d98(r2)         |r2 = Target data pointer
00186770: 00000000 nop                      |
00186774: 90420005 lbu r2,0x0005(r2)        |r2 = Target ENTD flags
00186778: 00000000 nop                      |
0018677c: 30420030 andi r2,r2,0x0030        |r2 = Target Team 
00186780: 00008012 mflo r16                 |r16 = Attacker's Speed*Level
00186784: 14400008 bne r2,r0,0x001867a8     #If Target is in Player Team
00186788: 00000000 nop                          |
0018678c: 0c04ed64 jal 0x0013b590               |-->Get_Script_Variable Returns r2 = War Funds Variable Value
00186790: 3404002c ori r4,r0,0x002c             |r4 = 0x2c (Variable : War Funds)
00186794: 00401821 addu r3,r2,r0                |r3 = War Funds value
00186798: 0070102a slt r2,r3,r16                |r2 = 0x01 if Stolen Gils amount > War Funds
0018679c: 10400002 beq r2,r0,0x001867a8         #If Stolen Gils amount > War Funds
001867a0: 00000000 nop                              |
001867a4: 00608021 addu r16,r3,r0                   |r16 = War Funds Value
001867a8: 16000005 bne r16,r0,0x001867c0    #If Stolen Gils = 0 Gils (No more money in player War funds)
001867ac: 34030001 ori r3,r0,0x0001         |r3 = 0x01 
001867b0: 0c0610c3 jal 0x0018430c                   |-->Force_Attack_Miss Hit Flag = Miss Hit% = 0 - Evade type = 0x07
001867b4: 00000000 nop                              |
001867b8: 08061a00 j 0x00186800                     >>jump to  END
001867bc: 00000000 nop                              |
001867c0: 3c048019 lui r4,0x8019            #Else : Stolen Gils > 0
001867c4: 8c842d8c lw r4,0x2d8c(r4)         |r4 = Attacker Current Action (ACA) data pointer
001867c8: 00000000 nop                      |
001867cc: a0830000 sb r3,0x0000(r4)         |Set ACA hit flag to HIT
001867d0: 3c028019 lui r2,0x8019            |
001867d4: 8c422d8c lw r2,0x2d8c(r2)         |r2 = ACA data pointer
001867d8: a490000c sh r16,0x000c(r4)        |Store Stolen Gils amount in ACA stolen gil (0x0c)
001867dc: a0430025 sb r3,0x0025(r2)         |Set ACA Attack type to pseudo status (disables other flags)
001867e0: 3c028019 lui r2,0x8019            |
001867e4: 8c422d8c lw r2,0x2d8c(r2)         |r2 = ACA data pointer
001867e8: 3c048019 lui r4,0x8019            |
001867ec: 8c842d90 lw r4,0x2d90(r4)         |r4 = TCA data pointer
001867f0: 9442000c lhu r2,0x000c(r2)        |r2 = Gils stolen
001867f4: a0830025 sb r3,0x0025(r4)         |Set TCA Attack type to pseudostatus (disables other flags)
001867f8: 00021023 subu r2,r0,r2            |r2 = Stolen gils (negative value)
001867fc: a482000c sh r2,0x000c(r4)         |Store Lost gils in TCA 0x0c (Stolen/Lost gils)
00186800: 8fbf0014 lw r31,0x0014(r29)       
00186804: 8fb00010 lw r16,0x0010(r29)       
00186808: 27bd0018 addiu r29,r29,0x0018     
0018680c: 03e00008 jr r31                   
00186810: 00000000 nop                      

Return locations

Battle.bin
00186c44: Talk_Skill
00189860: 27_StealGil_(CasLVL*SP)_Hit_(SP+X)%