• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Resource icon

v19 Primal Boost 1

This resource pertains to version 19 of Pokémon Essentials.
Pokémon Essentials Version
v19.1 ➖
This script was written for my own game, but I have decided to share it with anyone who may be interested. Just paste it above main in a new section in the script editor. This script also comes with its own scene, which can be modified by changing the default file names of the sounds to those you want to use.

Primal Boost is similar to hypertraining and requires a Pokemon to be level 100. The process drains a pokemon's level and experience points, lowering the pokemon's level by 10. This number can be easily modified in the script. The end result of Primal Boost is that the chosen Pokemon will have all their IV's boosted by 11. This number can also be easily altered within the script. Pokemon who undergo this process are happy to level up again while gaining all the standard benefits of leveling up.

This is my first time sharing a script; anyone may use it for their own Pokemon projects. I have no plans to add any further functionality to the script or update it to another version of Pokemon Essentials. I give permission for the script to be shared and modified. Credit: Pokemon Liberator

Primal Boost Script:
Expand Collapse Copy
################################################################################
# Choose Pokemon For Primal Boost Method
################################################################################

def pbChooseAblePrimalBoostPokemon
  return pbChoosePokemon(1, 3, proc { |pkmn|
    next false if pkmn.isEgg?
    next pkmn.level >= 100
  }) { |pkmn, i|
    next false if !pkmn
    next false if !pkmn.level || pkmn.level < 100
    next true
  }
end


################################################################################
# Primal Boost
################################################################################


class PokemonPrimalBoost
  def initialize
    @pokemon = nil
  end

  def valid_pokemon?(pokemon)
    return true if pokemon.iv.values.any? { |iv| iv < 31 }
    false
  end

  def choose_pokemon
    pbChooseAblePrimalBoostPokemon { |pkmn|  # Use the custom method here
      pkmn.level == 100
    }

    chosen_pokemon_index = pbGet(1)

    return if chosen_pokemon_index == -1

    @pokemon = $Trainer.party[chosen_pokemon_index]
  end

  def primal_boost_pokemon
    choose_pokemon

    return unless @pokemon

    return unless valid_pokemon?(@pokemon)

    increase_all_ivs_by_11(@pokemon)
    reduce_level_and_experience_by_10(@pokemon)

    @pokemon.calc_stats
    
    # Call the original PokemonPrimalBoostScene here
    scene = PokemonPrimalBoostScene.new
    scene.pbStartScene(@pokemon)
    scene.pbPrimalBoost
    scene.pbEndScene

    pbMessage(_INTL("{1} has been Primal Boosted!", @pokemon.name))
  end

  def increase_all_ivs_by_11(pokemon)
    stats = [:HP, :ATTACK, :DEFENSE, :SPECIAL_ATTACK, :SPECIAL_DEFENSE, :SPEED]
    
    stats.each do |stat|
      current_iv = pokemon.iv[stat]
      next if current_iv.nil?
      
      # Increase the IV
      pokemon.iv[stat] = [current_iv + 11, 31].min
    end
  end

  def reduce_level_and_experience_by_10(pokemon)
    new_level = [pokemon.level - 10, 1].max # Ensure level doesn't go below 1
    pokemon.level = new_level
    pokemon.exp = pokemon.growth_rate.minimum_exp_for_level(new_level)
  end
end

# Script Commands: (Requires both commands)
# pbChooseAblePrimalBoostPokemon  # Allows the selection of a level 100 pokemon
# PokemonPrimalBoost.new.primal_boost_pokemon  # Initiates the Primal Boost process for the selected Pokémon

#===============================================================================
# Pokémon Primal Boost Scene
#===============================================================================
class PokemonPrimalBoostScene
  def initialize
    @sprites = {}
    @viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
    @viewport.z = 99999
  end

  def pbStartScene(pokemon)
    @pokemon = pokemon
    addBackgroundOrColoredPlane(@sprites,"background","evolutionbg",
       Color.new(248,248,248),@viewport)

    # Setting up Pokémon Sprite
    rsprite = PokemonSprite.new(@viewport)
    rsprite.setOffset(PictureOrigin::Center)
    rsprite.setPokemonBitmap(@pokemon, false)
    rsprite.x = Graphics.width/2
    rsprite.y = (Graphics.height-64)/2
    @sprites["rsprite"] = rsprite

    pbFadeInAndShow(@sprites)
  end

  def pbPrimalBoost
    # Play your desired SE here
    pbSEPlay("SE_Zoom6", 100, 50)
    zoom_duration = 20   # Frame duration for zoom effect

    # Zoom in effect
    for i in 1..zoom_duration
      @sprites["rsprite"].zoom_x += 0.01
      @sprites["rsprite"].zoom_y += 0.01
      pbUpdate
      Graphics.update
    end

    # Short pause after zoom
    (Graphics.frame_rate/2).times do
      pbUpdate
      Graphics.update
    end

    # Play another SE here
    pbSEPlay("Pkmn move learnt", 100, 50)
    # Wait for the SE to finish
    (Graphics.frame_rate).times do
      pbUpdate
      Graphics.update
    end
  end

  def pbEndScene
    pbFadeOutAndHide(@sprites)
    pbDisposeSpriteHash(@sprites)
    @viewport.dispose
  end

  def pbUpdate
    pbUpdateSpriteHash(@sprites)
  end
end
Credits
Credit if used: Pokemon Liberator
  • Like
Reactions: TechSkylander1518
Author
Pokemon Liberator
Views
679
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Pokemon Liberator

Back
Top