• 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!
Preventing Pomeg Berry Exploit

v19 Preventing Pomeg Berry Exploit 2021-09-20

This resource pertains to version 19 of Pokémon Essentials.
Pokémon Essentials Version
v19.1 ➖
pomeg.gif


Note: This exploit is no longer possible in Essentials v20.
When the Pomeg Berry is used on a Pokémon, its HP can be reduced if enough EVs were deleted, even to the point of the Pokémon fainting. Because of this, it can be used to cause weird scenarios where the player has no usable Pokémon for battle, allowing them to walk past trainers and simply skip fighting them until later. It's not the biggest exploit- a player can only go so far until they face a battle required to progress through the story, after all- but it's pretty easy to prevent, so might as well do it.

Find this section in Item_Utilities:

Ruby:
def pbRaiseHappinessAndLowerEV(pkmn,scene,stat,messages)
  h = pkmn.happiness<255
  e = pkmn.ev[stat]>0
  if !h && !e
    scene.pbDisplay(_INTL("It won't have any effect."))
    return false
  end
  if h
    pkmn.changeHappiness("evberry")
  end
  if e
    pkmn.ev[stat] -= 10
    pkmn.ev[stat] = 0 if pkmn.ev[stat]<0
    pkmn.calc_stats
  end
  scene.pbRefresh
  scene.pbDisplay(messages[2-(h ? 0 : 2)-(e ? 0 : 1)])
  return true
end

Right underneath pkmn.calc_stats, add this line:

Ruby:
    pkmn.hp += 1 if pkmn.hp == 0

That's it! Now, if a Pokemon's HP hits 0 because of the Pomeg Berry, it'll instead be left at 1!
Credits
None needed.
Author
TechSkylander1518
Views
1,537
First release
Last update
Rating
5.00 star(s) 1 ratings

More resources from TechSkylander1518

Back
Top