- 79
- Posts
- 9
- Years
- Seen Jan 12, 2024
Hello, I'd like to make two items that raises a stat's IVs either by one, or maxes it out to 31 (I'm repurposing Bottle Caps and Gold Bottle Caps to remove the need for a dedicated NPC). Similar to PP Ups and PP Maxes, it would let you choose which stat you'd like to increase. I found a script for specific items that raise specific IVs:
How would I change this to allow the player to select which stat they'd like to increase? PP Ups and Maxes use "move=scene.pbChooseMove" So I'm assuming I'd need to do something similar for stats, but I couldn't find an existing effect. Any help would be appreciated! Thanks
Spoiler:
Code:
ItemHandlers::UseOnPokemon.add(:HPIVSTONE,proc{|item,pokemon,scene|
if pokemon.iv[PBStats::HP]>=31
scene.pbDisplay(_INTL("It won't have any effect."))
next false
else
pokemon.iv[PBStats::HP]=pokemon.iv[PBStats::HP]+1
scene.pbRefresh
scene.pbDisplay(_INTL("{1}'s HP increased.",pokemon.name))
pokemon.changeHappiness("vitamin")
next true
end
})
How would I change this to allow the player to select which stat they'd like to increase? PP Ups and Maxes use "move=scene.pbChooseMove" So I'm assuming I'd need to do something similar for stats, but I couldn't find an existing effect. Any help would be appreciated! Thanks