Advertiser Content

WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 9 Hours Ago
787 posts
1.1 Years
Let's start it!
Steam Engine:
Paste into abilities.txt:
232,PRISMARMOR,Prism Armor,"Reduces the power of supereffective attacks taken."
233,NEUROFORCE,Neuroforce,"Powers up moves that are super effective."
234,BALLFETCH,Ball Fetch,"If the Pokémon is not holding an item, it will fetch the Poké Ball from the first failed throw of the battle."
235,STEAMENGINE,Steam Engine,"A Pokémon with this Ability will get a Speed stat boost if it's hit with a Fire- or Water-type move during battle."
235 is my last number. Pay attention with yours.

Then, inside script, find 'PokeBattle_Battler' and paste below Justified's code, like:
Spoiler:

Old Code:
Spoiler:

        if target.hasWorkingAbility(:JUSTIFIED) && isConst?(movetype,PBTypes,:DARK)
          PBDebug.log("[#{target.pbThis}'s Justified triggered]")
          if target.pbCanIncreaseStatStage?(PBStats::ATTACK)
            target.pbIncreaseStatBasic(PBStats::ATTACK,1)
            @battle.pbCommonAnimation("StatUp",target,nil)
            @battle.pbDisplay(_INTL("{1}'s {2} raised its Attack!",target.pbThis,PBAbilities.getName(target.ability)))
          end
        end
        if target.hasWorkingAbility(:STEAMENGINE) && 
        isConst?(movetype,PBTypes,:WATER) || isConst?(movetype,PBTypes,:FIRE)
          PBDebug.log("[#{target.pbThis}'s Steam Engine triggered]")
          if target.pbCanIncreaseStatStage?(PBStats::SPEED)
            target.pbIncreaseStatBasic(PBStats::SPEED,3)
            @battle.pbCommonAnimation("StatUp",target,nil)
            @battle.pbDisplay(_INTL("{1}'s {2} raised its Speed!", target.pbThis,PBAbilities.getName(target.ability)))
          end
        end

New Code:
Spoiler:

Into 'PokeBattle_Battler' script, inside 'def pbEffectsOnDealingDamage(move,user,target,damage)' and above 'if target.hasWorkingItem(:AIRBALLOON,true)', paste (I made a better code for Stamina and Cotton Down if you want to):
          effMessages=false
        end
        if target.hasWorkingAbility(:STAMINA)
          if !target.pbTooHigh?(PBStats::DEFENSE)
            PBDebug.log("[#{target.pbThis}'s Stamina triggered]")
            target.pbIncreaseStat(PBStats::DEFENSE,1,false,true)
          end 
        end
        if target.hasWorkingAbility(:COTTONDOWN)
          if !user.pbTooLow?(PBStats::SPEED)
            PBDebug.log("[#{target.pbThis}'s Cotton Down triggered]")
            user.pbReduceStat(PBStats::SPEED,1,nil,false)
          end 
        end
        if target.hasWorkingAbility(:STEAMENGINE) && (isConst?(movetype,PBTypes,:WATER) || isConst?(movetype,PBTypes,:FIRE))
          if !target.pbTooHigh?(PBStats::SPEED)
            PBDebug.log("[#{target.pbThis}'s Steam Engine triggered]")
            target.pbIncreaseStat(PBStats::SPEED,3,false,true)
          end 
        end
        if target.hasWorkingItem(:AIRBALLOON,true)

Ball Fetch


Assumptions made due to the current lack of accessible data:
Spoiler:

-It doesn't trigger only if the pokemon is in battle (but only if is in the party)
-It isn't affected by moves and abilities that deactivate abilities
-Can't obtain Safari balls with this
-If you have in your party more pokemon that can fetch pokeballs, the first of these that have no item, in the order of the party, will get it



