• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Help with Custom Ability

  • 650
    Posts
    8
    Years
    Hey. So I have created a custom ability that reduces the accuracy of the damaging moves of all opponents by 5%. The accuracy nerf works like that of Hustle and is not a direct decrease in the Accuracy Stat Stage. Can anyone help me code this in Essentials?
     
    What have you tried? It's pretty much just Hustle, except instead of checking if the user has it, you want to check if a foe has it (or maybe the target, not sure exactly what you want). Ctrl-Shift-F searches all scripts, so if you look for :HUSTLE I'm sure you can find the accuracy modifier.
     
    Give me a second, I did something similar for a weather effect once.

    EDIT: Okay, so in def pbAccuracyCheck, you'll want to something like:
    Code:
        if isConst?(target.ability,PBAbilities,:ABILITYNAMEHERE)
          accuracy=(accuracy*19/20).floor
        end
    ...
    Except probably with an extra condition that the move is a damaging one.
     
    Last edited:
    What have you tried? It's pretty much just Hustle, except instead of checking if the user has it, you want to check if a foe has it (or maybe the target, not sure exactly what you want). Ctrl-Shift-F searches all scripts, so if you look for :HUSTLE I'm sure you can find the accuracy modifier.

    I tried using Ctrl+Shift+F to search for Hustle but i didn't know how to change the multiplier for the opponent.

    Give me a second, I did something similar for a weather effect once.

    EDIT: Okay, so in def pbAccuracyCheck, you'll want to something like:
    Code:
        if isConst?(target.ability,PBAbilities,:ABILITYNAMEHERE)
          accuracy=(accuracy*19/20).floor
        end
    ...
    Except probably with an extra condition that the move is a damaging one.

    Thank you so much it works perfectly!
     
    Back
    Top