<Patch name="Abandon gives 100/XX% evasion bonus"> <Description>Fixing an old hack by FFM. Not sure if this hack was already fixed by someone else, but here you go anyway. The first section is vanilla, so you don't have to use that (it's mainly for when I patch FFT Arena with it).
For 50% evasion bonus, XX = 43 and for 33% bonus, XX = 4b </Description> <Location file="BATTLE_BIN" offset="11E3BC"> 1980033c dc386324 00006290 00000000 </Location> <Variable name="XX" file="BATTLE_BIN" offset="11E3CC" /> <Location file="BATTLE_BIN" offset="11E3CD"> 000234 000062a0 </Location> </Patch>
<Patch name="Geomastery RSM"> <Description>Replaces Secret Hunt/Train Routine with Geomastery. Example: If a unit is standing on Lava (which corresponds to Lava Ball, which is fire elemental), this movement will boost all Fire elemental skills. If the unit is standing on Grass (which corresponds to Hell Ivy, which is non-elemental), this movement will do nothing. Default for this RSM is Move on Lava. Will be coded to work with weapons shortly :)</Description> <Location file="BATTLE_BIN" offset="124988"> 00000000 </Location> <Location file="BATTLE_BIN" offset="11EFFC"> e8ffbd27 1000bfaf 281f060c 00000000 834e050c 00000000 1000bf8f 1800bd27 0800e003 00000000 </Location> <Location file="BATTLE_BIN" offset="120CA0"> e8ffbd27 1000bfaf 1980023c 942d428c 00000000 95004390 00004434 20006330 16006010 00000000 b6fc050c 00000000 0680033c f0fb6324 0e000434 18004400 12100000 21186200 07006390 00000000 08006010 00000000 1980023c 942d428c 00000000 71004490 00000000 25186400 710043a0 1000bf8f 1800bd27 0800e003 00000000 </Location> <Location file="BATTLE_BIN" offset="ECA0C"> 1980023c 942d428c 1980033c f7386390 71004290 00000000 24104300 0c004010 00000000 1980033c ce386384 00000000 80100300 21104300 02004104 00000000 03004224 83100200 1980013c ce3822a4 0800e003 00000000 </Location> </Patch>
<Patch name="Move/Jump+X Routine Condensation"> <Description>Removes the checks for move/jump +2 and 3, and nops space afterward. This frees up SCUS space from 0x5c950-0x5c980. Useful if you are only using move/jump+1 for your hack.</Description> <Location file="SCUS_942_21" offset="4D0EC"> 0500a014 00000000 2a008294 2e008394 280082a4 2c0083a4 3a008590 93008690 3b008390 8000c230 02004010 1000c230 0100a524 02004010 00000000 01006324 fd00422c 02004014 ffff6230 fc000534 0800422c 02004014 3a0085a0 07000334 0800e003 3b0083a0 </Location> <Location file="SCUS_942_21" offset="4D150"> 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 </Location> </Patch>
<Patch name="Move-Get EXP becomes Reflect Null"> <Description>Reflectable skills become unreflectable when equipped. A word of warning: This hack also makes stuff in math skill reflectable, so don't use unless you plan on scrapping calculators!</Description> <Location file="BATTLE_BIN" offset="125FE8"> 1980033c 942d6390 1980023c 94006390 f5384290 40006330 11006010 00000000 </Location> </Patch>
Formula Hacks:
<Patch name="Formula 26 becomes Random Steal"> <Description>Was going to be 100% status if nothing can be stolen/broken, but I couldn't really do that feasibly in 37 lines or less. I set the base chance to steal/break as 50% for each slot here.</Description> <Location file="BATTLE_BIN" offset="122794"> e8ffbd27 1000bfaf 4421060c 00000000 1c004014 00000000 8c17060c 00000000 7e21060c 00000000 6719060c 00000000 441d060c 00000000 1980023c 982d428c 00000000 8c014390 91004290 0d006010 00000000 04004230 05004014 00000000 d076050c 00000000 0400c014 00000000 18000434 100044a0 1a0048a0 00000000 00000000 1000bf8f 1800bd27 0800e003 00000000 </Location> <Location file="BATTLE_BIN" offset="F6B40"> e8ffbd27 1000bfaf 21300000 21380000 1980023c 982d428c 00000000 21104700 1a004890 ff000334 05000311 00000000 32000534 3378010c 64000434 05004014 06000234 f2ffe214 0100e724 07000010 01000134 1980023c 902d428c 80000334 0718e300 190043a0 030048a0 1000bf8f 1800bd27 0800e003 00000000 </Location> </Patch>
<Patch name="Turn HP damage/healing into MP damage/healing"> <Description>Useful if you wanted to make a weapon the deals MP damage, but heals MP upon absorb for instance.</Description> <Location file="BATTLE_BIN" offset="F6AFC"> 1980023c 902d428c 00000000 06004494 10000334 03008010 060040a4 0a0044a4 250043a0 04004494 20000334 03008010 040040a4 080044a4 250043a0 0800e003 00000000 </Location> </Patch>
<Patch name="Versatile Cure"> <Description>Depends on the higher of PA or MA</Description> <Location file="BATTLE_BIN" offset="ECA10"> 1980023c 942d428c 1980043c 36002280 37002480 fa382380 2b288200 0300a010 ce3824a4 00000000 ce3822a4 0800e003 d03823a4 </Location> <Location file="BATTLE_BIN" offset="121EF8"> e8ffbd27 1000bfaf 844e050c 00000000 1622060c 00000000 541c060c 00000000 d41c060c 00000000 ad1f060c 00000000 1000bf8f 1800bd27 0800e003 00000000 </Location> </Patch>
<Patches> <Patch name="New talk skill"> <Description>Stat + Status Hack: Replaces talk skill formula Includes: - (MA+X)% chance to hit - 100% add status if ability lands - Change PA, MA, brave, faith, or speed based on elemental flags - Y value is between 0 and 255, determines whether it's raised or lowered (sign bit) and the amount (everything else) - Blockable by Finger Guard
Notes: - You can only really change one stat unless you want both stats to be changed by the same amount - Quick and CT 00 can be done by setting a CT change of FF (255) and 7F (127), respectively. - How to determine the Y value if you're not familiar with hex: Take the amount you want to change the stat and add 128 to make it add the stat, and leave it as is to make it subtract.
<Patches> <Patch name="Status Conditional - Check if target has X status"> <Description>The status to check for is indexed as X in the patcher and it is a value between 0-27 (hex).
TUTORIAL: Offset represented by X/8: 0-7 00000000 - 00000111 => 00000 = 0 => Group 1 8-f 00001000 - 00001111 => 00001 = 1 => Group 2 10-17 00010000 - 00010111 => 00010 = 2 => Group 3 18-1f 00011000 - 00011111 => 00011 = 3 => Group 4 20-27 00100000 - 00100111 => 00100 = 4 => Group 5
This is the offset you want to read from byte 0x0058 in the unit's data.
Last 3 bits of X value to status flags correlation: X Bits Flags Example 0 000 0x01 Wall 1 001 0x02 Stop 2 010 0x04 Slow *** 3 011 0x08 Haste 4 100 0x10 Shell 5 101 0x20 Protect 6 110 0x40 Regen 7 111 0x80 Poison
Slow is in the 4th group of statuses and has a value of 0x04. So to check for slow, we go to the start of the unit's current statuses (byte 0x0058 in the unit data) and we look 3 bytes after that. The offset is 3, therefore our first 5 bytes of the X value will be 00011. Then we need to get the last 3 bytes from the table shown above. 0x04 corresponds to 010. Now we just need to OR the two values to get the final X value: 00011010 = 1A in hex = 26 in decimal. Don't forget that the X field in patcher is decimal.</Description> <Location file="BATTLE_BIN" offset="E8480"> 1980023c fa384390 982d428c c2200300 21208200 58008290 07006330 47106200 c0170200 c2170200 02004010 00000334 01000334 0800e003 00000000 </Location> </Patch> <Patch name="Faith-based damage, 2x damage if target has X status"> <Description>Replaces formula 56. Does faith-based damage, and 2x damage if the target has a certain status.</Description> <Location file="BATTLE_BIN" offset="1236F8"> e8ffbd27 1000bfaf 6123060c 00000000 203d050c 00000000 08006010 00000000 1980023c 902d428c 00000000 04004384 00000000 00883100 040064a4 1000bf8f 1800bd27 0800e003 00000000 </Location> </Patch> </Patches>
<Patch name="Smart brave/faith hack 2.0"> <Description>Original idea by DW, Fixed by Emmy. :) What it does: - Brave and faith gradually return to original values when changed - Works in increments of 5 - Works! :) </Description> <Location file="BATTLE_BIN" offset="11c280"> E7780508 00000000 </Location> <Location file="BATTLE_BIN" offset="f739c"> 24000B92 23000C92 26000D92 25000E92 2A106C01 0A004010 00000000 23188B01 0500622C 02004014 80006324 85000334 25002292 160023A2 01004234 250022A2 2A10AE01 0A004010 00000000 2318CD01 0500622C 02004014 80006324 85000334 25002292 170023A2 01004234 250022A2 A90C0608 00000000 </Location> </Patch>
<Patch name="Multi-hit determined by random fire flag"> <Description>X + 1 hits, Y + 1 hits if math skill is checked.</Description> <Location file="BATTLE_BIN" offset="1165D0"> 04004590 00000000 08004530 1600a010 ff00c330 00000000 05004590 00000000 4000a530 0300a010 00000000 1980023c fa385090 00000000 bbf50508 01000226 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 </Location> </Patch>
AI Hacks:
<Patch name="Jump on Sleeping Unit Fix"> <Description>AI no longer jumps on sleeping allies. Replaces the check for charge.</Description> <Location file="BATTLE_BIN" offset="137958"> 09000234 </Location> </Patch>
<Patch name="AI becomes not dumb with protect/shell"> <Description>AI will now use these statuses only if GREATER than 50% HP.</Description> <Location file="BATTLE_BIN" offset="137CD4"> 01004230 03004010 </Location> </Patch>
<Patch name="AI Throw Item Fix"> <Description>AI correctly sees throw item as 4 range.</Description> <Location file="BATTLE_BIN" offset="12E9FC"> 04000234 </Location> </Patch>
Title: Re: DW's ASM Thread
Post by: Emmy on August 24, 2016, 02:37:21 am
Quick question: In your Geomastery hack, what exactly are these lines doing in between where you load the ability ID and the ability element?
ori r4,r0,0x000e mult r2,r4 mflo r2 addu r3,r3,r2
I ask because I'm writing a different tile based ability.
Also if you want Geomastery to work with both weapon attacks and abilities, do you patch both hacks? I'd assume so, but it's unclear.
Title: Re: DW's ASM Thread
Post by: dw6561 on August 24, 2016, 08:39:35 pm
The data for each skill is 0x000e bytes long, so that is multiplying the ability ID by 0x000e and adding it to the table start. That gives me the ability data for the corresponding elemental skill that the attacker is standing on.
And yeah, you would patch both hacks for that. However, the one that works for weapons is untested as of right now, which is why it is separate.
Title: Re: DW's ASM Thread
Post by: dw6561 on November 17, 2016, 01:40:32 am
I kinda just dumped all of my ASMs that have been tested here just now. Enjoy. A quick note about the formula below: It displays just the hit % if the status can't be added for whatever reason. That being said, it has been tested to work with the AI (I wasn't sure due to the elemental flag weirdness).
<Patches> <Patch name="New talk skill"> <Description>Stat + Status Hack: Replaces talk skill formula Includes: - (MA+X)% chance to hit - 100% add status if ability lands - Change PA, MA, brave, faith, or speed based on elemental flags - Y value is between 0 and 255, determines whether it's raised or lowered (sign bit) and the amount (everything else) - Blockable by Finger Guard
Notes: - You can only really change one stat unless you want both stats to be changed by the same amount - Quick and CT 00 can be done by setting a CT change of FF (255) and 7F (127), respectively. - How to determine the Y value if you're not familiar with hex: Take the amount you want to change the stat and add 128 to make it add the stat, and leave it as is to make it subtract.
Maybe I'm not getting the terminology right. I wasn't sure what to call it when it adds the stat if you add 0x80 and subtracts it if you don't. Sometimes I think I'm being smart but I'm really not, and this is apparently one of those times.
No, monsters can be hit regardless. I've always thought monster talk was the stupidest support skill ever, but I can make a version for monster talk if need be.
Title: Re: DW's ASM Thread
Post by: Timbo on November 18, 2016, 05:23:35 pm
Quote from: dw6561 on November 18, 2016, 01:44:46 am Maybe I'm not getting the terminology right. I wasn't sure what to call it when it adds the stat if you add 0x80 and subtracts it if you don't. Sometimes I think I'm being smart but I'm really not, and this is apparently one of those times.
No, monsters can be hit regardless. I've always thought monster talk was the stupidest support skill ever, but I can make a version for monster talk if need be.
No need. I also think that monster talk should die in a fire and never return. This is great!
Title: Re: DW's ASM Thread
Post by: dw6561 on December 03, 2016, 03:52:13 pm
UPDATE: Steal hack has been tested, and it works fine if you replace the animation so "stole ..." doesn't appear, as that was my only real concern. I still have no idea how to make this display the item name stolen, so if anyone knows how to do that, please tell me. For example, do I have to store that in the attacker's current action data?
Title: Re: DW's ASM Thread
Post by: Xifanie on December 03, 2016, 04:29:15 pm
I know where it is stored, but I don't know which function writes to it... I think anyway? I looked into that stuff a few years ago, but I'm pretty sure the string IDs and the amounts displayed by the special text characters are called from the same table which starts at 0x80165EF4. I'm not sure I remember the sections correctly, but every 0x0400 means another section, and IIRC 0x0000 is the start of ability names and 0x0400 is the start of item names... add the corresponding ID and you got yourself your text string ready to print in whatever message box FFT calls for. So 0x0480 would print "Leather Hat" when requested. In this case, there's only one special value, so it should be the first one (the table supports up to 64 entries; it's ridiculous), meaning 0x80165EF4. Just tossing that out there or something, idunno.
I'm way too tired to look deeper into this at the moment.
Title: Re: DW's ASM Thread
Post by: Timbo on December 10, 2016, 10:49:17 pm
What exactly does the Multi-hit determined by random fire flag asm do? I'm confused.
Title: Re: DW's ASM Thread
Post by: dw6561 on December 11, 2016, 03:43:04 pm
If random fire is checked in the patcher, it makes the skill multi-hit with X or Y being the number of hits (X if math skill is not checked, Y if it is). So rather than hardcode the multi hit functionality to 2-3 formulas like vanilla does, you can use ANY formula as long as it doesn't use one of those variables.
Title: Re: DW's ASM Thread
Post by: Timbo on December 11, 2016, 10:24:04 pm
Quote from: dw6561 on December 11, 2016, 03:43:04 pm If random fire is checked in the patcher, it makes the skill multi-hit with X or Y being the number of hits (X if math skill is not checked, Y if it is). So rather than hardcode the multi hit functionality to 2-3 formulas like vanilla does, you can use ANY formula as long as it doesn't use one of those variables.
That's great. I'm guessing that all the skills that do this still strike targets in an aoe randomly? Does Math Skill still work with this asm?
Title: Re: DW's ASM Thread
Post by: dw6561 on December 13, 2016, 01:42:13 pm
Yes, targets will still be struck randomly for the time being. I'm hoping that I can find maybe ANOTHER patcher flag to attach multi-hit functionality to so that you can apply as many hits as you want to any skill in the game without sacrificing X or Y (example application- multi-hit raise spell).
Also, I recommend not using the "spell charging" animation with it because it does repeat that for however many times it hits.
Most modders remove math skill because it's overpowered, but as long as random fire is not checked it should be fine. I think math skill only accepts skills from WM, BM, time magic, and YY magic also. Therefore, I don't think rafa/malak's skills should be impacted at all. However, just be careful about making sure things are checked where they are supposed to or else funny bugs could happen.
Maybe I could put in a "check for skillset of used ability, skip multi-hit if math skill" section if that would help. I'd imagine all sorts of bugs could happen if random fire/multi-hit were used with math skill.
(I kept that in because maybe, just maybe someone with creativity would use it for something I didn't think of.)
Title: Re: DW's ASM Thread
Post by: dw6561 on January 22, 2017, 02:59:54 am
Updated the smart brave/faith hack because apparently it didn't work the way I wanted it to. Credits to Emmy for rewriting it.
Also, new AI hacks based on the recently decoded AI routines! Still trying to figure out how to give priority to blank status and dark/evil looking though...
Title: Re: DW's ASM Thread
Post by: deus-misereatur on April 06, 2018, 10:49:44 am
Um, not sure if I should resurrect this topic or not, but for the "multi-hit determined by random fire flag" patch, I think it suffers from the left hand weapon bug much like previous multi-hit patches as well.
This can be seen by having the additional attacks deal 0 damage when WP is involved in the formula and the left hand is empty, and dealing the appropriate damage when the left is suitably equipped. Weapons which are forced to be wielded with two hands deal 0 damage as well for the additional attacks.
EDIT: Upon remembering that Choto had a fix for weapon strike, I decided to try and patch that fix in, and lo and behold, it seems to be working fine. Still have to try and see if there's any other unwanted side effects or not.
Title: Re: DW's ASM Thread
Post by: stardragoon9 on September 08, 2018, 03:30:16 pm
Quote from: deus-misereatur on April 06, 2018, 10:49:44 am Um, not sure if I should resurrect this topic or not, but for the "multi-hit determined by random fire flag" patch, I think it suffers from the left hand weapon bug much like previous multi-hit patches as well.
This can be seen by having the additional attacks deal 0 damage when WP is involved in the formula and the left hand is empty, and dealing the appropriate damage when the left is suitably equipped. Weapons which are forced to be wielded with two hands deal 0 damage as well for the additional attacks.
EDIT: Upon remembering that Choto had a fix for weapon strike, I decided to try and patch that fix in, and lo and behold, it seems to be working fine. Still have to try and see if there's any other unwanted side effects or not.
Did you mean combining Choto's Weapon strike hack with DW's random fire hack,does that hack has the Load Delay issue?
By the way doesn't Choto had a multi hit hack of his own?Did the AI problem fixed?
Title: Re: DW's ASM Thread
Post by: deus-misereatur on September 29, 2018, 12:26:57 pm
IIRC, there isn't any Load Delay issue after combining both hacks. I did not test it extensively, though, so there might still be issues I might not be unaware of - the bug I detailed above, however, seemed fixed though, which, at that time, I was super elated for.
As for Choto's multi-hit hack, last I checked, the AI problem was still there.
Title: Re: DW's ASM Thread
Post by: JadeKnightblazer on May 24, 2021, 08:21:22 am
"Status Conditional - Check if target has X status" Possible to check if target has any status effect? via any option.
Be neat to make a skill that does more damage if target has an status effect.