øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1853.msg18833e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index2e3b.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1883.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index2e3b.html.zx"g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0°jOKtext/htmlISO-8859-1gzip@øÕÿÿÿÿÿÿÿÿTue, 10 Mar 2020 05:00:40 GMT0ó°° ®0®P®€§²ð® g^ÿÿÿÿÿÿÿÿP* Can the "life" effect be achieved on arbitrary spells?

Author Topic: Can the "life" effect be achieved on arbitrary spells?  (Read 3687 times)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Can the "life" effect be achieved on arbitrary spells?
« on: August 16, 2013, 11:34:32 AM »
It appears as though changing any given spell's effect to "raise" (revive a KO/dead character) does not seem to have the effect you'd expect. Or, if I understand correctly, any effect at all. Only the Life, Life 2, and Asura spells can actually achieve the effect of raising a fallen character. Why?

Presumably there is some kind of index check going on where the game is like "only spells with these indexes can raise people" but the questions then are:
  • Where are these checks and how do we manipulate them to point to different spells?
  • Can they be made to point to more spells than the original? Or fewer?
  • Can we affect whether they revive the characters to full or (Vit * 5)?
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #1 on: August 16, 2013, 01:12:42 PM »
Hmm, I just tested this, I switched Protect to a Raise spell and it worked fine, Cecil revived with 15 HP (I did not know there was a set formula to the healing done by Raise, interesting.) It may be a White Magic Spell only thing, let me check...

Nope, worked perfectly fine as a Black Magic Spell as well...


Alright, well I found the Life2 check, but it is Only a single spell. When a spell (possibly only healing) is cast it gets put into its own small section of RAM at 7E26D2 and is checked against a lot of variables, one of those variables are...

03D6CD - C9 14   CMP #$14   A:001D   - Comparing Current Spell with Life2?

Where it is in RAM is... right there, where it is in ROM is at...

0x01D8CD - C9 14 - Change the 14 to any value you like And be a !Reviving Spell! to have this Life Spell to bring the fallen back to full life.

I am still searching for the Vit * 5 Formula base, that one has been a little bit trickier to find than I expected.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #2 on: August 16, 2013, 01:34:58 PM »
Hmm perhaps I'm getting confused with something else.

Does the life effect work as multi-targetting when it isn't Asura?
Let's dance!

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #3 on: August 16, 2013, 01:47:30 PM »
Here's the thread where Phoenix was looking into Life2/Asura:

http://slickproductions.org/forum/index.php?topic=442.0

I don't think he ever found what allows her multi-target Life to work.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #4 on: August 16, 2013, 02:37:10 PM »
Yeah, that part is the real problem with Life spells. I recall that Phoenix looked in vain for the reasoning behind why that would be. I have to wonder why it works like that myself.

Also I've cracked Vit * 5 I think and you can change it to look at any stat now you like...

At least it seemed that way. Finding that 5 was a lot trickier than it ought to be, in the end it's placed All the way at the start of RAM at 0xAB.

...Well that was fruitless. As far as I could figure this Formulaic 5 is comprised of several rotated bytes until it becomes a 5 making it very difficult to change.

Code: [Select]
$03/843C CA DEX A:0008 X:0002 Y:0010 P:envmxdizc
$03/843D D0 DE BNE $DE    [$841D] A:0008 X:0001 Y:0010 P:envmxdizc
$03/841D 2E 45 39 ROL $3945  [$7E:3945] A:0008 X:0001 Y:0010 P:envmxdizc
$03/8420 2E 4B 39 ROL $394B  [$7E:394B] A:0008 X:0001 Y:0010 P:envmxdiZc
$03/8423 38 SEC A:0008 X:0001 Y:0010 P:envmxdizc
$03/8424 AD 4B 39 LDA $394B  [$7E:394B] A:0008 X:0001 Y:0010 P:envmxdizC
$03/8427 ED 47 39 SBC $3947  [$7E:3947] A:0010 X:0001 Y:0010 P:envmxdizC
$03/842A 8D 4B 39 STA $394B  [$7E:394B] A:0000 X:0001 Y:0010 P:envmxdiZC
$03/842D B0 0A BCS $0A    [$8439] A:0000 X:0001 Y:0010 P:envmxdiZC
$03/8439 2E 49 39 ROL $3949  [$7E:3949] A:0000 X:0001 Y:0010 P:envmxdiZC
$03/843C CA DEX A:0000 X:0001 Y:0010 P:envmxdizc

