• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Resource icon

Resource Pokemon Outbreaks 4.0

Vendily

Elite Trainer
Member
Vendily submitted a new resource:

Pokemon Outbreaks - Route 209! There's a whole bunch of Pokemon there!

Sometimes swarms of Pokemon appear on routes they normally don't. This script just replicates the Gen 4 mechanics, for the most part. As long as the switch to activate is on, it will generate a predefined outbreak of Pokemon on one route for the time period you have set up. The script defaults to 24 hours and will persist through a save and quit.

It's a plug and play script, defaulting to being enabled with switch...

Read more about this resource...
 

VoxITH

Trainer
Member
Joined
Dec 22, 2021
Posts
92
It's not a native feature in this, since that was only added in Legends Arceus (before the script was made), but you could add some code in EncounterModifier.register to add a chance to make the Pokemon shiny.
I don’t know how to do that. Is there some kind of script that I can paste?
 

Gneipadd

Rookie
Member
Joined
Mar 1, 2022
Posts
2
When I set "[155,:FINNEON,15,55,[:Water]],"
game crash when I shore fishing
outbreak_1.png



outbreak_2.png



work fine if you surf and fish while surfing.


thank you
 

Dionen

Rookie
Member
Joined
Jul 21, 2022
Posts
2
Hello, I took the liberty to update this to essentials 20.1
also added the option to use already predefined levels (in that map's encounter.txt) if you set the min and max to -1 and -1:

Pokémon Outbreaks:
#===============================================================================
# Pokémon Outbreaks - By Vendily [v20.1 Update by Dionen] - v4
#===============================================================================
# This script adds in the Mass outbreak of pokemon that appear on a random map.
# It uses the Gen 4 version of the mechanics, so when the save is loaded, if
#  there is no active outbreak and the switch is active, will pick one outbreak
#  at random and spawn them at a 40% encounter rate. Feel free to change that of
#  course.
#===============================================================================
# This script includes some utility functions, such as the ability to
#  randomly set a new outbreak at will with pbGenerateOutbreak, and get the
#  location and species of an outbreak, pbOutbreakInformation (which can save in
#  two variables,  for species and map in that order). The variables contain
#  strings for names, or -1 if there is no outbreak. It will also return the map
#  id and species index for your scripting uses.
#===============================================================================
# * The length of time that an encounter will last in hours. (Default 24)
# * The percent chance an outbroken pokemon will spawn in place of
#    a regular one. (Default 40)
# * The switch used to enable outbreaks. (Default 100)
# * A set of arrays each containing details of a wild encounter that can only
#      occur via Pokemon Outbreaks. The information within is as follows:
#      - Map ID on which this encounter can occur.
#      - Species.
#      - Minimum possible level.
#      - Maximum possible level.
#      - Allowed encounter types.
#===============================================================================
PluginManager.register({
  :name    => "Pokémon Outbreaks",
  :version => "3.0",
  :link    => "https://eeveeexpo.com/resources/266/",
  :credits => "Vendily"
})
 
OUTBREAK_TIME    = 24
OUTBREAK_CHANCE  = 40
OUTBREAK_SWITCH  = 100
OUTBREAK_SPECIES = [
    [5,:DODUO,2,2,[:Land]],
    [5,:VOLTORB,28,29,[:Land,:LandNight]],
    [2,:MILOTIC,-1,-1,[:Water]]
    ]
class PokemonGlobalMetadata
  attr_accessor :currentOutbreak
end

def pbGenerateOutbreak
  index=rand(OUTBREAK_SPECIES.length)
  $PokemonGlobal.currentOutbreak=[index,pbGetTimeNow]
end

EventHandlers.add(:on_wild_species_chosen, :make_outbreak_battle,
  proc { |encounter|
    next encounter if !encounter
    next encounter if !$game_switches[OUTBREAK_SWITCH]
    if !$PokemonGlobal.currentOutbreak || $PokemonGlobal.currentOutbreak[0]<=-1 || ((pbGetTimeNow-$PokemonGlobal.currentOutbreak[1])>OUTBREAK_TIME*60*60)
       $PokemonGlobal.currentOutbreak=[-1,nil]
    end
    
    if $PokemonGlobal.currentOutbreak[0] > -1
       newenc=OUTBREAK_SPECIES[$PokemonGlobal.currentOutbreak[0]]
       species=newenc[1]
       next encounter if $game_map && $game_map.map_id!=newenc[0]
       next encounter if !newenc[4].include?($PokemonEncounters.encounter_type)
       if rand(100) < OUTBREAK_CHANCE
         encounter[0] = species
         if newenc[2] > 0 && newenc[3] > 0
           level=rand(newenc[3]-newenc[2])+newenc[2]
           encounter[1] = level
         end
       end
     end
     next encounter
  }
)

EventHandlers.add(:on_enter_map, :make_outbreak_happen,
  proc { |_old_map_id|
      next if !$game_switches[OUTBREAK_SWITCH]
        if !$PokemonGlobal.currentOutbreak || $PokemonGlobal.currentOutbreak[0]<=-1 || ((pbGetTimeNow-$PokemonGlobal.currentOutbreak[1])>OUTBREAK_TIME*60*60)
          pbGenerateOutbreak
      end
  }
)

def pbOutbreakInformation(speciesvar,mapvar)
  if !$PokemonGlobal.currentOutbreak || $PokemonGlobal.currentOutbreak[0]<=-1 || ((pbGetTimeNow-$PokemonGlobal.currentOutbreak[1])>OUTBREAK_TIME*60*60)
      $PokemonGlobal.currentOutbreak=[-1,nil]
      $game_variables[speciesvar]=-1 if speciesvar>0
      $game_variables[mapvar]=-1 if mapvar>0
      return [-1,-1]
  end
  newenc=OUTBREAK_SPECIES[$PokemonGlobal.currentOutbreak[0]]
  species=newenc[1]
  $game_variables[speciesvar]=GameData::Species.get(species).name if speciesvar>0
  $game_variables[mapvar]=pbGetMessage(MessageTypes::MapNames,newenc[0]) if mapvar>0
  return [newenc[0],species]
end
 
Back
Top