øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1883.msg20031e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index0389.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1883.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index0389.html.zxñg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ'UaOKtext/htmlISO-8859-1gzip@øÕUaÿÿÿÿÿÿÿÿTue, 10 Mar 2020 04:59:51 GMT0ó°° ®0®P®€§²ð®ïg^ÿÿÿÿÿÿÿÿK]Ua Grimoire LD's Notes, Patches, and Hacks (Dark Knight/Paladin Swap In Battle!)

Author Topic: Grimoire LD's Notes, Patches, and Hacks (Dark Knight/Paladin Swap In Battle!)  (Read 78643 times)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #195 on: January 07, 2014, 02:09:52 PM »
Mage characters, who use regular black magic spells, have and can run out of MP.

Player characters yes, but not monsters.

Have you ever charmed a Gargoyle? It casts Weak on its own guys. And it works; it doesn't just come up "out of MP" or show the spell name with no effect or anything. It has 160 Max HP meaning it should in theory have 10 MP, nowhere near enough to cast Weak even once.

Better yet, ever fight TinyMages? As in, physically attack them? They only have 69 HP, so 4 MP, meaning they shouldn't even be able Hold once, but they don't seem to have any trouble casting Hold all day on your guys, not to mention all the Lit-1s and stuff.
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #196 on: January 07, 2014, 05:35:03 PM »
Hmm. I would swear I've seen the "Not enough MP" message from a monster before, but you make a pretty convincing case.

Hah - FFVI. Yes, that was a typo. :blush:

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #197 on: January 07, 2014, 11:59:58 PM »
Alright then, let's get started with implementing these ideas... maybe one day I should release a patch that includes all of my changes (bug fixes, routine edits, editing to make those routine edits effective, etc.) but I think that day is still a bit of a ways of.

Katana Soul - (Replacing Dart) I was concerned at first that Dart had forced targeting, but then I remembered that I found the ways to change targeting through routines (Grimoire as a proof of concept) which actually works a bit better for my purposes anyhow.

NOTE: I had to change the order a couple of times to get things working correctly and this document is not all compiled at once, therefore the addresses to the side may be a little inaccurate but rest assured the order is correct.


Code: [Select]
$03/E34C A9 C8 LDA #$C8 A:0003 X:002C Y:0000 P:envMxdizc - Load C8 into A (Animation from Sing)
$03/E34E 8D C4 33 STA $33C4  [$7E:33C4] A:00C7 X:002C Y:0000 P:eNvMxdizc - Store it in Audiovisual Code
$03/E351 A9 FF LDA #$FF A:00C7 X:002C Y:0000 P:eNvMxdizc - Load FF into A (Targeting)
$03/E353 8D D3 26 STA $26D3  [$7E:26D3] A:00FF X:002C Y:0000 P:eNvMxdizc - Store A in Next Monster Target
$03/E356 AD D2 26 LDA $26D2  [$7E:26D2] A:00FF X:002C Y:0000 P:eNvMxdizc - Load Ability (or Item)  ("Thrown" Weapon) from A
$03/E359 48 PHA A:002E X:002C Y:0000 P:envMxdizc - Push A for Later in the Routine
$03/E359 C9 2C CMP #$2C A:002C X:002C Y:0000 P:envMxdizc - Is it Middle?
$03/E35B D0 08 BNE $08    [$E365] A:002C X:002C Y:0000 P:envMxdiZC - If not, branch to next CMP.
-----------------------------------------------------------------------------------------------------------------
$03/E35D A9 9A LDA #$9A A:002E X:002C Y:0000 P:envMxdiZC - Load 9A (D.Breath) into A.
$03/E35F 8D D2 26 STA $26D2  [$7E:26D2] A:009A X:002C Y:0000 P:eNvMxdizC - Store A in next action to take.
$03/E362 20 3E CD JSR $CD3E  [$03:CD3E] A:009A X:002C Y:0000 P:eNvMxdizC - Jump to Magic Routine
$03/E365 C9 2D CMP #$2D A:002D X:002C Y:0000 P:envMxdizC - Is it Long?
$03/E367 D0 08 BNE $08    [$E371] A:002E X:002C Y:0000 P:envMxdiZC - If not, branch to next CMP.
----------------------------------------------------------------------------------------------------------------
$03/E369 A9 A3 LDA #$A3 A:002E X:002C Y:0000 P:envMxdiZC- - Load A3 (Heat Ray) into A.
$03/E36B 8D D2 26 STA $26D2  [$7E:26D2] A:00A3 X:002C Y:0000 P:eNvMxdizC - Store A in next action to take
$03/E36E 20 3E CD JSR $CD3E  [$03:CD3E] A:00A3 X:002C Y:0000 P:eNvMxdizC - Jump to Magic Routine
$03/E371 C9 2E CMP #$2E A:002E X:002C Y:0000 P:envMxdizC - Is it Ninja?
$03/E373 D0 08 BNE $08    [$E37D] A:002E X:002C Y:0000 P:envMxdiZC - If not, branch to next CMP.
-------------------------------------------------------------------------------------------------------------------
$03/E375 A9 2F LDA #$2E A:002E X:002C Y:0000 P:envMxdiZC - Load 2E into A. (Group-Osmose, Shockingly works!)
$03/E377 8D D2 26 STA $26D2  [$7E:26D2] A:002E X:002C Y:0000 P:envMxdizC - Store A in Next action to take.
$03/E37A 20 3E CD JSR $CD3E  [$03:CD3E] A:002E X:002C Y:0000 P:envMxdizC - Jump to Magic Routine
$03/E37D C9 2F CMP #$2F A:002F X:002C Y:0000 P:envMxdizC - Is it Muramasa?
$03/E37F D0 10 BNE $10    [$E391] A:002E X:002C Y:0000 P:envMxdiZC - If not, branch to next CMP
--------------------------------------------------------------------------------------------------------------------------------------
$03/E381 9C D3 26 STZ $26D3  [$7E:26D3] A:002E X:002C Y:0000 P:envMxdiZC - Store Zero in Monster Targeting (To prevent override)
$03/E384 A9 F0 LDA #$F0 A:002E X:002C Y:0000 P:envMxdiZC - Load F0 into A (Target All Allies)
$03/E386 8D D4 26 STA $26D4  [$7E:26D4] A:00F0 X:002C Y:0000 P:eNvMxdizC - Store A in Ally Targets
$03/E389 A9 85 LDA #$85 A:00F0 X:002C Y:0000 P:eNvMxdizC - Load Absorb into A.
$03/E38B 8D D2 26 STA $26D2  [$7E:26D2] A:0085 X:002C Y:0000 P:eNvMxdizC - Store A in Next Action
$03/E38E 20 3E CD JSR $CD3E  [$03:CD3E] A:0085 X:002C Y:0000 P:eNvMxdizC - Jump to Magic Routine
$03/E391 C9 30 CMP #$30 A:0030 X:002C Y:0000 P:eNvMxdizc - Is it Masamune?
$03/E393 D0 10 BNE $10    [$E3A5] A:002E X:002C Y:0000 P:envMxdiZC - If not, branch to next CMP.
-------------------------------------------------------------------------------------------------------------------------
$03/E395 9C D3 26 STZ $26D3  [$7E:26D3] A:002E X:002C Y:0000 P:envMxdiZC - Store Zero in Monster Target (otherwise it takes precedence.)
$03/E398 A9 F0 LDA #$F0 A:002E X:002C Y:0000 P:envMxdiZC - Load F0 into A (Target All Allies.)
$03/E39A 8D D4 26 STA $26D4  [$7E:26D4] A:00F0 X:002C Y:0000 P:eNvMxdizC - Store A in Ally Targets.
$03/E39D A9 08 LDA #$08 A:00F0 X:002C Y:0000 P:eNvMxdizC - Load Fast into A.
$03/E39F 8D D2 26 STA $26D2  [$7E:26D2] A:0008 X:002C Y:0000 P:envMxdizC - Store A in Next Action to Take
$03/E3A2 20 3E CD JSR $CD3E  [$03:CD3E] A:0008 X:002C Y:0000 P:envMxdizC - Jump to Magic Routine
$03/E3A6 C9 3E CMP #$3E A:00E0 X:0680 Y:001A P:eNvMxdizC - Is it Spoon?
$03/E3A8 D0 08 BNE $08    [$E3B2] A:003E X:0680 Y:001A P:envMxdiZC - If not, branch to RNG Routine.
-----------------------------------------------------------------------------------------------------------------------------------------------------
$03/E3AA A9 87 LDA #$87 A:003E X:0680 Y:001A P:envMxdiZC - Load Big Bang into A.
$03/E3AC 8D D2 26 STA $26D2  [$7E:26D2] A:0087 X:0680 Y:001A P:eNvMxdizC - Store A in Next Action to Take
$03/E3AF 20 3E CD JSR $CD3E  [$03:CD3E] A:0087 X:0680 Y:001A P:eNvMxdizC - Load Magic Routine


