• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
June 16, 2025, 02:53:32 pm

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


A formula request.

Started by bht, January 28, 2014, 01:48:38 pm

bht

If it's simple enough, could anyone make an ASM that turns either 27-Steal Gil or 28-Steal Exp (if one of them happens to be easier) into:
(MA+PA)/2*Y Status ME (Magic Attack/Defend Up, Shell) (and works outside of ePSXe).
Thanks.

bht

If it helps, I've been using one for another spell that is -almost- what I want:
Drawout to (MA+PA)/2*Y by Pride
<Patch name="DrawOut fomula 20,21,23 to (MA+PA)/2*Y">
  <Location file="BATTLE_BIN" offset="F690C">
1980023c
942d428c
1980033c
942d638c
37004290
36006390
1980013c
21106200
42100200
1980033c
FA386390
CE3822A4
D03823A4
0800E003
00000000
</Location>
<Location file="BATTLE_BIN" offset="1225D4">
4376050C
</Location>
<Location file="BATTLE_BIN" offset="122604">
4376050C
</Location>
<Location file="BATTLE_BIN" offset="12268C">
4376050c
</Location>
</Patch>

I basically need the Formula 20 from there, just on a different slot, magic-evadeable and not tied to the Katana Inventory.
If there is an issue with Steal Gil/Exp, there's several others I'm not using, those two were just the first to pop to mind.
Thanks again.

Glain

So I figured I'd randomly do an ASM request...

I think this should work.  This patch will replace the Steal Exp formula with the one you mentioned.  I don't have anything to test with except emulators (tested with pSX) so you'll have to let me know if it works for you.

 
    <Patch name="Formula 28 edit">
    <Location file="BATTLE_BIN" offset="122870" mode="ASM">
      addiu   sp, sp, -8
      sw      ra, 4(sp)

      jal     0x1885b8              #   Magic Evade
      nop
      bne     v0, zero, formula_end
      nop

      lui     t0, 0x8019
      lw      t1, 0x2d94(t0)        #   Load Attacker's Stats   
      lbu     t2, 0x38fa(t0)        #   Load Ability Y
      lbu     t3, 0x0037(t1)        #   Load Attacker's MA     
      lbu     t4, 0x0036(t1)        #   Load Attacker's PA
      sh      t2, 0x38d0(t0)        #   Store Ability Y as YA

      addu    t5, t3, t4
      addiu   t5, t5, 1
      sra     t5, t5, 1     
      sh      t5, 0x38ce(t0)        #   Store (PA + MA) / 2 as XA

      jal     0x00185ffc            #   Get Elemental Boost
      nop
      jal     0x00188744            #   Magic XA Modifications
      nop
      jal     0x0018877c            #   Magic Damage Calculation
      nop
      bne     v0, zero, formula_end
      nop
      jal     0x001870fc            #   Elemental Absorption
      nop
      jal     0x00187eb4            #   Status
      nop

      formula_end:
          lw      ra, 4(sp)
          addiu   sp, sp, 8
      jr      ra
      nop
    </Location>
  </Patch>
  • Modding version: Other/Unknown