You should give Umbreon credit.################################################################################
# Randomized Pokemon Script
# By Umbreon
################################################################################
# Used for a randomized pokemon challenge mainly.
#
# By randomized, I mean EVERY pokemon will be random, even interacted pokemon
# like legendaries. (You may easily disable the randomizer for certain
# situations like legendary battles and starter selecting.)
#
# To use: simply activate Switch Number X
# (X = the number listed After "Switch = ", default is switch number 36.)
#
# If you want certain pokemon to NEVER appear, add them inside the black list.
# (This does not take into effect if the switch stated above is off.)
#
# If you want ONLY certain pokemon to appear, add them to the whitelist. This
# is only recommended when the amount of random pokemon available is around
# 32 or less.(This does not take into effect if the switch stated above is off.)
#
################################################################################
########################## You may edit any settings below this freely.
module RandomizedChallenge
Switch = 36 # switch ID to randomize a pokemon, if it's on then ALL
# pokemon will be randomized. No exceptions.
BlackListedPokemon = [PBSpecies::MEW, PBSpecies::ARCEUS]
# Pokemon to Black List. Any pokemon in here will NEVER appear.
WhiteListedPokemon = []
# Leave this empty if all pokemon are allowed, otherwise only pokemon listed
# above will be selected.
end
######################### Do not edit anything below here.
class PokeBattle_Pokemon
alias randomized_init initialize
def initialize(species,level,player=nil,withMoves=true)
species = RandomizedChallenge::WhiteListedPokemon.shuffle[0]
if $game_switches && $game_switches[RandomizedChallenge::Switch]
if RandomizedChallenge::WhiteListedPokemon.length == 0
species = rand(PBSpecies.maxValue - 1) + 1
while RandomizedChallenge::BlackListedPokemon.include?(species)
species = rand(PBSpecies.maxValue - 1) + 1
end
end
end
randomized_init(species, level, player, withMoves)
end
end
And if you want randomize battle , here
You should give Umbreon credit.
no not that , this :
Moves learned / Items Picked Up / Market / Move Types / Pokemon Types ?
Randomize Market Shops , Moves Learned ,Pokemon Typing (All Pokemon Move Types & Pokemon Main Type) , Items Gained RandomizedWhat does that even mean... You can't be so vague and expect people to understand you.
def getMoveList
movelist=[]
atkdata=pbRgssOpen("Data/attacksRS.dat","rb")
offset=atkdata.getOffset(@species-1)
length=atkdata.getLength(@species-1)>>1
atkdata.pos=offset
for k in 0..length-1
level=atkdata.fgetw
move=atkdata.fgetw[COLOR="red"]
if move != nil
move=rand(PBMoves::[COLOR="Navy"]CUSTOMMOVE[/COLOR])+1 if $game_switches[RANDOMIZER][/COLOR]
movelist.push([level,move])[COLOR="Red"] if !(isConst?(move,PBMoves,:CHATTER) && !isConst?(self.species,PBSpecies,:CHATOT))
end[/COLOR]
end
atkdata.close
return movelist
end
Randomizing the moves learned by Pokemon by way of Level Up:
PokeBattle_Pokemon, search for "def getMoveList". Add the red stuff. You will have to go into your games moves.txt file (in the folder marked PBS) and find out what move is at the very bottom of the file. Replace the blue words with that move's internal name (Maruno likely knows a way to just grab the total number of moves legitimately rather than the workaround I came up with when I discovered that "PBMoves.maxvalue" didn't work like it does with "PBSpecies.maxvalue").
Notes:Code:def getMoveList movelist=[] atkdata=pbRgssOpen("Data/attacksRS.dat","rb") offset=atkdata.getOffset(@species-1) length=atkdata.getLength(@species-1)>>1 atkdata.pos=offset for k in 0..length-1 level=atkdata.fgetw move=atkdata.fgetw[COLOR="red"] if move != nil move=rand(PBMoves::[COLOR="Navy"]CUSTOMMOVE[/COLOR])+1 if $game_switches[RANDOMIZER][/COLOR] movelist.push([level,move])[COLOR="Red"] if !(isConst?(move,PBMoves,:CHATTER) && !isConst?(self.species,PBSpecies,:CHATOT)) end[/COLOR] end atkdata.close return movelist end
1.) In the official games, Smearlge cannot Sketch Chatot's Chatter move because it would cause a glitch if used by any Pokemon other than Chatot. This limitation is coded into Essentials even though the glitch doesn't occur (no recording sounds in Essentials, so Chatter runs off the generic Chatot cry always), and as such I coded in the limitation that Chatter cannot be learned by any Pokemon except Chatot.
2.) This code spits up a random learnset every time it is called. This means that you could level up your Glalie to level 37, have it learn Grass Whistle, then quit your game without saving and restart, level it up to 37 again, and have it learn Fire Blast instead.
3.) The Pokemon still learns moves at the levels it normally would learn moves at.
4.) You need some way of preventing the Move Relearner from working when Randomizer is on. Otherwise, players could stand next to him and ask him to tutor their Pokemon until the list contains some "press this move to win" move (to quote a video I once saw, "Ice-type, Glaciate-boosted STAB Hyper Beam!")
Randomizing the types of Pokemon would run into an issue because it would be random every time the game checks what types the Pokemon is. That means your Pokemon might be Fairy/Dark when the game checks for type effectiveness, but then half a millisecond later it's Electric/Grass when checking if STAB applies. Randomizing the moves' types runs into a similar issue.
I am unsure what bit of code allows for items picked up from item balls, or rather, how to ally this code in such a way that you get a random item. You'd have to have some way of preventing certain items from being chosen (i.e., Key Items), without creating the possibility of opening an item ball with nothing inside.
def Kernel.pbReceiveItem(item,quantity=1,plural=nil)
if item.is_a?(String) || item.is_a?(Symbol)
item=getID(PBItems,item)
[COLOR="Red"]elsif item !=nil
item=rand(PBItems::CUSTOMITEM)+1 if $game_switches[RANDOMIZER][/COLOR]
end
thanks but now im trying to figure out items gained are randomized , and thank you for clearing up some issues i was having.
Code:def Kernel.pbReceiveItem(item,quantity=1,plural=nil) if item.is_a?(String) || item.is_a?(Symbol) item=getID(PBItems,item) end [COLOR="Red"] item=rand(PBItems::CUSTOMITEM)+1 if $game_switches[RANDOMIZER][/COLOR]
You don't need the check to see if item is nil - the function itself does that (if item was nil, an error message will pop up.) The original way you had it also only would randomize items if the item was written as a number (pbRecieveItem(2) instead of pbRecieveItem(:SUPERPOTION) )
Notes:
1.) I'm fairly certain that pbRecieveItem is used by a lot more than item balls. NPCs and possibly even the item shop. Which means the player would think they're buying a potion and instead get a Cherish Ball. Maybe you can play off that and make shops sell "???" in Randomizer?
2.) This still includes every single item, even Key Items. Considering some items are needed in order to progress, you need a way to say "this item get isn't randomized ever"
3.) This code will only work if Custom Item is an item in items.txt
PBMoves.maxValue should work. It's used by Metronome's effect, for one. Note the camelCase.(Maruno likely knows a way to just grab the total number of moves legitimately rather than the workaround I came up with when I discovered that "PBMoves.maxvalue" didn't work like it does with "PBSpecies.maxvalue").