And here is where I came to a slight... issue. When you use a weapon with Throw, you lose it. I had thought that was done through the routine itself, for some reason, but it is not. It is done elsewhere. I knocked my head thinking of ways around this then I just decided to breakpoint on the decrement itself and found it, I tested it and it is fully unique to the Dart Menu, thank goodness...

Code: [Select]
$03/A664 B1 80 LDA ($80),y[$7E:321C] A:002E X:0000 Y:0002 P:envMxdizc - Load Item that is to be thrown into A.
$03/A666 3A DEC A A:0001 X:0000 Y:0002 P:envMxdizc - -1 to A.
$03/A667 91 80 STA ($80),y[$7E:321C] A:0000 X:0000 Y:0002 P:envMxdiZc - Store A in Thrown Item Quantity.

I nulled that and was good to go, but then I realized I didn't know how to actually remove the item. So it may be best to leave it be for the time being, I have another scheme which may help me get the item. Which may be even more efficient.

I am very proud of myself for being able to fit this in the amount of bytes and even take part of another routine to use for my own purposes. Because of space though I did have to sacrifice my loftier plans of each Katana having its own percentage to break, so it's a straight 50% chance to break with all of the Katanas.

RNG And +1 to Current Soul Sword Routine
Code: [Select]
$03/E3B2 A2 01 00 LDX #$0001 A:00E0 X:0680 Y:001A P:eNvMxdizC - Load 0001 as lowest value in X
$03/E3B5 A9 64 LDA #$64 A:00E0 X:0001 Y:001A P:envMxdizC - Load 64 (100) as highest value in A.
$03/E3B7 20 79 83 JSR $8379  [$03:8379] A:0064 X:0001 Y:001A P:envMxdizC - RNG Routine
$03/E3BA C9 32 CMP #$32 A:0007 X:0000 Y:001A P:envMxdizc -Is it 50 or above?
$03/E3BC 90 09 BCC $09    [$E3C7] A:0032 X:0000 Y:001A P:envMxdiZC - If lower than 50 branch to 03E3C7.
$03/E3BE A9 01 LDA #$01 A:0032 X:0000 Y:001A P:envMxdiZC - Load 01 into A.
$03/E3C0 85 AA STA $AA    [$00:00AA] A:0001 X:0000 Y:001A P:envMxdizC - Store A in AA (this gives you only +1 rather than whatever value AA had stored previously)
$03/E3C2 68 PLA A:0001 X:0000 Y:001A P:envMxdizC - Pull A from the start of the routine (The Item Number)
$03/E3C3 20 5A E2 JSR $E25A  [$03:E25A] A:002E X:0000 Y:001A P:envMxdizC - Run Steal Routine - Item Acquisition Portion.
$03/E3C6 60 RTS A:001D X:001C Y:0007 P:envMxdizc - Return (though I could easily just make the last instruction be a "Jump" rather than a "JSR"
-----------------------------------------------------------------------------------------------------------------------------------------
$03/E3C7 68 PLA A:0006 X:0000 Y:001A P:eNvMxdizc - Pull A (Otherwise there are Major problems)
$03/E3C8 60 RTS A:002E X:0000 Y:001A P:envMxdizc - Return

And there you have it! A system akin to the Samurai's in FFT in FFIV. I thought this was going to be really difficult, but it was a lot of fun and I learned a lot through this. It was a real brain teaser.








Now you have to be careful... The Murasame and Masamune cast Beneficial Spells only when you target an ally.



But when you cast it on an enemy...



Should I start releasing standalone patches? Things like this and my Hunter's patch might be worth releasing separately on their own.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Draw Out from FFT put into FFIV!)
« Reply #198 on: January 08, 2014, 12:54:39 AM »
Should I start releasing standalone patches? Things like this and my Hunter's patch might be worth releasing separately on their own.
My philosophy on that is, might as well. Even if nobody uses them right away, somebody will remember or stumble across them down the road and will really appreciate having them. Making the patch is the easy part of the process.
Though Dragonsbrethren may disagree with me...

Btw, does Cecil know Tellah has been wearing his dark armor?
« Last Edit: January 08, 2014, 01:11:01 AM by chillyfeez »

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Draw Out from FFT put into FFIV!)
« Reply #199 on: January 08, 2014, 04:09:11 AM »
I'm a big fan of large numbers of small patches rather than small numbers of composite patches. It gives people more choice and customizability. Maybe I want to make a hack that has Rapid Fire (I assume that's what <arrow>Strm does?) but want to keep Dart/Throw. Of course there are certain things it makes sense to package together, like if it's hard to imagine someone wanting one without the other, or if it's particularly difficult or a lot of work to separate them, or if you're dealing with a whole game as opposed to just some specific mechanics or bugfixes, but as a general philosophy I prefer the piecemeal approach.
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Draw Out from FFT put into FFIV!)
« Reply #200 on: January 08, 2014, 08:48:49 AM »
I will keep that in mind moving forward then, thank you for the suggestions PinkPuff and Chillyfeez. Haha! Yes, Tellah was the name I originally used to test the "in-battle names=out of battle name" hack, and most pictures that you see come from "FFIV Test" which is a rom of mine for testing changes to the editor and routine changes to make sure they are safe before I put them on any actual modding rom. It is surprisingly more stable than it had been in the past. Maybe because I have a more firm idea of what I'm doing.

