- Pokémon Essentials Version
- v20.1 ➖
This will change the vitamins default behavior from increasing the EVs of the stat by ten, to increasing the IV of a stat by one. This also does not change the Pokemon's nature as it might have in previous versions of Essentials.
To install the plugin, download this file, and unzip the contents to your plugin folder in Essentials.
To install the plugin, download this file, and unzip the contents to your plugin folder in Essentials.
Insert the following code into Item_Utilities just under the function
Next, in the Item_Effects script tab, find where
pbUseEVRaisingItem
ends
Item_Utilities script:
#CHANGED
def pbMaxUsesOfIVRaisingItem(stat, amt_per_use, pkmn, iv_cap = Pokemon::IV_STAT_LIMIT)
amt_can_gain = iv_cap - pkmn.iv[stat]
return [(amt_can_gain.to_f / amt_per_use).ceil, 1].max
end
#CHANGED
def pbUseIVRaisingItem(stat, amt_per_use, qty, pkmn, happiness_type, scene, iv_cap = Pokemon::IV_STAT_LIMIT)
ret = true
qty.times do |i|
if pkmn.iv[stat] < iv_cap
pkmn.iv[stat] = [pkmn.iv[stat] + amt_per_use, 31].min
pkmn.changeHappiness(happiness_type)
else
ret = false if i == 0
break
end
end
if !ret
scene.pbDisplay(_INTL("It won't have any effect."))
return false
end
pkmn.calc_stats
scene.pbRefresh
scene.pbDisplay(_INTL("{1}'s base {2} increased permanently.", pkmn.name, GameData::Stat.get(stat).name))
return true
end
Next, in the Item_Effects script tab, find where
ItemHandlers::UseOnPokemonMaximum.add(:HPUP
begins, and ending just before ItemHandlers::UseOnPokemonMaximum.add(:HEALTHFEATHER
begins, and replace it with the following code:
Item_Effects script:
#CHANGED
ItemHandlers::UseOnPokemonMaximum.add(:HPUP, proc { |item, pkmn|
next pbMaxUsesOfIVRaisingItem(:HP, 1, pkmn)
})
#CHANGED
ItemHandlers::UseOnPokemon.add(:HPUP, proc { |item, qty, pkmn, scene|
next pbUseIVRaisingItem(:HP, 1, qty, pkmn, "vitamin", scene)
})
#CHANGED
ItemHandlers::UseOnPokemonMaximum.add(:PROTEIN, proc { |item, pkmn|
next pbMaxUsesOfIVRaisingItem(:ATTACK, 1, pkmn)
})
#CHANGED
ItemHandlers::UseOnPokemon.add(:PROTEIN, proc { |item, qty, pkmn, scene|
next pbUseIVRaisingItem(:ATTACK, 1, qty, pkmn, "vitamin", scene)
})
#CHANGED
ItemHandlers::UseOnPokemonMaximum.add(:IRON, proc { |item, pkmn|
next pbMaxUsesOfIVRaisingItem(:DEFENSE, 1, pkmn)
})
#CHANGED
ItemHandlers::UseOnPokemon.add(:IRON, proc { |item, qty, pkmn, scene|
next pbUseIVRaisingItem(:DEFENSE, 1, qty, pkmn, "vitamin", scene)
})
#CHANGED
ItemHandlers::UseOnPokemonMaximum.add(:CALCIUM, proc { |item, pkmn|
next pbMaxUsesOfIVRaisingItem(:SPECIAL_ATTACK, 1, pkmn)
})
#CHANGED
ItemHandlers::UseOnPokemon.add(:CALCIUM, proc { |item, qty, pkmn, scene|
next pbUseIVRaisingItem(:SPECIAL_ATTACK, 1, qty, pkmn, "vitamin", scene)
})
#CHANGED
ItemHandlers::UseOnPokemonMaximum.add(:ZINC, proc { |item, pkmn|
next pbMaxUsesOfIVRaisingItem(:SPECIAL_DEFENSE, 1, pkmn)
})
#CHANGED
ItemHandlers::UseOnPokemon.add(:ZINC, proc { |item, qty, pkmn, scene|
next pbUseIVRaisingItem(:SPECIAL_DEFENSE, 1, qty, pkmn, "vitamin", scene)
})
#CHANGED
ItemHandlers::UseOnPokemonMaximum.add(:CARBOS, proc { |item, pkmn|
next pbMaxUsesOfIVRaisingItem(:SPEED, 1, pkmn)
})
#CHANGED
ItemHandlers::UseOnPokemon.add(:CARBOS, proc { |item, qty, pkmn, scene|
next pbUseIVRaisingItem(:SPEED, 1, qty, pkmn, "vitamin", scene)
})
- Credits
- Please credit DarkYuan if used!