STEAM GROUP
Final Fantasy - Modding FF-Modding
STEAM GROUP
Final Fantasy - Modding FF-Modding
292
IN-GAME
2,310
ONLINE
Founded
26 July, 2015
Language
English
Location
United States 
Showing 1-10 of 40 entries
2
Final Fantasy XII Mod -Path to Greatness
2
FF8's KERNEL?
867
1
Memoria - Engine modifications
2
FF8's KERNEL?
32
Hades Workshop
Originally posted by Tirlititi:
It is possible although often tricky to do it. The battle engine (CIL code) is the thing that controls the supporting abilities' effects. The auto-status, along with the immune-status, are handled in the method "btl_abil::CheckStatusAbility".

Here is what it looks like in C#
https://www.dropbox.com/s/b50cj0gruiytcu3/Source_AutoAbilities.cs?dl=0

What you need to do is changing the few things in the "if" block corresponding to the supporting ability that you want to change. Mainly, you need to replace the number by the one corresponding to the new status you want, but there may be some few additional requirements depending on that status.

For auto-shell and auto-protect, it seems that you need to add both the flag to the "permanent status" and "current status" fields, otherwise it doesn't work properly. For some others, you need to call an SPS method in order to display the corresponding icon in the battle.

In CIL Code (what you can see and edit in Hades Workshop), the "Auto-Life" part looks like this:
IL_00F3: ldarg.0 IL_00F4: ldfld 0x400024C // BTL_DATA::sa IL_00F9: ldc.i4.0 IL_00FA: ldelem.u4 IL_00FB: ldc.i4.s 16 IL_00FD: and IL_00FE: brfalse IL_011A // NOTE: the 'brfalse' target is the IL position right after the 'stfld' call IL_0103: ldarg.0 IL_0104: ldfld 0x400022C // BTL_DATA::stat IL_0109: dup IL_010A: ldfld 0x400021F // STAT_INFO::cur IL_010F: ldc.i4 8192 IL_0114: or IL_0115: stfld 0x400021F // STAT_INFO::cur
You can turn it into an "Auto-Shell" by replacing that part of the method by this:
IL_00F3: ldarg.0 IL_00F4: ldfld 0x400024C // BTL_DATA::sa IL_00F9: ldc.i4.0 IL_00FA: ldelem.u4 IL_00FB: ldc.i4.s 16 IL_00FD: and IL_00FE: brfalse IL_0131 // NOTE: the 'brfalse' target is the IL position right after the second 'stfld' call IL_0103: ldarg.0 IL_0104: ldfld 0x400022C // BTL_DATA::stat IL_0109: dup IL_010A: ldfld 0x400021E // STAT_INFO::permanent IL_010F: ldc.i4 4194304 IL_0114: or IL_0115: stfld 0x400021E // STAT_INFO::permanent IL_011A: ldarg.0 IL_011B: ldfld 0x400022C // BTL_DATA::stat IL_0120: dup IL_0121: ldfld 0x400021F // STAT_INFO::cur IL_0126: ldc.i4 4194304 IL_012B: or IL_012C: stfld 0x400021F // STAT_INFO::cur
And replace the part corresponding to "Auto-Regen" by something similar, but with the status 8388608 (Protect) instead of 4194304 (Shell).

NOTES:
1) It might happen that the 'ldfld' and 'stfld' 0x... identifiers are different in your version (usually because you wouldn't have the latest Steam patch). Don't copy/paste the above code if that's the case, but write one with your 0x... identifiers instead.
2) You can add several statuses without problem. Using the status 12582912, for instance, will make an "Auto-Mother". In such case, you still need to add the special requirements of each statuses.
3) When editing the CIL code, the targets of the different 'brfalse' (and the other 'br' opcodes) outside of the edited part of the code are automatically updated. However, the target position of 'brfalse' must be carefully verified, even if you copy/paste the code above. It must points to the position right after the end of the corresponding C# "if" block.

Good luck.
Thank you for showcasing how to properly change it! For me I actually wanna change Float and Regen to pretty much protect and shell, I'm struggling on figuring which part is Float and Regen. If you can point out on where the IL_ line of where they both start on and end at that be helpful for me to change them up.
Showing 1-10 of 40 entries