This is absolutely amazing, thank you so much for all the hard work!
I do have a few tweaks I would like to share.
As of the current version of this script all "helper" Pokemon will be 1 level lower than the level of the Pokemon that called it, until it hits the level 1 floor.
I have modified your script to allow "helper" Pokemon's level to be in a range of + or - 3 of the original wild encounter. I.E. if you find a wild Pikachu at level 20, every ally will be level 17-23.
Secondly I have added an optional minimum level for an ally Pokemon to Spawn at. If you don't want Gyarados to spawn under level 20 and a level 12 Magikarp is calling for help, any Gyarados that shows up will ignore the +/- 3 rule and will spawn in at level 20 with a variation of +0 to +3.
Instructions:
Pick a variable, this will be how the level of ally Pokemon without a set minimum level will be determined. I will be using $game_variables[55].
In
PField_EncounterModifiers (This might not be the best place) replace
Code:
Events.onWildPokemonCreate += proc { |_sender, e|
pokemon = e[0]
if $game_switches[SHINY_WILD_POKEMON_SWITCH]
pokemon.makeShiny
end
}
With
Code:
Events.onWildPokemonCreate += proc { |_sender, e|
pokemon = e[0]
$game_variables[55]=pokemon.level if $game_variables[55]==0 #SOS
if $game_switches[SHINY_WILD_POKEMON_SWITCH]
pokemon.makeShiny
end
}
In
PField_Battles find
Code:
Events.onWildBattleEnd.trigger(nil,species,level,decision)
make it this:
Code:
Events.onWildBattleEnd.trigger(nil,species,level,decision)
$game_variables[55]=0 #Reset for SOS Battles
Now let's make some adjustments to the actual
SOS script!
Let's make a new hash. Add what is in red.
Code:
SOS_CALL_RATES={:BULBASAUR=>100}
SOS_CALL_MONS={}
[COLOR="Red"]MIN_LVL={} [/COLOR]
NO_SOS_BATTLES = -1
And replace
Code:
if idxOther>=0 && pbRandom(100)<rate
@lastturnanswered=true
mons=SOS_CALL_MONS[cspecies] || [caller.species]
mons=pbSpecialSOSMons(caller,mons)
mon=mons[pbRandom(mons.length)]
alevel=caller.level-1
alevel=1 if alevel<1
ally=pbGenerateSOSPokemon(getID(PBSpecies,mon),alevel)
if @battlers[idxOther].nil?
pbCreateBattler(idxOther,ally,@party2.length+1)
else
@battlers[idxOther].pbInitialize(ally,@party2.length+1)
end
with
Code:
if idxOther>=0 && pbRandom(100)<rate
@lastturnanswered=true
mons=SOS_CALL_MONS[cspecies] || [caller.species]
mons=pbSpecialSOSMons(caller,mons)
mon=mons[pbRandom(mons.length)]
alevel=$game_variables[55]+rand(-3..3) #level range of +/-3 of caller.
alevel=1 if alevel<1
ally=pbGenerateSOSPokemon(getID(PBSpecies,mon),alevel)
ally.level=MIN_LVL.fetch(ally.species)+rand(4) if MIN_LVL.key?(ally.species)
ally.resetMoves
if @battlers[idxOther].nil?
pbCreateBattler(idxOther,ally,@party2.length+1)
else
@battlers[idxOther].pbInitialize(ally,@party2.length+1)
end
And that's it, all ally Pokemon will be within 3 levels of the original wild encounter, and here are a few examples of how to use the minimum level setting.
This will ensure all SOS allies of National Dex number 130 (Gyarados) will spawn no lower than level 20.
MIN_LVL={130=>20}
Pokemon #11(Medapod) and #14(Kakuna) will not spawn any lower than level 7, while Pokemon #12(Butterfree) and #15(Beedrill) will spawn no lower than level 10.
MIN_LVL={11=>7,12=>10,14=>7,15=>10}