• 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] Ability of Gen 7 Corrosion

37
Posts
6
Years
  • I've been trying to implement the Corrosion ability in Pokémon Essentials V17.1 where I downloaded the pack with everything needed for it. Only 1 movement was incomplete because I could not find one of the sections in the scripts to modify. But the problem that is taking away my patience is with a ability, which is called Corrosion.

    As most will know, it allows the attacker to poison any type of opponent, even if it is Poison or Steel. type.

    The modified script is PokeBattle_BattleEffects, at line 127, where only one exception is added. "! attacker.hasWorkinAbility (: CORROSION)"

    The skill works perfectly, the problem is when any other Pokémon of the type Steel or Poison uses attacks of physical contact with some other pokémon that has the Poison Point ability. The error is as follows:
    BMNYoG8.jpg


    As I included the 7th generation, the Pokemon that has this ability would lose its identity if I put another ability in the place, could someone explain to me what happens and why this error happens...
     
    Last edited:

    Diegou18

    Forever Chandelure lover.
    75
    Posts
    6
    Years
    • Seen Aug 16, 2021
    In PokeBattle_BattlerEffects search this line "if (pbHasType?(:POISON) || pbHasType?(:STEEL)) && !hasWorkingItem(:RINGTARGET)" and add this to it:

    || !attacker.hasWorkingAbility(:CORROSION)

    You should have this line now: if (pbHasType?(:POISON) || pbHasType?(:STEEL)) && !hasWorkingItem(:RINGTARGET) || !attacker.hasWorkingAbility(:CORROSION)

    I did that and it seems that works. Btw, I have the v17.2
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • If you inflict Toxic against Steelix, it won't take Poison.
    I made that code:

    Inside 'def pbCanPoison?(attacker,showMessages,move=nil)', below that code:
    Code:
        if status==PBStatuses::POISON
          @battle.pbDisplay(_INTL("{1} is already poisoned.",pbThis)) if showMessages
          return false
        end

    Paste:
    Code:
        if attacker.hasWorkingAbility(:CORROSION)
          return true
        end
     
    220
    Posts
    9
    Years
  • Pokemons with that ability works fine. Usinf Wolfs code. But the same error appears from the other pokemon poison abilities, for ex: When a wild pokemon like nidoking against my nidoking, that reported error above appears again. I tried other methods and ways but no sucess for now.
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    For the benefit of anyone reading this thread in the future, pbCanPoison? is sometimes called without an attacker (e.g. for something like a Toxic Orb). That means you'd need something like (attacker && attacker.hasWorkingAbility(:CORROSION)).
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • For the benefit of anyone reading this thread in the future, pbCanPoison? is sometimes called without an attacker (e.g. for something like a Toxic Orb). That means you'd need something like (attacker && attacker.hasWorkingAbility(:CORROSION)).

    Thanks for point me!
    V2.0
    Spoiler:


    V3.0
    Inside def pbPoison?(attacker,showMessages,move=nil), replace the code to recognize STEEL and POISON types to:
    Code:
    if (pbHasType?(:POISON) || pbHasType?(:STEEL))  && !(attacker && attacker.hasWorkingAbility(:CORROSION)) && !hasWorkingItem(:RINGTARGET)
      @battle.pbDisplay(_INTL("It doesn't affect {1}...",pbThis(true))) if showMessages
      return false
    end
     
    Last edited:
    Back
    Top