Aslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2074.0;prev_next=nexte:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index9388.htmldelayedslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2074.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index9388.html.zxg^Ћ:OKtext/htmlISO-8859-1gzip8::HTue, 10 Mar 2020 04:42:43 GMT0 0Pg^ : Weak/Tornado Spell

Author Topic: Weak/Tornado Spell  (Read 1342 times)

Dark Knight

  • Ymir
  • *
  • Posts: 10
    • View Profile
Weak/Tornado Spell
« on: July 18, 2015, 09:00:29 AM »
I've made the black magic spell Weak into a normal damaging spell, but it doesn't successfully cast on bosses (no spell animation/etc). So I'm guessing that the spell is hardcoded. I've look at some documents, but didn't find anything related to the Weak spell. I've search the forum for Weak and nothing turned up. Was this information found by anyone to make the Weak spell hit bosses.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Weak/Tornado Spell
« Reply #1 on: July 18, 2015, 09:03:12 AM »
If you're doing this in FF4kster, there should be a property "Hits Boss" or some such. Just change that to YES and you're good.
Let's dance!

Dark Knight

  • Ymir
  • *
  • Posts: 10
    • View Profile
Re: Weak/Tornado Spell
« Reply #2 on: July 19, 2015, 06:05:22 PM »
As good as FF4kster is, it doesn't work with the rom I am using. So that utility is sadly useless for me.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Weak/Tornado Spell
« Reply #3 on: July 19, 2015, 08:21:57 PM »
Still, there is a "hits boss" bit assigned to every spell, and for Weak, it is set (meaning the spell will not hit a boss) by default.
Assuming you are using some version of FFIIUS, then the location of spell properties in ROM should be at 797A0 (ROM without header).
The bab-il documents detail the meaning of the data (http://rb.thundaga.com/tob/spelldata.txt), except they list some bytes as "unknown." The byte you're interested in is byte 02. You'll notice that it's CB by default for Weak. That it is a value above 80 indicates that the "hits boss" bit is set, meaning the spell will not hit a boss. To keep the same hit rate, but make Weak able to hit a boss, turn that uppermost bit off, or to put it simply, change the value of that byte to 4B.
(DISCLAIMER: I'm not 100% positive I've got the right byte, as it's been a long whole since I didn't use FF4kster to make this change, so if changing that byte doesn't work, it's because I got it wrong, and you should try playing with other bytes in this table that the document lists as "unknown.")

Bydoless

  • Wing Raptor
  • *
  • Posts: 6
    • View Profile
Re: Weak/Tornado Spell
« Reply #4 on: July 25, 2015, 02:15:04 AM »
Hello, I'm posting this here because it's the best thread for my question.

Is it possible to ASM Hack the game to make it so that Air-elemental attacks like Aero (which replaces Weak/Tornado in my hack) deal double/quadruple damage to enemies with the Float status?

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Weak/Tornado Spell
« Reply #5 on: July 25, 2015, 05:43:32 AM »
I'm pretty sure the game already does that... If I'm not mistaken "Air weakness" on enemies also grants quake immunity (so, effectively, Float). But I don't think it works in terms of, say, casting Float on the enemies during the battle, and then using an air attack on them. I think granting air weakness somehow during the fight doesn't actually turn on quake immunity and vice-versa.
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Weak/Tornado Spell
« Reply #6 on: July 25, 2015, 07:19:27 AM »
I'm pretty sure Pinkpuff's right about the default behavior.
I have done what you're looking for in my project, but I'm not sure I kept notes on exactly what I did... It involved a few mathy ops that were more complicated than it seems like they should be, because float status and elemental weakness are not stored in the same byte.

Bydoless

  • Wing Raptor
  • *
  • Posts: 6
    • View Profile
Re: Weak/Tornado Spell
« Reply #7 on: July 26, 2015, 04:20:51 PM »
I think I found the routine you were talking about here http://slickproductions.org/forum/index.php?topic=1922.msg22998;topicseen#msg22998, but I can't seem to get it to work:

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Weak/Tornado Spell
« Reply #8 on: July 27, 2015, 04:09:44 PM »
A-ha. It looks like what I posted there was the subroutine, but not the jump TO that subroutine. Unfortunately, I'm working late tonight, so I won't get to look at it for you today, but if I can pull myself out of bed early enough tomorrow, I'll put something more complete up for you.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Weak/Tornado Spell
« Reply #9 on: July 28, 2015, 08:47:33 AM »
Okay, Bydoless...
Looking at this actually exposed an oversight in my original coding, so this works out for both of us.
What I had done originally only adjusted the elemental weakness of floating monsters if you used magic, but not if attacking with air elemental weapons. the following will correct that issue...

So, first, you want to write the routine. By the way, the location of the assembly over on that other thread would only work with my project, as vanilla FFIV has some other code in that location that would get messed up if you put my stuff in there. So we're going to use the empty space at $03/F210.
Since I am not familiar with your knowledge base, I'll say this - forgive me if I'm telling you something you already know. That offset is the LoROM offset. You'll only be using $03/F210 if you're writing the code using Geiger's SNES9x Debugger. If you're using a normal hex editor, this will be at $01/F210. You'll know you're in the right place if what is there currently is a bunch of FFs
So anyway (possibly adjusted offsets depending on how you're doing this), write this in the empty space:
Code: [Select]
$03/F210 C0 20 00    CPY #$0020             
$03/F213 D0 13       BNE $13    [$F228]     
$03/F215 48          PHA                     
$03/F216 5A          PHY                     
$03/F217 A0 04 00    LDY #$0004             
$03/F21A B1 80       LDA ($80),y[$7E:E88B]   
$03/F21C 29 40       AND #$40               
$03/F21E F0 06       BEQ $06    [$F226]     
$03/F220 7A          PLY                     
$03/F221 68          PLA                     
$03/F222 09 20       ORA #$20               
$03/F224 80 02       BRA $02    [$F228]     
$03/F226 7A          PLY                     
$03/F227 68          PLA                     
$03/F228 99 00 27    STA $2700,y[$7E:6C10]   
$03/F22B 60          RTS                     

So that's the subroutine, now we have to execute the jump there at the appropriate time(s).
The data being affected by this routine is loaded from a different place depending on if you're using magic or not, so we need two separate subroutine jumps.

Currently, at $03/AE7B (or $01/AE7B, depending on the same issue mentioned above), you should see:
99 00 27

You want to change that to:
20 10 F2

Likewise, at $03/CF77 (or $01/CF77), you should see the same:
99 00 27

And again, change it to read:
20 10 F2

And that should do it! whether they are set by default to have the "weak to air" property set, all floating monsters will now be weak to air.
Note again that this is "Weak" (x2 damage) and not "Very Weak" (x4 damage).

Hope that helps. Happy hacking!