In PokeBattle_Battle, replace (or adapt) the method pbThrowPokeBall with this:
Spoiler:
# Ball Fetch
  def tryFetchingBall(ball,safari,firstfailedthrowatsafari)
    ret=0
    if safari
      if !firstfailedthrowatsafari
        for i in 0...$Trainer.party.length
          if isConst?($Trainer.party[i].ability,PBAbilities,:BALLFETCH) &&
            $Trainer.party[i].item <= 0
            pbDisplay(_INTL("{1} fetched the {2}.",$Trainer.party[i].name,PBItems.getName(ball)))
            PBDebug.log("[Ability triggered] #{$Trainer.party[i].name} fetched the #{PBItems.getName(ball)}")
            pbDisplay(_INTL("{1}! Give me that, you naughty!",$Trainer.party[i].name))
            ret=-1
            break
          end
        end
      end
    else
      if !@firstfailedthrow
        for i in 0...$Trainer.party.length
          if isConst?($Trainer.party[i].ability,PBAbilities,:BALLFETCH) &&
            $Trainer.party[i].item <= 0
            $Trainer.party[i].item=ball
            $Trainer.party[i].itemInitial=ball
            pbDisplay(_INTL("{1} fetched the {2}.",$Trainer.party[i].name,PBItems.getName(ball)))
            PBDebug.log("[Ability triggered] #{$Trainer.party[i].name} fetched the #{PBItems.getName(ball)}")
            ret=-1
            break
          end
        end
        @firstfailedthrow=true
      end
    end
    return ret
  end
      
  # Retuns: 1 - success at capturing, 0 - fail at capturing and at fetching ball,
  # -1 - fail at capturing and success at fetching ball
  def pbThrowPokeBall(idxPokemon,ball,rareness=nil,showplayer=false,safari=false,firstfailedthrowatsafari=false)
    ret=0
    itemname=PBItems.getName(ball)
    battler=nil
    if pbIsOpposing?(idxPokemon)
      battler=self.battlers[idxPokemon]
    else
      battler=self.battlers[idxPokemon].pbOppositeOpposing
    end
    if battler.fainted?
      battler=battler.pbPartner
    end
    pbDisplayBrief(_INTL("{1} threw one {2}!",self.pbPlayer.name,itemname))
    if battler.fainted?
      pbDisplay(_INTL("But there was no target..."))
      return tryFetchingBall(ball,safari,firstfailedthrowatsafari)
    end
    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
      ret=tryFetchingBall(ball,safari,firstfailedthrowatsafari)
    else
      pokemon=battler.pokemon
      species=pokemon.species
      if $DEBUG && Input.press?(Input::CTRL)
        shakes=4
      else
        if !rareness
          dexdata=pbOpenDexData
          pbDexDataOffset(dexdata,pokemon.fSpecies,16)
          rareness=dexdata.fgetb # Get rareness from dexdata file
          dexdata.close
        end
        a=battler.totalhp
        b=battler.hp
        rareness=BallHandlers.modifyCatchRate(ball,rareness,self,battler)
        x=(((a*3-b*2)*rareness)/(a*3)).floor
        if battler.status==PBStatuses::SLEEP || battler.status==PBStatuses::FROZEN
          x=(x*2.5).floor
        elsif battler.status!=0
          x=(x*1.5).floor
        end
        c=0
        if $Trainer
          if $Trainer.pokedexOwned>600
            c=(x*2.5/6).floor
          elsif $Trainer.pokedexOwned>450
            c=(x*2/6).floor
          elsif $Trainer.pokedexOwned>300
            c=(x*1.5/6).floor
          elsif $Trainer.pokedexOwned>150
            c=(x*1/6).floor
          elsif $Trainer.pokedexOwned>30
            c=(x*0.5/6).floor
          end
        end
        shakes=0; critical=false
        if x>255 || BallHandlers.isUnconditional?(ball,self,battler)
          shakes=4
        else
          x=1 if x<1
          y = ( 65536 / ((255.0/x)**0.1875) ).floor
          if USECRITICALCAPTURE && pbRandom(256)<c
            critical=true
            shakes=4 if pbRandom(65536)<y
          else
            shakes+=1 if pbRandom(65536)<y
            shakes+=1 if pbRandom(65536)<y && shakes==1
            shakes+=1 if pbRandom(65536)<y && shakes==2
            shakes+=1 if pbRandom(65536)<y && shakes==3
          end
        end
      end
      PBDebug.log("[Threw Poké Ball] #{itemname}, #{shakes} shakes (4=capture)")
      @scene.pbThrow(ball,shakes,critical,battler.index,showplayer)
      case shakes
      when 0
        pbDisplay(_INTL("Oh no! The Pokémon broke free!"))
        BallHandlers.onFailCatch(ball,self,battler)
        ret=tryFetchingBall(ball,safari,firstfailedthrowatsafari)
      when 1
        pbDisplay(_INTL("Aww... It appeared to be caught!"))
        BallHandlers.onFailCatch(ball,self,battler)
        ret=tryFetchingBall(ball,safari,firstfailedthrowatsafari)
      when 2
        pbDisplay(_INTL("Aargh! Almost had it!"))
        BallHandlers.onFailCatch(ball,self,battler)
        ret=tryFetchingBall(ball,safari,firstfailedthrowatsafari)
      when 3
        pbDisplay(_INTL("Gah! It was so close, too!"))
        BallHandlers.onFailCatch(ball,self,battler)
        ret=tryFetchingBall(ball,safari,firstfailedthrowatsafari)
      when 4
        pbDisplayBrief(_INTL("Gotcha! {1} was caught!",pokemon.name))
        @scene.pbThrowSuccess
        if pbIsSnagBall?(ball) && @opponent
          pbRemoveFromParty(battler.index,battler.pokemonIndex)
          battler.pbReset
          battler.participants=[]
        else
          @decision=4
        end
        if pbIsSnagBall?(ball)
          pokemon.ot=self.pbPlayer.name
          pokemon.trainerID=self.pbPlayer.id
        end
        BallHandlers.onCatch(ball,self,pokemon)
        pokemon.ballused=pbGetBallType(ball)
        ((pokemon.makeUnmega if pokemon.isMega?) rescue nil)
        ((pokemon.makeUnprimal if pokemon.isPrimal?) rescue nil)
        ((pokemon.makeUnultra if pokemon.isUltra?) rescue nil)
        (pokemon.updateOtherForms rescue nil)
        pokemon.pbRecordFirstMoves
        if GAINEXPFORCAPTURE
          battler.captured=true
          pbGainEXP
          battler.captured=false
        end
        if !self.pbPlayer.hasOwned?(species)
          self.pbPlayer.setOwned(species)
          if $Trainer.pokedex
            pbDisplayPaused(_INTL("{1}'s data was added to the Pokédex.",pokemon.name))
            @scene.pbShowPokedex(species)
          end
        end
        pokemon.forcedForm = nil if MultipleForms.hasFunction?(pokemon.species,"getForm")
        @scene.pbHideCaptureBall
        if pbIsSnagBall?(ball) && @opponent
          pokemon.pbUpdateShadowMoves rescue nil
          @snaggedpokemon.push(pokemon)
        else
          pbStorePokemon(pokemon)
        end
        ret=1
      end
    end
    return ret
  end


