Skip to content

Active ability features

Tirlititi edited this page Oct 24, 2024 · 7 revisions

In Final Fantasy IX, several abilities are handled specially by the game in order to have original effects. For example, Carbuncle changes depending on the accessory currently equipped, or Roulette's target is randomised on casting. Memoria's active ability features allow to control these very special ways to handle abilities, that go beyond the effect of the ability when it hits its targets. The effects of active abilities are stored in the file StreamingAssets/Data/Characters/Abilities/AbilityFeatures.txt, together with supporting ability features and can be modified using a simple text editor such as a Notepad. To some extent, they also work similarly to supporting ability features.

Table of Contents

Active Ability features

Similarly to supporting ability features, active ability features are introduced by a line >AA {AbilId} {Comment} with AbilId being the numerical ID of the ability to which a feature is applied.

It is also possible to declare features >AA Global+ {Comment} that can apply to multiple abilities, in which case a code Condition is mandatory. Also, Patch cannot be used in global features.

Each ability can optionnally have special modifiers that change their behaviour depending on the context. There are 12 possible different modifiers, triggered by 12 different tags:

  [code=Patch] {Formula} [/code]              -> Swap the ability with another one
                                             This affects the ability in battles but also in the menu
  [code=Disable] {Formula} [/code]            -> Setup a special requirement for using the ability
  [code=Priority] {Formula} [/code]           -> Change the command's priority, to make it trigger as soon as inputted
  [code=MPCost] {Formula} [/code]             -> Change the ability's MP cost
  [code=GilCost] {Formula} [/code]            -> Add a gil cost to the cast of the ability
  [code=ItemRequirement] {Formulas} [/code]   -> Add item requirement(s) to the cast of the ability, without using it (them) directly
                                             There can be several formulas separated by a semi-colon ;
                                             Formulas go 2 by 2, with the 1st one defining the item ID and the 2nd one defining the item amount (default: 1)
  [code=Power] {Formula} [/code]              -> Dynamically change the ability's power
  [code=HitRate] {Formula} [/code]            -> Dynamically change the ability's hit rate
  [code=Element] {Formula} [/code]            -> Dynamically change the ability's element
  [code=Status] {Formula} [/code]             -> Dynamically change the ability's status
  [code=Target] {Formula} [/code]             -> Redefine the command's target(s)
  [code=SpecialEffect] {Formula} [/code]      -> Dynamically change the ability's special effect

Most of the time, formulas should use the format {condition} ? {formula 1} : {formula 2} in order to be efficient. Alternatively, you can add a condition [code=Condition] {Formula} [/code] that will make the features apply only if that condition is satisfied. Note that Condition doesn't work with Patch features: for these, only the method using a formula in the form {condition} ? {formula 1} : {formula 2} can be done.

Check here what parameters can be used in these formulas.

The feature Patch applies at any time. Its formula may include informations about the player character (their current HP or level for instance) but not about their state in battle (their ATB cannot be used for instance).

The features Disable and MPCost apply only in battles but is also used when browsing the menus, so before any command is sent.

The feature Priority applies as soon as a command is sent (either as a player input or as a reaction). Its formula may include the same variables and functions as below for the other features.

The other features apply when the command starts, on the tick before the Command supporting ability features take effect. before the setup of a few informations (IsCovered will always return false, for example). Check here which informations they can include.

Examples

Fenrir Earth/Wind: Alternate between Fenrir (Earth) and Fenrir (Wind) when casting it, instead of patching the ability depending on Eiko's accessory.

  >AA 66 Fenrir
  [code=Patch] GetAbilityUsageCount(BattleAbilityId_Fenrir1) <= GetAbilityUsageCount(BattleAbilityId_Fenrir2) ? BattleAbilityId_Fenrir1 : BattleAbilityId_Fenrir2 [/code]

Change Meteor's missing condition: Have Vivi's Meteor always miss in random battles but never miss against bosses and scripted battles. This is done by changing the special effect of Meteor to the version that fails (and that has no effect point).

  >AA 46 Meteor
  [code=Condition] IsRandomBattle [/code]
  [code=SpecialEffect] 143 [/code]

