- 16
- Posts
- 5
- Years
- Seen Aug 1, 2023
I'm trying to make an item that reverts a Pokemon's hidden ability back to it's normal ability/abilities.
The problems lies when I use it on a Pokemon with a single ability. I don't know how to make it check if the Pokemon only has one ability so it won't asks me twice and giving me a "?" where the second ability should be.
Here's the script that I adapted from BulbasaurLvl5 Ability capsule
Also if I make any mistake or something that shouldn't be in there, Please let me know.
Thanks!
The problems lies when I use it on a Pokemon with a single ability. I don't know how to make it check if the Pokemon only has one ability so it won't asks me twice and giving me a "?" where the second ability should be.
Here's the script that I adapted from BulbasaurLvl5 Ability capsule
Code:
#DeDream capsule
ItemHandlers::UseOnPokemon.add(:DEDREAMCAPSULE,proc{|item,poke,scene|
abilityList=poke.getAbilityList
abil1=0; abil2=0; abil3=0
for i in abilityList
abil1=i[0] if i[1]==0
abil2=i[0] if i[1]==1
abil3=i[0] if i[1]==2
end
if poke.abilityIndex() <=1
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() == 2
if Kernel.pbConfirmMessage(_INTL("Do you want to change it to {1}?",
PBAbilities.getName(abil1)))
poke.setAbility(0)
else
if Kernel.pbConfirmMessage(_INTL("Do you want to change it to {1}?",
PBAbilities.getName(abil2)))
poke.setAbility(1)
else
scene.pbDisplay(_INTL("You changed your mind."))
next false
end
end
end
scene.pbDisplay(_INTL("{1}'s ability was changed!",poke.name))
next true
end
next false
})
Also if I make any mistake or something that shouldn't be in there, Please let me know.
Thanks!