So I don't think we can change the 05 without a lot of modification. However you can change the stat or value that you want the character to use. So it could be Str * 5 or Will * 5, or anything in the character data, as long as its in the mirrored dead character data. As before you may use the Stat Sheet that is in the Dark Wave thread.

$03/D6D9    AD 16 27   LDA $2716  [$7E:2716]   A:001D   X:0002   Y:0005   P:envMxdizc - Looks at 7E2716 which is a copy of the fallen character's stats. This is the fallen character's Modified Vitality.

----------------------------------------

In ROM this is at...

0x01D8D9 - AD 16 27   LDA $2716  [$7E:2716]   A:001D   X:0002   Y:0005   P:envMxdizc - Looks at 7E2716 which is a copy of the fallen character's stats. This is the fallen character's Modified Vitality, you may change it accordingly using the character stat sheet.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #5 on: August 16, 2013, 02:53:25 PM »
That's awesome!

I don't suppose... could it be modified to use the spell power of the spell? 5 * SP? So like, if the spell power was 5 it would heal 25 HP, or if the spell power was 20 it would heal 100 HP or whatever.
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #6 on: August 16, 2013, 03:09:24 PM »
That... is a little trickier to say. I've never dealt with magic in RAM or ROM for that matter, only being content to use editors to deal with that. Do you happen to know where that data is in ROM? With that I can easily find where it would be in RAM and see if it is loaded in that manner in battle.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #7 on: September 02, 2013, 05:48:09 PM »
A small update. While it seems difficult to get multi-targetted life spells to work under ordinary circumstances using Edward's Salve command to use Phoenix Downs works Perfectly. All fallen characters are revived at the same time. The only issue appears to be that it takes the Vitality of the closest fallen character to the top of the list. But that's a minor manner.

Though I think I'm starting to understand why that is somewhat difficult... Magic, by-and-large targets the living and Only the living, therefore when you put a live target into the targetting range of any Spell (not command apparently) the game will assume that is only the ones who are alive are being cast upon. Asura's Life spell is the exception to this.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #8 on: September 06, 2013, 11:16:31 AM »
That's awesome!

I don't suppose... could it be modified to use the spell power of the spell? 5 * SP? So like, if the spell power was 5 it would heal 25 HP, or if the spell power was 20 it would heal 100 HP or whatever.

I figured it out! I was looking through the Tower of Bab-il Docs and saw this...

"At the time this subroutine is called, the target's data has been copied to
2700-277F in RAM. The caster's data has been copied to 2680-26FF. The
subroutines modify this data. The relevant spell/item table entry has been
copied to 289C-28A1. 28A2-28A4 "

That tells me exactly where the spell data is in RAM at the exact time I need it. 289C was what you were looking for. For just a Brief second the game puts the spell's power and accuracy into 289D, but that brief second is all the time the Life formula needs to grab its spell power and revive an ally using its spell power as a base.

You would change this...

$03/D6D9    AD 16 27   LDA $2716  [$7E:2716]   A:001D   X:0002   Y:0005   P:envMxdizc - Looks at 7E2716 which is a copy of the fallen character's stats. This is the fallen character's Modified Vitality

To this...

