• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] A specified enhancement

  • 40
    Posts
    4
    Years
    • Seen Jan 13, 2022
    I want to make an item that maxes out the EVs and IVs of a Pokemon, but under the condition they are a non-Shadow Bug-type. If they are not a Bug-type or are a Shadow Pokemon, then the item will fail. Only issue is, I have no clue how to go about this. Any help would be appreciated, but you do not have to.
     
    I think this is fairly straightforward to do, at least for IVs. EVs would be more tricky because these cap at 510. I don't think you can throw 252 EVs into every stat and call it good, so this step would need to give the player the choice of which EVs to maximise. Is that what you had in mind?
     
    I think this is fairly straightforward to do, at least for IVs. EVs would be more tricky because these cap at 510. I don't think you can throw 252 EVs into every stat and call it good, so this step would need to give the player the choice of which EVs to maximise. Is that what you had in mind?

    Yeah, that works well.
     
    I've been able to create an item that maximises an IV of the player's choice. Here's the code:

    Spoiler:

    The code is not pretty and I'm fairly certain there are better ways to do this, but it does work in v18.1. Put this in PItem_ItemEffects (I put it just below Rare Candy, but I don't think it matters).

    You'll then need to define the item in your items.txt file, e.g.
    Code:
    XXX,ULTRAIVTRAINER,Ultra IV Trainer,Ultra IV Trainers,1,0,"This is a test.",1,0,0,
    Tweak this as you want. You'll need a graphic as well.

    Let me know it it doesn't work for you.
     
    Last edited:
    Back
    Top