Skip to content

Active ability features

Tirlititi edited this page Jun 19, 2023 · 2 revisions

Introduction

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.

Documentation

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

  [code=Patch] {Formula} [/code]              -> Swap the ability with another one
                                             This affects the ability in battles but also in the menu
  [code=Priority] {Formula} [/code]           -> Change the command's priority, to make it trigger as soon as inputted
  [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.

The feature Patch applies at any time. Its formula may include the same variables and functions as a Permanent supporting ability feature.

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). Their formulas may include these variables and functions:

  Common variables and functions, IsSingleTarget, IsSelfTarget, AreCasterAndTargetEnemies, AreCasterAndTargetAllies,
  CasterMaxHP, CasterMaxMP, CasterMaxATB, CasterHP, CasterMP, CasterATB, CasterTrance, CasterInTrance, CasterModelId,
  CasterCurrentStatus, CasterPermanentStatus, CasterResistStatus, CasterHalfElement, CasterGuardElement, CasterAbsorbElement,
  CasterWeakElement, CasterBonusElement, CasterWeaponPower, CasterWeaponRate, CasterWeaponElement, CasterWeaponStatus,
  CasterWeaponCategory, CasterWeaponId, CasterHeadId, CasterWristId, CasterArmorId, CasterAccessoryId,
  CasterSerialNumber, CasterRow, CasterPosition, CasterSummonCount, CasterIsPlayer, CasterIsSlave, CasterIsOutOfReach,
  CasterLevel, CasterExp, CasterSpeed, CasterStrength, CasterMagic, CasterSpirit, CasterDefence, CasterEvade,
  CasterMagicDefence, CasterMagicEvade, CasterPlayerCategory, CasterCategory, CasterCharacterIndex,
  CasterIsStrengthModified, CasterIsMagicModified, CasterIsEvadeModified, CasterIsDefenceModified,
  CasterIsMagicDefenceModified, CasterIsMagicEvadeModified, CasterCriticalRateBonus, CasterCriticalRateWeakening,
  CasterHasSA(support ability ID)
  CommandId, AbilityId, ScriptId, Power, AbilityStatus, AbilityElement, AbilityElementForBonus,
  ItemUseId, WeaponThrowShape, SpecialEffectId, TargetType, IsATBCommand, IsAbilityMultiTarget, IsShortSummon,
  IsSpellReflected, IsCovered, IsDodged, IsShortRanged, IsReflectNull, IsMeteorMiss, AbilityCategory, MPCost,
  AbilityFlags, CommandTargetId, CalcMainCounter

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(66) <= GetAbilityUsageCount(67) ? 66 : 67 [/code]

Change Meteor's missing condition: Have Vivi's Meteor always miss in random battles but never miss against bosses and scripted battles.

  >AA 46 Meteor
  [code=SpecialEffect] IsRandomBattle ? 143 : 134 [/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) ? BattleFilter(255, 1, 1, BattleStatus_Death | BattleStatus_Jump) : -1 [/code]
  [code=SpecialEffect] HasSA(33) ? (UseSFXRework ? 89 : 506) : -1 [/code]

Jewel Mix: Have a custom Mix ability requiring 2 Ores + 1 other random jewel The actual ability effect 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]