- Pokémon Essentials Version
- v19.1 ➖
This is just the script for IV raising items, with sample names.
How to install:
How to install:
code:
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:
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