• 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.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
Sacrifice for stat machine!

v21.1 Sacrifice for stat machine! 2025-08-06

This resource pertains to version 21.1 of Pokémon Essentials.
Pokémon Essentials Version
v21.1 ✅
This may be compatible with other versions, it for sure will be with minor edits. (this was technically made with Essentials GSC V21.1 but will still work with Essentials V21.1)

Add this script above main and name it whatever you want or "tradeOffMachine"
Ruby:
Expand Collapse Copy
def tradeOffMachine
  if $player.party.length < 2
    pbMessage("You need at least two Pokémon in your party to use this machine.")
    return
  end

  # Setup the party screen
  scene = PokemonParty_Scene.new
  screen = PokemonPartyScreen.new(scene, $player.party)

  # 1. Choose the Pokémon to sacrifice
  scene.pbStartScene($player.party, _INTL("Choose a Pokémon."))
  scene.pbSetHelpText("Choose the Pokémon to sacrifice.")
  sac_index = scene.pbChoosePokemon
  if !sac_index || sac_index < 0
    scene.pbEndScene
    pbMessage("Cancelled.")
    return
  end
  sac_pkmn = $player.party[sac_index]

  # 2. Choose the Pokémon to receive
   # 2. Choose the Pokémon to receive
  scene.pbSetHelpText("Choose the Pokémon to receive the transfer.")
  recv_index = scene.pbChoosePokemon
  if !recv_index || recv_index < 0 || recv_index == sac_index
    scene.pbEndScene
    pbMessage("Invalid selection.")
    return
  end
  recv_pkmn = $player.party[recv_index]

  # Check if they are in the same evolution family
  sac_family  = sac_pkmn.species_data.get_family_species
  recv_species = recv_pkmn.species

  unless sac_family.include?(recv_species)
    scene.pbEndScene
    pbMessage("#{recv_pkmn.name} is not in the same evolutionary family as #{sac_pkmn.name}.")
    return
  end
  #recv_pkmn = $player.party[recv_index]

  scene.pbEndScene

  # 3. Choose what to transfer
  transfer_options = [
    _INTL("HP IV"),
    _INTL("Attack IV"),
    _INTL("Defense IV"),
    _INTL("Sp. Atk IV"),
    _INTL("Sp. Def IV"),
    _INTL("Speed IV"),
    _INTL("Shiny Flag"),
    _INTL("Pokerus"),
    _INTL("First Move")
  ]
  choice = pbMessage("What do you want to transfer?", transfer_options, -1)
  if choice < 0
    pbMessage("Cancelled.")
    return
  end

  # 4. Perform the transfer
  case choice
  when 0 then recv_pkmn.iv[:HP]              = sac_pkmn.iv[:HP]
  when 1 then recv_pkmn.iv[:ATTACK]          = sac_pkmn.iv[:ATTACK]
  when 2 then recv_pkmn.iv[:DEFENSE]         = sac_pkmn.iv[:DEFENSE]
  when 3 then recv_pkmn.iv[:SPECIAL_ATTACK]  = sac_pkmn.iv[:SPECIAL_ATTACK]
  when 4 then recv_pkmn.iv[:SPECIAL_DEFENSE] = sac_pkmn.iv[:SPECIAL_DEFENSE]
  when 5 then recv_pkmn.iv[:SPEED]           = sac_pkmn.iv[:SPEED]
  when 6 then recv_pkmn.makeShiny
  when 7 then recv_pkmn.givePokerus
  when 8
    if sac_pkmn.moves[0]
      recv_pkmn.moves[0] = sac_pkmn.moves[0].clone
    else
      pbMessage("No move in slot 1 to transfer. Cancelling.")
      return
    end
  end

  # 5. Confirm and remove the sacrificed Pokémon
  if pbConfirmMessage("Are you sure you want to sacrifice #{sac_pkmn.name}?")
    $player.party.delete_at(sac_index)
    pbMessage("#{sac_pkmn.name} has been sacrificed. The transfer is complete.")
  else
    pbMessage("Cancelled.")
  end
