Final Fantasy Hacktics

Modding => PSX FFT Hacking => Topic started by: Timbo on December 05, 2013, 10:24:32 pm

Title: Has anyone managed to create a functioning Jump Ability?
Post by: Timbo on December 05, 2013, 10:24:32 pm
This is not a request or anything, I was just wondering if anybody has all ready managed to cobble together a working Jump ability that jumps and lands normally, that can be used in a normal skillset? If you have done it, would you mind sharing it?
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on December 06, 2013, 10:46:40 am
No one has done that asm to the best of my knowledge (unless FDC is hiding things) its also not particularly easy as well.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Timbo on December 06, 2013, 12:31:22 pm
Thanks Pride. I just don't want to overlook somethin potentiallly huge for my patch. The closest I've seen is using ALMA to attach Izlude's Jump to an unused support skill. While this works fine and allows you to create a fully fleshed out Lancer skillset, it uses Alma which is probably too big for a full patch, like mine.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: 3lric on December 06, 2013, 01:20:26 pm
Alma is also a bit broken and causes issues when trying to use certain emulators or trying to play a mod on the PSP or other hardware that isn't
ePSXe
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on December 06, 2013, 01:23:03 pm
I have an asm to attach Jump to a job ala ALMA, I'll find it for you later.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Timbo on December 06, 2013, 07:43:11 pm
I appreciate that Pride, but is that safe? Doesn't adding it to a job in addition to their two skillsets allow a player to add defend and exceed the maximum number of battle commands/menus?
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on December 06, 2013, 08:36:25 pm
Pretty sure its programmed to handle both change equip and defend if they are both innate, don't see why this would be an issue. Your welcome to test it.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Timbo on December 06, 2013, 08:42:37 pm
No, I believe you. This is something I may or may not have read a long time ago. If you find the ASM I'd be happy to test it.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Celdia on December 07, 2013, 07:08:28 am
Quote from: Jack of All Trades on December 06, 2013, 07:43:11 pm
I appreciate that Pride, but is that safe? Doesn't adding it to a job in addition to their two skillsets allow a player to add defend and exceed the maximum number of battle commands/menus?


I had a lot of stacking possible in CCP 2nd. There is a limit to the number of extra skills that can show up on the action list but going over it doesn't break anything...you just can't reach the last one. I know you can manage two extra without 'losing' any of them. I know I decided to specifically set things up in my patch so you couldn't ever put more of them than you could access on at once. Since I have jobs with EC and Jump innate to their skillsets [which is also a fun idea instead of binding to the job] and I removed the Defend support skill, that would likely mean it can't handle 3 extra without more ASM applied.

Of course the only problem with binding Jump to a job/skillset is the unit will get them for 'free' with the class. You can't make them pay JP for the different Level/Distance tiers. It'll just be the highest of each that you put in the skillset.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Timbo on December 07, 2013, 10:21:05 am
When I was playing with ALMA at first I added Jump to the Lancer skillset as well. If I remember correctly I had to do it once for when it was a primary skillset and again for when it was a secondary. I later decided that Jump needs to have some sort of JP cost so I bound it to a support which I made innate for Lancers.

Beggers can't be choosers. Celdia, did you use ALMA for your patch or did you use an ASM hack and if so, would you be willing to share it with me?
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on December 07, 2013, 02:26:05 pm
She used ALMA, I have mine and it's easy enough to tie it to a support skill, just need to change the check from job Id to a support.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Timbo on December 07, 2013, 03:46:20 pm
You guys are awesome. Thank you.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on December 07, 2013, 04:05:15 pm
Well what support do you want to replace silly
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Timbo on December 07, 2013, 05:12:40 pm
The 1st blank support under Non-Charge seems like a pretty good spot.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Celdia on December 07, 2013, 05:26:06 pm
Quote from: Jack of All Trades on December 07, 2013, 10:21:05 am
When I was playing with ALMA at first I added Jump to the Lancer skillset as well. If I remember correctly I had to do it once for when it was a primary skillset and again for when it was a secondary. I later decided that Jump needs to have some sort of JP cost so I bound it to a support which I made innate for Lancers.

Beggers can't be choosers. Celdia, did you use ALMA for your patch or did you use an ASM hack and if so, would you be willing to share it with me?


Yeah, you have to set it for when it's Primary and again for Secondary in ALMA. Pride has the right of it though, use his way. I use ALMA for a whole bunch of shit and that is the only reason anyone should use it at all. I love what it cando but holy fuck is it a huge headache. If you can find any functional alternative to it, do so. I've had to find some creative workarounds for the problems it causes and there are a few things I've just been like "well....fuck it" over and dealt with the problems. However, to its credit, it has come a long way from the first version I used.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Timbo on December 07, 2013, 06:00:39 pm
Honestly, I was not expecting to get any response at all. This is a very awesome and unexpected surprise. I have to go back to my plans and redo a few things, but its totally worth it. I'm very excited.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on December 07, 2013, 06:06:57 pm
Over two year old hack so testing is probably required, I did make sure it worked right now but you never know... As always copy + paste the code below, save as a .xml in the same folder as FFTorgASM and apply. Enjoy!


<?xml version="1.0" encoding="utf-8" ?>
<Patches> 
<Patch name="Support Equip Jump">
    <Description>Support skill below Non-Charge gives access to skillset x34</Description>
<Location file="BATTLE_BIN" offset="F762C">
      E8FFBD27
  1000BFAF
  92004392
  00000000
  02006330
  03006010
  21302002
  7E69060C
  34000534
  12004392
  1000BF8F
  1800BD27
  0800E003
  00000000
  92006590
  00000000
  0200A230
  04004010
  00000000
  34000234
  000002A2
  01001026
  FF000234
  000002A2
  0800E003
  00000000
</Location>
<Location file="BATTLE_BIN" offset="11A4F0">
  9979050C
  00000000
</Location>
<Location file="BATTLE_BIN" offset="13347C">
  8B79050C
</Location>
  </Patch>
</Patches>


