Users browsing this thread: 2 Guest(s)
"Low on HP" spells and "Active if Imp" flag

#1
Posts: 735
Threads: 36
Thanks Received: 13
Thanks Given: 42
Joined: Jan 2016
Reputation: 6
Status
None
So I had a neat idea and thought others may find it useful. Here's the coding for the three "Cast spell when low on HP" effects.

Code:
C2/0A4A: BD A0 3A     LDA $3AA0,X
C2/0A4D: 89 10        BIT #$10
C2/0A4F: D0 3F        BNE $0A90    (Exit function)
C2/0A51: A9 02        LDA #$02
C2/0A53: 3C E5 3E     BIT $3EE5,X
C2/0A56: F0 38        BEQ $0A90    (Branch if not Near Fatal)
C2/0A58: 3C 05 32     BIT $3205,X  (is bit 1 set?)
C2/0A5B: F0 33        BEQ $0A90    (exit if not, meaning we've already activated
                                   a spell on low HP this battle)
C2/0A5D: 5D 05 32     EOR $3205,X
C2/0A60: 9D 05 32     STA $3205,X  (turn off bit 1)
                                  (TRB $3205,X could've replaced two instructions)
C2/0A63: BD 59 3C     LDA $3C59,X
C2/0A66: 4A           LSR
C2/0A67: 90 0B        BCC $0A74   (Branch if not Shell when low HP)
C2/0A69: 48           PHA
C2/0A6A: A9 25        LDA #$25
C2/0A6C: 85 B8        STA $B8     (Shell spell ID)
C2/0A6E: A9 26        LDA #$26
C2/0A70: 20 91 4E     JSR $4E91
C2/0A73: 68           PLA
C2/0A74: 4A           LSR
C2/0A75: 90 0B        BCC $0A82   (branch if not Safe when low HP)
C2/0A77: 48           PHA
C2/0A78: A9 1C        LDA #$1C
C2/0A7A: 85 B8        STA $B8     (Safe spell ID)
C2/0A7C: A9 26        LDA #$26
C2/0A7E: 20 91 4E     JSR $4E91
C2/0A81: 68           PLA
C2/0A82: 4A           LSR
C2/0A83: 90 0B        BCC $0A90   (branch if not Reflect when low HP [no item
                                  in game has this feature, but it's possible])
C2/0A85: 48           PHA
C2/0A86: A9 24        LDA #$24
C2/0A88: 85 B8        STA $B8     (Rflect spell ID)
C2/0A8A: A9 26        LDA #$26
C2/0A8C: 20 91 4E     JSR $4E91
C2/0A8F: 68           PLA
C2/0A90: 60           RTS

The spots at C2/0A6A. C2/0A78, and C2/0A86, are the spell IDs. Note that "Cast Reflect when at low HP" is never used in the base game, but the coding is here for it.

Now, of course, the spell IDs can be changed to anything, and in that is the potential for three unique "Cast spell at low HP" effects. The coding will always default to single-targeting the caster, even for party-wide spells (tested with Ultima and Big Guard). So here are some examples of what you could make:

* 1-Up Ring - Casts Cure 3 when at low HP.
* Once More - Casts Life 3 when at low HP.
* Second Chance - Casts Big Guard when at low HP.
* Hide Cowl - Character flees battle when at low HP. (casts Escape, which works fine - single character runs away complete with animation and sound effect. However, this apparently lets you "win" boss battles by letting the rest of the party get KO'd and you don't Game Over)

Trying to make a "Summon at low HP" item was a bit more hit or miss. Golem, Bismarck, Tritoch, and Odin, didn't want to play, but Palidor and Kirin would. I guess you'd have to check yourself what works and what doesn't.

* Final Jump - Summons Palidor when at low HP. (this WILL effect the entire party)

And in turn you can customize whatever spell you want, so...

* Second Wind - Fully restores HP and status when at low HP.
* Hyper Mighty G - Casts Haste, Regen, Shell, Protect, and Life 3 when at low HP

Alas that there isn't a way to attach HP and MP restoration to a spell effect that I know of, or we could do "Last Elixir" to automatically use an Elixir on a low HP character.

To the second part of the topic, this is an idea I didn't figure out how to implement due to a strange hex concerning identifying statuses, but I'll post the coding if someone else could figure it out - the coding for the "weapon/armor active if Imp" trigger.

Code:
C2/1018: BF 14 50 D8  LDA $D85014,X   (get weapon battle power / armor defense power)
C2/101C: EB           XBA
C2/101D: BF 02 50 D8  LDA $D85002,X   (get top byte of equippable chars?)
C2/1021: 0A           ASL
C2/1022: 0A           ASL             (carry = Specs active when Imp?)
C2/1023: A5 FE        LDA $FE         (Character Status Byte 1)
C2/1025: B0 02        BCS $1029       (branch if imp-activated)
C2/1027: 49 20        EOR #$20        (flip Imp status)
C2/1029: 89 20        BIT #$20        (character has Imp status?)
C2/102B: D0 03        BNE $1030      
C2/102D: A9 01        LDA #$01        (if you're an Imp and specs aren't Imp-activated,
                                      defense/battle power = 1.  or if you're not an Imp
                                      and the specs are Imp-activated, battle/defense
                                      power = 1)
C2/102F: EB           XBA
C2/1030: EB           XBA             (if imp-activation and imp status match, put the
                                      original Battle/Defense Power back in bottom of A)

If one could figure out how to change the status that this coding refers to, then you could make some creative equipment. Here are some ideas, presuming all of them can be done.

* Berserker Blade - Powerful sword activates when user is Berserked
* Reaper Rod - Powerful rod activates when user is Condemned
* Rage Vest - Powerful armor defends user under effect of Rage
* Sweet Dreams - Powerful armor defends user when they are asleep.

So yeah, just sharing some simple ideas I had that others could use to make some more fun equipment.
  Find
Quote  
[-] The following 6 users say Thank You to DrakeyC for this post:
  • Fenrir (02-22-2018), Gi Nattak (02-21-2018), madsiur (02-20-2018), Robo Jesus (02-22-2018), Tenkarider (02-22-2018), Turbotastic (02-22-2018)

#2
Posts: 76
Threads: 20
Thanks Received: 2
Thanks Given: 4
Joined: Apr 2012
Reputation: 0
Status
None
(02-20-2018, 10:38 PM)DrakeyC Wrote: * Hide Cowl - Character flees battle when at low HP. (casts Escape, which works fine - single character runs away complete with animation and sound effect)

Just wanted to point out that the exclusive enemy ability Escape ignores the "cannot escape" bit. So, you can escape from all battles including boss battles and the final battle with this ability. You just have to weaken the character wearing the Hide Cowl and have him/her use Escape, then kill off the remaining character(s) to end the battle. This will be treated as a "victory" without killing the boss.

I remember placing Escape in one of Gau's Rage, I used said Rage against the Earth Dragon in the Opera House. Gau ran away alright, and I killed off the remaining characters to see if I would get a game over and I did not. I apparently "won" the battle. Got the 7 dragons remaining text. I assume because some bosses uses Escape, like Kefka, who uses this ability to end the battle.
  Find
Quote  
[-] The following 1 user says Thank You to Fenrir for this post:
  • DrakeyC (02-22-2018)

#3
Posts: 45
Threads: 0
Thanks Received: 0
Thanks Given: 24
Joined: Feb 2015
Reputation: 0
Status
None
Thank you. This opens up some new and interesting things to use and play around with, and can allow 'worthless' items and their associated spell flags to be made into something useful.
  Find
Quote  

#4
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
gg for the imp flag, i already had some idea for the near death ones, but imp tweak is a must: Imp weapons are just boring


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  
[-] The following 1 user says Thank You to Tenkarider for this post:
  • MC50 (01-05-2019)

#5
Posts: 110
Threads: 4
Thanks Received: 4
Thanks Given: 1
Joined: Jan 2012
Reputation: 4
Status
None
A simple code modification to the SOS spellcasts:

Code:
hirom

org $c20a4a
C20A4A: LDA $3AA0,X
C20A4D: BIT #$10                   ; (is entity Wounded, Petrified, or Stopped, or is somebody else under the influence of Quick?)
C20A4F: BNE sos_end                  ; (Exit function if any are true)
C20A51: LDA #$02
C20A53: BIT $3EE5,X
C20A56: BEQ sos_end                  ; (Branch if not Near Fatal)
C20A58: BIT $3205,X                ; (is bit 1 set?)
C20A5B: BEQ sos_end                  ; (exit if not, meaning we've already activated a spell on low HP this battle)
C20A5D: EOR $3205,X
C20A60: STA $3205,X                ; (toggle off bit 1)
lda $3c59,x                        ; load equip special byte 4
and #$07                            ; filter all except bits 0-2
beq sos_end
phx                                ; save X
dec
tax                                ; move A to X, as index
lda (#spell_index),x                ; load value to compare
plx
sta $b8                            ; spell ID
lda #$26                        ; command #$26 (force target self, no MT)
jsr $4e91                        ; queue command
sos_end:
rts

spell_index:
;Spell IDs go here. All use self-targetting only, though offensive spells may use a very simple single target randomization on enemy targets. I haven't tested that.
db $00                            ; 001 (Previously Shell flag)
db $00                            ; 010 (Previously Safe flag)
db $00                            ; 011 (Previously Shell+Safe flags)
db $00                            ; 100 (Previously Rflect flag)
db $00                            ; 101 (Previously Rflect+Shell flags)
db $00                            ; 110 (Previously Rflect+Safe flags)
db $00                            ; 111 (Previously Rflct+Safe+Shell flags)
padbyte $FF : pad $c20a91
  Find
Quote  



Forum Jump:

Users browsing this thread: 2 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite