Advertiser Content

fauno

Non-binary
Brazil
Seen 21 Hours Ago
Posted 2 Days Ago
23 posts
2.1 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:


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...
Seen 2 Weeks Ago
Posted July 19th, 2019
17 posts
1.7 Years
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

Discord: Wolf#1235

Male
Brazil
Seen 1 Hour Ago
Posted 1 Day Ago
869 posts
1.2 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:
    if status==PBStatuses::POISON
      @battle.pbDisplay(_INTL("{1} is already poisoned.",pbThis)) if showMessages
      return false
    end
Paste:
    if attacker.hasWorkingAbility(:CORROSION)
      return true
    end

WolfPP

Discord: Wolf#1235

Male
Brazil
Seen 1 Hour Ago
Posted 1 Day Ago
869 posts
1.2 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:

Correct code I guess is:
if (attacker && attacker.hasWorkingAbility(:CORROSION))
  if !attacker || !attacker.hasMoldBreaker
    return true if (pbHasType?(:POISON) || pbHasType?(:STEEL))
    end
  end
end
Above:
if (pbHasType?(:POISON) || pbHasType?(:STEEL)) && !hasWorkingItem(:RINGTARGET)'


V3.0
Inside def pbPoison?(attacker,showMessages,move=nil), replace the code to recognize STEEL and POISON types to:
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
Advertiser Content