Search @snaggedpokemon = [] and above it, put @firstfailedthrow= false # First failed catch attempt with a pokeball

Search @peer=PokeBattle_BattlePeer.create() and put @firstfailedthrow=false # First failed catch attempt with a pokeball below it.

Search if safariBall and replace what's inside that condition with this:
Spoiler:
result=pbThrowPokeBall(1,safariBall,rare,true,true,@firstfailedthrow)
            case result
            when 0
              @firstfailedthrow=true
            when -1
              @ballcount+=1
              @firstfailedthrow=true
            end



If I don't forget, or sombody reminds me, I'll update this when more knowledge on this ability is available.

EDIT: Fixed the bug showed in the post below.

WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 9 Hours Ago
787 posts
1.1 Years
Ball Fetch


Assumptions made due to the current lack of accessible data:
Spoiler:

-It doesn't trigger only if the pokemon is in battle (but only if is in the party)
-It isn't affected by moves and abilities that deactivate abilities
-Can't obtain Safari balls with this
-If you have in your party more pokemon that can fetch pokeballs, the first of these that have no item, in the order of the party, will get it

If I don't forget, or sombody reminds me, I'll update this when more knowledge on this ability is available.
Correct phrase.
After battle the poke ball dissapears (even if into the Bag and Pokémon - Summary or Party Screen i.e) . To fix that, add 'self.battlers[i].pokemon.itemInitial=self.battlers[i].item', like:
Spoiler:

    else
      if !@firstfailedthrow
        for i in 0...4
          if self.battlers[i].hasWorkingAbility(:BALLFETCH) && self.battlers[i].item==0
            self.battlers[i].item=ball
            self.battlers[i].pokemon.itemInitial=self.battlers[i].item
            PBDebug.log("[Ability triggered] #{$Trainer.party[i].name} fetched the #{PBItems.getName(ball)}")
            pbDisplay(_INTL("{1} found a {2}!",self.battlers[i].name,PBItems.getName(ball)))
            ret=-1
            break
          end
        end
        @firstfailedthrow=true
      end
    end
    return ret
  end

