Registrarse

[RPG - Scripting] Capsula de habilidad, habilidad oculta (Ayuda)

Estado
Cerrado para nuevas respuestas.
Hola, encontr el script del funcionamiento de la capsula de habilidad. Soy muy malo en scripting y lo que me gustaria es que en lugar de solo poder cambiar entre habilidad 1 y 2 tambien se pudiera cambiar a la habilidad oculta.
No se si se pueda agregar al ciclo de el item o si se pueda hacer que el item simplemente haga que se da acceso al menu de debug donde te permite acceder a la eleccion de habilidades. (Solo por el uso del item claro )
Si alguien me pudiera ayudar estaria muy agradecido-

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
})

EDITO PARA PONER LA SOLUCION:
Este script permite que una capsula de habilidad cambie las habilidades y habilidades ocultas: (Por WolfPP de Pokecommunity)

ItemHandlers::UseOnPokemon.add:)ABILITYCAPSULE,proc{|item,pokemon,scene|
abils=pokemon.getAbilityList
abil1=0; abil2=0; abil3=0
for i in abils
abil1=i[0] if i[1]==0
abil2=i[0] if i[1]==1
abil3=i[0] if i[1]==2
end
choices = []
choices.push("Change Ability")
choices.push("Change to Hidden Ability")
choices.push("Cancel")
cmd = Kernel.pbMessage(_INTL("What would you like to do?"), choices, choices.length - 1)
if choices[cmd]=="Change Ability"
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
elsif choices[cmd]=="Change to Hidden Ability"
if abil3<=0
scene.pbDisplay(_INTL("It won't have any effect."))
next false
end
newabil= pokemon.setAbility(2)#(pokemon.abilityIndex+1)%2
newabilname=PBAbilities.getName((newabil==0) ? abil1 : abil3)
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
end
})

Claramente hay que hacer este cambio en el script PItem_ItemEffects
 
Última edición:
Estado
Cerrado para nuevas respuestas.
Arriba