• 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.

Lucidious89's Custom Ability Thread [Essentials v18.1]

6
Posts
3
Years
    • Seen Jan 19, 2021
    There's no reason for that line to be causing an error unless you placed it somewhere it shouldn't be. Paste the code if you can't figure it out.

    BattleHandlers::UserAbilityOnHit.add(:HYPNOCHANT,
    proc { |ability,user,target,move,battle|
    next if !isConst?(move.calcType,PBTypes,:PSYCHIC)?
    next if pbRandom(100)>=10
    battle.pbShowAbilitySplash(user)
    if target.hasActiveAbility?(:SHIELDDUST) && !battle.moldBreaker
    battle.pbShowAbilitySplash(target)
    if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
    battle.pbDisplay(_INTL("{1} is unaffected!",target.pbThis))
    end
    battle.pbHideAbilitySplash(target)
    elsif target.pbCanSleep?(user,PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
    msg = nil
    if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
    msg = _INTL("{1} {2} fell asleep! {3}!",user.pbThis,user.abilityName,target.pbThis(true))
    end
    target.pbSleep(user,msg)
    end
    battle.pbHideAbilitySplash(user)
     
    1,408
    Posts
    10
    Years
    • Seen today
    BattleHandlers::UserAbilityOnHit.add(:HYPNOCHANT,
    proc { |ability,user,target,move,battle|
    next if !isConst?(move.calcType,PBTypes,:PSYCHIC)?
    next if pbRandom(100)>=10
    battle.pbShowAbilitySplash(user)
    if target.hasActiveAbility?(:SHIELDDUST) && !battle.moldBreaker
    battle.pbShowAbilitySplash(target)
    if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
    battle.pbDisplay(_INTL("{1} is unaffected!",target.pbThis))
    end
    battle.pbHideAbilitySplash(target)
    elsif target.pbCanSleep?(user,PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
    msg = nil
    if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
    msg = _INTL("{1} {2} fell asleep! {3}!",user.pbThis,user.abilityName,target.pbThis(true))
    end
    target.pbSleep(user,msg)
    end
    battle.pbHideAbilitySplash(user)

    Oh whoops, my bad. There's a random "?" after :PSYCHIC that shouldn't be there. Idk why I wrote that in my original response to you. Everything else seems fine. I'm assuming you closed the brackets off with } at the end of the code, and you just didn't paste it over.

    Also, your msg text needs to be fixed. The way you wrote it is going to display the ability message like "User Hypno Chant fell asleep! Target!" which obviously makes no sense.
     
    6
    Posts
    3
    Years
    • Seen Jan 19, 2021
    Yup that fixed it thanks! Lol, guess I'll fix that later, now the essentials is giving me an error message on an un altered flamebody beneath it. But aside from that, thank you again!
     
    4
    Posts
    4
    Years
    • Seen Jun 28, 2022
    These are really cool abilities! I find the type adding abilities the most intriguing though, and they are kind of why I found this thread. I've been looking for abilities that add types that I could use as a reference for an ability of my own, "Diamond Skin" which would essentially just grant the user pokemon Rock as a third typing whenever they were in battle. Sorry if this is a pretty simple question, how would I go about targeting the user of the ability only with gaining the third typing? I've tried using other abilities that target the user only as a reference and I'm running into issues with that and I'm starting to feel a little dumb lmao
     
    40
    Posts
    3
    Years
    • Seen Jan 13, 2022
    These are really cool abilities! I find the type adding abilities the most intriguing though, and they are kind of why I found this thread. I've been looking for abilities that add types that I could use as a reference for an ability of my own, "Diamond Skin" which would essentially just grant the user pokemon Rock as a third typing whenever they were in battle. Sorry if this is a pretty simple question, how would I go about targeting the user of the ability only with gaining the third typing? I've tried using other abilities that target the user only as a reference and I'm running into issues with that and I'm starting to feel a little dumb lmao

    Me personally, I had an ability concept that would completely change a Pokemons type in battle.
    Say, for example, we go with the ability name Blackened Soul.
    If we give this ability to, say, a Dusknoir, it would change from a pure Ghost-type to a pure Dark-type.
     
    4
    Posts
    4
    Years
    • Seen Jun 28, 2022
    Me personally, I had an ability concept that would completely change a Pokemons type in battle.
    Say, for example, we go with the ability name Blackened Soul.
    If we give this ability to, say, a Dusknoir, it would change from a pure Ghost-type to a pure Dark-type.

    That's a cool idea for an ability, is it just all the time in battle or under specific conditions?
     
    40
    Posts
    3
    Years
    • Seen Jan 13, 2022
    That's a cool idea for an ability, is it just all the time in battle or under specific conditions?

    Under specific conditions, specifically when Dusknoir is either used against a Psychic-type wild Pokemon or Trainer Pokemon. It can also activate this way if the Trainer has multiple different-typed Pokemon, which case you can just keep Dusknoir in and do your best to defeat them and make it to the Psychic-type one if present, which case when the Psychic-type is sent out, the ability will activate and change Dusknoirs typing mid-battle.
     
    1,408
    Posts
    10
    Years
    • Seen today
    These are really cool abilities! I find the type adding abilities the most intriguing though, and they are kind of why I found this thread. I've been looking for abilities that add types that I could use as a reference for an ability of my own, "Diamond Skin" which would essentially just grant the user pokemon Rock as a third typing whenever they were in battle. Sorry if this is a pretty simple question, how would I go about targeting the user of the ability only with gaining the third typing? I've tried using other abilities that target the user only as a reference and I'm running into issues with that and I'm starting to feel a little dumb lmao

    You don't have to target anything, you're making it more complicated than it needs to be. Simply add the type to the Pokemon in the battler initialization, so that it always starts with that type upon entering battle. All of the default effects for a battler is handled in "def pbInitEffects(batonPass)". A Pokemon's third type is among these effects, PBEffects::Type3. By default, this is set to -1, which means basically that it's set to nothing. So just put a line below that so that it's set to the type you want instead if the battler has your custom ability.

    Code:
    if hasActiveAbility?(:ABILITYNAME)
          @effects[PBEffects::Type3]             = getConst(PBTypes,:TYPENAME)
        end

    Done. Now a Pokemon with Ability X will always have its third type set to Type Y in battle. If you want this to be a permanent effect that can't be changed, you'll have to go through the script and have any effects that change Type3 or reset it somehow fail when the target has this ability.
     
    Last edited:
    4
    Posts
    4
    Years
    • Seen Jun 28, 2022
    Oh, that makes a lot of sense actually. I definitely was making it a lot more complicated then it had to be. Thanks for explaining that to me!
     
    4
    Posts
    4
    Years
    • Seen Jun 28, 2022
    Code:
    if hasActiveAbility?(:ABILITYNAME)
          @effects[PBEffects::Type3]             = getConst(PBTypes:TYPENAME)
        end

    Hm. I put it inside of def pbInitEffects(batonPass), and it's giving out this error:

    Code:
    Exception: NoMethodError
    
    Message: undefined method PBTypes' for #<PokeBattle_Battler:0xf9ed560>
    
    
    
    Backtrace:
    
    Battler_Initialize:315:in pbInitEffects'
    
    Battler_Initialize:67:in pbInitialize'
    
    Battle_StartAndEnd:113:in pbCreateBattler'
    
    Battle_StartAndEnd:147:in pbSetUpSides'
    
    Battle_StartAndEnd:144:in eachInTeam'
    
    PokeBattle_Battle:388:in each_with_index'
    
    PokeBattle_Battle:388:in each'
    
    PokeBattle_Battle:388:in each_with_index'
    
    PokeBattle_Battle:388:in eachInTeam'
    
    Battle_StartAndEnd:144:in `pbSetUpSides'
     
    1,408
    Posts
    10
    Years
    • Seen today
    Hm. I put it inside of def pbInitEffects(batonPass), and it's giving out this error:

    Code:
    Exception: NoMethodError
    
    Message: undefined method PBTypes' for #<PokeBattle_Battler:0xf9ed560>
    
    
    
    Backtrace:
    
    Battler_Initialize:315:in pbInitEffects'
    
    Battler_Initialize:67:in pbInitialize'
    
    Battle_StartAndEnd:113:in pbCreateBattler'
    
    Battle_StartAndEnd:147:in pbSetUpSides'
    
    Battle_StartAndEnd:144:in eachInTeam'
    
    PokeBattle_Battle:388:in each_with_index'
    
    PokeBattle_Battle:388:in each'
    
    PokeBattle_Battle:388:in each_with_index'
    
    PokeBattle_Battle:388:in eachInTeam'
    
    Battle_StartAndEnd:144:in `pbSetUpSides'

    Sorry, I just typed it out real quick without checking my syntax. I forgot a comma after "PBTypes". That'll fix it.
     
    13
    Posts
    3
    Years
    • Seen Sep 9, 2023
    Does anyone know how to create an ability that makes the user immune to switching out from moves like dragon tail, whirlwind, roar, etc. I don't know ruby scripting at all and was hoping to get some help.

    Thanks.
     
    1,408
    Posts
    10
    Years
    • Seen today
    Does anyone know how to create an ability that makes the user immune to switching out from moves like dragon tail, whirlwind, roar, etc. I don't know ruby scripting at all and was hoping to get some help.

    Thanks.

    The Ability Suction Cups already exists and does that. If you want to clone that ability under a new name, just search the script for :SUCTIONCUPS and duplicate that where appropriate.
     
    13
    Posts
    3
    Years
    • Seen Sep 9, 2023
    The Ability Suction Cups already exists and does that. If you want to clone that ability under a new name, just search the script for :SUCTIONCUPS and duplicate that where appropriate.

    I never realised suction cups did that. I feel like an idiot now lol
    Thanks for the help.
     
    34
    Posts
    4
    Years
    • Seen May 9, 2024
    Yo guys, anyone able to help me make an ability that draws in sound-based moves like Lightningrod, and boosts Sp.Atk? I've tried a variety of approaches and can't get it to work :P
     
    1,408
    Posts
    10
    Years
    • Seen today
    Yo guys, anyone able to help me make an ability that draws in sound-based moves like Lightningrod, and boosts Sp.Atk? I've tried a variety of approaches and can't get it to work :P

    The methods that abilities like Lightning Rod use are all type-based, and don't check for move categories, so you'll have to build your own methods to check for Sound to get this to work. It doesn't look hard, though.


    For the re-targeting effect, you'll probably have to create a new method thats nearly identical to def pbChangeTargetByAbility. Except change/remove everything related to "drawnType" and make it so that it checks whether the move is sound-based instead, rather than checking for a specific type. Then just include this new check at the end of def pbChangeTargets in the same way the checks for Lightning Rod and Storm Drain are handled.

    For the stat boost effect, again, you'll have to just create a new method that is nearly identical to def pbBattleMoveImmunityStatAbility. But again, remove/change all the code related to type, and instead make it check for whether or not the move is Sound-based. Then create a new BattleHandlers::MoveImmunityTargetAbility ability in the same way Lightning Rod is handled, except have it check for your new sound-based immunity method, rather than the type-based one.

    Then finally, just copy the BattleHandlers::AccuracyCalcTargetAbility effect abilities like Lightning Rod use, except have it check for a Sound move rather than a move type. This'll prevent the drawn-in moves from missing.


    If you wanna be extra fancy, you could make this a bit more generalized so that you can use these new methods to check for other move categories too (Dance moves, Biting moves, bomb moves, etc) just in case you want to create other abilities with the same concept later on, but for different kinds of move categories. But that might be jumping the gun a bit.
     
    1,408
    Posts
    10
    Years
    • Seen today
    It's rare that I'm this bored and creatively stumped that I'd actually ask people to make an ability for them, but if anyone's got a good original idea for something and needs help, I'd be willing to take a crack at it. And make sure it's actually interesting, not just a reskin of an existing ability/item/etc. That's boring.
     
    40
    Posts
    3
    Years
    • Seen Jan 13, 2022
    It's rare that I'm this bored and creatively stumped that I'd actually ask people to make an ability for them, but if anyone's got a good original idea for something and needs help, I'd be willing to take a crack at it. And make sure it's actually interesting, not just a reskin of an existing ability/item/etc. That's boring.

    I have something interesting. This is meant to be a special ability for Dialga and Celebi, in fact.
    Temporal Rewind - If a move would normally one-hit KO this Pokemon, whether it be a normal move or something like Fissure, the Pokemon endures the move at one HP and is then healed back to half their max HP.
     
    1,408
    Posts
    10
    Years
    • Seen today
    I have something interesting. This is meant to be a special ability for Dialga and Celebi, in fact.
    Temporal Rewind - If a move would normally one-hit KO this Pokemon, whether it be a normal move or something like Fissure, the Pokemon endures the move at one HP and is then healed back to half their max HP.

    Cool idea, but execution-wise that's just a reskin of Sturdy with an extra line to heal back HP.
     
    40
    Posts
    3
    Years
    • Seen Jan 13, 2022
    Cool idea, but execution-wise that's just a reskin of Sturdy with an extra line to heal back HP.

    Alternatively, rather than enduring the hit with one HP, they could actually faint still, but after fainting and switching out, the ability heals them to half the max HP so they can re-enter battle.
     
    Back
    Top