Ah, Rapid Fire... I don't think FFIV's system allows for that, unfortunately. There seems to be no way I can tell to refresh the audio-visual code to show more than one Character Animation & Spell Effect before each action is taken, that might require more exploration though.

 What (Arrow)Strm does is dependent on which hack is used. One is more akin to FFT:War of the Lions Barrage used by Balthier. x4 Attacks with damage cut in half (so x2 attack) at the use of 4 Arrows each time. The second (Arrow)Strm is based more on FFIII DS's version. In this it will by default do two attacks. But if you have above 45 Str. It will do 3 and if you have above 60 it will do 4. It's to possibly encourage a more Str. based set-up for Rosa and make it a viable choice rather than a fun derivative, and to keep in the spirit of FFIII DS that relied on Job Level for its power. (I seem to have a thing for Aim, making Snipe,Barrage, and ArrowStorm all out of the same basic space and skill).

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Draw Out from FFT put into FFIV!)
« Reply #201 on: January 08, 2014, 10:12:47 AM »
Ah, Rapid Fire... I don't think FFIV's system allows for that, unfortunately. There seems to be no way I can tell to refresh the audio-visual code to show more than one Character Animation & Spell Effect before each action is taken, that might require more exploration though.
One of the Limit skills in my (I swear!) forthcoming hack is something I've been calling Attack Barrage (they don't have displayed names, so the name is really irrelevant). The skill is five consecutive attacks with no wait time between. This is achieved by manipulating the wait time (at 2A04,x as discovered in my "whose turn is it" thread) within the command code and making tallies of how many attacks have been used in the character's Dropped Item byte (which is unused for PCs). It works well, though takes a while, and other characters cued for a command can act in between its attacks. But this is the only way I could think of to execute such an attack.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Draw Out from FFT put into FFIV!)
« Reply #202 on: January 08, 2014, 10:19:51 AM »
Very clever! Could you post the code regarding that? I'm not too well versed in wait-functions when it comes to routines (I've never dealt much with the ATB in fear of screwing up terribly) and I should be able to add in the "target randomly" command from Grimoire and that could work ideally as a Rapid-Fire.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Draw Out from FFT put into FFIV!)
« Reply #203 on: January 08, 2014, 02:44:02 PM »
Very clever!

Agreed! That is clever. It reminds me of the Quick spell. I could see expanding that to work as an X-Magic ability - but that of course is more work, but just throwing it out as an idea. I could see it working like Hide and Show - just giving two turns of only Magic available on the menu. The one that gets me (just off the top of my head) is casting time.

Well, it's something to think about I suppose. :hmm:

Also, I too am for the individual patch approach - there's some fun mixing and matching to be had!  :childish:
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Draw Out from FFT put into FFIV!)
« Reply #204 on: January 08, 2014, 10:36:24 PM »
So while adding Magic to the normal attack as a possibility seemed great on the surface, it would be Way too complicated to actually use properly. I was wrong, there is no unknown byte in data that can be written in ROM that I could use for a secondary spell index on weapons.

But one thing you can do, and quite easily may I add is add Command-Executions to the normal Fight Routine, to simulate things like the "Thief Dagger" and the "Dancing Knife" from FFV in FFIV.

