Difference between revisions of "Item quantity increment for steal/break"
Jump to navigation
Jump to search
(Created page with " Item quantity increment for steal/break? 0018e9e8: 3c028019 lui r2,0x8019 0018e9ec: 8c42f5fc lw r2,-0x0a04(r2) 0018e9f0: 27bdffe0 addiu r29,r29,0xffe0 0018e9f4: afb1001...") |
|||
Line 1: | Line 1: | ||
− | + | 0018e9e8: 3c028019 lui r2,0x8019 | | |
− | 0018e9e8: 3c028019 lui r2,0x8019 | + | Parameters : r4 = Unit data pointer |
− | 0018e9ec: 8c42f5fc lw r2,-0x0a04(r2) | + | r5 = Item ID |
− | 0018e9f0: 27bdffe0 addiu r29,r29, | + | |
− | 0018e9f4: afb10014 sw r17,0x0014(r29) | + | Returns : r2 = Item price / 4 if item is maxed |
− | 0018e9f8: 00808821 addu r17,r4,r0 | + | r2 = 0x00 if not or nothing is done |
− | 0018e9fc: afbf0018 sw r31,0x0018(r29) | + | |
− | 0018ea00: 1440000a bne r2,r0,0x0018ea2c | + | |
− | 0018ea04: afb00010 sw r16,0x0010(r29) | + | Checks number of Items in inventory. |
− | 0018ea08: 922201ba lbu r2,0x01ba(r17) | + | - If < 99 : Add one Item |
− | 0018ea0c: 00000000 nop | + | - If = 99 : Add 25% of Item price to war funds |
− | 0018ea10: 30420030 andi r2,r2,0x0030 | + | -------------------------------------------------------------------------------- |
− | 0018ea14: 14400005 bne r2,r0,0x0018ea2c | + | 0018e9ec: 8c42f5fc lw r2,-0x0a04(r2) |{{f/load|<nowiki>r2 = Action Stata</nowiki>}} |
− | 0018ea18: 30b000ff andi r16,r5,0x00ff | + | 0018e9f0: 27bdffe0 addiu r29,r29,-0x0020 | |
− | 0018ea1c: 12000003 beq r16,r0,0x0018ea2c | + | 0018e9f4: afb10014 sw r17,0x0014(r29) | |
− | 0018ea20: 340200ff ori r2,r0,0x00ff | + | 0018e9f8: 00808821 addu r17,r4,r0 |{{f/std|<nowiki>r17 = Targeted Unit Data pointer</nowiki>}} |
− | 0018ea24: 16020003 bne r16,r2,0x0018ea34 | + | 0018e9fc: afbf0018 sw r31,0x0018(r29) | |
− | 0018ea28: 02002021 addu r4,r16,r0 | + | 0018ea00: 1440000a bne r2,r0,0x0018ea2c {{f/Cond|If Action is being Executed}} /Else Branch to jump to {{f/loc|END}} (r2 = 0x00) |
− | 0018ea2c: 08063aa0 j 0x0018ea80 | + | 0018ea04: afb00010 sw r16,0x0010(r29) | |
− | 0018ea30: 00001021 addu r2,r0,r0 | + | 0018ea08: 922201ba lbu r2,0x01ba(r17) |{{f/load|<nowiki>r2 = Targeted Unit modified ENTD flags</nowiki>}} |
− | 0018ea34: 0c0178a2 jal 0x0005e288 | + | 0018ea0c: 00000000 nop | |
− | 0018ea38: 34050001 ori r5,r0,0x0001 | + | 0018ea10: 30420030 andi r2,r2,0x0030 |{{f/std|r2 <> 0x00 If Targeted Unit is not in player Team}} |
− | 0018ea3c: 28420063 slti r2,r2,0x0063 | + | 0018ea14: 14400005 bne r2,r0,0x0018ea2c {{f/Cond|If Targeted Unit is in player Team}} /Else Branch to jump to {{f/loc|END}} (r2 = 0x00) |
− | 0018ea40: 1040000b beq r2,r0,0x0018ea70 | + | 0018ea18: 30b000ff andi r16,r5,0x00ff |{{f/std|<nowiki>r16 = Targeted Unit 0x1b2 (supposed to be last received attack - seems to be received Item here)</nowiki>}} |
− | 0018ea44: 00001021 addu r2,r0,r0 | + | 0018ea1c: 12000003 beq r16,r0,0x0018ea2c {{f/Cond|If Targeted Unit 0x1b2 <> 0x00}} /Else Branch to jump to {{f/loc|END}} (r2 = 0x00) |
− | 0018ea48: 3c018006 lui r1,0x8006 | + | 0018ea20: 340200ff ori r2,r0,0x00ff |{{f/std|<nowiki>r2 =0x0ff</nowiki>}} |
− | 0018ea4c: 00300821 addu r1,r1,r16 | + | 0018ea24: 16020003 bne r16,r2,0x0018ea34 {{f/Cond|<nowiki>If Targeted Unit 0x1b2 = 0x0ff</nowiki>}} /Else Avoid the jump to END |
− | 0018ea50: 902396e0 lbu r3,-0x6920(r1) | + | 0018ea28: 02002021 addu r4,r16,r0 | |
− | 0018ea54: 00000000 nop | + | 0018ea2c: 08063aa0 j 0x0018ea80 {{f/Cond|E }} {{f/Cond|E }} {{f/Cond|E }} {{f/jump|Jump to }} {{f/loc|END}} r2 = 0x00 |
− | 0018ea58: 24630001 addiu r3,r3,0x0001 | + | 0018ea30: 00001021 addu r2,r0,r0 |{{f/std|<nowiki>r2 = 0x00</nowiki>}} |
− | 0018ea5c: 3c018006 lui r1,0x8006 | + | {{f/Cond|Else (All checks are OK)}} |
− | 0018ea60: 00300821 addu r1,r1,r16 | + | 0018ea34: 0c0178a2 jal 0x0005e288 |{{f/jal|Get_Total_Equipment_Quantity_(Equip_Change/Formation_Screen%3F)|Get_Total_Equipment_Quantity}} |
− | 0018ea64: a02396e0 sb r3,-0x6920(r1) | + | 0018ea38: 34050001 ori r5,r0,0x0001 |{{f/std|<nowiki>r5 = 0x01</nowiki>}} |
− | 0018ea68: 08063aa0 j 0x0018ea80 | + | 0018ea3c: 28420063 slti r2,r2,0x0063 |{{f/std|<nowiki>r2 = 0x01 if Quantity < 0x63 (99)</nowiki>}} |
− | 0018ea6c: 00000000 nop | + | 0018ea40: 1040000b beq r2,r0,0x0018ea70 {{f/Cond|If Item Quantity is less than 99}} |
− | 0018ea70: 02202021 addu r4,r17,r0 | + | 0018ea44: 00001021 addu r2,r0,r0 |{{f/std|<nowiki>r2 = 0x00</nowiki>}} |
− | 0018ea74: 00002821 addu r5,r0,r0 | + | 0018ea48: 3c018006 lui r1,0x8006 | |
− | 0018ea78: 0c063aa6 jal 0x0018ea98 | + | 0018ea4c: 00300821 addu r1,r1,r16 | |
− | 0018ea7c: 02003021 addu r6,r16,r0 | + | 0018ea50: 902396e0 lbu r3,-0x6920(r1) |{{f/load|<nowiki>r3 = Item quantity</nowiki>}} {{f/std|0x800596e0 + Item offset}} |
− | 0018ea80: 8fbf0018 lw r31,0x0018(r29) | + | 0018ea54: 00000000 nop | |
− | 0018ea84: 8fb10014 lw r17,0x0014(r29) | + | 0018ea58: 24630001 addiu r3,r3,0x0001 |{{f/std|<nowiki>r3 = Item quantity + 1</nowiki>}} |
− | 0018ea88: 8fb00010 lw r16,0x0010(r29) | + | 0018ea5c: 3c018006 lui r1,0x8006 | |
− | 0018ea8c: 27bd0020 addiu r29,r29,0x0020 | + | 0018ea60: 00300821 addu r1,r1,r16 | |
− | 0018ea90: 03e00008 jr r31 | + | 0018ea64: a02396e0 sb r3,-0x6920(r1) |{{f/store|store new item quantity}} |
+ | 0018ea68: 08063aa0 j 0x0018ea80 {{f/jump|jump to end}} | ||
+ | 0018ea6c: 00000000 nop | | ||
+ | {{f/Cond|Else (Item at 99)}} | ||
+ | 0018ea70: 02202021 addu r4,r17,r0 |{{f/std|<nowiki>r4 = Targeted Unit Data pointer</nowiki>}} | ||
+ | 0018ea74: 00002821 addu r5,r0,r0 |{{f/std|<nowiki>r5 = 0x00</nowiki>}} | ||
+ | 0018ea78: 0c063aa6 jal 0x0018ea98 |{{f/jal|Add_price_of_item_/_4_to_total_gil|Add_price_of_item_/_4_to_total_gil}} | ||
+ | 0018ea7c: 02003021 addu r6,r16,r0 |{{f/std|<nowiki>r6 = Item ID</nowiki>}} | ||
+ | 0018ea80: 8fbf0018 lw r31,0x0018(r29) | ||
+ | 0018ea84: 8fb10014 lw r17,0x0014(r29) | ||
+ | 0018ea88: 8fb00010 lw r16,0x0010(r29) | ||
+ | 0018ea8c: 27bd0020 addiu r29,r29,0x0020 | ||
+ | 0018ea90: 03e00008 jr r31 | ||
0018ea94: 00000000 nop | 0018ea94: 00000000 nop | ||
+ | === Return locations === | ||
+ | '''Battle.bin''' | ||
+ | 00180948: [[Learn_from_Crystal]] ?? | ||
+ | 0018bf24: [[Main_Reaction_Routine_-_performs_ability_effects]] | ||
+ | 0018c1a8: [[Main_Reaction_Routine_-_performs_ability_effects]] | ||
+ | 0018d498: [[Steal_Routine]] |
Revision as of 21:06, 15 March 2022
0018e9e8: 3c028019 lui r2,0x8019 | Parameters : r4 = Unit data pointer r5 = Item ID Returns : r2 = Item price / 4 if item is maxed r2 = 0x00 if not or nothing is done Checks number of Items in inventory. - If < 99 : Add one Item - If = 99 : Add 25% of Item price to war funds -------------------------------------------------------------------------------- 0018e9ec: 8c42f5fc lw r2,-0x0a04(r2) |r2 = Action Stata 0018e9f0: 27bdffe0 addiu r29,r29,-0x0020 | 0018e9f4: afb10014 sw r17,0x0014(r29) | 0018e9f8: 00808821 addu r17,r4,r0 |r17 = Targeted Unit Data pointer 0018e9fc: afbf0018 sw r31,0x0018(r29) | 0018ea00: 1440000a bne r2,r0,0x0018ea2c #If Action is being Executed /Else Branch to jump to END (r2 = 0x00) 0018ea04: afb00010 sw r16,0x0010(r29) | 0018ea08: 922201ba lbu r2,0x01ba(r17) |r2 = Targeted Unit modified ENTD flags 0018ea0c: 00000000 nop | 0018ea10: 30420030 andi r2,r2,0x0030 |r2 <> 0x00 If Targeted Unit is not in player Team 0018ea14: 14400005 bne r2,r0,0x0018ea2c #If Targeted Unit is in player Team /Else Branch to jump to END (r2 = 0x00) 0018ea18: 30b000ff andi r16,r5,0x00ff |r16 = Targeted Unit 0x1b2 (supposed to be last received attack - seems to be received Item here) 0018ea1c: 12000003 beq r16,r0,0x0018ea2c #If Targeted Unit 0x1b2 <> 0x00 /Else Branch to jump to END (r2 = 0x00) 0018ea20: 340200ff ori r2,r0,0x00ff |r2 =0x0ff 0018ea24: 16020003 bne r16,r2,0x0018ea34 #If Targeted Unit 0x1b2 = 0x0ff /Else Avoid the jump to END 0018ea28: 02002021 addu r4,r16,r0 | 0018ea2c: 08063aa0 j 0x0018ea80 #E #E #E >>Jump to END r2 = 0x00 0018ea30: 00001021 addu r2,r0,r0 |r2 = 0x00 #Else (All checks are OK) 0018ea34: 0c0178a2 jal 0x0005e288 |-->Get_Total_Equipment_Quantity 0018ea38: 34050001 ori r5,r0,0x0001 |r5 = 0x01 0018ea3c: 28420063 slti r2,r2,0x0063 |r2 = 0x01 if Quantity < 0x63 (99) 0018ea40: 1040000b beq r2,r0,0x0018ea70 #If Item Quantity is less than 99 0018ea44: 00001021 addu r2,r0,r0 |r2 = 0x00 0018ea48: 3c018006 lui r1,0x8006 | 0018ea4c: 00300821 addu r1,r1,r16 | 0018ea50: 902396e0 lbu r3,-0x6920(r1) |r3 = Item quantity 0x800596e0 + Item offset 0018ea54: 00000000 nop | 0018ea58: 24630001 addiu r3,r3,0x0001 |r3 = Item quantity + 1 0018ea5c: 3c018006 lui r1,0x8006 | 0018ea60: 00300821 addu r1,r1,r16 | 0018ea64: a02396e0 sb r3,-0x6920(r1) |store new item quantity 0018ea68: 08063aa0 j 0x0018ea80 >>jump to end 0018ea6c: 00000000 nop | #Else (Item at 99) 0018ea70: 02202021 addu r4,r17,r0 |r4 = Targeted Unit Data pointer 0018ea74: 00002821 addu r5,r0,r0 |r5 = 0x00 0018ea78: 0c063aa6 jal 0x0018ea98 |-->Add_price_of_item_/_4_to_total_gil 0018ea7c: 02003021 addu r6,r16,r0 |r6 = Item ID 0018ea80: 8fbf0018 lw r31,0x0018(r29) 0018ea84: 8fb10014 lw r17,0x0014(r29) 0018ea88: 8fb00010 lw r16,0x0010(r29) 0018ea8c: 27bd0020 addiu r29,r29,0x0020 0018ea90: 03e00008 jr r31 0018ea94: 00000000 nop
Return locations
Battle.bin 00180948: Learn_from_Crystal ?? 0018bf24: Main_Reaction_Routine_-_performs_ability_effects 0018c1a8: Main_Reaction_Routine_-_performs_ability_effects 0018d498: Steal_Routine