PDA

View Full Version : [Essentials script] Pokemon editing script for beginners


dragonnite
October 24th, 2011, 08:17 AM
Pokemon editing script for beginners
for essentals

class PokeBattle_Pokemon
def moves
return @moves
end
def moves=(val)
@moves=val
end
# Time object specifying the time egg hatched.
def attack=(val)
@attack=val
end
def defense=(val)
@defense=val
end
def speed=(val)
@speed=val
end
def spatk=(val)
@spatk=val
end
def spdef=(val)
@spdef=val
end
end
class Pokemon
# Version 0.4 debug prints remove debug file write added
def createpokemon(sp,lv,shiny=false,egg=false,steps=0)
a=1
sp1=sp+1 rescue a=0
if a==1
sp1-=1
else
sp1=eval("PBSpecies::"+sp)
end
poke=PokeBattle_Pokemon.new(sp1,lv,$Trainer)
if shiny==true
poke.makeshiny
end
if egg==true
egg=poke
egg.calcStats
egg.name=_INTL("EGG")
egg.eggsteps=steps
egg.makeshiny
a=$Trainer.party.size
if not a==6
i=a-1
$Trainer.party[i]=egg
return "egg"
end
else
return poke
end
end
def createmoveset(move1=nil,move2=nil,move3=nil,move4=nil)
moveset=[]
if not move1==nil
a=eval("PBMoves"+move1)
moveset.push(a)
end
if not move2==nil
a=eval("PBMoves"+move1)
moveset.push(a)
end
if not move3==nil
a=eval("PBMoves"+move1)
moveset.push(a)
end
if not move4==nil
a=eval("PBMoves"+move1)
moveset.push(a)
end
return moveset
end
def createstatset(maxhp=nil,atk=nil,def1=nil,speed=nil,spatk=nil,spdef=nil)
statset=[]
statset.push(maxhp)
statset.push(atk)
statset.push(def1)
statset.push(speed)
statset.push(spatk)
statset.push(spdef)
end
def complepokemon(pokemon,auto="add",moveset=[],statset=[])
poke=pokemon
a=moveset[0]
if not a==nil
pbAutolearnMove(poke,a)
end
a=moveset[1]
if not a==nil
pbAutolearnMove(poke,a)
end
a=moveset[2]
if not a==nil
pbAutolearnMove(poke,a)
end
a=moveset[3]
if not a==nil
pbAutolearnMove(poke,a)
end
if not statset[0]==nil
poke.totalhp=statset[0]
end
if not statset[1]==nil
poke.attack=statset[1]
end
if not statset[2]==nil
poke.defense=statset[2]
end
if not statset[3]==nil
poke.speed=statset[3]
end
if not statset[4]==nil
poke.spatk=statset[4]
end
if not statset[5]==nil
poke.spdef=statset[5]
end
if auto=="add"
pbAddPokemon(poke)
if $DEBUG
make_pokey_file(poke)
end
elsif auto=="battle"
pbWildBattle(poke,1)
else
return poke
end
end
def make_pokey_file(poke)
s1="name:"+poke.name+"\n"
s2="hp:"+poke.totalhp.to_s+"\n"
s3="atk:"+poke.attack.to_s+"\n"
s4="def:"+poke.defense.to_s+"\n"
s5="spatk:"+poke.spatk.to_s+"\n"
s6="spdef:"+poke.spdef.to_s+"\n"
s7="moves("
s71=poke.moves[0].id.to_s+", "
s72=poke.moves[1].id.to_s+", "
s73=poke.moves[2].id.to_s+", "
s74=poke.moves[3].id.to_s+") "
s=s1+s2+s3+s4+s5+s6+s7+s71+s72+s73+s74
File.open(poke.name+".pkm","wb"){|f|
f.write(s)
}
end
end
This Has Bin remade and untested So i would like to request feedback
And ideas for new fetures
Exmple of use


Script: $Pokemon=Pokemon.new poke=$pokemon.createpokemon("DRAKRAI",100)
stats=createstatset(999,999,999,999,999,999)
complepokemon(poke,"add",[],stats)

FUNchions
Createing a pokemon


createpokemon(sp,lv,shiny,egg,steps)
shiny,egg and step have defaults so dont need to add
eg createpokemon(sp,lv)
eg2 createpokemon(sp,lv,shiny)
eg3 createpokemon(sp,lv,shiny,egg,steps)
sp=pokemon name or number DRAKRAI=491
lv=pokemon level


Createing a moveset



createmoveset(move1,move2,move3,move4)
all have defaults
eg createmoveset(move1,move2,move3,move4)
eg2 createmoveset(move1,move2,move3)
eg3 createmoveset(move1,move2)
eg4 createmoveset(move1)
eg5 createmoveset

exmple use


Script: $Pokemon=Pokemon.new poke=$pokemon.createpokemon("DRAKRAI",100)
stats=createstatset(999,999,999,999,999,999)
moves=createmoveset("HYDROPUMP","FLAMETHOWER","THUNDER")
complepokemon(poke,"add",moves,stats)


Creadit not requed but not to be claimed as yours apples to versions 0.4 and up

dragonnite
October 25th, 2011, 09:56 AM
UPDATE
new complete rebuild
edit not yet made

Lord Varion
October 25th, 2011, 10:06 AM
This is for Essentials, yes?
I would be nice to have that in the first post, In case someone ''new'' comes along.

dragonnite
October 25th, 2011, 10:11 AM
edit done
thanks for the tip
new update the v0.2 would not load so its has a fix and a auto install pokemon stat edit
makeing it more or less plug in and play v0.3
contains stat editors but edits are only do able on createion

So how is this thing working for the beginers ask me questions you move edits stats edits

from exmple redidit and got my debug test result
filedebug
new pokemon 1
name:DARKRAI
hp:999
atk:999
def:999
spatk:999
spdef:999
moves(464, 417, 138, 399)

dragonnite
October 26th, 2011, 03:44 AM
Update Moveediting explend debug systems removed(err1,err2,err3)
debug file write

dragonnite
November 26th, 2011, 07:03 AM
Update script download:a
inculdes
editing

IceGod64
November 26th, 2011, 12:52 PM
The examples Darkrai's stats would reset to normal Darkrai stats if it was ever put in the PC or given a vitamin such as Calcium, HP up, etc. Anything that recalculates stats.

You shouldn't give the ability to edit stats directly, it's too faulty. Manipulation of IV's, EV's, and natures are what stays consistent.