Raid: Battle Call

Section 7.C.2

To initiate a raid battle, you just have to enter a script in an event like you would with any other battle. Except, instead of using WildBattle.start or TrainerBattle.start, you can use a brand new battle call named RaidBattle.start.

This new battle call can accept two arguments, although each of these arguments are optional. Just entering RaidBattle.start on its own is enough to trigger a raid battle, but you can control various aspects about the raid with the following arguments that I will go into detail about in this subsection.


Setting A Species

A species can be set by entering a value as the first argument in the RaidBattle.start call. There are various ways in which this value can be set, each of which can control which species will be encountered in a raid battle in different ways. I'll explain each method that this may be set below.

Setting a specific species

If you would like to set the specific species generated for a raid battle, you can enter the species ID of the Pokemon you want, exactly like you would in a WildBattle.start call. However, unlike with normal wild battles, you do not enter a level for the Pokemon as the second argument, since raid battles will automatically determine the level the raid Pokemon should be based on the raid's difficulty level.

For example:

RaidBattle.start(:PIKACHU)

This would initiate a raid battle with a wild Pikachu. Its level and other attributes will be naturally decided for you based on the difficulty of the raid, which will automatically scale based on your badge count and the raid ranks that the entered species is naturally capable of generating in.

Note that if the species you entered is an ineligible raid species (such as Shedinja is by default), then Ditto will be generated by the raid instead. Ditto will always act as a placeholder species to spawn in scenarios where the entered species cannot appear in a raid battle.


Entering Forms

You may enter a specific form to appear in a raid, too. This can be done the same as above, by entering the species ID of that specific form, like so:

RaidBattle.start(:RAICHU_1)

However, if you enter a form which isn't eligible, then the base form of the species will be generated instead. For example, Primal Kyogre is an ineligible raid form by default. So if you enter :KYOGRE_1 in a raid battle call, it will generate a raid with base Kyogre despite what you entered here.

If the base species is also ineligible, then the species generated will default to Ditto, same as above.

Setting a random species based on entered criteria

If you would like a raid battle to generate a random species, or generate a random species based on certain criteria, then you can enter a hash instead of a specific species ID. This hash can contain any number of the following:

  • :type => Type ID This will only randomize species that have a particular type. For example, entering :FIRE would only generate random Fire-type species.

  • :habitat => Habitat ID This will only randomize species that are found in a particular habitat. For example, entering :Forest will only generate random species that appear in the Forest habitat. A species' habitat is set in their PBS data.

  • :generation => Generation Number This will only randomize species that were introduced in a particular generation. For example, entering 3 will only generate random species from the Hoenn region, introduced in Generation 3. A species' generation is set in their PBS data.

  • :encounter ⇒ Encounter Type ID This will only randomize species that are found on a certain encounter table on the specific map this event is found on. For example, entering :Land will only generate random species that may be encountered in the Land encounter table for this map defined in the encounters.txt PBS file. The encounter type will automatically update based on the time of day, so you don't have to manually enter something like :LandNight, unless you specifically want the raid to only pull from the nighttime encounter table at all times of day. Note that the species found in this manner will scale based on the difficulty rank of the raid. So for example, if the encounter tables only contain weak Pokemon like Pidgey, but the difficulty rank of the raid would outclass Pidgey; the raid may generate a raid with the evolved forms of Pidgey instead, even though Pidgeotto or Pidgeot do not appear in this encounter table.

You can set as few or as many of these filters as you want. You can even set none of them if you'd like, and just enter nil or an empty hash for a truly random selection of species. Or, you can combine multiple filters to really narrow down the specific kinds of species you would like to appear in a raid battle. For example:

RaidBattle.start({
  :habitat    => :Cave,
  :generation => 1
})

This raid battle would generate a random species found in the Cave habitat that was introduced in Gen 1. This includes things like Onix, Zubat, Gastly, and Diglett. If you added the :type filter to this and set it to :POISON, this would narrow things down further so that only things like Zubat and Gastly could be generated.

