---
description: Section 7.F
---

# Terastallization

[**Eevee Expo Link**](https://eeveeexpo.com/resources/1476/)

[**PokeCommunity Link**](https://www.pokecommunity.com/threads/terastallization-dbk-add-on-v21-1.525945/#post-10795127)

[**Download Link**](https://www.mediafire.com/file/8q5gh9u8sbeu9eu/Terastallization.zip/file)

This plugin builds upon the Deluxe Battle Kit to add the Terastallization battle mechanic introduced in _Pokemon Scarlet & Violet_. All functionality for this mechanic has been replicated in this plugin, and will work along side other battle gimmicks such as Mega Evolution without issue. In the following subsections, I'll go over specific areas of this plugin in more detail. Below, I'll go over general plugin functionality.

***

<mark style="background-color:orange;">**Terastal Availability**</mark>

Once this plugin is installed, Terastallization will be available to use right out of the gate. However, there are some criteria that must be met in order for the option to Terastallize to appear in battle. Below I'll go over all the factors for Terastallization eligibility, how to disable its availability, and various other settings related to its use.

<details>

<summary>General</summary>

Terastallization is available by default after installation. However, if you would like to disable the Terstallization mechanic entirely at any point, you may do so by using a game switch.&#x20;

In the plugin settings, there is a setting named `NO_TERASTALLIZE` which stores the switch number used for disabling Terstallization. This is saved as switch number `69` by default, but please renumber this if this conflicts with an existing game switch that you use.

If this switch is turned on, then Terstallization will be disabled for all trainers and Pokemon until the switch is turned back off. If you're plaing in debug mode, you can easily toggle this switch on and off by going into the debug menu and opening the "Deluxe plugin settings..." menu, and then selecting "Toggle Terastallization."

***

<mark style="background-color:yellow;">**Pokemon Requirements**</mark>

By default, all Pokemon are capable of Terastallization if the trainer meets the necessary requirements to utilize the mechanic. However, there are some exceptions. The following are all of the reasons why a Pokemon may be unable to Terastallize:

* The Pokemon is a Shadow Pokemon.
* The Pokemon is already Terastallized.
* The Pokemon is in Mega form, or meets all the criteria for Mega Evolution.
* The Pokemon is in Primal form, or meets all the criteria for Primal Reversion.
* The Pokemon is holding a Z-Crystal and is capable of using an eligible Z-Move.
* The Pokemon is in Ultra Burst form, or meets all the criteria for Ultra Burst.
* The Pokemon is in Dynamax form, or on a map that supports Dynamax and meets all the criteria for Dynamax.
* The Pokemon is Transformed into a species that has a unique Terastal form that cannot be duplicated.
* The Pokemon has a unique Terastal form, but is currently Transformed into a different species that would prevent it from entering that unique form.
* The Pokemon somehow doesn't have a Tera Type.
* The Pokemon has been manually flagged as unable to use Terastallization.
* The Pokemon is a member of a species that has been given the `CannotTerastallize` flag in its PBS data.

Note that if a Pokemon with Illusion is disguised as a species with a unique Terastal form, such as Ogerpon, its Illusion will automatically end if it attempts to Terastallize while disguised as that species. The Illusion will also fail to activate if the Pokemon in the player's last party slot is Terastallized into a unique Terastal form.

If you would like to flag a specific Pokemon as unable to use Terastallization, you may do so by setting `Pokemon.terastal_able = false`, where `Pokemon` is the specific Pokemon object that you'd like to flag.&#x20;

While playing in debug mode, this can also be done for the player's Pokemon by opening a Pokemon's debug options and selecting "Plugin attributes..." at the bottom of the list, and then selecting "Terastal..." From here, you can select "Set eligibility" to toggle the Pokemon's ability to use Terastallization.&#x20;

If you would like to flag an entire species as unable to use Terastallization instead of just a specific Pokemon, you may also do this by giving that species the `CannotTerastallize` flag in its PBS data.

Note that in any case where a Pokemon is unable to use Terastallization, it will be considered as having no Tera Type, and so this will be hidden from all displays that would show it.

***

<mark style="background-color:yellow;">**Debug Battle Options**</mark>

While playing in debug mode, you can manually edit Terastal options for trainers and Pokemon. To do so, open the debug menu while in battle (F9), and navigate to "Trainer options..." and then "Terastallization." You'll be able to toggle Terastallization availability for each trainer from here.

If you'd like to edit the Terastal attributes of specific battlers or party members, you may also do this by navigating to a specific Pokemon from the "Battlers..." or "Pokemon teams" options, and then scrolling down to the "Terastal values" option for that Pokemon.

</details>

<details>

<summary>Player</summary>

<mark style="background-color:yellow;">**Tera Orb**</mark>

To use Terastallization yourself, you'll first need to have an item in your inventory that unlocks the ability to use it. Any item given the `TeraOrb` flag in its PBS data will be considered a Tera Orb, which will allow you to Terastallize. By default, this plugin adds the Tera Orb introduced in _Pokemon Scarlet & Violet_. Feel free to create your own custom Tera items, too.\
\
In addition, the player also requires that their Tera Orb be charged in order to use Terastallization. The player's Tera Orb is depleted upon each use, and must be recharged between uses. You can recharge your Tera Orb by healing at a Pokemon Center. If you're currently on a map that is flagged as `AreaZero` in its map metadata, your Tera Orb will have infinite charge and won't require recharging.\
\
While playing in Debug mode, new options related to the player's Tera Orb will be added to the "Deluxe plugin settings..." in the debug menu. These can be found in the "Terastal settings..." option.

<img src="https://2153694798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzqYxbzoSOVtGkOgfRUQ%2Fuploads%2FmwbWlKeZYhpwEMFGJ9Rk%2F%5B2024-02-20%5D%2012_17_47.602.png?alt=media&#x26;token=8cb3c17a-8b0d-4b16-8aa9-cf0be1fa329a" alt="" data-size="original"> ![](https://2153694798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzqYxbzoSOVtGkOgfRUQ%2Fuploads%2FcHVnbO5YljVsRcmVmcmf%2F%5B2024-02-20%5D%2012_17_50.113.png?alt=media\&token=25764c09-f86c-408e-89fc-c1e40d97fb9a)

* **Player's Tera Orb is charged**\
  This allows you to toggle the player's Tera Orb between a charged and uncharged state.
* **Tera Orb has infinite charge**\
  This allows you to toggle whether or not the player's Tera Orb requires charging between uses, or remains in a permanent charged state. This relies on a game switch to toggle on or off. This game switch is saved in the plugin settings as `TERA_ORB_ALWAYS_CHARGED`, and is set to game switch number `70` by default. Please renumber this if it conflicts with an existing switch number you use.

In addition, while playing in debug mode you may also hold `CTRL` while Terastallizing to keep your Tera Orb charged, or even hold the `CTRL` key while opening the Fight menu to force the Terastallization button to appear even if your Tera Orb is uncharged.

***

<mark style="background-color:yellow;">**Radiant Tera Jewel**</mark>

This plugin introduces a completely custom item not found in the original Pokemon Scarlet & Violet called the Radiant Tera Jewel. This is a unique item that may replenish your Tera Orb's charge during battle, allowing you to Terastallize an additional time during the same battle. Using this item in battle uses up the player's entire turn in order to try and keep it (sorta) balanced, so this will use up the turn for all of your Pokemon even if you have more than one Pokemon to issue commands to.

<img src="https://2153694798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzqYxbzoSOVtGkOgfRUQ%2Fuploads%2FdbA5b94pKAnKNJuwgXeY%2Fdemo46.gif?alt=media&#x26;token=447251ae-c818-467d-80c3-ba44aa960d32" alt="" data-size="original">

This is intended to be a "just for fun" item, and not to be used seriously, but it's there if you'd like to make use of it.

</details>

<details>

<summary>NPC Trainers</summary>

<mark style="background-color:yellow;">**Trainer Requirements**</mark>

Other trainers may utilize Terastallization too, whether they're opponents or partners. The requirements for this are the same as for the player, they are simply set up differently. Like with the player, the NPC trainer must be given an eligible Tera Orb in their inventory in order to use Terastallization. However, unlike the player, Tera Orbs owned by NPC trainers are always considered "charged", and don't require recharging between uses.

The Pokemon eligible to be Terastallized by an NPC trainer all follow the same rules as for the player. This means that any Pokemon in an NPC trainer's party which is considered an "exception" will not be considered for Terastallization. If you'd like to flag certain members of an NPC's party as ineligible for Terastallization, you may do so by setting `NoTera = true` for that Pokemon in the trainer's PBS data. This may also be done within the in-game trainer editor while playing in debug mode.

This setting can be useful if the trainer has a certain Pokemon in their party that would be entirely wasteful to use Terastallization on due to not having any offensive capabilities, or because changing their type might actually screw up some sort of specific strategy you have in mind for that trainer to use. You can also use this setting to force a trainer to only consider Terastallization for a certain member in their party by flagging all other members besides the one you want them to Terastallize with this flag.

***

<mark style="background-color:yellow;">**Terastal AI**</mark>

The Pokemon that an NPC trainer will Terastallize will be automatically determined by the trainer's AI. How effective this is depends on the skill level of each particular trainer. Below, I'll give a general description of how each trainer skill level will handle how to utilize Terastallization.

Note that Trainers who are given the `ReserveLastPokemon` flag in their PBS data will always save Terastallization for their final Pokemon, no matter what. This behavior will override what their natural AI behavior would otherwise be.

* **"Low" skilled trainers** (skill < 32)\
  Typically, the lowest skilled trainers will only ever consider how to use Terastallization offensively. This means if using Terastallization would give them an immediate offensive advantage due to dealing more raw damage to one of the currently active targets on the field, then they will use it.\

* **"Medium" skilled trainers** (skill >= 32)\
  Medium skilled trainers will also only consider Terastallization offensively, however they will gauge this across their entire party. So if Terastallization would give them an advantage, but there's another Pokemon in their party which would gain a substantially higher offensive advantage from Terastallization, then they will hold off on using it until they send out that Pokemon. This calculation is constantly checked each turn, so which Pokemon would be "best" to use Terastallization on may constantly change as the battle state progresses.\

* **"High" skilled trainers** (skill >= 48)\
  High skill trainers will consider Terastallization both offensively and defensively, and across their entire party. So if they calculate that Terastallization would grant them an advantage offensively, they will weigh this against how much this would cost them defensively. They'll calculate this for each member of their party, as well. If they have determined that their active Pokemon would gain a substantial offensive or defensive advantage from Terastallization, and that that this advantage in one area isn't outweighed by the cost of the other, then they'll choose to Terastallize that Pokemon.\

* **"Best" skilled trainers** (skill = 100+)\
  Trainers with the highest skill level will naturally be given the `ReserveLastPokemon` flag. Any trainer with this skill flag will always save Terastallization for their final Pokemon, no matter what. This will typically include trainers such as Gym Leaders and Elite Four members. If you choose to disable this flag for a trainer with this skill level, then their AI behavior will default to how "high" skilled trainers function.

For trainers of all skill levels, if they are down to their final Pokemon and have still yet to use Terastallization in this battle for some reason, then they may use it out of desperation even if it's not particularly advantageous. The will still avoid using it however if it would put them in a dramatically worse position, though (depending on their AI).

</details>

<details>

<summary>Wild Pokemon</summary>

Terastallization may also be utilized by wild Pokemon, without the need of a trainer or a Tera Orb. These wild Tera battles replicate how they work in _Pokemon Scarlet & Violet_, so they work a little differently than a standard wild battle.

When encountered, a wild Tera Pokemon will immediately Terastallize at the start of battle, before any commands can even be entered. When this happens, the Pokemon will become uncatchable until you break their Terastallization by lowering their HP to a certain threshold (1/6th of their max HP). Any damage dealt by direct attacks cannot exceed this threshold until the wild Pokemon's Terastallization is removed. When removed, the Pokemon will become catchable again like a normal wild Pokemon.

If the wild Pokemon is ineligible to use Terastallization for some reason, nothing will happen and the battle will just be a standard wild battle.\
\
To set up battles against wild Tera Pokemon, you may do so by using the <mark style="background-color:green;">"wildTerastallize"</mark> Battle Rule.

</details>

***

<mark style="background-color:orange;">**Terastal Count**</mark>

Essentials internally keeps track of a variety of the player's game statistics. One of those statistics is how many times the player has used Mega Evolution. To keep Terastallization in line with this, I've added trackers which will keep count of various statistics related to Terastallization, too.

Below are all of the new statistics tracked by this plugin, and how to call them.

* **Terastallization count**\
  This plugin keeps count of how many times the player has Terastallized. This can be called with the script `$stats.terastallize_count`.\

* **Wild Tera battles won**\
  This plugin keeps count of how many battles the player has won against wild Tera Pokemon. A "win" counts as either defeating or capturing the Pokemon to end the battle. This can be called with the script `$stats.wild_tera_battles_won`.\

* **Tera types changed**\
  This plugin keeps count of how many times the player has changes the Tera Type of their Pokemon. This only considers legitimate methods of changing Types through the use of Tera Shards, or other items which may change a Pokemon's Tera Type. Changing this through debug shortcuts or by hardcoding the change through a script will not count. This can be called with the script `$stats.total_tera_types_changed`.
