øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=463.msg9245e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexe9be.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=463.45e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexe9be.html.zx¬1g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ…¬ãOKtext/htmlISO-8859-1gzip8:ÖãÿÿÿÿÿÿÿÿTue, 10 Mar 2020 06:36:51 GMT0ó°° ®0®P®€§²ð®¬1g^ÿÿÿÿÿÿÿÿR&ã Enemy Special/Magic Attacks

Author Topic: Enemy Special/Magic Attacks  (Read 16021 times)

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #45 on: January 04, 2009, 03:02:19 PM »
I assume that changing these values will affect any other spells that use the "defense up" / "magic defense up" routines?

What I mean is, you couldn't have, say, one spell that's a single-target protect spell that boosts the target's defense a lot and a different spell, "Protect 2" or something that targets the group but gives less of a defense boost.

lol @ stealing my screenshots. Oh well, nice patch, but I'd still recommend you add a separate patch to set the new defaults .
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #46 on: January 04, 2009, 04:52:44 PM »
Actually that wasn't me. Someone else linked those there. I didn't submit any screenshots other than the title screen.

Anyway, the reason I didn't change anything else was that I figured the only possible use this patch could have is for people who want to do some sort of magic hacking in the first place, in which case I'm sure they'd have their own ideas as to what they want to do with the spells.
Let's dance!

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #47 on: January 04, 2009, 05:54:54 PM »
Has it been tested on all versions of this game? The lack of a readme doesn't help the header issue either...
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Enemy Special/Magic Attacks
« Reply #48 on: January 04, 2009, 06:03:50 PM »
Actually that wasn't me. Someone else linked those there. I didn't submit any screenshots other than the title screen.

Yeah, I threw those on there. Please include screenshots in any future submissions.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #49 on: January 04, 2009, 06:40:58 PM »
It's not that I have a problem providing screenshots in general, it's just that for this specific case I wasn't really sure what I was supposed to provide a screenshot of... the patch doesn't do anything visible; in fact on its own it doesn't even do anything measurable.
Let's dance!

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Enemy Special/Magic Attacks
« Reply #50 on: January 04, 2009, 06:42:09 PM »
Yeah, I realize that. Generally in that case I'd do what I did with your submission and include shots of the spells being used.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #51 on: January 04, 2009, 06:53:19 PM »
If you ask me, that's a bit deceptive; it gives the impression that the patch enables the casting of those spells...
Let's dance!

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #52 on: January 04, 2009, 06:56:48 PM »
It doesn't really suggest it.. it's based off of J2e's translation so it assumes FF4 and those were weapon-item based spells.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #53 on: January 05, 2009, 12:59:20 AM »
If you're interested, there's a few tweaks worth making..

For instance, the Bomb's Explode or the Last Arm's Fission attack use the same sacrifice code.. it ignores the multiplier that's set for the attack.. fixing that would be nice (although, this means that the Fission attack needs the spell power set).

Remedy (heals 1/10 of the target's MaxHP) and Absorb (heals 1/3 of the target's CurrentHP) can't be changed (it obviously ignores the spell power bit).. changing that behavior would be nice.

Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #54 on: January 05, 2009, 08:10:19 AM »
Remedy (heals 1/10 of the target's MaxHP) and Absorb (heals 1/3 of the target's CurrentHP) can't be changed (it obviously ignores the spell power bit).. changing that behavior would be nice.

I agree... and I tried my hand at it this morning. I found the code for those routines and found the places where it loads the constants 10 and 3 respectively. Changing those constants to other constants indeed changes the number the HP is divided by. Sadly however, when I tried to get it to load the spell power byte it resulted in healing 0 HP no matter what.

For example, changing

