Final Attack (ファイナルアタック, Fainaru Atakku?), also known as a death counter or a death script, is a gameplay term in the Final Fantasy series. It refers to a part of a unit's attack script that has it execute an action upon being killed. In terms of game coding, the final attack can be a specific attack, or the final attack script can initiate a cutscene.
When a monster revives itself using the final attack script, it is treated as if it had never died; monsters with a final attack script to revive themselves typically are not meant to be killed. For example, the player's goal is to defeat Wrexsoul, not the Soul Savers, so simultaneously killing the Soul Savers would hypothetically end the battle with Wrexsoul still "alive," but due to the final attack script, they are not treated as being dead during the time they revive themselves, and so the battle continues. In the same way, the player is intended to defeat the demon form of the Chadarnook, not the goddess form, so the final attack script to revive itself keeps the player from winning by killing the goddess form.
There are ways around this script. Certain Death attacks stall an enemy's final attack script for one turn. They are Banish, Odin, Raiden, Oblivion, Snare, and Banisher. For most normal enemies, disabling their final attack only does that and nothing more, but against certain bosses glitches can arise. Against Wrexsoul and the Soul Savers, if the player kills a Soul Saver with Snare or Banish, their final attack to revive themselves will not execute and they will remain dead. If both Soul Savers are killed this way, and Wrexsoul removes/has removed itself from the battle, the battle will end as the game considers the player to have defeated the enemy party.
If the player kills Deathgaze with the Vanish-Doom bug using Banish in the Super Nintendo version, it prevents the game from recognizing it as beaten. This does not permanently miss the Bahamut magicite; while it will not drop for that battle, Deathgaze's death script never running also means Deathgaze is not flagged as defeated, and continues to appear at random, and so will give the magicite whenever he is beaten "properly".
The player can use the final attack script as part of the Final Attack Materia, won from the Battle Square after winning the Special Battle once. If the player's Materia quota is full, they will permanently lose the Final Attack Materia. For each level the Materia gains, the command from the attached Materia will be used upon death, up to a maximum of five times. This can be further extended if the player equips the same Materia again to another Final Attack Materia on the same character, up to eight times. Final Attack can be paired with a wide variety of Materia, including all Magic and Summon Materia, as well as many Command Materia.
Several enemies execute a final attack when their HP is reduced to 0. Some enemies, such as the Dragon Zombie and Ultimate Weapon, cast a powerful spell. Other enemies that have a final attack script are 2-Faced, Bottomswell, Gargoyle, Hojo, and Helletic Hojo.
Dragon Zombie is special in that it will only use its final attack, Pandora's Box, once per save file due to a global variable coded into the attack. The global variable is also used in the Jenova∙SYNTHESIS battle, meaning that after this battle, fighting another Dragon Zombie would have it use its final attack again. This is normally impossible since the Jenova∙SYNTHESIS battle is past the point of no return.
Final attack scripts are generally run through monsters that are at least level 30 or higher, including the Buel, Imp, Behemoth, and Krysta. If killed via instant death moves, the final attack script does not play.
Two bosses useg final attacks upon their "death": Beatrix and Kuja. While the player has technically won against these opponents by reducing their HP to 0, they use a powerful attack that reduces the entire party's HP to 1, or ends the battle instantly, respectively. Thus, for storyline purposes, neither opponent can technically be defeated, and they give no battle spoils.
Maliris uses Raining Swords when defeated as a final attempt to defeat the player. If all the characters' HP is depleted by this attack, it is Game Over even if Maliris also dies.
Only two enemies have access to a final attack. The Behemoth King casts Meteor when killed, and the Catoblepas casts Ultima. If either enemy is defeated by a counterattack or Zanmato, the final attack will not be executed. In the case of the Behemoth King in the PAL/International/HD versions, if it is captured on the final attack, it will not cast Meteor.
Some opponents, such as the Behemoth fought in the KS99 BCNM Horns of War, use final attacks upon their death.