But rareness isn't a property defined for a Pokemon. But I know it exists somewhere since it's one of the required fields when defining a species. So my question is, how do I access the rareness attribute of a Pokémon?
Edit: I figured something out, so I guess this thread is now a tutorial.
I went into the PokeBattle_Pokemon script and added the following
attr_accessor(:rareness) # Capture rate
in the beginning section
and
def rareness
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,@species,16)
ret=dexdata.fgetb
dexdata.close
return ret
end
(Pretty much anywhere should be fine I think. I personally added it between def growthrate and def baseExp, at line 146)
Then, in the npc event, the script call command to make the player select a Pokémon looks like this
pbChoosePokemon(1,2,
proc {|poke|
!poke.egg? &&
!(poke.isShadow? rescue false) &&
poke.rareness<=50
})
And that's it!
Though if someone could come up with a solution that doesn't involve editing the scripts it could be nice.
Last edited: