Hello, is there a way that the trainers keep the random pokemon they got?
Cause when they kill all pokemon from my party and that I go back to them they have different Pokemon.
Thanks ^^
Hello, is there a way that the trainers keep the random pokemon they got?
Cause when they kill all pokemon from my party and that I go back to them they have different Pokemon.
Thanks ^^
I want to make different options for randomizer
exemple :
Everything is random (so switch 36)
Only wild pokemon (switch xxx)
Only trainers (switch xxx)
ect
How can I do this?
Events.onWildPokemonCreate += proc {| sender, e |
pkmn = e[0]
if $game_switches[45] # Here 45 is the number of your switch
pokemon.species = rand(890)+1 # Here 890 is the number of different pokemon species you have in your game
end
}
Events.onTrainerPartyLoad
By trainers I meant NPC one, not the player
Code:Events.onWildPokemonCreate += proc {| sender, e | pkmn = e[0] if $game_switches[45] # Here 45 is the number of your switch pokemon.species = rand(890)+1 # Here 890 is the number of different pokemon species you have in your game end }
Events.onWildPokemonCreate += proc { |_sender, e|
pokemon = e[0]
if $game_switches[45]
pokemon.species = rand(PBSpecies.maxValue)+1
end
}
I want to make different options for randomizer
exemple :
Everything is random (so switch 36)
Only wild pokemon (switch xxx)
Only trainers (switch xxx)
ect
How can I do this?
Switch = 1975 # switch ID to randomize a pokemon, if it's on then ALL
# pokemon will be randomized. No exceptions.
SwitchOnlyWild = 1976 # Switch ID
SwitchOnlyTrainer = 1977 # Switch ID
species = getID(PBSpecies,arg[0])
if $game_switches[Randomized::SwitchOnlyWild]
species = Randomized::WhiteListedPokemon.shuffle
if Randomized::WhiteListedPokemon.length == 0
random = 1+rand(PBSpecies.maxValue)
loop do
if Randomized.isIDBlack(random)
random = 1+rand(PBSpecies.maxValue)
else
break
end
end
species = random
end
else
species = getID(PBSpecies,arg[0])
end
species = getID(PBSpecies,sp)
if $game_switches[Randomized::SwitchOnlyWild]
species = Randomized::WhiteListedPokemon.shuffle
if Randomized::WhiteListedPokemon.length == 0
random = 1+rand(PBSpecies.maxValue)
loop do
if Randomized.isIDBlack(random)
random = 1+rand(PBSpecies.maxValue)
else
break
end
end
species = random
end
else
species = getID(PBSpecies,sp)
end
scene = pbNewBattleScene
if $game_switches[Randomized::SwitchOnlyTrainer]
(0...foeParty.size).each{ |i|
old = foeParty[i].level
species = Randomized::WhiteListedPokemon.shuffle
if Randomized::WhiteListedPokemon.length == 0
random = 1+rand(PBSpecies.maxValue)
loop do
if Randomized.isIDBlack(random)
random = 1+rand(PBSpecies.maxValue)
else
break
end
end
foeParty[i].species = random
foeParty[i].level = old
foeParty[i].calcStats
foeParty[i].resetMoves
else
foeParty[i].species = species
foeParty[i].level = old
foeParty[i].calcStats
foeParty[i].resetMoves
end }
end
And there is a way to only randomize trainers 1 time to not find new pokemon on gyms/trainers?
class PokemonGlobalMetadata
attr_accessor :storeRandomPkmn
attr_accessor :wantStoreRandomPkmn
alias random_ini initialize
def initialize
@wantStoreRandomPkmn = false
# Old
random_ini
end
end
def setRandomStore(name,pokemon)
$PokemonGlobal.storeRandomPkmn={} if !$PokemonGlobal.storeRandomPkmn
$PokemonGlobal.storeRandomPkmn[name]={} if !$PokemonGlobal.storeRandomPkmn[name]
$PokemonGlobal.storeRandomPkmn[name][pokemon]={} if !$PokemonGlobal.storeRandomPkmn[name][pokemon]
end
$PokemonGlobal.wantStoreRandomPkmn = true
$PokemonGlobal.wantStoreRandomPkmn = false
if $game_switches[Randomized::Switch]
nametrainerevent="#{pbMapInterpreter.get_character(0).id} #{$game_map.map_id}"
(0...foeParty.size).each{ |i|
old = foeParty[i].level
species = Randomized::WhiteListedPokemon.shuffle
if Randomized::WhiteListedPokemon.length == 0
random = 1+rand(PBSpecies.maxValue)
loop do
if Randomized.isIDBlack(random)
random = 1+rand(PBSpecies.maxValue)
else
break
end
end
foeParty[i].species = random
foeParty[i].level = old
foeParty[i].calcStats
foeParty[i].resetMoves
else
foeParty[i].species = species
foeParty[i].level = old
foeParty[i].calcStats
foeParty[i].resetMoves
end
# Set
setRandomStore(nametrainerevent,"#{i}")
t = $PokemonGlobal.storeRandomPkmn[nametrainerevent]["#{i}"]
if t.length<2
if $PokemonGlobal.wantStoreRandomPkmn
$PokemonGlobal.storeRandomPkmn[nametrainerevent]["#{i}"]["species"] = foeParty[i].species
$PokemonGlobal.storeRandomPkmn[nametrainerevent]["#{i}"]["level"] = foeParty[i].level
end
else
foeParty[i].species = $PokemonGlobal.storeRandomPkmn[nametrainerevent]["#{i}"]["species"]
foeParty[i].level = $PokemonGlobal.storeRandomPkmn[nametrainerevent]["#{i}"]["level"]
foeParty[i].calcStats
foeParty[i].resetMoves
end }
end
What do you mean by "storing" the pokemon of a trainer?
I want to make different options for randomizer
exemple :
Everything is random (so switch 36)
Only wild pokemon (switch xxx)
Only trainers (switch xxx)
ect
How can I do this?
module Randomized
Switch = 1975 # switch ID to randomize a pokemon, if it's on then ALL
# pokemon will be randomized. No exceptions.
SwitchOnlyWild = 1976 # Switch ID
SwitchOnlyTrainer = 1977 # Switch ID
BlackListedPokemon = [:MEW,: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.
def self.isIDBlack(id)
(0...BlackListedPokemon.size).each{|i|
if getID(PBSpecies,BlackListedPokemon[i])==id
return true
break
end }
return false
end
def self.random
ret = WhiteListedPokemon.shuffle
if WhiteListedPokemon.length == 0
ret = 1+rand(PBSpecies.maxValue)
loop do
if self.isIDBlack(ret)
ret = 1+rand(PBSpecies.maxValue)
else
break
end
end
end
ret = getID(PBSpecies,ret)
return ret
end
end
Events.onWildPokemonCreate += proc { |_sender, e|
pokemon = e[0]
oldlevel = pokemon.level
if $game_switches[Randomized::Switch] || $game_switches[Randomized::SwitchOnlyWild]
pokemon.species = Randomized.random
pokemon.level = oldlevel
pokemon.calcStats
pokemon.resetMoves
end
}
Events.onTrainerPartyLoad += proc { |_sender, e|
if e[0]
trainer = e[0][0]
items = e[0][1]
party = e[0][2]
if $game_switches[Randomized::Switch] || $game_switches[Randomized::SwitchOnlyTrainer]
nametrainerevent="#{pbMapInterpreter.get_character(0).id} #{$game_map.map_id}"
(0...party.size).each{|i|
oldlevel=party[i].level
party[i].species=Randomized.random
party[i].level=oldlevel
party[i].calcStats
party[i].resetMoves
# Set
setRandomStore(nametrainerevent,"#{i}")
t = $PokemonGlobal.storeRandomPkmn[nametrainerevent]["#{i}"]
if t.length<2
if $PokemonGlobal.wantStoreRandomPkmn
$PokemonGlobal.storeRandomPkmn[nametrainerevent]["#{i}"]["species"] = party[i].species
$PokemonGlobal.storeRandomPkmn[nametrainerevent]["#{i}"]["level"] = party[i].level
end
else
party[i].species = $PokemonGlobal.storeRandomPkmn[nametrainerevent]["#{i}"]["species"]
party[i].level = $PokemonGlobal.storeRandomPkmn[nametrainerevent]["#{i}"]["level"]
party[i].calcStats
party[i].resetMoves
end }
end
end
}
class PokemonGlobalMetadata
attr_accessor :storeRandomPkmn
attr_accessor :wantStoreRandomPkmn
alias random_ini initialize
def initialize
@wantStoreRandomPkmn = false
# Old
random_ini
end
end
def setRandomStore(name,pokemon)
$PokemonGlobal.storeRandomPkmn={} if !$PokemonGlobal.storeRandomPkmn
$PokemonGlobal.storeRandomPkmn[name]={} if !$PokemonGlobal.storeRandomPkmn[name]
$PokemonGlobal.storeRandomPkmn[name][pokemon]={} if !$PokemonGlobal.storeRandomPkmn[name][pokemon]
end
HEy thats me again, so I noticed that during double trainer battle the two trainer had the same randomized pokemon, is that normal?