- 8
- Posts
- 5
- Years
- Seen Apr 2, 2020
As title says, simply add above main and add them to your items.txt in PBS (i assume you know how to add new items)
known bugs:
- it might get complicated with the rarecandy. the code checks the moves of the pokemon before evolution. E.g. if you give 10000 to metapod it wont learn moves as butterfree
Spoiler:
Code:
#Ability capsule
ItemHandlers::UseOnPokemon.add(:ABILITYCAPSULE,proc{|item,poke,scene|
abilityList=poke.getAbilityList
abil1=0; abil2=0
for i in abilityList
abil1=i[0] if i[1]==0
abil2=i[1] if i[1]==1
end
if poke.abilityIndex() >=2 || abil1 == abil2
scene.pbDisplay(_INTL("It won't have any effect."))
next false
end
if Kernel.pbConfirmMessage(_INTL("Do you want to change {1}'s ability?",
poke.name))
if poke.abilityIndex() == 0
poke.setAbility(1)
else
poke.setAbility(0)
end
scene.pbDisplay(_INTL("{1}'s ability was changed!",poke.name))
next true
end
next false
})
#IVcapsule
ItemHandlers::UseOnPokemon.add(:IVCAPSULE,proc{|item,pokemon,scene|
scene.pbDisplay(_INTL("{1}'s individual values are HP: {2}, Att: {3}, Def: {4}, Spd: {5}, S.Att:{6}, S.Def: {7}",
pokemon.name,
pokemon.iv[0],pokemon.iv[1],
pokemon.iv[2],pokemon.iv[3],
pokemon.iv[4],pokemon.iv[5]))
if Kernel.pbConfirmMessage(_INTL("Do you want to change {1}'s idividual values?",
pokemon.name))
for i in 0...6; pokemon.iv[i]=rand(32); end
pokemon.calcStats
scene.pbDisplay(_INTL("{1}'s individual values changed to HP: {2}, Att: {3}, Def: {4}, Spd: {5}, S.Att:{6}, S.Def: {7}",
pokemon.name,
pokemon.iv[0],pokemon.iv[1],
pokemon.iv[2],pokemon.iv[3],
pokemon.iv[4],pokemon.iv[5]))
next true
else
scene.pbDisplay(_INTL("{1}'s individual values did not change.",
pokemon.name))
end
next false
})
#Shinycapsule
ItemHandlers::UseOnPokemon.add(:SHINYCAPSULE,proc{|item,pokemon,scene|
if Kernel.pbConfirmMessage(_INTL("Are you sure to use your Shinycapsule on {1}?",
pokemon.name))
pokemon.makeShiny
next true
else
scene.pbDisplay("Nothing happend.")
next false
end
})
#Rare Candies
ItemHandlers::UseOnPokemon.add(:RC1000,proc{|item,pokemon,scene|
if Kernel.pbConfirmMessage(_INTL("Are you sure to use your Rare Candy 1000 on {1}?",
pokemon.name))
oldlvl=pokemon.level+1
pokemon.exp=pokemon.exp+1000
pokemon.calcStats
newlvl=pokemon.level+1
#check for new moves
movelist=pokemon.getMoveList
if newlvl==oldlvl
else
scene.pbDisplay(_INTL("{1}'s gained 1000exp and grew to level {2}.",
pokemon.name,pokemon.level))
for k in movelist
for i in oldlvl...newlvl
if k[0]==i
pbLearnMove(pokemon,k[1],true)
end
end
#check for evolution
newspecies=pbCheckEvolution(pokemon)
if newspecies>0
pbFadeOutInWithMusic(99999){
evo=PokemonEvolutionScene.new
evo.pbStartScreen(pokemon,newspecies)
evo.pbEvolution
evo.pbEndScreen
}
end
end
end
next true
else
scene.pbDisplay("Nothing happend.")
next false
end
})
#nature cpasule
ItemHandlers::UseOnPokemon.add(:NATURECAPSULE,proc{|item,pokemon,scene|
k=PBNatures.getName(pokemon.nature)
if Kernel.pbConfirmMessage(_INTL("At the moment {1} is {2}. Do you want to change this?",
pokemon.name,k))
pokemon.setNature(rand(25))
pokemon.calcStats
k=PBNatures.getName(pokemon.nature)
scene.pbDisplay(_INTL("{1} now feels {2}.",
pokemon.name,k))
next true
else
scene.pbDisplay("Nothing happend.")
next false
end
})
known bugs:
- it might get complicated with the rarecandy. the code checks the moves of the pokemon before evolution. E.g. if you give 10000 to metapod it wont learn moves as butterfree