Change Spare Change gil cost: Have the gil cost of Spare Change be a fraction of the player's total gil (Spare Change's power should then be set to a number between 0 and 100). The default formula is Power * CasterLevel.

  >AA 126 Spare Change (single)
  [code=GilCost] Power * Gil / 100 [/code]
  >AA 134 Spare Change (multi)
  [code=GilCost] Power * Gil / 100 [/code]

Curse using weapon's element: Curse elemental weaknesses using Amarant's weapon element when applicable, and a random element if Amarant's weapon has none. Both of these formulas are valid for picking a random element.

  >AA 129 Curse (single)
  [code=Element] CasterWeaponElement != 0 ? CasterWeaponElement : (1 << GetRandom(0, 8)) [/code]
  >AA 137 Curse (multi)
  [code=Element] CasterWeaponElement != 0 ? CasterWeaponElement : GetRandomBit(255) [/code]

Summon have priority: Have summons take priority over the other commands, once per character per battle.

  >AA 49 Shiva
  [code=Priority] CasterSummonCount <= 1 ? 1 : -1 [/code]
  >AA 51 Ifrit
  [code=Priority] CasterSummonCount <= 1 ? 1 : -1 [/code]
  >AA 53 Ramuh
  [code=Priority] CasterSummonCount <= 1 ? 1 : -1 [/code]
  etc...

Concentrate improves Shell: Have Shell upgrade to Mighty Guard if Concentrate is equipped. Note that returning the value -1 will not apply any change.

  >AA 11 Shell
  [code=Patch] HasSA(33) ? BattleAbilityId_MightyGuard : -1 [/code]

Concentrate improves Haste: Have Haste upgrade to a party-wide spell if Concentrate is equipped. Note that the SFX Rework system allows to use the special effect Haste (89) on multiple targets but it has to be switched to Carbuncle's Emerald effect (506) if that system is deactivated.

  >AA 13 Haste
  [code=Target] HasSA(33) ? BattleUnitFilter(CandidateIsPlayer == CasterIsPlayer && CandidateIsTargetable && !CheckAnyStatus(CandidateCurrentStatus, BattleStatus_Death, BattleStatus_Jump)) : -1 [/code]
  [code=SpecialEffect] HasSA(33) ? (UseSFXRework ? 89 : 506) : -1 [/code]

Jewel Mix: Have a custom ability that requires 2 Ores + 1 other random jewel. The actual ability effect, including the removal of these items, has to be coded in a custom battle script (see External Battle scripts)

  >AA 200 Mix Jewels
  [code=Power] RegularItem_Garnet + GetRandom(0, 12) [/code]
  [code=ItemRequirement] RegularItem_Ore ; 2 ; Power ; 1 [/code]

Don't waste Soul Blade: Cannot select Soul Blade and thus waste a turn when a weapon other than a thief sword is equipped.

  >AA 104 Soul Blade
  [code=Disable] CasterWeaponShape != 2 [/code]

No MP in Oeilvert: Disable all the abilities costing MP in Oeilvert (not only magic spells).

  >AA Global+ Oeilvert extended curse
  [code=Disable] (GetEventGlobalByte(227) & 1) != 0 && MPCost > 0 [/code]

Command features

Very similarly, it is possible to define command features. These are introduced by a line >CMD {CommandId} {Comment} with CommandId being the numerical ID of the command to which a feature is applied.

Again, it is possible to declare non-Patch features >CMD Global+ {Comment} that can apply to multiple commands, in which case a code Condition is mandatory.

The possible features for commands are:

  [code=Patch] {Formula} [/code]              -> Swap the command with another one
  [code=Disable] {Formula} [/code]            -> Setup a special requirement for accessing the command (greyed out)
  [code=HardDisable] {Formula} [/code]        -> Setup a special requirement for accessing the command (hide completly)

The formulas there can use player character informations and battle unit informations.

Examples

Defender's own command: Change the command "Defend" to a custom command with ID 104 when the weapon Defender is equipped.

  >CMD 4 Defend
  [code=Patch] WeaponId == RegularItem_Defender ? 104 : -1 [/code]

Summon is spoiler: Completly disable Garnet's summoning command before the events in Alexandria's dungeon.

  >CMD 16 Garnet's summon
  [code=Condition] ScenarioCounter < 5080 [/code]
  [code=HardDisable] true [/code]