Code: [Select]
1DF5A: A2 0A 00   (Load X with #000A)
to

Code: [Select]
1DF5A: A2 02 00   (Load X with #0002)
caused the spell to cure 1/2 the target's max HP rather than 1/10. However, changing it to

Code: [Select]
1DF5A: AE 9D 28   (Load X with $7E:289D)
should have caused it to cure 1/(spell power) the target's max HP, but instead it cured 0. The same goes for the absorb routine. In both cases, the spell power for the spell I was using to test the routine was 2 (so it should have healed 1/2 in each case).
« Last Edit: January 05, 2009, 12:07:38 PM by Pinkpuff »
Let's dance!

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #55 on: February 05, 2015, 03:12:01 PM »
GINORMOUS NECRO TIME!

I was wondering if perhaps some of our assembly miracle workers can enlighten me as to what I did wrong in the post above? For context, I was trying to make it so that the code for the "Resore 1/10 of target's max HP" spell routine, instead of healing 1/10 max, healed 1/(spell power) max.

For my hack, I was trying to create a "White Wind" ability for Draghinazzo. I figured if he absorbs Holy then if I made a Holy attack that dealt damage equal to caster's HP that would more or less do the trick. However, I found that instead what happened was that he would heal only a tiny amount, no matter what his HP was. I thought that if the problem I was tackling here years ago could be solved, I could use that routine and make the spell power 1 and get the White Wind effect.

Any ideas?
Let's dance!

avalanche

  • Mom Bomb
  • *
  • Posts: 122
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #56 on: February 05, 2015, 07:13:53 PM »
It is probably because the X register is 16 bits at that time, so it is loading 2 bytes; the power and the following byte.  If there is a non-zero value for that byte, then it would probably result in zero after the division.

There isn't enough room to switch register sizes around that, but you can make room by altering the instructions above that.  If you go up to the start of the routine (03:DD4E, or 1DF4E in the ROM)

From:
Code: [Select]
03:DD4E  AD 09 27    LDA $2709
03:DD51  8D 45 39    STA $3945
03:DD54  AD 0A 27    LDA $270A
03:DD57  8D 46 39    STA $3946
03:DD5A  A2 0A 00    LDX #$000A

To:
Code: [Select]
  AE 09 27  LDX $2709
  8E 45 39  STX $3945
  AD 9D 28  LDA $289D
  AA        TAX

  Then I think that leaves 5 bytes of extra room, so fill with no-ops?  (EA)


Full disclosure, I didn't test this, just scribbled it on paper.


Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #57 on: February 05, 2015, 09:25:16 PM »
GINORMOUS NECRO TIME!

I was wondering if perhaps some of our assembly miracle workers can enlighten me as to what I did wrong in the post above? For context, I was trying to make it so that the code for the "Resore 1/10 of target's max HP" spell routine, instead of healing 1/10 max, healed 1/(spell power) max.

For my hack, I was trying to create a "White Wind" ability for Draghinazzo. I figured if he absorbs Holy then if I made a Holy attack that dealt damage equal to caster's HP that would more or less do the trick. However, I found that instead what happened was that he would heal only a tiny amount, no matter what his HP was. I thought that if the problem I was tackling here years ago could be solved, I could use that routine and make the spell power 1 and get the White Wind effect.

Any ideas?

You asked about this a while back and here was my fix...

$03/DD5A   AD 9D 28   LDA $289D  [$7E:289D]   A:0000   X:004E   Y:0000   P:envMxdiZc
$03/DD5D   8D 47 39   STA $3947  [$7E:3947]   A:0005   X:004E   Y:0000   P:envMxdizc

When you look at the formula you can see that LDA is loaded again before it is reused for 2707 below, so it's safe to load the Spell Power into A rather than X in the first place.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #58 on: February 05, 2015, 09:45:20 PM »
Umm... Target's max HP will be in 2709. I don't know where you got 2894 from...
Max HP is two bytes, so that's not a problem, but your fraction there would be 1/max HP, which would be zero for all intents and purposes.

I made a white wind spell for TfW, the ASM is pretty simple actually. I think it's just:
Code: [Select]
C2 20 REP #$20; make A 16 bits
AD 87 26 LDA $2687; load caster's current HP
09 00 80 ORA #$8000; set HP recovery bit
85 A4 STA $A4; store A in target damage
7B TDC; clear A
E2 20 SEP #$20; make A 8 bits again
I too am just scribbling this out, I'm not positive that's how I wrote it, but this should work.
What this does is restore the target's HP in the amount of the caster's current HP (which is what white wind does in most FF games)
 :edit: fixed a couple of errors in that code
« Last Edit: February 05, 2015, 10:23:49 PM by chillyfeez »

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Enemy Special/Magic Attacks
« Reply #59 on: February 06, 2015, 05:01:35 AM »
You asked about this a while back and here was my fix...

$03/DD5A   AD 9D 28   LDA $289D  [$7E:289D]   A:0000   X:004E   Y:0000   P:envMxdiZc
$03/DD5D   8D 47 39   STA $3947  [$7E:3947]   A:0005   X:004E   Y:0000   P:envMxdizc

When you look at the formula you can see that LDA is loaded again before it is reused for 2707 below, so it's safe to load the Spell Power into A rather than X in the first place.

I did?? My apologies! I had completely forgotten!

Anyway thanks all for your input! I will test these solutions when I get home tonight or possibly tomorrow.
Let's dance!