$03/D6D9    AD 9D 28   LDA $289D  [$7E:289D]   A:001D   X:0002   Y:0005   P:envMxdizc - Looks at 7E289D's value which is the where the power of Life and Phoenix Down will be stored. Then this becomes the fallen character's HP * 5. This also effects anything else that may bring a fallen one back to life (ironically though this should fix the enemy vitality = 0 glitch from the original game.

This change also appears to have the strange effect of taking hit percentage into account, since it uses Spell Power as its base.

And with this you can make Phoenix Downs and Life Spells heal different amounts.

In ROM just change...
0x01D8D9 - AD 16 27

To....

0x01D8D9 - AD 9D 28

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #9 on: September 06, 2013, 12:25:35 PM »
Life can actually "miss".

Try "forcing" the Rubicante battle with the ultimate party and kill off a character. See what happens when you use a Fire elemental spell on him.

It is noted as it is being used as an "offensive magic attack" so magic evasion is applied. It is actually possible to miss with that spell in any case and it is most apparently related to having poor accuracy while being Blind. Try it, you will be surprised.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #10 on: September 11, 2013, 12:30:43 PM »
Also I've cracked Vit * 5 I think and you can change it to look at any stat now you like...

At least it seemed that way. Finding that 5 was a lot trickier than it ought to be, in the end it's placed All the way at the start of RAM at 0xAB.

...Well that was fruitless. As far as I could figure this Formulaic 5 is comprised of several rotated bytes until it becomes a 5 making it very difficult to change.

Yeah... um...  :isuck:

Only a couple of bytes away from where I found the Vitality check I missed the LDA 05 which is the true x5 that the game uses to calculate how to restore the dead.


$03/D6D9   AD 16 27   LDA $2716  [$7E:2716]   A:0013   X:0002   Y:0006   P:envMxdizc - Load Target's Modified Vitality.
$03/D6DC   85 DF   STA $DF    [$00:00DF]   A:0006   X:0002   Y:0006   P:envMxdizc - Store A in DF.
$03/D6DE   A9 05   LDA #$05   A:0006   X:0002   Y:0006   P:envMxdizc - Load 05 into A (How did I miss this?!)
$03/D6E0   85 E1   STA $E1    [$00:00E1]   A:000F   X:0002   Y:0006   P:envMxdizc - Store A in E1
$03/D6E2   20 E0 83   JSR $83E0  [$03:83E0]   A:000F   X:0002   Y:0006   P:envMxdizc - Jump to Subroutine. (Cleaning Routine)
$03/D6E5   A6 E3   LDX $E3    [$00:00E3]   A:0000   X:0000   Y:0006   P:envMxdiZc - Load X from E3 (where the end result of multiplying DF and E1 must have taken place)
$03/D6E7   8E 07 27   STX $2707  [$7E:2707]   A:0000   X:005A   Y:0006   P:envMxdizc - Store X in Character's HP.
$03/D6EA   60    RTS   A:0000   X:005A   Y:0006   P:envMxdizc - End of Routine.

So there you go. You can now change the stat it looks at for healing and the amount it multiplies to reach a final HP value.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #11 on: November 21, 2013, 10:20:19 AM »
Hey - did you guys know that if you force-target only dead party members, multi-targeting life spells works? It's true. For instance, if the characters in slots 1 and 2 are dead, another character casts Life1, and during the "chanting" portion of the cast you manually change the targeting byte ($2054, x) to C0, Life1 will successfully revive both characters.
Now, how to make this work without cheating...

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #12 on: November 21, 2013, 10:59:36 AM »
I've written above that multi-targetted Life effects work when combined with Salve because it seems that it looks past the "are they dead?" check. I've also suggested that the Asura code should have something special involved that you likely hit upon in your research.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #13 on: November 21, 2013, 05:14:13 PM »
I thought so, and I actually tried multi-targeting salve with Life as its effect and it didn't work for me, so I assumed I had misunderstood what you were saying.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Can the "life" effect be achieved on arbitrary spells?
« Reply #14 on: November 21, 2013, 05:22:37 PM »
Really? It worked fine for me when I tried it. I take it you changed it to use the Life item and made the effect the Life item as well?