end

There isn't a pretty UI but since Im making a Gen 2 game most of you wouldn't want the one I would make!

Next in an event do a script and put "tradeOffMachine" or "tradeOffMachine()" in the script


Now talk to the event and it will have you select 2 pokemon, the first is the sacrifice and the second is the Inheritor. They must be from the same evolutionary line If you want it to be any pokemon try the script at the bottom instead!

Lastly it will ask what you want to Inherit a stat Iv or a move or shininess Ect... after you select the first pokemon... runs away? and the second powers up how you selected... or down I guess...


Here's an alternative script If you want any pokemon to work and not just one from the evolutionary family

Code:
Expand Collapse Copy
def tradeOffMachine
  if $player.party.length < 2
    pbMessage("You need at least two Pokémon in your party to use this machine.")
    return
  end

  # Setup the party screen
  scene = PokemonParty_Scene.new
  screen = PokemonPartyScreen.new(scene, $player.party)

  # 1. Choose the Pokémon to sacrifice
  scene.pbStartScene($player.party, _INTL("Choose a Pokémon."))
  scene.pbSetHelpText("Choose the Pokémon to sacrifice.")
  sac_index = scene.pbChoosePokemon
  if !sac_index || sac_index < 0
    scene.pbEndScene
    pbMessage("Cancelled.")
    return
  end
  sac_pkmn = $player.party[sac_index]

  # 2. Choose the Pokémon to receive
  scene.pbSetHelpText("Choose the Pokémon to receive the transfer.")
  recv_index = scene.pbChoosePokemon
  if !recv_index || recv_index < 0 || recv_index == sac_index
    scene.pbEndScene
    pbMessage("Invalid selection.")
    return
  end
  recv_pkmn = $player.party[recv_index]

  scene.pbEndScene

  # 3. Choose what to transfer
  transfer_options = [
    _INTL("HP IV"),
    _INTL("Attack IV"),
    _INTL("Defense IV"),
    _INTL("Sp. Atk IV"),
    _INTL("Sp. Def IV"),
    _INTL("Speed IV"),
    _INTL("Shiny Flag"),
    _INTL("Pokerus"),
    _INTL("First Move")
  ]
  choice = pbMessage("What do you want to transfer?", transfer_options, -1)
  if choice < 0
    pbMessage("Cancelled.")
    return
  end

  # 4. Perform the transfer
  case choice
  when 0 then recv_pkmn.iv[:HP]              = sac_pkmn.iv[:HP]
  when 1 then recv_pkmn.iv[:ATTACK]          = sac_pkmn.iv[:ATTACK]
  when 2 then recv_pkmn.iv[:DEFENSE]         = sac_pkmn.iv[:DEFENSE]
  when 3 then recv_pkmn.iv[:SPECIAL_ATTACK]  = sac_pkmn.iv[:SPECIAL_ATTACK]
  when 4 then recv_pkmn.iv[:SPECIAL_DEFENSE] = sac_pkmn.iv[:SPECIAL_DEFENSE]
  when 5 then recv_pkmn.iv[:SPEED]           = sac_pkmn.iv[:SPEED]
  when 6 then recv_pkmn.makeShiny
  when 7 then recv_pkmn.givePokerus
  when 8
    if sac_pkmn.moves[0]
      recv_pkmn.moves[0] = sac_pkmn.moves[0].clone
    else
      pbMessage("No move in slot 1 to transfer. Cancelling.")
      return
    end
  end

  # 5. Confirm and remove the sacrificed Pokémon
  if pbConfirmMessage("Are you sure you want to sacrifice #{sac_pkmn.name}?")
    $player.party.delete_at(sac_index)
    pbMessage("#{sac_pkmn.name} has been sacrificed. The transfer is complete.")
  else
    pbMessage("Cancelled.")
  end
end
Credits
InTheLight
Author
InTheLight
Views
470
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from InTheLight

Back
Top