Hello everybody!
I am trying to make some items that when held give the same effect of "man-made" medicines (like potions, ethers, antidotes, etc...).
With most of them I had no problem since I just copied the script of the corresponding berries, but I'm having a few problems with the trigger and the effect of max ether, elixir, max elixir and full restore because I am really ignorant script-wise.
Could anybody help me? I guess the easiest way is to start from the leppa berry script in the PokeBattle_Battler section but then how should I modify the script to obtain the effect I am looking for?
Thank you in advance if anyone can help me and stay safe!
I am trying to make some items that when held give the same effect of "man-made" medicines (like potions, ethers, antidotes, etc...).
With most of them I had no problem since I just copied the script of the corresponding berries, but I'm having a few problems with the trigger and the effect of max ether, elixir, max elixir and full restore because I am really ignorant script-wise.
Could anybody help me? I guess the easiest way is to start from the leppa berry script in the PokeBattle_Battler section but then how should I modify the script to obtain the effect I am looking for?
Code:
elsif isConst?(berry,PBItems,:NEWITEM)
found=[]
for i in [email protected]
if @pokemon.moves[i].id!=0
if (consume && @pokemon.moves[i].pp==0) ||
(!consume && @pokemon.moves[i].pp<@pokemon.moves[i].totalpp)
found.push(i)
end
end
end
if found.length>0
choice=(consume) ? found[0] : found[@battle.pbRandom(found.length)]
[email protected][choice]
pokemove.pp+=10
pokemove.pp=pokemove.totalpp if pokemove.pp>pokemove.totalpp
self.moves[choice].pp=pokemove.pp
movename=PBMoves.getName(pokemove.id)
@battle.pbDisplay(_INTL("{1}'s {2} restored {3}'s PP!",pbThis,berryname,movename))
consumed=true
end
Thank you in advance if anyone can help me and stay safe!