You can use these filters to make highly specified types of raid battles that aren't set to a specific species, but will still generate species that match a specific theme. If you set a combination of filters that doesn't result in any species that matches the entered criteria, then Ditto will be spawned instead.

Note that the species that are randomly generated in this manner are entirely based on the difficulty of the raid, which is determined by the player's badge count by default. So the player will never randomly encounter something like Charizard if they only have 1 badge, for example.


Setting Raid Properties

The second argument in the RaidBattle.start call is used for setting various special rules and conditions that alter certain properties of this raid battle. These rules are entered as a hash that may contain any number of the following elements:

Key
Value
Description

:rank

Integer (1-7)

Sets the number of stars of this raid battle, aka the difficulty of the raid. By default, the rank of a raid is determined by the player's badge count, but you can manually set the rank with this setting. Note that rank 7 is the highest difficulty a raid can be.

:style

Raid Type ID

Sets the type of raid for this raid battle. This can be set to any of the following: :Basic, :Ultra, :Max, or :Tera. By default, all raid battles are Basic Raids unless specified. NOTE: This setting is totally ignored when setting up a Raid Den event, as the type of raid is determined through other means. Check out the "Raid: Raid Dens" subsection of this guide for details.

:size

Integer (1-3)

Sets the number of battlers the player will send out against the raid boss at one time. By default, this is set to the value of RAID_BASE_PARTY_SIZE in the plugin Settings. This setting is ignored if the player has less than the number of able Pokemon in the party, or if the :partner setting is entered.

:partner

Array

Sets a partner trainer to accompany the player in this raid battle. This is an array containing a trainer type ID, the name of the particular trainer, and the desired version number (optional). This partner trainer will replace any existing follower the player currently has with them for this battle only, and the original partner will be restored afterwards. Note that you may add true as an optional fourth element in this array if you wish to set a trainer without their attributes being automatically scaled to suit the raid.

:turn_count

Integer

Overrides the natural turn counter for this raid battle with the number of turns entered here. If set to nil, the turn counter for this raid battle will be disabled altogether.

:ko_count

Integer

Overrides the natural KO counter for this raid battle with the number of KO's entered here. If set to nil, the KO counter for this raid battle will be disabled altogether.

:shield_hp

Integer

Overrides the natural amount of max shield HP the raid Pokemon will have during this raid battle with the HP number entered here. If set to nil, the the raid Pokemon will be unable to summon a raid shield altogether.

:extra_actions

Array

Overrides the natural extra actions the raid Pokemon will use during this raid battle with the ones entered here. If set to nil, the the raid Pokemon will be unable to use these extra actions altogether. By default, this array contains the following extra actions:

:reset_boosts

:reset_drops

:drain_cheer

You can include or exclude whichever of these actions that you like.

:support_moves

Array

Overrides the natural extra support moves the raid Pokemon may select from during this raid battle with the ones entered here. If set to nil, the raid Pokemon will not use any extra support moves. By default, this array contains all eligible support moves that the species is capable of learning. You can include as many move ID's in this array as you like to allow the raid Pokemon to use an extra move when a support move is triggered. Despite the name "support moves," you can technically enter any move ID's here.

:spread_moves

Array

Overrides the natural extra spread moves the raid Pokemon may select from during this raid battle with the ones entered here. If set to nil, the raid Pokemon will not use any extra spread moves. By default, this array contains all eligible spread moves that the species is capable of learning. You can include as many move ID's in this array as you like to allow the raid Pokemon to use an extra move when a spread move is triggered. Despite the name "spread moves," you can technically enter any move ID's here.

:loot

Array

Used for Raid Den events only. Check out the "Raid: Raid Dens" subsection of this guide for details.

:online

False

Used for Raid Den events only. Check out the "Raid: Raid Dens" subsection of this guide for details.

For more details on specifics about partner trainers, raid counters, raid shields, and extra raid actions and moves, check out the "Raid: Battle Mechanics" subsection of this guide. That will clarify what some of these settings do, and how they are meant to be used.


Example Raid Battles

