• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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

  • 658
    Posts
    7
    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?
     
  • 1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    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.
     
  • 220
    Posts
    14
    Years
    • Seen Nov 29, 2021
    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:
  • 658
    Posts
    7
    Years
    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