Edit: It uses skillset x34 aka Izlude's Jump, not the lancer Jump as an fyi.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Timbo on December 07, 2013, 06:22:39 pm
Thanks Pride, I'll test this as soon as I get a chance.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Vanya on December 08, 2013, 03:59:32 am
Hey, Pride. If I wanted to change which skill set this patch binds to a support skill and which support skill it's bound to which hex values would I change?
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on December 08, 2013, 04:12:00 am
<?xml version="1.0" encoding="utf-8" ?>
<Patches> 
<Patch name="Support Equip Jump">
    <Description>Support skill below Non-Charge gives access to skillset x34</Description>
   <Location file="BATTLE_BIN" offset="F762C">
      E8FFBD27
     1000BFAF
     92004392
     00000000
     02006330
     03006010
     21302002
     7E69060C
     34000534
     12004392
     1000BF8F
     1800BD27
     0800E003
     00000000
     92006590
     00000000
     0200A230
     04004010
     00000000
     34000234
     000002A2
     01001026
     FF000234
     000002A2
     0800E003
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="11A4F0">
     9979050C
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="13347C">
     8B79050C
   </Location>
  </Patch>
</Patches>

x92 is the support set, x02 is the specific support skill in the set, and x34 is the skillset.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Timbo on December 08, 2013, 05:56:02 pm
I had time to test it a bit today. It seems to work just fine.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Vanya on December 09, 2013, 03:37:58 am
Groovie! Thanks for that, Pride.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Aqueous on March 24, 2015, 05:04:55 pm
Hi Pride,

Is it possible to attach a skillset to another skillset? I'd like to attach Jump to another skillset so I can give Dragoons worthwhile skills but keep their Jump ability. I've tried editing your code to change it from a support to a skillset lookup but I break the game!

Thanks in advance.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Choto on March 25, 2015, 08:18:09 am
Aqueous, we will make this hack your first hack. It's very simple and even more so since pride provided the framework. However, I Probly won't be able to give you detailed instructions until this weekend. If you want you can probably figure it out though.

Prides hack checks if a unit has a certain support ability equipped (from 0x92 status set). All you need to do is check if the units equipped skillset = whatever you want it to attach to. Check unit data (801908cc in data locations) for which bytes are primary and secondary skillset (I think they're 0x12 and 0x13). So instead of loading 0x92,  we load 0x12. Then put the value of the skillset you want it to attach to in a register, then do a bne comparing the two.

you could even apply Prides hack and step through it to understand what's going on. Good luck

Also get used to breaking the game lol. Again step through your routine and see why your code fails, then fix it. Just a part of the business.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Aqueous on March 25, 2015, 03:12:43 pm
Yep, tried that and bricked the game. I'll try again :)

EDIT: Ok, it's not crashing the game anymore and I know why it was to begin with - something really silly - and the code wasn't correctly injected into Battle.BIN so Disassembly had a bunch of "illegal" in that section of the code.

However, now instead the hack just isn't working! What's weird though is that I can't seem to see this code even being referenced. I've set a breakpoint on the offset for the jump (0x1814F0), both read/write AND execute, and nothing ever triggers.

Weirdly though I've tried with the default hack...and the same thing. Tried it on a Vanilla ISO as well, hm...
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on March 25, 2015, 10:05:26 pm
That hack should work, its one I've made a long time ago and I made sure it was tested before posting it.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Choto on March 25, 2015, 11:07:30 pm
well first things first, lets talk about breakpoints. An execute breakpoint will stop the game when that code is reached and about to be executed. Read/Write breakpoints occur when the unit loads or stores a value to that address.

Also be aware that if you reload a savestate, your hack will be overwritten. I don't suspect that's happening here, but just figure'd I'd state it.

if you can't figure it out, post a savestate and I'll check into it.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Aqueous on March 26, 2015, 06:05:25 am
Quote from: Pride on March 25, 2015, 10:05:26 pm
That hack should work, its one I've made a long time ago and I made sure it was tested before posting it.


I know...other people have posted right here saying it's working great. I also looked at the routine where you've inserted the jump and you've stuck it right in where the Defend/Equip Change check is so...that should be working.

I would say I just screwed up installing it but I've checked the code in the Disassembly at the precise point where it should be and...it's there. I'm going to try sticking a breakpoint at the beginning of the routine where the jump is rather than on the jump itself.

Thanks for the info on breakpoints also, Choto, I was a little bit unsure. It seems I've been doing the correct thing by selecting Execute.

And in general just thank you for the help :)
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on March 26, 2015, 10:55:28 am
When you tested my original, did you either: make sure you had the blank support ability equipped or tie the hack to another support ability? I just tested it and it works for me, tying it to magic attack up.