By combining the information above, I'll provide various examples of several raid battles to show how these various elements may be set.

Basic Raid Examples

Example 1

RaidBattle.start(:CHARIZARD, {
  :rank          => 5,
  :shield_hp     => 8,
  :support_moves => [:SUNNYDAY]
})

This initiates a 5-star Basic Raid vs. a wild Charizard. Charizard will always use the move Sunny Day as its support move, and will always have 8 bars of shield HP when it summons its raid shield. This will be a 3v1 battle by default, since no :size information was manually set.


Example 2

RaidBattle.start({
  :type       => :ROCK,
  :habitat    => :Mountain }, {
  :turn_count => 25,
  :partner    => [:POKEMONTRAINER_May, "May"]
})

This initiates a Basic Raid vs. a random Rock-type species that is found in the Mountain habitat. The difficulty of the raid and encounter is determined by the player's badge count, since no :rank information was manually set.

The player will have Pokemon Trainer May set as their raid partner for this battle only, so this will always be a 2v1 battle. You will also be given 25 turns to clear the raid, instead of whatever the natural turn counter would be.


Example 3

RaidBattle.start(nil, {
  :size          => 1,
  :extra_actions => [:reset_boosts, :reset_drops]
})

This initiates a Basic Raid vs. a completely random wild species based on the raid's rank. Since no :rank information has been manually set, the rank will be determined based on the player's badge count. This will be a 1v1 battle, and the raid Pokemon will be able to perform the :reset_boosts and :reset_drops extra actions, but be unable to use the :drain_cheer action since it's not included in the array.


Example 4

RaidBattle.start({
  :encounter => :Cave }, {
  :rank      => 5
})

This initiates a 5-star Basic Raid vs. a random wild species found on the :Cave encounter table for this specific map. If the species found on this encounter table are too weak to appear in a 5-star raid, such as Geodude or Machop, then the raid will consider the evolved forms of these species instead. If this map doesn't have an encounter table of this type, or if none of the species can appear in this raid (including their evolved forms), then this will be a Ditto raid instead.

Ultra Raid Examples

Example 1

RaidBattle.start(:NECROZMA, {
  :style      => :Ultra,
  :ko_count   => 6,
  :shield_hp  => nil,
})

This initiates a 6-star Ultra Raid vs. Ultra Necrozma. This will always be a 6-star raid since legendary Pokemon are always set to appear in 6-star raids by default. Necrozma will always be in Ultra Burst form despite base Necrozma being entered here, because species that have Ultra Burst forms will always appear in those forms when encountered in an Ultra Raid.

In this raid battle, the KO counter will be set to 6, overriding the natural KO counter. Ultra Necrozma will not summon a raid shield in this battle, since it has been disabled.


Example 2

RaidBattle.start({
  :generation   => 7 }, {
  :style        => :Ultra,
  :partner      => [:POKEMONTRAINER_Brendan, "Brendan", 1],
  :spread_moves => nil
})

This initiates an Ultra Raid vs. a random species from Generation 7. The difficulty of the raid and encounter is determined by the player's badge count, since no :rank information was manually set.

The player will have version 1 of Pokemon Trainer Brendan set as their raid partner for this battle only, so this will always be a 2v1 battle. The raid Pokemon will not use any extra spread moves during this battle, as they have been disabled.


Example 3

setBattleRule("editWildPokemon", {
  :item => :GHOSTIUMZ,
  :moves => [:CURSE, :SHADOWBALL, :SLUDGEBOMB, :CONFUSERAY]
})
RaidBattle.start(:GENGAR, {
  :rank          => 5,  
  :style         => :Ultra,
  :extra_actions => nil,
})

This initiates a 5-star Ultra Raid vs. Gengar. The "editWildPokemon" rule has been set to ensure that this Gengar will always be holding the Z-Crystal Ghostium Z, and has specific moves to use with its held Z-Crystal. In this battle, Gengar will not perform extra actions (reset boosts, reset drops, and drain cheer), since they have been disabled.

Max Raid Examples

Example 1

