• 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.
  • Apologies if you've had troubles connecting to the site, you may need a VPN to access it. Staff are also facing issues connecting, so if it's urgent please message Cat on-site or through Discord directly.
  • Hey Guest, staff applications are open! If you are interested in becoming a forum staff member and/or Discord staff member, please apply through this Google Form before April 2! You can also message Cat with any questions.
IV vitamins

IV vitamins 1.0

Pokémon Essentials Version
v19.1 ➖
This is just the script for IV raising items, with sample names.
How to install:
code:
Expand Collapse Copy
def pbItemRaiseIV(pkmn, stat, scene, ivGain = 2, item = nil, happiness = "")
  if pkmn.iv[stat]>=Pokemon::IV_STAT_LIMIT
    scene.pbDisplay(_INTL("It won't have any effect."))
    return false
  end
  $PokemonBag.pbDeleteItem(item, 1)
  pkmn.iv[stat] += ivGain
  pkmn.iv[stat] = pkmn.iv[stat].clamp(0, Pokemon::IV_STAT_LIMIT)
  scene.pbRefresh
  statName = GameData::Stat.get(stat).name
  scene.pbDisplay(_INTL("{1}'s {2} increased.",pkmn.name,statName))
  pkmn.changeHappiness(happiness)
  return true
end
code:
Expand Collapse Copy
ItemHandlers::UseOnPokemon.add(:STAMINA_GUMMY,proc { |item,pkmn,scene|
  next pbItemRaiseIV(pkmn,:HP,scene,2,item,"vitamin")
})

ItemHandlers::UseOnPokemon.add(:STRENGH_GUMMY,proc { |item,pkmn,scene|
  next pbItemRaiseIV(pkmn,:ATTACK,scene,2,item,"vitamin")
})

ItemHandlers::UseOnPokemon.add(:TOUGHNESS_GUMMY,proc { |item,pkmn,scene|
  next pbItemRaiseIV(pkmn,:DEFENSE,scene,2,item,"vitamin")
})

ItemHandlers::UseOnPokemon.add(:WILL_GUMMY,proc { |item,pkmn,scene|
  next pbItemRaiseIV(pkmn,:SPECIAL_ATTACK,scene,2,item,"vitamin")
})

ItemHandlers::UseOnPokemon.add(:SANITY_GUMMY,proc { |item,pkmn,scene|
  next pbItemRaiseIV(pkmn,:SPECIAL_DEFENSE,scene,2,item,"vitamin")
})

ItemHandlers::UseOnPokemon.add(:REACTION_GUMMY,proc { |item,pkmn,scene|
  next pbItemRaiseIV(pkmn,:SPEED,scene,2,item,"vitamin")
})
Credits
Asto\Astefia
Author
Astefia
Views
1,613
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Astefia

Back
Top