- 59
- Posts
- 7
- Years
- Seen Jul 26, 2023
Hi, i found the script for the Ability capsule, im not good at all at scripting and i wanted to know how can i make it so that when used it can switch to the Hidden ability as well.
Please somebody help me.
Please somebody help me.
Spoiler:
ItemHandlers::UseOnPokemon.add(:ABILITYCAPSULE,proc{|item,pokemon,scene|
abils=pokemon.getAbilityList
abil1=0; abil2=0
for i in abils
abil1=i[0] if i[1]==0
abil2=i[0] if i[1]==1
end
if abil1<=0 || abil2<=0 || pokemon.hasHiddenAbility?
scene.pbDisplay(_INTL("It won't have any effect."))
next false
end
newabil=(pokemon.abilityIndex+1)%2
newabilname=PBAbilities.getName((newabil==0) ? abil1 : abil2)
if scene.pbConfirm(_INTL("Would you like to change {1}'s Ability to {2}?",
pokemon.name,newabilname))
pokemon.setAbility(newabil)
scene.pbRefresh
scene.pbDisplay(_INTL("{1}'s Ability changed to {2}!",pokemon.name,
PBAbilities.getName(pokemon.ability)))
next true
end
next false
})
abils=pokemon.getAbilityList
abil1=0; abil2=0
for i in abils
abil1=i[0] if i[1]==0
abil2=i[0] if i[1]==1
end
if abil1<=0 || abil2<=0 || pokemon.hasHiddenAbility?
scene.pbDisplay(_INTL("It won't have any effect."))
next false
end
newabil=(pokemon.abilityIndex+1)%2
newabilname=PBAbilities.getName((newabil==0) ? abil1 : abil2)
if scene.pbConfirm(_INTL("Would you like to change {1}'s Ability to {2}?",
pokemon.name,newabilname))
pokemon.setAbility(newabil)
scene.pbRefresh
scene.pbDisplay(_INTL("{1}'s Ability changed to {2}!",pokemon.name,
PBAbilities.getName(pokemon.ability)))
next true
end
next false
})