I have a couple formulas I'm working on where simply viewing the attack preview window causes the changes to actually occur, even if you back out before confirming that you want to execute the ability.
Here is one I'm having an issue with:
This is basically Edgar's debilitator tool from FFVI, which causes the target to be weak to a random element. The code begins with a copy/paste of formula 3F (Mustadio's snipe), then most everything from 00188fd4 on down are the element roll and changes. I'm clearly missing something I need since simply running the attack preview and backing out does make the target weak to a random element. Also, if you follow through and confirm the attack, it doesn't yield any XP or JP like normal (but does add an additional weakness on top of the attack preview.)
Anyone know what I'm missing on this?
Here is one I'm having an issue with:
Code Select
00188f90: addiu r29,r29,0xffe8
00188f94: sw r31,0x0010(r29)
00188f98: jal 0x 00185e30 # Loads SP and X
00188f9c: nop
00188fa0: jal 0x 001885f8 # Zodiac Calculation
00188fa4: nop
00188fa8: jal 0x 0018659c # Loads SP + X as X
00188fac: nop
00188fb0: jal 0x 00187510 # Total Accuracy Check
00188fb4: nop
00188fb8: lui r3,0x8019
00188fbc: lw r2,0x2d90(r3)
00188fc0: nop
00188fc4: lbu r2,0x0000(r2)
00188fc8: nop
00188fcc: beq r2,r0,0x00189038 # branch if attack fails
00188fd0: nop
00188fd4: jal 0x0002230c # r3=random number
00188fd8: nop
00188fdc: lui r2,0x8019
00188fe0: ori r5,r0,0x0008 # r5=8
00188fe4: divu r3,r5 # divide random number by 8
00188fe8: lw r4,0x2d98(r2) # load target's data pointer
00188fec: lw r1,0x2d90(r2)
00188ff0: ori r5,r0,0x0001 # r5=1
00188ff4: mfhi r6 # r6=remainder (random from 0...7)
00188ff8: lbu r7,0x006d(r4) # load target's absorb element
00188ffc: lbu r8,0x006e(r4) # load target's null element
00189000: lbu r9,0x006f(r4) # load target's halve element
00189004: lbu r10,0x0070(r4) # load target's weak element
00189008: sllv r6,r5,r6 # shift 1 left by the remainder
0018900c: xori r11,r6,0xff # r11=bit flip of r6
00189010: and r7,r7,r11 # remove element from absorb elements
00189014: and r8,r8,r11 # remove element from null elements
00189018: and r9,r9,r11 # remove element from halve elements
0018901c: or r10,r10,r6 # add element to weak elements
00189020: sb r7,0x006d(r4) # store new absorb elements
00189024: sb r8,0x006e(r4) # store new null elements
00189028: sb r9,0x006f(r4) # store new halve elements
0018902c: sb r10,0x0070(r4) # store new weak elements
00189030: sb r5,0x0000(r1) # store as hit?
00189034: sb r5,0x0025(r1) # store as pseudo status?
00189038: lw r31,0x0010(r29)
0018903c: addiu r29,r29,0x0018
00189040: jr r31
00189044: nop
This is basically Edgar's debilitator tool from FFVI, which causes the target to be weak to a random element. The code begins with a copy/paste of formula 3F (Mustadio's snipe), then most everything from 00188fd4 on down are the element roll and changes. I'm clearly missing something I need since simply running the attack preview and backing out does make the target weak to a random element. Also, if you follow through and confirm the attack, it doesn't yield any XP or JP like normal (but does add an additional weakness on top of the attack preview.)
Anyone know what I'm missing on this?