i know it's probably a dumb question, but i'm still learning about this rom hacking thing, and i can't help but wonder. i was also wondering the same thing before about how you discovered yang's oddball battle script that had to do with the pictures i posted on gamefaqs.
if you could explain it a lil bit, or maybe point me to a document that could, i'd really appreciate it. i've been working hard over here reading, etc, and practicing hacking with my hex editor and all the docs i can find, but i'd love to get to the level that you guys are at one day. so, i wanted to know how you do what it is that you're doing.
I'm always glad to be of help, as are the other people on this board. Ask as many questions as you need -- the more you understand the better your hacks will be, and I look forward to seeing what you'll produce. For the enemy attack sequences, you should download the Tower of Bab-il documents (they can be found in Deathlike2's "Useful Links" thread). There's a document in there describing where the data is and what is means. Once you understand that, you can use the three documents I've attached to this thread.
1. First, look up the enemy attack group. It's the 9th of the 10 bytes in the enemy stats data (another Tower of Bab-il document explains this).
2. Once you have this hex number, you can look it up in the Enemy Attack Group document. This will give you a series of 2-byte sets: first is the condition index, then the attack sequence index.
3. Look up the condition index(es) in the Enemy Condition Indices document. This tells you the condition for the following attack sequence byte.
4. Look up the attack sequence index(es) in the Enemy Attack Sequences document. This will give you a series of commands the enemy performs under the previous condition.
Here's an easy example: the Imp. If you look up it's attack group number, it's 00 (in hex). Look this up in the Enemy Attack Group document, and the data there is "55 00 01 02 00 01 FF." This gives you three 2-byte sets. Using the conditions document and the sequences document, you can tell the following:
55 00: Condition 55 is "if self is an egg". Sequence 00 is "E1 FF" which means "do nothing."
01 02: Condition 01 is "if charmed". Sequence 02 is "F9 24 C0 FF" which means "target a random enemy and attack."
00 01: Condition 00 is "no condition" (i.e. "otherwise). Sequence 01 is "C0 FF" which means "attack."
Let me know if the formatting in the documents is funky. I work on a Mac, so I'm not sure how it'll turn up in other OS's.
Edit: I don't think my interpretation of "F2" in the attack sequences is correct. It displays the dialogue, but doesn't do it while performing the next attack. Not sure what the difference is between "F1" and "F2". If anyone knows or figures it out, please share.