- 4
- Posts
- 49
- Days
- Seen today
Version 21.1 with Hotfixes + Gen 9 Pack
Hi!
I want to edit Pokemon movesets from the Battle Frontier to increase/maximize their potencial.
I want to add ...
- the ability (the ability gets chosen randomly, but there are movesets that really rely on the right ability)
- the excact EV spread (because why not ).
- the Tera Type (not the highest priority)
Example:
Breloom @ Toxic Orb
Ability: Poison Heal
EVs: 240 HP / 80 Atk / 140 Def / 48 Spe
Tera Type: Normal
Adamant Nature
- Facade
- Seed Bomb
- Bulk Up
- Protect
Im pretty sure I've to edit the Script down below (found in Script Editor --> [[ Battle Frontier ]] --> Challenge_Data) to do this, but im a Lvl. 0-guy at scripting. Can somebody help me?
TYSM in advance and much love
#===============================================================================
#
#===============================================================================
class PBPokemon
attr_accessor :species
attr_accessor :item
attr_accessor :nature
attr_accessor :move1
attr_accessor :move2
attr_accessor :move3
attr_accessor :move4
attr_accessor :ev
# This method is how each Pokémon is compiled from the PBS files listing
# Battle Tower/Cup Pokémon.
def self.fromInspected(str)
insp = str.gsub(/^\s+/, "").gsub(/\s+$/, "")
pieces = insp.split(/\s*;\s*/)
species = (GameData::Species.exists?(pieces[0])) ? GameData::Species.get(pieces[0]).id : nil
item = (GameData::Item.exists?(pieces[1])) ? GameData::Item.get(pieces[1]).id : nil
nature = (GameData::Nature.exists?(pieces[2])) ? GameData::Nature.get(pieces[2]).id : nil
ev = pieces[3].split(/\s*,\s*/)
ev_array = []
ev.each do |stat|
case stat.upcase
when "HP" then ev_array.push(:HP)
when "ATK" then ev_array.push(:ATTACK)
when "DEF" then ev_array.push(:DEFENSE)
when "SA", "SPATK" then ev_array.push(:SPECIAL_ATTACK)
when "SD", "SPDEF" then ev_array.push(:SPECIAL_DEFENSE)
when "SPD" then ev_array.push(:SPEED)
end
end
moves = pieces[4].split(/\s*,\s*/)
moveid = []
Pokemon::MAX_MOVES.times do |i|
move_data = GameData::Move.try_get(moves)
moveid.push(move_data.id) if move_data
end
moveid.push(GameData::Move.keys.first) if moveid.length == 0 # Get any one move
return self.new(species, item, nature, moveid[0], moveid[1], moveid[2], moveid[3], ev_array)
end
def self.fromPokemon(pkmn)
mov1 = (pkmn.moves[0]) ? pkmn.moves[0].id : nil
mov2 = (pkmn.moves[1]) ? pkmn.moves[1].id : nil
mov3 = (pkmn.moves[2]) ? pkmn.moves[2].id : nil
mov4 = (pkmn.moves[3]) ? pkmn.moves[3].id : nil
ev_array = []
GameData::Stat.each_main do |s|
ev_array.push(s.id) if pkmn.ev[s.id] > 60
end
return self.new(pkmn.species, pkmn.item_id, pkmn.nature,
mov1, mov2, mov3, mov4, ev_array)
end
def initialize(species, item, nature, move1, move2, move3, move4, ev)
@species = species
itm = GameData::Item.try_get(item)
@ItEm = itm ? itm.id : nil
@Nature = nature
@move1 = move1
@move2 = move2
@move3 = move3
@move4 = move4
@Ev = ev
end
def inspect
c1 = GameData::Species.get(@species).id
c2 = (@ItEm) ? GameData::Item.get(@ItEm).id : ""
c3 = (@Nature) ? GameData::Nature.get(@Nature).id : ""
evlist = ""
@ev.each do |stat|
evlist += "," if evlist != ""
evlist += stat.real_name_brief
end
c4 = (@move1) ? GameData::Move.get(@move1).id : ""
c5 = (@move2) ? GameData::Move.get(@move2).id : ""
c6 = (@move3) ? GameData::Move.get(@move3).id : ""
c7 = (@move4) ? GameData::Move.get(@move4).id : ""
return "#{c1};#{c2};#{c3};#{evlist};#{c4},#{c5},#{c6},#{c7}"
end
# Unused.
def tocompact
return "#{species},#{item},#{nature},#{move1},#{move2},#{move3},#{move4},#{ev}"
end
# def _dump(depth)
# return [@species, @ItEm, @Nature, @move1, @move2, @move3, @move4, @Ev].pack("vvCvvvvC")
# end
# def self._load(str)
# data = str.unpack("vvCvvvvC")
# return self.new(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7])
# end
def convertMove(move)
move = :FRUSTRATION if move == :RETURN && GameData::Move.exists?(:FRUSTRATION)
return move
end
def createPokemon(level, iv, trainer)
pkmn = Pokemon.new(@species, level, trainer, false)
pkmn.item = @ItEm
pkmn.personalID = rand(2**16) | (rand(2**16) << 16)
pkmn.nature = nature
pkmn.happiness = 0
pkmn.moves.push(Pokemon::Move.new(self.convertMove(@move1)))
pkmn.moves.push(Pokemon::Move.new(self.convertMove(@move2))) if @move2
pkmn.moves.push(Pokemon::Move.new(self.convertMove(@move3))) if @move3
pkmn.moves.push(Pokemon::Move.new(self.convertMove(@move4))) if @move4
pkmn.moves.compact!
if ev.length > 0
ev.each { |stat| pkmn.ev[stat] = Pokemon::EV_LIMIT / ev.length }
end
GameData::Stat.each_main { |s| pkmn.iv[s.id] = iv }
pkmn.calc_stats
return pkmn
end
end
Hi!
I want to edit Pokemon movesets from the Battle Frontier to increase/maximize their potencial.
I want to add ...
- the ability (the ability gets chosen randomly, but there are movesets that really rely on the right ability)
- the excact EV spread (because why not ).
- the Tera Type (not the highest priority)
Example:
Spoiler: Example Smogon set
Breloom @ Toxic Orb
Ability: Poison Heal
EVs: 240 HP / 80 Atk / 140 Def / 48 Spe
Tera Type: Normal
Adamant Nature
- Facade
- Seed Bomb
- Bulk Up
- Protect
Spoiler: Example Smogon set converted to Essentials
BRELOOM;TOXICORB;ADAMANT;HP,DEF;FACADE,SEEDBOMB,BULKUP,PROTECT
Spoiler: How I imagine the example should look like,
BRELOOM;TOXICORB;POISONHEAL;ADAMANT;240,80,140,0,0,48;NORMAL;FACADE,SEEDBOMB,BULKUP,PROTECT
Im pretty sure I've to edit the Script down below (found in Script Editor --> [[ Battle Frontier ]] --> Challenge_Data) to do this, but im a Lvl. 0-guy at scripting. Can somebody help me?
TYSM in advance and much love
Spoiler: SCRIPT
#===============================================================================
#
#===============================================================================
class PBPokemon
attr_accessor :species
attr_accessor :item
attr_accessor :nature
attr_accessor :move1
attr_accessor :move2
attr_accessor :move3
attr_accessor :move4
attr_accessor :ev
# This method is how each Pokémon is compiled from the PBS files listing
# Battle Tower/Cup Pokémon.
def self.fromInspected(str)
insp = str.gsub(/^\s+/, "").gsub(/\s+$/, "")
pieces = insp.split(/\s*;\s*/)
species = (GameData::Species.exists?(pieces[0])) ? GameData::Species.get(pieces[0]).id : nil
item = (GameData::Item.exists?(pieces[1])) ? GameData::Item.get(pieces[1]).id : nil
nature = (GameData::Nature.exists?(pieces[2])) ? GameData::Nature.get(pieces[2]).id : nil
ev = pieces[3].split(/\s*,\s*/)
ev_array = []
ev.each do |stat|
case stat.upcase
when "HP" then ev_array.push(:HP)
when "ATK" then ev_array.push(:ATTACK)
when "DEF" then ev_array.push(:DEFENSE)
when "SA", "SPATK" then ev_array.push(:SPECIAL_ATTACK)
when "SD", "SPDEF" then ev_array.push(:SPECIAL_DEFENSE)
when "SPD" then ev_array.push(:SPEED)
end
end
moves = pieces[4].split(/\s*,\s*/)
moveid = []
Pokemon::MAX_MOVES.times do |i|
move_data = GameData::Move.try_get(moves)
moveid.push(move_data.id) if move_data
end
moveid.push(GameData::Move.keys.first) if moveid.length == 0 # Get any one move
return self.new(species, item, nature, moveid[0], moveid[1], moveid[2], moveid[3], ev_array)
end
def self.fromPokemon(pkmn)
mov1 = (pkmn.moves[0]) ? pkmn.moves[0].id : nil
mov2 = (pkmn.moves[1]) ? pkmn.moves[1].id : nil
mov3 = (pkmn.moves[2]) ? pkmn.moves[2].id : nil
mov4 = (pkmn.moves[3]) ? pkmn.moves[3].id : nil
ev_array = []
GameData::Stat.each_main do |s|
ev_array.push(s.id) if pkmn.ev[s.id] > 60
end
return self.new(pkmn.species, pkmn.item_id, pkmn.nature,
mov1, mov2, mov3, mov4, ev_array)
end
def initialize(species, item, nature, move1, move2, move3, move4, ev)
@species = species
itm = GameData::Item.try_get(item)
@ItEm = itm ? itm.id : nil
@Nature = nature
@move1 = move1
@move2 = move2
@move3 = move3
@move4 = move4
@Ev = ev
end
def inspect
c1 = GameData::Species.get(@species).id
c2 = (@ItEm) ? GameData::Item.get(@ItEm).id : ""
c3 = (@Nature) ? GameData::Nature.get(@Nature).id : ""
evlist = ""
@ev.each do |stat|
evlist += "," if evlist != ""
evlist += stat.real_name_brief
end
c4 = (@move1) ? GameData::Move.get(@move1).id : ""
c5 = (@move2) ? GameData::Move.get(@move2).id : ""
c6 = (@move3) ? GameData::Move.get(@move3).id : ""
c7 = (@move4) ? GameData::Move.get(@move4).id : ""
return "#{c1};#{c2};#{c3};#{evlist};#{c4},#{c5},#{c6},#{c7}"
end
# Unused.
def tocompact
return "#{species},#{item},#{nature},#{move1},#{move2},#{move3},#{move4},#{ev}"
end
# def _dump(depth)
# return [@species, @ItEm, @Nature, @move1, @move2, @move3, @move4, @Ev].pack("vvCvvvvC")
# end
# def self._load(str)
# data = str.unpack("vvCvvvvC")
# return self.new(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7])
# end
def convertMove(move)
move = :FRUSTRATION if move == :RETURN && GameData::Move.exists?(:FRUSTRATION)
return move
end
def createPokemon(level, iv, trainer)
pkmn = Pokemon.new(@species, level, trainer, false)
pkmn.item = @ItEm
pkmn.personalID = rand(2**16) | (rand(2**16) << 16)
pkmn.nature = nature
pkmn.happiness = 0
pkmn.moves.push(Pokemon::Move.new(self.convertMove(@move1)))
pkmn.moves.push(Pokemon::Move.new(self.convertMove(@move2))) if @move2
pkmn.moves.push(Pokemon::Move.new(self.convertMove(@move3))) if @move3
pkmn.moves.push(Pokemon::Move.new(self.convertMove(@move4))) if @move4
pkmn.moves.compact!
if ev.length > 0
ev.each { |stat| pkmn.ev[stat] = Pokemon::EV_LIMIT / ev.length }
end
GameData::Stat.each_main { |s| pkmn.iv[s.id] = iv }
pkmn.calc_stats
return pkmn
end
end