Also, if i throw a poke ball with other pokemon (without Ball Fetch ability, but i have a pokemon with that ability into the party) the ability will trigger. If you don't want that just replace 'def tryFetchingBall(ball,safari,firstfailedthrowatsafari)' (I don't know about Safari Zone, i made to normal battle):
Spoiler:

  # Ball Fetch
  def tryFetchingBall(ball,safari,firstfailedthrowatsafari)
    ret=0
    if safari
      if !firstfailedthrowatsafari
        for i in 0...Trainer.party.length
          if isConst?($Trainer.party[i].ability,PBAbilities,:BALLFETCH) && $Trainer.party[i].item <= 0
            PBDebug.log("[Ability triggered] #{$Trainer.party[i].name} fetched the #{PBItems.getName(ball)}")
            pbDisplay(_INTL("{1} found a {2}!",$Trainer.party[i].name,PBItems.getName(ball)))
            ret=-1
            break
          end
        end
      end
    else
      if !@firstfailedthrow
        for i in 0...4
          if self.battlers[i].hasWorkingAbility(:BALLFETCH) && self.battlers[i].item<=0
            self.battlers[i].item=ball
            self.battlers[i].pokemon.itemInitial=self.battlers[i].item
            PBDebug.log("[Ability triggered] #{$Trainer.party[i].name} fetched the #{PBItems.getName(ball)}")
            pbDisplay(_INTL("{1} found a {2}!",self.battlers[i].name,PBItems.getName(ball)))
            ret=-1
            break
          end
        end
        @firstfailedthrow=true
      end
    end
    return ret
  end

Alan Flygon

A new GUY!!!

Male
Kerala
Seen 4 Weeks Ago
Posted 4 Weeks Ago
79 posts
1.4 Years
I got a small vacation from studies so I made this script. This is my first script so there might be some mistakes, please feel free to correct it here.

Cotton Down (Ability):
Note: The correct definition for this ability hasn't been revealed yet, so when it does you should change the definition to the correct one both in PBS and in Battle Display.
236,COTTONDOWN,Cotton Down,"A Pokémon with this Ability will reduce the Speed stat of its opponent in battle."
Put it below Wolf's Steam Engine Code in PokeBattle_Battler
        if target.hasWorkingAbility(:COTTONDOWN)
          PBDebug.log("[#{target.pbThis}'s Cotton Down triggered]")
          if target.damagestate.calcdamage>0 && !target.fainted?
            if user.pbCanReduceStatStage?(PBStats::SPEED)
              user.pbReduceStatBasic(PBStats::SPEED,1)
              @battle.pbCommonAnimation("StatDown",user,nil)
              @battle.pbDisplay(_INTL("{1}'s Speed fell!", user.pbThis))
            end
          end
        end
Sorry to say that I won't be online for a few Weeks due to my studies.
So if there's any mistake in the script or any bugs please report it here and other programmers will help you.😉

EDIT: Known Bugs -
# When the user is hit with a non contact move the user's speed also increases. I don't actually know how to fix it.

EDIT 2: LOOK AT MY BELOW POST FOR THE NEW CODE

WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 9 Hours Ago
787 posts
1.1 Years
Spoiler:
I got a small vacation from studies so I made this script. This is my first script so there might be some mistakes, please feel free to correct it here.

Cotton Down (Ability):
Note: The correct definition for this ability hasn't been revealed yet, so when it does you should change the definition to the correct one both in PBS and in Battle Display.
236,COTTONDOWN,Cotton Down,"A Pokémon with this Ability will reduce the Speed stat of its opponent in battle."
Put it below Wolf's Steam Engine Code in PokeBattle_Battler
        if target.hasWorkingAbility(:COTTONDOWN)
          PBDebug.log("[#{target.pbThis}'s Cotton Down triggered]")
          if target.damagestate.calcdamage>0 && !target.fainted?
            if user.pbCanReduceStatStage?(PBStats::SPEED)
              user.pbReduceStatBasic(PBStats::SPEED,1)
              @battle.pbCommonAnimation("StatDown",user,nil)
              @battle.pbDisplay(_INTL("{1}'s Speed fell!", user.pbThis))
            end
          end
        end
Sorry to say that I won't be online for a few Weeks due to my studies.
So if there's any mistake in the script or any bugs please report it here and other programmers will help you.😉

EDIT: Known Bugs -
# When the user is hit with a non contact move the user's speed also increases. I don't actually know how to fix it.
Cotton Down is like Gooey/Tangling Hair 2.0. I posted the script into main post.

Alan Flygon

A new GUY!!!

Male
Kerala
Seen 4 Weeks Ago
Posted 4 Weeks Ago
79 posts
1.4 Years
Cotton Down is like Gooey/Tangling Hair 2.0. I posted the script into main post.
Alright I changed the code. I tested it and no Error was found 😄

Bulbapedia
EFFECT:

In battle
When a Pokémon with this Ability is hit by a move, the Speed of the attacking Pokémon is decreased by one stage.
Due to limited info about the Ability I made two Versions of the code
In PokeBattle_Battler put the code under Illusion (just search "# Illusion")
Spoiler:

Version 1 (Reduces Speed if user is hit with a Contact or Non-Contact move)
# Cotton Down
      if target.hasWorkingAbility(:COTTONDOWN) && thismove.isContactMove? &&
         !target.damagestate.substitute
        if user.pbReduceStatWithCause(PBStats::SPEED,1,target,PBAbilities.getName(target.ability))
          PBDebug.log("[Ability triggered] #{target.pbThis}'s Cotton Down was activated")
        end
	    elsif target.hasWorkingAbility(:COTTONDOWN) && !thismove.isContactMove? &&
	       !target.damagestate.substitute
        if user.pbReduceStatWithCause(PBStats::SPEED,1,target,PBAbilities.getName(target.ability))
          PBDebug.log("[Ability triggered] #{target.pbThis}'s Cotton Down was activated")
        end
      end
Version 2 (Reduces Speed if user is hit with a Contact move)
# Cotton Down
      if target.hasWorkingAbility(:COTTONDOWN) && thismove.isContactMove? &&
         !target.damagestate.substitute && !user.hasWorkingAbility(:LONGREACH)
        if user.pbReduceStatWithCause(PBStats::SPEED,1,target,PBAbilities.getName(target.ability))
          PBDebug.log("[Ability triggered] #{target.pbThis}'s Cotton Down was activated")
        end
      end

WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 9 Hours Ago
787 posts
1.1 Years
STEAMENGINE is not working for me. I get this error.
Its weird because 'def pbEffectOnDealingDamage', below it have an definition to 'movetype':
movetype=move.pbType(move.type,user,target)
Maybe you put into the wrong place.
Seen 2 Days Ago
Posted 2 Weeks Ago
57 posts
1.8 Years
Yes, sorry i fixed it. My air balloon is not inside 'def pbEffectsOnDealingDamage(move,user,target,damage)' but above (but works) i just put steam engine inside and it works.
A question: You made the ability to rise speed by 3 stages right? Is there information of how much this ability raises the speed? I don't really think that it will rise that much but maybe it's confirmed (?

WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 9 Hours Ago
787 posts
1.1 Years
Yes, sorry i fixed it. My air balloon is not inside 'def pbEffectsOnDealingDamage(move,user,target,damage)' but above (but works) i just put steam engine inside and it works.
A question: You made the ability to rise speed by 3 stages right? Is there information of how much this ability raises the speed? I don't really think that it will rise that much but maybe it's confirmed (?
Well you can check using google serch tool. You will see "drastically", same to increase 3:
Seen 2 Days Ago
Posted 2 Weeks Ago
57 posts
1.8 Years
Well you can check using google serch tool. You will see "drastically", same to increase 3:
Oh it flew over my head, well that's a pretty nice buff.
But i guess Rolycoly must be really slow and once you know it's ability it's not hard to counter. It may be interesting if it's evolutions can tank a water attack to make him useful in a bad matchup.

WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 9 Hours Ago
787 posts
1.1 Years
Oh it flew over my head, well that's a pretty nice buff.
But i guess Rolycoly must be really slow and once you know it's ability it's not hard to counter. It may be interesting if it's evolutions can tank a water attack to make him useful in a bad matchup.
Nothing that Trick Room can help. 8D

WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 9 Hours Ago
787 posts
1.1 Years
Pastel Veil, Galarian Ponyta's signature ability:

Add inside ability.txt (238 is my last number; description not official):
238,PASTELVEIL,Pastel Veil,"Prevents Pokémon and its Ally it from getting poisoned."
Now, in 'PokeBattle_Battler' script, above Imposter's code, paste:
Spoiler:

    # Pastel Veil
    if self.hasWorkingAbility(:PASTELVEIL) && @battle.doublebattle && 
    !pbPartner.fainted? && onactive
      if pbPartner.status==PBStatuses::POISON
        PBDebug.log("[Ability triggered] #{pbThis}'s Pastel Veil")
        @battle.pbDisplay(_INTL("{1} was cured of its poisoning.",pbPartner.pbThis))
        pbPartner.status=0
        pbPartner.statusCount=0
      end
    end


Then, in 'PokeBattle_BattlerEffects' script, search for 'def pbCanPoison?(attacker,showMessages,move=nil)' and where you have FLOWERVEIL you will add for PASTELVEIL, like I did (using '||'. Anyway, compare with yours):
Spoiler:

    if !attacker || !attacker.hasMoldBreaker
      if hasWorkingAbility(:IMMUNITY) ||
      (hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)) ||
      (hasWorkingAbility(:LEAFGUARD) && (@battle.pbWeather==PBWeather::SUNNYDAY || @battle.pbWeather==PBWeather::HARSHSUN)) ||
       hasWorkingAbility(:PASTELVEIL)      
        @battle.pbDisplay(_INTL("{1}'s {2} prevents poisoning!",pbThis,PBAbilities.getName(self.ability))) if showMessages
        return false
      end
      if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS) ||
         pbPartner.hasWorkingAbility(:PASTELVEIL)
        abilityname=PBAbilities.getName(pbPartner.ability)
        @battle.pbDisplay(_INTL("{1}'s partner's {2} prevents poisoning!",pbThis,abilityname)) if showMessages
        return false
      end
    end
    if pbOwnSide.effects[PBEffects::Safeguard]>0 &&


And done! :D

WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 9 Hours Ago
787 posts
1.1 Years
Neutralizing Gas, Galarian Weezing's ability:

In ability.txt (XXX will be your last number; description not official):
XXX,NEUTRALIZINGGAS,Neutralizing Gas, "All other abilities get neutralized!"

Now inside 'def hasWorkingAbility(ability,ignorefainted=false)', add to return false if some battler has NEUTRALIZINGGAS (compare and add or replace what you have for):
  def hasWorkingAbility(ability,ignorefainted=false)
    return false if fainted? && !ignorefainted
    return false if @effects[PBEffects::GastroAcid]
    for i in @battle.battlers
      return false if isConst?(i.ability,PBAbilities,:NEUTRALIZINGGAS)
    end
    return isConst?(@ability,PBAbilities,ability)
  end
Advertiser Content