RaidBattle.start(:GYARADOS, {
  :style         => :Max,
  :spread_moves  => [:BREAKINGSWIPE, :EARTHQUAKE],
  :support_moves => [:AQUARING, :BULKUP]
})

This initiates a Max Raid vs. Gyarados. The difficulty of this raid will be randomly determined based on the raid ranks that Gyarados may appear in, since no :rank information has been set.

In this raid battle, Gyarados' AI will always select between using the moves Breaking Swipe or Earthquake when an extra spread move is triggered, and it will select between using Aqua Ring and Bulk Up when an extra support move is triggered. Note that Gyarados doesn't normally learn the moves Aqua Ring or Bulk Up, but it can be forced to use them anyway when set here.


Example 2

RaidBattle.start(:LAPRAS_1, {
  :rank     => 3,
  :style    => :Max,
  :ko_count => nil
})

This initiates a 3-star Max Raid vs. G-Max Lapras. Note that :LAPRAS_1 is usually banned from most other types of raids, and would default to base Lapras when set in most situations. However, the G-Max Lapras form is eligible in Max Raids specifically, so it can be set and encountered here without issue.

In this raid, the KO counter has been disabled, so the raid will not end regardless of how many times your Pokemon are KO'd.


Example 3

RaidBattle.start(:ETERNATUS, {
  :style         => :Max,
  :extra_actions => nil,
})

This initiates a 6-star Max Raid vs. Eternamax Eternatus. This will always be a 6-star raid since legendary Pokemon are always set to appear in 6-star raids by default. Eternatus will always be in its Eternamax form despite base Eternatus being entered here, because species that have an Eternamax form will always appear in those forms when encountered in a Max Raid.

Tera Raid Examples

Example 1

RaidBattle.start({
  :type      => :WATER,
  :encounter => :SuperRod }, {
  :rank      => 7,
  :style     => :Tera
})

This initiates a 7-star Tera Raid vs. a random Water-type species found on the :SuperRod encounter table for this specific map. This will be fought on the most extreme difficulty, since 7 is the highest rank a raid may have.


Example 2

RaidBattle.start(:TERAPAGOS, {
  :style         => :Tera,
  :size          => 2,
  :support_moves => nil,
  :extra_actions => [:drain_cheer]
})

This initiates a 6-star Tera Raid vs. Stellar Terapagos. This will always be a 6-star raid since legendary Pokemon are always set to appear in 6-star raids by default. Terapagos will always be in its Terastallized Stellar form despite base Terapagos being entered here, because species that have a special Terastal form will always appear in those forms when encountered in a Tera Raid.

This will be a 2v1 battle, and Terapagos will not use any extra support moves since they have been disabled. Terapagos will be able to perform the :drain_cheer extra action, but it won't be able to perform the :reset_boosts or :reset_drops actions since they have been excluded.


Example 3

setBattleRule("editWildPokemon", {
  :tera_type => :GHOST
})
RaidBattle.start(:SLAKING, {
  :rank          => 5,
  :style         => :Tera,
  :support_moves => [:SKILLSWAP]
})

This initiates a 5-star Tera Raid vs. Slaking. The "editWildPokemon" rule has been set to ensure that this Slaking is always Tera Ghost. In this battle, Slaking will use the move Skill Swap as an extra support move. Note that Slaking doesn't normally learn Skill Swap, but it can be forced to use it anyway when set here.


Debug Raid Battle

Note that if you would like to quickly set up a raid battle for testing purposes, you can create your own in-game through the debug menu. To do so, navigate to "Deluxe plugin settings...", and then select "Other plugin settings..."

From here, there will be an option called "Raid settings..." that opens a menu with three other options. The last option here is called "Test raid battle."

Once selected, you will be asked to choose the specific type of raid battle to participate in, and the specific species you wish to challenge. From there, you will be allowed to set specific criteria for this raid, such as the rank, what party members to bring, or whether or not there should be a partner trainer accompanying you. Once you finalized on the desired criteria for this raid battle, select the Battle option to initiate a demo raid battle.

Last updated

Was this helpful?