(http://i221.photobucket.com/albums/dd289/Pride_Nick/SCUS_942.21_26032015_075047_0817_zpsibvg4kci.png)
(http://i221.photobucket.com/albums/dd289/Pride_Nick/SCUS_942.21_26032015_075042_0751_zpswckwri1t.png)
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Aqueous on March 26, 2015, 01:17:42 pm
Tied it to JP UP and equipped it. No Jump.

I must be doing something wrong, don't worry. If breakpoints can be trusted, and I wasn't doing something wrong with them, the issue I had was the main body of code not being executed at all. So somehow the jump(s) you added weren't being reached. I have no idea how or why at the moment but I'm going to try putting a break on the routine your jump was put in and take it from there.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on March 26, 2015, 01:24:03 pm
You /have/ to applying it incorrectly, there's no other way for something else to be wrong (unless you're using a dirty iso). Did you change the bytes at x0015E634, x0015E63C, x0015E664, and x0015E66C?

Post the hack that you're applying through FFTorgASM.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Aqueous on March 26, 2015, 03:47:19 pm
Here's the xml:

<?xml version="1.0" encoding="utf-8" ?>
<Patch name="JP UP gives Jump">
  <Description>JP UP gives access to skillset x34</Description>
   <Location file="BATTLE_BIN" offset="F762C">
     E8FFBD27
     1000BFAF
     90004392
     00000000
     40006330
     03006010
     21302002
     7E69060C
     34000534
     12004392
     1000BF8F
     1800BD27
     0800E003
     00000000
     92006590
     00000000
     0200A230
     04004010
     00000000
     34000234
     000002A2
     01001026
     FF000234
     000002A2
     0800E003
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="11A4F0">
     9979050C
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="13347C">
     8B79050C
   </Location>
  </Patch>

</Patches>

I've attached a screenie showing the code in the debugger, you can see it at the correct addresses in the RAM. I've attached a savestate too.

Sigh. Thank you.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on March 26, 2015, 03:57:08 pm
92006590
00000000
0200A230

You didn't change x92 or x02. This is why Jump is not appearing for you.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Aqueous on March 26, 2015, 04:03:31 pm
One second,

Do I need to change the 0x92 and 0x02 in both sections then? There's two instances and only one is highlighted in your original post so those were the ones I changed.

If so I hope that's the reason! Having said that I'm still not understanding breakpoints then because my breakpoints should still be triggering, right?

Edit: Awesome, thank you, that's sorted that. And I've got my version of the hack working now. That's only for secondary though so I need to add to the code to make it so it looks at primary as well? Or am I misunderstanding what "primary skill" is?

Anyway it's working! Thank you for the help, everyone :)

I'm still really confused about breakpoints though, even with 0x92 and 0x02 still in there that should've just meant the branch failed, right? Hence why I wasn't getting Jump. I still should've had the breakpoint trigger though....
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on March 26, 2015, 06:44:08 pm
Fair chance I was being lazy or forgetful in the original post.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Choto on March 26, 2015, 08:47:52 pm
The dangers of hacking while inebriated...
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on March 26, 2015, 10:20:52 pm
It happens too often then I look the next day and am like "Oh..."
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: 3lric on March 27, 2015, 08:00:40 am
Quote from: Choto on March 26, 2015, 08:47:52 pm
The dangers of hacking while inebriated...


Psh, lightweights
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: The Damned on April 07, 2015, 07:55:40 pm
Hunh. I wasn't aware this even existed.

Pride, would it be possible to tie this functionality to a Movement instead of a Support? Or does it absolutely have to be a Support like how Jump still has to exist as a "dummy" skill set for this to draw from even if Jump is no longer the Lancer's primary?

Also, since the skill set is something isn't normally learn-able--if we having the Jump skill set be Izlude's original one--I have to ask if the Jump capacity just naturally maxes out to whatever the highest ability in set is, i.e. getting a Jump with range 8 and vertical 8 because that's naturally what's in Izlude's set.

Regardless, (belated) good job, as always.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on April 07, 2015, 10:50:16 pm
No reason why it wouldn't, you'd just have to change four bytes to attach it to a movement rather then a support. And I don't have the slightest idea, I just used Izlude's jump as general purpose so you can use the player skillset.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Aqueous on April 08, 2015, 02:26:16 pm
Quote from: The Damned on April 07, 2015, 07:55:40 pm
Hunh. I wasn't aware this even existed.

Pride, would it be possible to tie this functionality to a Movement instead of a Support? Or does it absolutely have to be a Support like how Jump still has to exist as a "dummy" skill set for this to draw from even if Jump is no longer the Lancer's primary?

Also, since the skill set is something isn't normally learn-able--if we having the Jump skill set be Izlude's original one--I have to ask if the Jump capacity just naturally maxes out to whatever the highest ability in set is, i.e. getting a Jump with range 8 and vertical 8 because that's naturally what's in Izlude's set.

Regardless, (belated) good job, as always.


Many CPU skillsets come preloaded with abilities learned, in 34 Jump's case both Vert Jump and Level Jump 8 are learned. If you use this with 12 Jump then only the abilities you've learned yourself under that skillset will be available.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: The Damned on April 08, 2015, 08:13:02 pm
Okay. I figured as much on both points. Good to have confirmation though.

I guess that means I'll use Izlude's skill set, which is totally fine with me. Thanks to you both.

Sweet, now I can give generic Lancer something other than Jump.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Aqueous on April 15, 2015, 09:04:04 am
If you felt that giving a Lancer Lv8 Jump from the start is overpowered, you could also link the new skillset to the 12 Jump skillset using RAD.

So for example, originally I dummied out the old Lancer job, made a copy of it as a new Job and used that as the accessible Lancer job. For that job, I gave it the new skillset and selected "Shares With" as Lancer on RAD. What that meant was when I learned the first skill in the new Lancer skillset (let's spare "Spear Rush" or whatever) it would also learn Level Jump 2 from the 12 Jump skillset set to the dummied out Lancer. That way, you could make it so you still "level up" your Jump skillset.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: The Damned on April 15, 2015, 07:56:52 pm
Hunh. I see.

For the record, I was just going to get around the problem of "instant" Level Jump 8 by excising it from Jump skill set 34 and having no one actually actively use that set. I'm personally fine with a static Jump range so long as it works.

Thanks for the information though.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Emmy on May 31, 2016, 03:07:07 am
I know this topic is old, but has anyone managed to create a functioning Elemental ability?  I could probably modify this to grant another skillset alongside Elemental, but ideally I'd like to have a formula that I'm not using call an elemental ability so I could just stick one move in a few boss skillsets and such so their secondary skillsets aren't tied with this.  First few attempts to write this formula failed. :( 
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on May 31, 2016, 11:28:02 pm
What are you trying to do exactly; you want to have one ability to have all the abilities inside of it?

Elemental is determining what ability to use during the action menu phase of selecting a skillset.


Geomancy
001821cc: 27bdff40 addiu r29,r29,0xff40
001821d0: afb100b4 sw r17,0x00b4(r29)      
001821d4: 00808821 addu r17,r4,r0         
001821d8: afb000b0 sw r16,0x00b0(r29)      
001821dc: 00a08021 addu r16,r5,r0         Move Skillset ID to r16
001821e0: afbf00bc sw r31,0x00bc(r29)      
001821e4: 0c060435 jal 0x001810d4         Get Unit Data Pointer
001821e8: afb200b8 sw r18,0x00b8(r29)      `
001821ec: 00409021 addu r18,r2,r0         Move to r18
001821f0: 1240002e beq r18,r0,0x001822ac   Branch if No unit exist
001821f4: 34020011 ori r2,r0,0x0011         r1 = x11
001821f8: 320300ff andi r3,r16,0x00ff      
001821fc: 1462002c bne r3,r2,0x001822b0      Branch if Skillset is not Elemental
00182200: 00001021 addu r2,r0,r0         Clear r2
00182204: 02202021 addu r4,r17,r0         Unit ID to r17?
00182208: 27a20060 addiu r2,r29,0x0060      
0018220c: afa20010 sw r2,0x0010(r29)      
00182210: 34020001 ori r2,r0,0x0001         
00182214: afa20014 sw r2,0x0014(r29)      
00182218: 27a20078 addiu r2,r29,0x0078      
0018221c: afa20018 sw r2,0x0018(r29)      
00182220: 27a20090 addiu r2,r29,0x0090      
00182224: 34050011 ori r5,r0,0x0011         r5 = x11 (Elemental)
00182228: 27a60020 addiu r6,r29,0x0020      
0018222c: 27a70048 addiu r7,r29,0x0048      
00182230: 0c0605f0 jal 0x001817c0         Action Menu x00 main routine
00182234: afa2001c sw r2,0x001c(r29)      
00182238: 00408021 addu r16,r2,r0         
0018223c: 16000005 bne r16,r0,0x00182254   Branch if /any/ abilities are learned
00182240: 00001021 addu r2,r0,r0         Clear r2 ("Gray" out menu)
00182244: 080608ac j 0x001822b0            
00182248: 00000000 nop                  
0018224c: 080608ac j 0x001822b0            
00182250: 30c2ffff andi r2,r6,0xffff      
00182254: 0c060428 jal 0x001810a0         Map Location Routine
00182258: 02402021 addu r4,r18,r0         Move Unit Data Pointer to r4
0018225c: 000210c0 sll r2,r2,0x03         
00182260: 3c018019 lui r1,0x8019         
00182264: 00220821 addu r1,r1,r2         
00182268: 9022f8cc lbu r2,-0x0734(r1)      Load Terrian Type ID
0018226c: 00000000 nop                  
00182270: 3042003f andi r2,r2,0x003f      
00182274: 3c018006 lui r1,0x8006         
00182278: 00220821 addu r1,r1,r2         
0018227c: 9026e9d0 lbu r6,-0x1630(r1)      Load Terrian type Element
00182280: 1a00000a blez r16,0x001822ac      Branch if Ability amount is less then 0
00182284: 00001821 addu r3,r0,r0         r3 = 0x0000
00182288: 00c02821 addu r5,r6,r0         Move Terrain Elemental ID to r5
0018228c: 27a40020 addiu r4,r29,0x0020      Pointer to Learned Ability
00182290: 84820000 lh r2,0x0000(r4)         Load Learned Ability
00182294: 00000000 nop                  
00182298: 1045ffec beq r2,r5,0x0018224c      Branch if Learned Ability = Terrain Elemental ID
0018229c: 24630001 addiu r3,r3,0x0001      r3 + 1
001822a0: 0070102a slt r2,r3,r16         
001822a4: 1440fffa bne r2,r0,0x00182290      Branch if all total Learn Abilities have not been checked
001822a8: 24840002 addiu r4,r4,0x0002      r4 + 2
001822ac: 00001021 addu r2,r0,r0         Clear r2 ("Gray" out menu)
001822b0: 8fbf00bc lw r31,0x00bc(r29)         
001822b4: 8fb200b8 lw r18,0x00b8(r29)      
001822b8: 8fb100b4 lw r17,0x00b4(r29)      
001822bc: 8fb000b0 lw r16,0x00b0(r29)      
001822c0: 27bd00c0 addiu r29,r29,0x00c0      
001822c4: 03e00008 jr r31               
001822c8: 00000000 nop         
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Emmy on May 31, 2016, 11:57:19 pm
Updated Wiki with this info.

Yeah, I'm trying to create an ability that does what a fully learned Elemental skillset does - as in, you select the Elemental ability, and it'll choose what ability it calls based off of the land you're standing on.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Pride on June 01, 2016, 12:23:38 am
You would have to overwrite the RAM data with a table telling it what to do, overwrite: status call, animation, formula (?), range (?), x/y value, ability ID, etc etc. I would use the above routine as a template for determining what type of ground you're on, then start loading the over the generic "elemental" ability.

Edit: AI may possibly act weird because it wouldn't "know" what ability is being called besides the initial call, you may have to correct the ai routines to alleviate that.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Emmy on June 01, 2016, 10:12:54 am
Thanks for your replies.  Sorry I have no idea how to do all of that. :(  (kinda new to asm compared to you guys here)

Didn't think it would be this involved, Guess I'll go back to it another time.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Emmy on April 12, 2017, 12:31:57 pm
I know this is kind of late to the discussion, but I managed to edit this code to not require a r/s/m slot.  This is useful if you want to turn 0x12 into an actual skillset, still have jump, and not tie up a blank r/s/m slot for its use. Posting it here in case of a new user searching for this info.


<Patch name="Action menu expansion">
    <Description>Grants access to jump (0x34) if unit has skillset 0x12.  Original code by Pride.</Description>
    <Location file="BATTLE_BIN" offset="e9994">
      12000934
      0300A910
      34000234
      0300E914
      00000000
      000002A2
      01001026
      FF000234
      000002A2
      0800E003
      00000000
    </Location>
    <Location file="BATTLE_BIN" offset="e99c0">
      E8FFBD27
      1000BFAF
      12004392
      13004592
      12000934
      03006910
      00000000
      0500A914
      00000000
      21302002
      7E69060C
      34000534
      12004392
      1000BF8F
      1800BD27
      0800E003
      00000000
    </Location>
    <Location file="BATTLE_BIN" offset="11a4f0">
      6542050C
      00000000
    </Location>
    <Location file="BATTLE_BIN" offset="13347c">
      7042050C
      00000000
    </Location>
  </Patch>


Also managed to change Geomancy to do what I was asking about in this topic a while ago (using a single formula instead of multiple ability slots/a skillset).  I included both the standard (calculated from attacker slot) and reverse (calculated from target slot) versions, along with all other required code.  This code is long/can use some improvement, but here we go:


  <Patch name="Formula 19 = Reverse Geomancy">
    <Description>Requires Gimmick elemental routine. Requires Elemental Tables. Requires Tile Location calculation.  Will calculate which element and status effect based on the tile that the target is standing on.</Description>
    <Location file="BATTLE_BIN" offset="1222a4">
AA790508
00000000
    </Location>
    <Location file="BATTLE_BIN" offset="f76a8">
E8FFBD27
1000BFAF
5017060C
00000000
7E21060C
00000000
3E19060C
00000000
5A19060C
00000000
19800A3C
982D448D
9717060C
00000000
1680013C
21082200
18E62490
EC56050C
00000000
3F1C060C
00000000
3021060C
00000000
16004014
00000000
19800A3C
902D498D
982D448D
00002291
00000000
0F004010
00000000
9717060C
00000000
1680053C
40100200
2128A200
48E6A390
49E6A690
06006010
00000000
25002291
21082301
000026A0
08004234
250022A1
1000BF8F
1800BD27
0800E003
00000000
    </Location>
  </Patch>

  <Patch name="Formula 57 = Geomancy">
    <Description>Requires Gimmick elemental routine. Requires Elemental Tables. Requires Tile Location calculation.  Will calculate which element and status effect based on the tile that the attacker is standing on.</Description>
    <Location file="BATTLE_BIN" offset="123758">
E8FFBD27
1000BFAF
5017060C
00000000
D121060C
00000000
3E19060C
00000000
5A19060C
00000000
19800A3C
942D448D
9717060C
00000000
1680013C
21082200
18E62490
EC56050C
00000000
3F1C060C
00000000
3021060C
00000000
16004014
00000000
19800A3C
902D498D
942D448D
00002291
00000000
0F004010
00000000
9717060C
00000000
1680053C
40100200
2128A200
48E6A390
49E6A690
06006010
00000000
25002291
21082301
000026A0
08004234
250022A1
1000BF8F
1800BD27
0800E003
00000000
    </Location>
  </Patch>

  <Patch name="Gimmick Elemental ability routine">
    <Description>Requires Oil/Undead. Requires r4 = new element of ability</Description>
    <Location file="BATTLE_BIN" offset="eebb0">
E8FFBD27
1000BFAF
19800A3C
942D4B8D
982D4C8D
71006291
902D4D8D
24104400
07004010
00000000
0400A395
00000000
80100300
21104300
82100200
0400A3A5
5A008591
00000000
8000A330
09006010
80008230
07004010
00000000
2200A291
2500A391
80004234
08006334
2200A2A1
2500A3A1
4000A330
07006010
08008230
05004010
00000000
9013060C
00000000
03000010
00000000
3361050C
00000000
1000BF8F
1800BD27
0800E003
00000000
    </Location>
  </Patch>


  <Patch name="Map location/tile calculation">
    <Description>Requires r4 = data pointer of character whose tile you're calculating.  Returns r2 = tile type ID that unit is on. Replaces Store PA and WP+Y (Move this to free space if you are still using these formulas!)</Description>
    <Location file="BATTLE_BIN" offset="11ee5c">
E8FFBD27
1000BFAF
2804060C
00000000
C0100200
1980013C
21082200
CCF82290
00000000
3F004230
1000BF8F
1800BD27
0800E003
00000000
    </Location>
  </Patch>

<Patch name="Elemental tables">
    <Description>First table is the element used by the attack:
0x80 = Fire, 0x40 = Lightning, 0x20 = Ice, 0x10 = Wind, 0x08 = Earth, 0x04 = Water, 0x02 = Holy, 0x01 = Dark
Second table is a double table.  First byte is the status group byte and second byte is the status inflicted (0x1b - 0x1f, current action data pointer).  Multiple statuses/elements are possible but must be on same byte! :)  Use 0000 for no status.
</Description>
    <Location file="BATTLE_BIN" offset="f7618">
02100240
40200808
02040404
80200404
04048002
01081008
00000220
01010801
10100840
40011040
02808010
080410
    </Location>
    <Location file="BATTLE_BIN" offset="f7648">
1c10
1d08
1d08
1e04
1e02
1c08
1c10
1c80
1f40
1f08
1c20
1e80
1c10
1f02
1c04
1c08
1f01
1d02
1d80
2009
1f40
1c80
1f20
1c08
0000
0000
1b80
1f80
1b20
1c02
1e20
1d02
1f04
1d90
1e04
1c80
1c08
1f20
1c08
1f0c
1c02
1b20
1f04
2260
1b10
1b80
1b10
    </Location>
  </Patch>

  <Patch name="Oil/Undead">
    <Description>Oil = Weak fire, Undead = Absorb Dark/Weak Holy.  Expansion of FFMaster's Oil Hack.  Credit also goes to Glain for fixing it. :)</Description>
    <Location file="BATTLE_BIN" offset="11ffe0">
3361050C
    </Location>
    <Location file="BATTLE_BIN" offset="1200e0">
3361050C
    </Location>
    <Location file="BATTLE_BIN" offset="f14cc">
1980023C
982D428C
E8FFBD27
5A004590
1000BFAF
8000A130
6D004590
58004690
02002010
9C014194
7F00A530
1000C330
03006010
00000000
0100A534
FD00A530
24188500
02006010
00042334
9C0143A4
5A004190
6E004590
80002130
02002010
00000000
7F00A530
1000C130
02002010
00000000
FC00A530
24188500
05006010
00000000
9013060C
00000000
72610508
00000000
6F004590
02002010
90014194
0300A530
24188500
02006010
43080100
900141A4
5A004190
70004590
80002130
02002010
90014194
8000A534
1000C330
03006010
00000000
FE00A530
0200A534
24188500
05006010
40080100
9C014394
900141A4
00086334
9C0143A4
1000BF8F
1800BD27
0800E003
00000000
    </Location>
  </Patch>


  <Patch name="Counter Flood uses Flood Ball">
    <Description>This allows for Counter Flood to work by using an ability instead of vanilla geomancy.  If you changed geomancy with my other codes, this is required to make Counter Flood work.</Description>
    <Location file="SCUS_942_21" offset="4f3df">
      29
    </Location>
    <Location file="BATTLE_BIN" offset="11731c">
      21202002
      0B000534
      F7F80508
      7E000634
    </Location>
  </Patch>
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Vanya on April 19, 2017, 12:12:17 am
That modification to the Jump patch is exactly what I always wanted.
My pipe dream also extended to having something similar with Throw and Charge.
And just now I had a thought for something similar for Draw Out, but that would additionally involve altering the Draw Out command to only allow the use of the skill(s) associated with your current equipment.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: TheSpartanMoose on February 25, 2018, 06:57:10 pm
Hello,

Quite a bump, but I had a question about Emmy's formula.  Whenever I upload the .xml into FFTOrgASM I get a message that it loaded incorrectly.  I've tried making new .xmls with the code wondering if maybe I pasted it wrong but I'm getting the same message.  This hasn't happened with any other .xmls I've added to FFTOrgASM.  I'm using version 0.492.  Thanks in advance for any help!
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: deus-misereatur on March 26, 2018, 07:19:11 am
Is it possible to have Pride's original patch to be extended to two abilities instead of just one - one that accounts for both Jump and Throw?

EDITED: English
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Timbo on March 26, 2018, 11:58:20 am
Quote from: Emmy on April 12, 2017, 12:31:57 pm
I know this is kind of late to the discussion, but I managed to edit this code to not require a r/s/m slot.  This is useful if you want to turn 0x12 into an actual skillset, still have jump, and not tie up a blank r/s/m slot for its use. Posting it here in case of a new user searching for this info.


<Patch name="Action menu expansion">
    <Description>Grants access to jump (0x34) if unit has skillset 0x12.  Original code by Pride.</Description>
    <Location file="BATTLE_BIN" offset="e9994">
      12000934
      0300A910
      34000234
      0300E914
      00000000
      000002A2
      01001026
      FF000234
      000002A2
      0800E003
      00000000
    </Location>
    <Location file="BATTLE_BIN" offset="e99c0">
      E8FFBD27
      1000BFAF
      12004392
      13004592
      12000934
      03006910
      00000000
      0500A914
      00000000
      21302002
      7E69060C
      34000534
      12004392
      1000BF8F
      1800BD27
      0800E003
      00000000
    </Location>
    <Location file="BATTLE_BIN" offset="11a4f0">
      6542050C
      00000000
    </Location>
    <Location file="BATTLE_BIN" offset="13347c">
      7042050C
      00000000
    </Location>
  </Patch>


Also managed to change Geomancy to do what I was asking about in this topic a while ago (using a single formula instead of multiple ability slots/a skillset).  I included both the standard (calculated from attacker slot) and reverse (calculated from target slot) versions, along with all other required code.  This code is long/can use some improvement, but here we go:


  <Patch name="Formula 19 = Reverse Geomancy">
    <Description>Requires Gimmick elemental routine. Requires Elemental Tables. Requires Tile Location calculation.  Will calculate which element and status effect based on the tile that the target is standing on.</Description>
    <Location file="BATTLE_BIN" offset="1222a4">
AA790508
00000000
    </Location>
    <Location file="BATTLE_BIN" offset="f76a8">
E8FFBD27
1000BFAF
5017060C
00000000
7E21060C
00000000
3E19060C
00000000
5A19060C
00000000
19800A3C
982D448D
9717060C
00000000
1680013C
21082200
18E62490
EC56050C
00000000
3F1C060C
00000000
3021060C
00000000
16004014
00000000
19800A3C
902D498D
982D448D
00002291
00000000
0F004010
00000000
9717060C
00000000
1680053C
40100200
2128A200
48E6A390
49E6A690
06006010
00000000
25002291
21082301
000026A0
08004234
250022A1
1000BF8F
1800BD27
0800E003
00000000
    </Location>
  </Patch>

  <Patch name="Formula 57 = Geomancy">
    <Description>Requires Gimmick elemental routine. Requires Elemental Tables. Requires Tile Location calculation.  Will calculate which element and status effect based on the tile that the attacker is standing on.</Description>
    <Location file="BATTLE_BIN" offset="123758">
E8FFBD27
1000BFAF
5017060C
00000000
D121060C
00000000
3E19060C
00000000
5A19060C
00000000
19800A3C
942D448D
9717060C
00000000
1680013C
21082200
18E62490
EC56050C
00000000
3F1C060C
00000000
3021060C
00000000
16004014
00000000
19800A3C
902D498D
942D448D
00002291
00000000
0F004010
00000000
9717060C
00000000
1680053C
40100200
2128A200
48E6A390
49E6A690
06006010
00000000
25002291
21082301
000026A0
08004234
250022A1
1000BF8F
1800BD27
0800E003
00000000
    </Location>
  </Patch>

  <Patch name="Gimmick Elemental ability routine">
    <Description>Requires Oil/Undead. Requires r4 = new element of ability</Description>
    <Location file="BATTLE_BIN" offset="eebb0">
E8FFBD27
1000BFAF
19800A3C
942D4B8D
982D4C8D
71006291
902D4D8D
24104400
07004010
00000000
0400A395
00000000
80100300
21104300
82100200
0400A3A5
5A008591
00000000
8000A330
09006010
80008230
07004010
00000000
2200A291
2500A391
80004234
08006334
2200A2A1
2500A3A1
4000A330
07006010
08008230
05004010
00000000
9013060C
00000000
03000010
00000000
3361050C
00000000
1000BF8F
1800BD27
0800E003
00000000
    </Location>
  </Patch>


  <Patch name="Map location/tile calculation">
    <Description>Requires r4 = data pointer of character whose tile you're calculating.  Returns r2 = tile type ID that unit is on. Replaces Store PA and WP+Y (Move this to free space if you are still using these formulas!)</Description>
    <Location file="BATTLE_BIN" offset="11ee5c">
E8FFBD27
1000BFAF
2804060C
00000000
C0100200
1980013C
21082200
CCF82290
00000000
3F004230
1000BF8F
1800BD27
0800E003
00000000
    </Location>
  </Patch>

<Patch name="Elemental tables">
    <Description>First table is the element used by the attack:
0x80 = Fire, 0x40 = Lightning, 0x20 = Ice, 0x10 = Wind, 0x08 = Earth, 0x04 = Water, 0x02 = Holy, 0x01 = Dark
Second table is a double table.  First byte is the status group byte and second byte is the status inflicted (0x1b - 0x1f, current action data pointer).  Multiple statuses/elements are possible but must be on same byte! :)  Use 0000 for no status.
</Description>
    <Location file="BATTLE_BIN" offset="f7618">
02100240
40200808
02040404
80200404
04048002
01081008
00000220
01010801
10100840
40011040
02808010
080410
    </Location>
    <Location file="BATTLE_BIN" offset="f7648">
1c10
1d08
1d08
1e04
1e02
1c08
1c10
1c80
1f40
1f08
1c20
1e80
1c10
1f02
1c04
1c08
1f01
1d02
1d80
2009
1f40
1c80
1f20
1c08
0000
0000
1b80
1f80
1b20
1c02
1e20
1d02
1f04
1d90
1e04
1c80
1c08
1f20
1c08
1f0c
1c02
1b20
1f04
2260
1b10
1b80
1b10
    </Location>
  </Patch>

  <Patch name="Oil/Undead">
    <Description>Oil = Weak fire, Undead = Absorb Dark/Weak Holy.  Expansion of FFMaster's Oil Hack.  Credit also goes to Glain for fixing it. :)</Description>
    <Location file="BATTLE_BIN" offset="11ffe0">
3361050C
    </Location>
    <Location file="BATTLE_BIN" offset="1200e0">
3361050C
    </Location>
    <Location file="BATTLE_BIN" offset="f14cc">
1980023C
982D428C
E8FFBD27
5A004590
1000BFAF
8000A130
6D004590
58004690
02002010
9C014194
7F00A530
1000C330
03006010
00000000
0100A534
FD00A530
24188500
02006010
00042334
9C0143A4
5A004190
6E004590
80002130
02002010
00000000
7F00A530
1000C130
02002010
00000000
FC00A530
24188500
05006010
00000000
9013060C
00000000
72610508
00000000
6F004590
02002010
90014194
0300A530
24188500
02006010
43080100
900141A4
5A004190
70004590
80002130
02002010
90014194
8000A534
1000C330
03006010
00000000
FE00A530
0200A534
24188500
05006010
40080100
9C014394
900141A4
00086334
9C0143A4
1000BF8F
1800BD27
0800E003
00000000
    </Location>
  </Patch>


  <Patch name="Counter Flood uses Flood Ball">
    <Description>This allows for Counter Flood to work by using an ability instead of vanilla geomancy.  If you changed geomancy with my other codes, this is required to make Counter Flood work.</Description>
    <Location file="SCUS_942_21" offset="4f3df">
      29
    </Location>
    <Location file="BATTLE_BIN" offset="11731c">
      21202002
      0B000534
      F7F80508
      7E000634
    </Location>
  </Patch>



Emmy, this is Amazing. The Jump thing is super effing cool! Now all this needs is an ASM that makes Jump distance equal a character's Jump (movement) attribute. I swear there's probably already an one lurking around here somewhere. *Note, I'm not actually asking for this. You've done enough already.

Personally, I think the Geomancy/Reverse Geomancy thing is even cooler. I don't see a table linking tile type to spell effect though. My ASM knowledge while better is still pretty limited. I'm guessing that each ability with one of these formula can only have one graphic associated with it, am I right or am I blind? How difficult would it be to link a graphical effect and possibly ability name to each kind of tile to properly mimic geomancy? *Again, I'm not trying to beg here. I'm just legitimately curious and impressed.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Reikan on November 07, 2018, 10:21:05 am
Hello. I don't want to bump an old topic, but there is nowhere else I can ask about this.

I'm trying to slightly edit and use Emmy's formula to link some skillsets to each other. What I did was basically swap numbers following Pride's logic line, but it only seems to work when I apply 1 ASM at a time. My issue is:

- I want both Sing and Dance skillsets to link with Item (I'm planning to dump both classes and mirror them into one, ending gender-based classes and also having a proper skillset with Item. Kinda like Alchemist is on FFTA)
- I want Time Magic to link with Throw (I want the Ninja to have a skillset, still keeping Throw)


So, whenever Sing was linked to Item, both Dance and Time Magic stopped linking with their secondary skillsets. It worked the other way around for everything I mentioned on this comment.

Any lights on what might be causing this issue? I'm new to ASM and I know almost nothing about it.

@Edit:

I'm basically mimicking codes so I'm quite sure they are having conflicts and one is overwriting the other.

This is an example of what I did to make the game link Time Magic to Throw. I don't know anything about ASM and I used logic to change numbers here. It works, but if I try to do again with the others it overwrites the previous ASM.
<Patch name="Time Magic grants access to Throw">
    <Description>Grants access to Throw (0x14) if unit has skillset 0x0C.  Original code by Pride.</Description>
    <Location file="BATTLE_BIN" offset="e9994">
      0C000934
      0300A910
      14000234
      0300E914
      00000000
      000002A2
      01001026
      FF000234
      000002A2
      0800E003
      00000000
    </Location>
    <Location file="BATTLE_BIN" offset="e99c0">
      E8FFBD27
      1000BFAF
      0C004392
      13004592
      0C000934
      03006910
      00000000
      0500A914
      00000000
      21302002
      7E69060C
      14000534
      0C004392
      1000BF8F
      1800BD27
      0800E003
      00000000
    </Location>
    <Location file="BATTLE_BIN" offset="11a4f0">
      6542050C
      00000000
    </Location>
    <Location file="BATTLE_BIN" offset="13347c">
      7042050C
      00000000
    </Location>
  </Patch>
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: xjamxx on November 07, 2018, 11:10:22 am
Quote from: Reikan on November 07, 2018, 10:21:05 amI'm trying to slightly edit and use Emmy's formula to link some skillsets to each other. What I did was basically swap numbers following Pride's logic line, but it only seems to work when I apply 1 ASM at a time.

I would really help that you post the code you are working on whenever you ask something...
Nonetheless from what i understand of your post, if you are trying to use this code of Pride:
<?xml version="1.0" encoding="utf-8" ?>
<Patches>
<Patch name="Support Equip Jump">
    <Description>Support skill below Non-Charge gives access to skillset x34</Description>
   <Location file="BATTLE_BIN" offset="F762C">
      E8FFBD27
     1000BFAF
     92004392
     00000000
     02006330
     03006010
     21302002
     7E69060C
     34000534
     12004392
     1000BF8F
     1800BD27
     0800E003
     00000000
     92006590
     00000000
     0200A230
     04004010
     00000000
     34000234
     000002A2
     01001026
     FF000234
     000002A2
     0800E003
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="11A4F0">
     9979050C
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="13347C">
     8B79050C
   </Location>
  </Patch>
</Patches>

It has 3 parts (each one is a location section):
The first one is the main code (the one that does the 'magic'), there other 2 (the smaller ones) are just for hooking (jumping or branching) from vanilla code to the 'main' code of the hack.

So if you wanna use it twice by duping the patch and replacing data numbers in main code, you will just get the last applied patch cuz both share the same memory space for main code (which starts at: F762C or in RAM offset at: 15E62C).

In battle.bin file the space from 14cf68 - 1743c4 (in ram offset) is occupied by 'unused' routine, so that's why most of the asm hacks main code goes there.

So what you should do? You will need to mod the main code to support two 'linking'.

One option: you could dupe the main code (the entire first location) in another offset (try not overwrite another used patch) then create a fourth location (maybe) to call both main codes and then adjust vanilla hooking to this new location instead of hooking the original main code.

I think it may be hard to understand but i am trying to teach you how to do things by yourself in this process...
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: Reikan on November 07, 2018, 11:26:18 am
Quote from: xjamxx on November 07, 2018, 11:10:22 am
I would really help that you post the code you are working on whenever you ask something...


I edited my post with the code I used (with my changes already done)

Quote from: xjamxx on November 07, 2018, 11:10:22 am
I think it may be hard to understand but i am trying to teach you how to do things by yourself in this process...


It's not that hard to understand and I really like your approach. I don't like bothering people and I hope to contribute with my own ASM ideas somewhere in the future, so your tips are welcome.

I've faced another problem: Having 2 skillsets automatically linking to other ones (Time Magic + Throw / Sing-Dance + Item) can give the player a giant combination of actions in-battle. You can only have 5 actions (Attack, Action 2 /3 /4 /5) without having display issues, so I'll scrap this idea and go with Pride's initial code (Support skill "X" links to Skillset "Y").

I just need to find a "safe place" to have a Support skill linking to Throw, and another one to Item. I'll look into your tips and see what I can do.
Title: Re: Has anyone managed to create a functioning Jump Ability?
Post by: xjamxx on November 07, 2018, 11:55:30 am
All i wrote can be translated to:
<Patch name="Time Magic grants access to Throw">
    <Description>Grants access to Throw (0x14) if unit has skillset 0x0C (twice).  Original code by Pride.</Description>
    <Location file="BATTLE_BIN" offset="e9994" mode="asm">
      or r9,r0,t0               #Modded here to have t0 instead of fixed value
      beq r5,r9,SKP1
      or r2,r0,t1               #Modded here to have t1 instead of fixed value
      bne r7,r9,SKP2
      nop
SKP1:   sb r2,0x0000(r16)
      addiu r16,r16,0x0001
SKP2:   ori r2,r0,0x00ff
      sb r2,0x0000(r16)
      jr r31
      nop
    </Location>
    <Location file="BATTLE_BIN" offset="e99c0" mode="asm">
      addiu r29,r29,-0x0018
      sw r31,0x0010(r29)
      lbu r3,0x000c(r18)
      lbu r5,0x0013(r18)
      or r9,r0,t0               #Modded here to have t0 instead of fixed value
      beq r3,r9,SKP1
      nop
      bne r5,r9,SKP2
      nop
SKP1:   addu r6,r17,r0
      jal 0x0019a5f8
      or r5,r0,t1               #Modded here to have t1 instead of fixed value
      lbu r3,0x000c(r18)
SKP2:   lw r31,0x0010(r29)
      addiu r29,r29,0x0018
      jr r31
      nop
    </Location>
    <Location file="BATTLE_BIN" offset="e9b00" mode="asm">
      ori t0,zero,0x000c
      jal 0x80150994
      ori t1,zero,0x0014
      ori t0,zero,0x000c         #yeah a second time. change 000c to another thing
      jal 0x80150994
      ori t1,zero,0x0014         #yeah a second time. change 0014 to another thing
      jr r31
      nop
    </Location>
    <Location file="BATTLE_BIN" offset="e9b50" mode="asm">
      ori t0,zero,0x000c
      jal 0x801509c0
      ori t1,zero,0x0014
      ori t0,zero,0x000c         #yeah a second time. change 000c to another thing
      jal 0x801509c0
      ori t1,zero,0x0014         #yeah a second time. change 0014 to another thing
      jr r31
      nop
    </Location>
    <Location file="BATTLE_BIN" offset="11a4f0">
      C042050C                  <!--Modded here to call e9b00 instead of e9994-->
      00000000
    </Location>
    <Location file="BATTLE_BIN" offset="13347c">
      D442050C                  <!--Modded here to call e9b50 instead of e99c0-->
      00000000
    </Location>
  </Patch>

Its quite crappy (in art of writing low level code), in theory it should work (but i am unsure, cuz didnt tried, of what the main code does, if its global then it won't work or it is call per unit in which case it will work).