• 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!
  • Cyndy, May, Hero (Conquest), or Wes - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

An item that makes one of your Pokemon Shiny

  • 4
    Posts
    9
    Years
    • Seen Aug 31, 2015
    How would I go about adding an item that makes one of your Pokemon shiny when used. What would the Itemeffects script for this look like?
     
    How would I go about adding an item that makes one of your Pokemon shiny when used. What would the Itemeffects script for this look like?

    Do you want the item to be used to permanently make your Pokemon Shiny?
    Code:
    ItemHandlers::UseOnPokemon.add(:SHINYJUICE,proc{|item,pokemon,scene|
       pokemon.makeShiny
       next
    })
    Place that anywhere in PItem_ItemEffects

    Do you want the Pokemon to temporarily make the Pokemon Shiny while they are holding it?
    Find "def isShiny?" in PokeBattle_Pokemon, which should look something like this. I say "something like this" because I changed how shininess works in my game and the lines where b-d are defined are most likely wrong since I'm going from memory how they worked:
    Code:
    def isShiny?
        [COLOR="Red"]return true if isConst?(self.item,PBItems,:SHINYJUICE)[/COLOR]
        return @shinyflag if @shinyflag!=nil
        a=@trainerID^@personalID
        b=a>>16
        c=(a%16)>>0xFF
        d=b^c
        return d<SHINYPOKEMONCHANCE
      end
    add in the red line of code.
     
    Hmm I added the code in PITem_ItemEffects but i get an argument error if I use the Item on a Pokémon
     
    Code:
    ItemHandlers::UseOnPokemon.add(:SHINYJUICE,proc{|item,pokemon,scene|
       pokemon.makeShiny
       next
    })
    Place that anywhere in PItem_ItemEffects


    Thats works fine, but ''Shiny Juice'' item never disappears after use. Its like a infinite use item, some help?
     
    Code:
    ItemHandlers::UseOnPokemon.add(:SHINYJUICE,proc{|item,pokemon,scene|
       pokemon.makeShiny
       next
    })
    Place that anywhere in PItem_ItemEffects


    Thats works fine, but ''Shiny Juice'' item never disappears after use. Its like a infinite use item, some help?

    I think that has to do with the way you added Shiny Juice in the pbs file. One of the arguments is how the item is used outside of battle - on a Pokemon and disappearing afterwards like an evolution stone, on a Pokemon but staying like the Pokeflute, on the Trainer like a Repel, etc.
     
    I think that has to do with the way you added Shiny Juice in the pbs file. One of the arguments is how the item is used outside of battle - on a Pokemon and disappearing afterwards like an evolution stone, on a Pokemon but staying like the Pokeflute, on the Trainer like a Repel, etc.

    I used essentials Editor.exe to add Shiny Juice. I have no idea what are you talking about but I will check the pbs file...

    Edit: Solved, i forgot use the return value in the script
     
    Last edited:
    For anyone wondering what the return values are, they are listed at the top of the PItem_ItemEffects section
    Code:
    #===============================================================================
    # UseFromBag handlers
    # Return values: 0 = not used
    #                1 = used, item not consumed
    #                2 = close the Bag to use, item not consumed
    #                3 = used, item consumed
    #                4 = close the Bag to use, item consumed
    #===============================================================================
     
    Back
    Top