Sorry for bumping a thread after 2 years, but while I was working on another idea related to FF5, I came across some potentially useful addresses that I figured might be useful here - I didn't really want the addresses to go to waste and stagnate on my PC so they might have some use for the someone who potentially creates a TAS for this.
Unfortunately I haven't really had the time to flesh them out fully - I've only managed to get the next attack ID for the first enemy slot. I believe I've got the addresses representing the party target for all 8 slots (not sure how this behaves if the target is either all party members, or all available targets including enemies). I've tried to keep samurai goroh's notation for these addresses to make it easy on myself, but my representations are probably wrong to people who know more in this space, I've just been going off what was in the LUA files to wrap my head around it.
For the first enemy slot, the ID of their next attack is:
0x01F616 XX
Starting at 80
If you're using
samurai goroh's data, the table can be found at section
4.6 Item ID (Magic Shops), starting at hex 80. If you're using the LUA files from the post above, you can get the string for display purposes via
TableMagicID[memory.read_u8(0x01f616)+1]
Its not the best way of doing it I'm sure, but I was in a pinch when I wrote it.
The target of that attack is located at:
0x020A8C XX
Starting at 00
And the offset for each enemy slot is
0x020A8C - (enemySlot * 0xFF)
I'm not a low level guy, so my offset might be inaccurate.
All of these addresses are WRAM (or combined WRAM in BizHawk). Apologies if I'm getting that wrong!
---
Addresses aside, and this is probably known knowledge, the attack a monster will perform is determined a number of frames
after their attack guage/ATB value reaches 0. Depending on any running animations, the offset may vary, but once their sprite flashes it will be correct. This is the same for the target that will be chosen if the attack is single target.
I'm not sure if this information will be of use to anyone, but after starring at samurai goroh's address references for a few days I didn't want this information to go to waste, if only for my sake.