Applicable Commands
Peep - E153 (Doesn't show damage, but does display actual data)
Steal - E1CC (Works perfectly)
Salve/Item Master - E2DC (Consider using as a Specialty for Cid!)
Regen - E3FA (Applicable. Puts Character using it out of commission as Regen begins could be interesting on a really good weapon)
Twin - E46F(Only to be used on a Twin Only Weapon!)
Kick - E6B4 (A Hit-All Attack from the normal attack! Now that is cool!)
Focus- E7F0 (Works as you'd expect, except damage isn't shown on the first attack, again another interesting facet to a powerful weapon)
X-"Aim" - E836 (Could potentially result in an Extraneous amount of extra damage, (Because it will go through the Fight Routine again and may possibly trigger again) it may be best to avoid this one.)
X-Hide - E876 (Appears to make it use on the enemy? May not be worthwhile, is worth rechecking.)
Sing - E900 (Almost as if it was made for this! The attack connects, the animation is shown, and the damage is displayed.
X-Jump - E954 (Does weird things, cannot be used.)
X-Parry - E9D0 (It does not display the damage done, nor the attack animation, but it does still do the normal damage, there could be a work around.)
Dark Wave - E9E9 (Acts like Kick as one would expect, will need to add a custom animation store before it.)
Recall - EA1A (Works perfectly! No complaints here.)
X-Boast - EAC3 (It gives the Int. Bonus to the foe (or friend) it strikes... not very useful.
X-Cry - EAE6 (??? It's very difficult to say if its doing anything at all.)
X-Grimoire - EC0D (While they work and the correct graphics show, the damage dealt is normal weapon damage and it doesn't seem as if it can be specially targeted.

So with this upcoming hack you will be able to tie command executions to weapons!

I will likely have to cannibalize a different routine if I want Magic+Weapon Strike. (though there may be a handful of space I can use here if I want to) It's not a difficult thing to set up in theory. The only problem is that the damage displayed may be slightly off from what it actually is.

And there goes my entire day! This one was much more painful than I thought it would be only because of hunting down the byte which wouldn't let you apply a status twice (in this case Calcify). This means that you could that an Imbued Weapon would use its special command Once and that would be it because you can't apply the same status on top of another status.

I searched RAM and ROM high and low and finally found the answer in an unlikely spot. Unfortunately fixing this problem was a lot more taxing than I had originally planned... however the final effort is all worth it. This hack includes "Command Executions" for 10 weapons in the game and after agonizing over space limits (I had to cut one out eventually) for several hours I finally put it together in a very efficient manner.

I would say this is my most impressive hack yet, but I say that for every hack I make say... take that with a grain of salt.

Unlike some of my other hacks, this fits into the game Seamlessly. There's nothing inherently "hackish" about it. (Well... somewhat). This will feel almost natural in some respects. Also I have some great news about Visual effects! The place where they are stored has a Lot of room. The problem with our approach is that we kept overwriting one visual effect with another. When there's at least room for 10 linear visual effects. This will lend itself to very interesting possibilities in the future.

Now this hack is only for the Right Hand (Sorry Palom and Kain) I had no room to fit in a Left Hand Check.

Imbued Weapons (I think I stole that name from one of Deathlike2's hacks?) Code

 :edit: 7/4/2014 - Changed the code to be more efficient to compensate for unforeseen difficulties.

Code: [Select]
[code]
(Changed "Is Target Charging? Than divide Defenses by 2" into "Is Caster using a Calcify1 Weapon? If so branch to routine.")
-----------------------------------------------------------------------------------------------------------------------------------------
$03/C740 AD 9F 26 LDA $269F  [$7E:269F] A:0000 X:0000 Y:0000 P:envMxdiZC - Load Caster's Attack Status Byte 2 into A.
$03/C743 29 01 AND #$01 A:0001 X:0000 Y:0000 P:envMxdizC - Is it Calcify 1?
$03/C745 F0 06 BEQ $06    [$C74D] A:0001 X:0000 Y:0000 P:envMxdizC - If not, branch to next portion of Defense determination...
-----------------------------------------------------------------------------------------------------------------------------------------
$03/C747 AD 9C 26 LDA $269C  [$7E:269C] A:0001 X:0000 Y:0000 P:envMxdizC - Load Caster's Accuracy into A.
$03/C74A 20 E6 CB JSR $CBE6  [$03:CBE6] A:0063 X:0000 Y:0000 P:envMxdizC - Jump to Imbued Weapons Subroutine - (Past Status clearing)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/CBDB 7B TDC A:0001 X:0014 Y:0001 P:envMxdizc - Transfer Direct Page (Clear A without using 2 bytes.
$03/CBDC AA TAX A:0000 X:0014 Y:0001 P:envMxdiZc - Transfer A to X.
$03/CBDD 9E A0 33 STZ $33A0,x[$7E:33A0] A:0000 X:0000 Y:0001 P:envMxdiZc - Store Zero in Statuses to Inflict on Enemies (this gets rid of Calcify, which is the catalyst for this particular hack and this data sits atop the ruins of the broken Calcify Weapon Routine so nothing is lost)
$03/CBE0 E8 INX A:0000 X:0000 Y:0001 P:envMxdiZc - +1 to X
$03/CBE1 E0 1F 00 CPX #$001F A:0000 X:0001 Y:0001 P:envMxdizc - Has X gone all the way to 33BF in clearing?
$03/CBE4 D0 F7 BNE $F7    [$CBDD] A:0000 X:0001 Y:0001 P:eNvMxdizc - If not, branch back to Clearing.
---------------------------------------------------------------------------------------------------------
$03/CBE6 20 79 83 JSR $8379  [$00:8379] A:0012 X:000F Y:0000 P:envMxdizc - Jump to RNG Routine (00 to Accuracy)
$03/CBE9 C9 32 CMP #$32 A:000B X:0000 Y:0000 P:envMxdizc - Is it 50 or above?
$03/CBEB 90 54 BCC $54    [$CC41] A:000B X:0000 Y:0000 P:eNvMxdizc - If not, branch to end of routine.
------------------------------------------------------------------------------------------------------
$03/CBED A9 FF LDA #$FF A:0010 X:0000 Y:0000 P:eNvMxdizc - Load All Enemies into Targeting
$03/CBEF 8D D3 26 STA $26D3  [$7E:26D3] A:00FF X:0000 Y:0000 P:eNvMxdizc - Store A in Monster Targets.
$03/CBF2 AD B3 26 LDA $26B3  [$7E:26B3] A:00FF X:0000 Y:0000 P:eNvMxdizc - Load Right Handed Weapon
$03/CBF5 C9 06 CMP #$05 A:0005 X:0000 Y:0000 P:envMxdizc - Is it the Poison Claw?
$03/CBF7 D0 08 BNE $08    [$CC01] A:0016 X:0000 Y:0000 P:envMxdizC - If not, branch to next Weapon Check.
$03/CBF9 A9 CE LDA #$CE A:0016 X:0000 Y:0000 P:envMxdiZC - Load Kick Graphic into A.
$03/CBFB 8D C4 33 STA $33C4  [$7E:33C4] A:00CE X:0000 Y:0000 P:eNvMxdizC - Store A in Audiovisual Code
$03/CBFE 4C B4 E6 JMP $E6B4  [$03:E6B4] A:00CE X:0000 Y:0000 P:eNvMxdizC - Jump and Stay with Kick Routine
-------------------------------------------------------------------------------------------------------------------------
$03/CC01 C9 0B CMP #$0B A:000B X:0000 Y:0000 P:envMxdizC - Is it the Change Rod?
$03/CC03 D0 03 BNE $03    [$CC08] A:0016 X:0000 Y:0000 P:envMxdiZC - If not, branch to next Weapon Check.
$03/CC05 4C 1A EA JMP $EA1A  [$03:EA1A] A:0016 X:0000 Y:0000 P:envMxdiZC - Jump to Recall Routine
----------------------------------------------------------------------------------------------------------------------
$03/CC08 C9 11 CMP #$11 A:0011 X:0000 Y:0000 P:envMxdizC - Is it the Silver Staff?
$03/CC0A D0 03 BNE $03    [$CC0F] A:0016 X:0000 Y:0000 P:envMxdiZC - If not, branch to next Weapon Check.
$03/CC0C 4C DC E2 JMP $E2DC  [$03:E2DC] A:0016 X:0000 Y:0000 P:envMxdiZC - Jump to Salve(But moreso Item Master, so the released patch will include Item Master, normal Salve will probably heal Foe, if I had to guess)
-------------------------------------------------------------------------------------------------------------------------
$03/CC0F C9 17 CMP #$17 A:0017 X:0000 Y:0000 P:envMxdizC - Is it the Darkness Sword?
$03/CC11 D0 08 BNE $08    [$CC1B] A:0016 X:0000 Y:0000 P:envMxdiZC - If not, branch to next Weapon Check.
$03/CC13 A9 C5 LDA #$C5 A:0016 X:0000 Y:0000 P:envMxdiZC - Load Dark Wave graphic into A.
$03/CC15 8D C4 33 STA $33C4  [$7E:33C4] A:00C5 X:0000 Y:0000 P:eNvMxdizC - Store A in Audiovisual Code.
$03/CC18 4C E9 E9 JMP $E9E9  [$03:E9E9] A:00C5 X:0000 Y:0000 P:eNvMxdizC - Jump to Dark Wave Routine.
----------------------------------------------------------------------------------------------------------------------------
$03/CC1B C9 20 CMP #$20 A:0020 X:0000 Y:0000 P:eNvMxdizc - Is it the Ancient Sword?
$03/CC1D D0 03 BNE $03    [$CC22] A:0016 X:0000 Y:0000 P:envMxdiZC - If not, branch to next Weapon Check.
$03/CC1F 4C FA E3 JMP $E3FA  [$03:E3FA] A:0016 X:0000 Y:0000 P:envMxdiZC - Jump to Regen Routine
-----------------------------------------------------------------------------------------------------------------------
$03/CC22 C9 3B CMP #$3B A:003B X:0000 Y:0000 P:eNvMxdizc - Is it the Silver Knife?
$03/CC24 D0 03 BNE $03    [$CC29] A:0016 X:0000 Y:0000 P:envMxdiZC - If not, branch to next Weapon Check.
$03/CC26 4C CC E1 JMP $E1CC  [$03:E1CC] A:0016 X:0000 Y:0000 P:envMxdiZC - Jump to Steal Routine
-----------------------------------------------------------------------------------------------------------------------
$03/CC29 C9 3F CMP #$3F A:003F X:0000 Y:0000 P:eNvMxdizc - Is it the Crystal Sword?
$03/CC2B D0 03 BNE $03    [$CC30] A:0016 X:0000 Y:0000 P:envMxdiZC - If not, branch to next Weapon Check.
$03/CC2D4C F0 E7 JMP $E7F0  [$03:E7F0] A:0016 X:0000 Y:0000 P:envMxdiZC - Jump to Focus Routine.
----------------------------------------------------------------------------------------------------------------------------
$03/CC30 C9 46 CMP #$46 A:0046 X:0000 Y:0000 P:eNvMxdizc - Is it the Dummy Weapon?
$03/CC32 D0 08 BNE $08    [$CC3C] A:0016 X:0000 Y:0000 P:envMxdiZC - If not, branch to Sing
$03/CC34 A9 C5 LDA #$C5 A:0016 X:0000 Y:0000 P:envMxdiZC - Load Dark Wave Animation into A.
$03/CC36 8D C4 33 STA $33C4  [$7E:33C4] A:00C5 X:0000 Y:0000 P:eNvMxdizC - Store A in Audiovisual Code
$03/CC39 4C E9 E9 JMP $E9E9  [$03:E9E9] A:00C5 X:0000 Y:0000 P:eNvMxdizC - Jump to Dark Wave Routine
----------------------------------------------------------------------------------------------------------------------------
$03/CC3C 4C 00 E9 JMP $E900  [$03:E900] A:0016 X:0000 Y:0000 P:eNvMxdizc - Jump to Sing Routine




Despite my complaining about space, if I would have been a little wiser I could have saved a lot more. I only noticed now that I used JSR's instead of JMP's for the Commands when there is no longer (the STZ code that is at the start was once at the end... yeah, I'm a poor programmer) reason for them being there. And only now are they being changed... hmm, I wonder if this will give me enough space to put the Peep Weapon back in...

No thanks, that thing wasn't that great either. Instead I opted to give the Dummy Crystal Sword Dark Wave. In the end I had one byte to spare. Well again, this was an incredible adventure.


You can expect the patch forthcoming, here is what you can expect in it...

Silver Dagger - Steal
Silver Staff - Salve/Item Master
Ancient Sword - Regen
Poison Claw - Kick
Crystal Sword - Focus
Harps - Sing
Darkness Sword - Dark Wave
Change Rod - Recall
Dummy - Dark Wave

Along with several equipment changes to make these... actually work.

No pictures this time I'm afraid, its a difficult thing to actually portray.

And the Patch is done! It uses Vivify93's absolutely awesome ProjectII Patch as a base for several reasons...

One, treasure put in all of its proper spots.
Two, better translation.
Three, bug fixes.
Four, general improvements.

This patch includes Imbued Weapons and Item Master.
In addition is the changing of several weapons stats to reflect their new purposes.

The Poison Claw loses Poison and is now the "Martial Claw" when you attack with it is has a chance to use Kick.
The Change Rod now has Immense physical power for a Caster's weapon of that level and randomly uses Recall.
The Silver Staff is now the Scholar Staff that can be bought for a princely sum at the Silvera Weapon Shop, it can randomly use Item Master.
The Darkness Blade (called Shadow in the normal FFIV translations,, confusing) can use Dark Wave and when used from a weapon it curiously does not reduce HP.
The Ancient Sword's power has been immensely upgraded its ability is a powerful Regen. So you have to be careful when and how you use it, it has lost Curse though.
The Silver Knife is now the Thief's Knife which can be found lying around as always, it goes without saying its ability is Steal.

The Medusa Blade (broken piece of junk... entire point of this hack anyhow...) has been replaced by the Coral Sword, which is a rare drop from Baron Guards. But they've had their drop table changed so it may be worth grinding for. Its power is on par with the other Elemental Swords and we know that Lightning rules the day in the Tower of Babil.

The Ragnarok now has Focus as its ability so using it can be a double edged sword, you may stall yourself for several turns in a row.

On the other hand this hack introduces the Dark Crystal Sword. A copy of the Crystal Sword (Ragnarok) but two handed (yep, really created it there...). Its ability is Dark Wave, which can be Very useful late game and with the added bonus of not losing any life when its used. The Dark Crystal Sword is obtained along with the Ragnarok so you can mix and match as you please, per the situation.

Last but not least the Charmer's Harp becomes the Siren's Harp... I bet you can guess what it will do. Taking a cue from Paladin's old mod, Rydia can equip Harps as well so it is worth holding onto this for her return.

As for character changes... there's only been one.

Edward has lost Salve(now (Item)Lord (Item Master)) and it now belongs to Cid.

I should give a brief synopsis of what ItemLord does... ItemLord will read the first usable item in your inventory and split it, it can be used on Friend or Foe. Single, in case you want that powerful attack magic item to focus on a single target, or multiple for when you're in a bit of trouble and everyone could use a bit of healing or if you're down to your last man and a mass Life Potion can turn the tides. ItemLord is used in this because of Salve, because Salve will only target whoever it is currently targeting and use that assigned item spell on it. Default that is a use of a Cure Potion for deficient amount of healing, granted in Project II it's a cure potion for Cure3 Potion healing, but... it would be on the enemy.

I decided to give it to Cid because you might Actually need it when he's in the party, rather than breezing through the Dark Knight portion of the game with yet another useless skill.

And without further ado, here is the patch...

Keep in mind it must be a v1.1 and Unheadered! (I made this mistake too many times.)

And please, give me your thoughts on it!


« Last Edit: July 04, 2014, 11:20:20 AM by Grimoire LD »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
So I've now completely (well somewhat) cracked the Audiovisual code. Every byte there is a check to see if an animation is called, Every Byte... Let me put that into perspective... There are 152 bytes In Hex reserved for Audiovisual alone. You know how many are filled in with a normal spell or attack? About five or six. You can create a spell chain technically that goes on through the length of spells and beyond.

Audiovisual starts at 7E33C2 you will Never have to worry about overflowing this. This game is Extremely Capable of showing more than one spell at one time, as long as those next spell graphics are written into the next section over.


Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
I tried to use Aura to make Piercing Sight, but I couldn't grasp how to keep the value from being rewritten to a higher value as it is in Chillyfeez's code... so instead I opted to use as much code as possible in making the Piercing Sight Routine. This replaces Damage, Sap because Damage, Sap is stupid. (Normal damage formula with a Zombie Check, Timer for HP Leak, and the 60 tick, HP Leak... yeah...)

This works identically to how it works in FFIV:The After Years, except that the Dispel portion of it will even hit bosses. The Weakness adding effect will not though. It even casts Peep so you can see the new weakness!

Code: [Select]
$03/D3C2 AD 70 27 LDA $2770  [$7E:2770] A:0003 X:0002 Y:0000 P:envMxdizc - Load Target's Boss Bit.
$03/D3C5 30 48 BMI $48    [$D40F] A:0006 X:0002 Y:0000 P:envMxdizc - If a Boss branch to Black Hole Routine Jump.
$03/D3C7 A2 01 00 LDX #$0001 A:0006 X:0002 Y:0000 P:envMxdizc - Load 0001 into X.
$03/D3CA A9 80 LDA #$80 A:0006 X:0001 Y:0000 P:envMxdizc - Load 80 into A.
$03/D3CC 20 79 83 JSR $8379  [$03:8379] A:0080 X:0001 Y:0000 P:eNvMxdizc - Jump to RNG.
$03/D3CF C9 70 CMP #$70 A:001B X:0000 Y:0000 P:eNvMxdizc - Is it 70?
$03/D3D1 90 04 BCC $04    [$D3D7] A:001B X:0000 Y:0000 P:eNvMxdizc - If less than 70 branch to next RNG check.
-----------------------------------------------------------------------------------------------------------------------------------
$03/D3D3 A9 80 LDA #$80 A:0078 X:0000 Y:0000 P:envMxdizC - Load x4 Weakness into A.
$03/D3D5 80 32 BRA $32    [$D409] A:0080 X:0000 Y:0000 P:eNvMxdizC - Branch to Weakness Store.
------------------------------------------------------------------------------------------------------------------------------------
$03/D3D7 C9 60 CMP #$60 A:001B X:0000 Y:0000 P:eNvMxdizc - Is it 60?
$03/D3D9 90 04 BCC $04    [$D3DF] A:001B X:0000 Y:0000 P:eNvMxdizc - If less than 60 branch to next RNG check.
-------------------------------------------------------------------------------------------------------------------------------
$03/D3DB A9 40 LDA #$40 A:006F X:0000 Y:0000 P:envMxdizC - Load Absorb Weakness into A.
$03/D3DD 80 2A BRA $2A    [$D409] A:0040 X:0000 Y:0000 P:envMxdizC - Branch to Weakness Store.
------------------------------------------------------------------------------------------------------------------------------
$03/D3DF C9 50 CMP #$50 A:001B X:0000 Y:0000 P:eNvMxdizc - Is it 50?
$03/D3E1 90 04 BCC $04    [$D3E7] A:001B X:0000 Y:0000 P:eNvMxdizc - If less than 50 branch to next RNG check.
-----------------------------------------------------------------------------------------------------------------------------
$03/D3E3 A9 20 LDA #$20 A:0054 X:0000 Y:0000 P:envMxdizC - Load Air Weakness into A.
$03/D3E5 80 22 BRA $22    [$D409] A:0020 X:0000 Y:0000 P:envMxdizC - Branch to Weakness Store.
------------------------------------------------------------------------------------------------------------------------------
$03/D3E7 C9 40 CMP #$40 A:001B X:0000 Y:0000 P:eNvMxdizc - Is it 40?
$03/D3E9 90 04 BCC $04    [$D3EF] A:001B X:0000 Y:0000 P:eNvMxdizc - If less than 40 branch to next RNG check.
------------------------------------------------------------------------------------------------------------------------------
$03/D3EB A9 10 LDA #$10 A:0040 X:0000 Y:0000 P:envMxdiZC - Load Holy Weakness into A.
$03/D3ED 80 1A BRA $1A    [$D409] A:0010 X:0000 Y:0000 P:envMxdizC - Branch to Weakness Store.
----------------------------------------------------------------------------------------------------------------------------
$03/D3EF C9 30 CMP #$30 A:001B X:0000 Y:0000 P:eNvMxdizc - Is it 30?
$03/D3F1 90 04 BCC $04    [$D3F7] A:001B X:0000 Y:0000 P:eNvMxdizc - If less than 30 branch to next RNG check.
-----------------------------------------------------------------------------------------------------------------------------
$03/D3F3 A9 08 LDA #$08 A:0030 X:0000 Y:0000 P:envMxdiZC - Load Dark Weakness into A.
$03/D3F5 80 12 BRA $12    [$D409] A:0008 X:0000 Y:0000 P:envMxdizC - Branch to Weakness Store.
-----------------------------------------------------------------------------------------------------------------------------
$03/D3F7 C9 20 CMP #$20 A:001B X:0000 Y:0000 P:eNvMxdizc -Is it 20?
$03/D3F9 90 04 BCC $04    [$D3FF] A:001B X:0000 Y:0000 P:eNvMxdizc - If less than 20 branch to next RNG check.
--------------------------------------------------------------------------------------------------------------------------
$03/D3FB A9 04 LDA #$04 A:0020 X:0000 Y:0000 P:envMxdiZC - Load Lightning Weakness into A.
$03/D3FD 80 0A BRA $0A    [$D409] A:0004 X:0000 Y:0000 P:envMxdizC  - Branch to Weakness Store.
------------------------------------------------------------------------------------------------------------------------------
$03/D3FF C9 10 CMP #$10 A:001B X:0000 Y:0000 P:eNvMxdizc - Is it 10?
$03/D401 90 04 BCC $04    [$D407] A:001B X:0000 Y:0000 P:envMxdizC - If less than 10 branch to next RNG check.
---------------------------------------------------------------------------------------------------------------------------
$03/D403 A9 02 LDA #$02 A:001B X:0000 Y:0000 P:envMxdizC - Load Ice Weakness into A.
$03/D405 80 08 BRA $02   [$D40F] A:0002 X:0000 Y:0000 P:envMxdizC - Branch to Weakness Store.
-------------------------------------------------------------------------------------------------------------------------
$03/D407 A9 01 LDA #$01 A:0002 X:0000 Y:0000 P:eNvMxdizc - Load Fire Weakness into A.
$03/D409 0D 20 27 ORA $2720  [$7E:2720] A:0001 X:0000 Y:0000 P:envMxdizc - See if Weakness is already there.
$03/D40C 8D 20 27 STA $2720  [$7E:2720] A:0001 X:0000 Y:0000 P:envMxdizc - Store A in Weakness Byte.
$03/D40F 20 AE DD JSR $DDAE  [$03:DDAE] A:0001 X:0000 Y:0000 P:envMxdizc - Jump to Black Hole Routine.
$03/D412 4C 24 D9 JMP $D924  [$03:D924] A:0010 X:0000 Y:0000 P:envMxdizC - Jump and stay with Peep Routine.

Very simple, but pretty effective. I love Scholar classes in FF and Piercing Sight fits right along with them.

Let's see... if I were to make a Scholar Class now they could have...

Piercing Sight...
ItemLord...

Hah, I thought I made more for them. I suppose not. I still need to figure out an ItemLore scheme, grumble, grumble...


chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
I know you've told me before, but I forget (and though I've watched HCBailley's LP, he pretty much sticks to his favorite characters, and Edward's girlfriend is not one of them) - is the effect of piercing sight to assign one random elemental weakness to the target and wipe out all status anomalies? Seems like that's what this code is doing... and I guess jumping to Peep at the end displays a message about which weakness was added? Pretty ingeneous.
I'm not sure my aura code would have worked any better to this end, unless you wanted to compound multiple weaknesses.

Regarding your cracking the AV code... I'd be interested in seeing what you've found. I've kicked the tires on writing some brand new spell animations for my hack, but so far have dismissed the notion as beyond the scope of my knowledge.

My holiday season is finally over (that is, it's back to business as usual at work and I'm finally done visiting various branches of the family tree) so I plan to get back into hacking more. I'll post the code for my "attack barrage" today per your request.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
I know you've told me before, but I forget (and though I've watched HCBailley's LP, he pretty much sticks to his favorite characters, and Edward's girlfriend is not one of them) - is the effect of piercing sight to assign one random elemental weakness to the target and wipe out all status anomalies? Seems like that's what this code is doing... and I guess jumping to Peep at the end displays a message about which weakness was added? Pretty ingeneous.

Thanks!  That is precisely what it does. Except normally Piercing Sight misses bosses and doesn't even apply the Dispel-esque effect. Making it... marginally useless. Another facet of Piercing Sight is that the weakness added can Only be told by the color of the flash on the screen. Obviously I didn't have the space required to do that. Nor was I overly fond of that. When I think of "Sight", I think of seeing the enemy's stats and what good is an ability that you can't be sure what it did (granted it if it applies Absorb or x4 Weakness, you won't ever actually know since there is no Peep check for those, but you can at least be sure its one of the two.)


Quote
I'm not sure my aura code would have worked any better to this end, unless you wanted to compound multiple weaknesses.

Oh? My original plan was to take what you basically had as the Aura code, roll a random number between 1 and 80, and get rid of the compounding... but I couldn't comprehend how the compounding was done in the end so I had to abandon that idea. It seemed simple in theory, I'm not sure if it would have worked in practice.

Quote
Regarding your cracking the AV code... I'd be interested in seeing what you've found. I've kicked the tires on writing some brand new spell animations for my hack, but so far have dismissed the notion as beyond the scope of my knowledge.

My holiday season is finally over (that is, it's back to business as usual at work and I'm finally done visiting various branches of the family tree) so I plan to get back into hacking more. I'll post the code for my "attack barrage" today per your request.

Well the "AV Code"... (that's probably not the Actually use for the area.) Is an extremely simple set of  bytes. Each byte there says to do something. Here is normal attack...
Starting from 7E33C2

C2 (First Byte) - F8 - (Tied to System Commands as displayed by next byte. such as Damage Display, and some possibly debug functions.)
C3 (Second Byte) 02 -  Looks to be a Kind of message, when changed to 00 it will show the character's name in a mini-message box who is attacking. May have been used for debugging or earlier plans 01 shows the name of the foe you are striking (if it is not the last one), again may have been used in an earlier system. 03 shows no difference. 04 is used by by the last few bytes of most attack commands. Ever wonder why some routines support showing damage and others may not? Well here is your answer, F804 is the Key. 06 and up are very glitchy.

C4 (Third Byte) C0 - What we often tend to write to in our routines. This is the basic attack animation.

C5 (Fourth Byte) 00 - This is another Effect Byte, used primarily by spells.

C6 (Fifth Byte) F8 - (Another System Command Call)
C7 (Sixth Byte)04 - (Display Damage done.)

And there you have it! Creating multiple spell effects or even multiple Command effects is a very simple thing to do and displaying damage is no longer a mystery, just be sure to finish off any damaging routine with F804 and you should be golden!

You can put off displaying damage as long as you need to show as many animations/effects that your heart desires! Just be sure to write in the F804 Somewhere along the lines though.
« Last Edit: January 10, 2014, 11:54:00 AM by Grimoire LD »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
OK, Attack Barrage:
Code: [Select]
A9 CO LDA #$CO
8D C4 33 STA $33C4 ;Load attack animation
A6 A6 LDX $A6 ;Load character's slot into X
FE 73 20 INC $2073,X ;+1 to "dropped item" byte
BD 73 20 LDA $2073,X
C9 05 CMP #$05 ;Check if "dropped item" byte is 05
F0 04 BEQ $04 ;If it is, skip the next two ops
A9 ** LDA #$** ;Load [whichever command this is] into A
80 02 BRA $02 ;Skip the next op
A9 00 LDA #$00 ;Load 00 [Fight] into A
9D 51 20 STA $2051,X ;Store A in character's next command
20 99 C4 JSR $C499 ;Jump to attack subroutine
A9 03 LDA #$03
20 C8 85 JSR $85C8 ;Load character's "turn queue" slot into X
A9 08 LDA #$08 ;Load 08 [ready to perform next action] into A
9D 06 2A STA $2A06,X ;Store A in character's "turn queue" status
9E 04 2A STZ $2A04,X ;Store zero in character's "next turn wait time"
EE 0A 39 INC $390A ;Required op to prevent "turn queue" from resetting
60 RTS
Now, something to note here - my Limit skills are designed to execute a maximum of once per battle. They won't activate if the character's "dropped item" byte is anything other than 00 (and every limit skill increases the byte by at least 1). If you were to execute this command a second time, the character would attack 255 times before you regain control (2073,X would cycle up to FF then back to zero before finally reaching 05 again).

You could, add a "STZ $2073,X" in there to reset the byte back to 00. That should make the command work flawlessly as many times as you want...
So:
Code: [Select]
A9 CO LDA #$CO
8D C4 33 STA $33C4 ;Load attack animation
A6 A6 LDX $A6 ;Load character's slot into X
FE 73 20 INC $2073,X ;+1 to "dropped item" byte
BD 73 20 LDA $2073,X
C9 05 CMP #$05 ;Check if "dropped item" byte is 05
F0 04 BEQ $04 ;If it is, skip the next two ops
A9 ** LDA #$** ;Load [whichever command this is] into A
80 05 BRA $05 ;Skip the next two ops
A9 00 LDA #$00 ;Load 00 [Fight] into A
9E 73 20 STZ $2073,X ;Reset "dropped item" byte to 00
9D 51 20 STA $2051,X ;Store A in character's next command
20 99 C4 JSR $C499 ;Jump to attack subroutine
A9 03 LDA #$03
20 C8 85 JSR $85C8 ;Load character's "turn queue" slot into X
A9 08 LDA #$08 ;Load 08 [ready to perform next action] into A
9D 06 2A STA $2A06,X ;Store A in character's "turn queue" status
9E 04 2A STZ $2A04,X ;Store zero in character's "next turn wait time"
EE 0A 39 INC $390A ;Required op to prevent "turn queue" from resetting
60 RTS
This adds the needed STZ and alters the necessary BRA op to make this work the way you want it to.