• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • 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] Custom Ability LeechSeed

  • 5
    Posts
    9
    Years
    • Seen Dec 14, 2021
    Hey!!

    Im a total coding n00b! Could you please help me with creating a custom ability that when a pokemon enters the field he immidiatly leech seeds the opposing pokemon? The ability woud be called Gardner

    Cheers!
     
    This one is easy. Paste this in the new script you made for the previous ability:

    Code:
    BattleHandlers::AbilityOnSwitchIn.add(:GARDENER,
      proc { |ability,battler,battle|
        show_splash = true
        battler.eachOpposing { |b|
          next if b.effects[PBEffects::LeechSeed]>=0
          if show_splash
            # Show the splash only won't. 
            battle.pbShowAbilitySplash(battler)
            show_splash = false
          end 
          b.effects[PBEffects::LeechSeed] = battler.index
          battle.pbDisplay(_INTL("{1} was seeded!",b.pbThis))
        }
        battle.pbHideAbilitySplash(battler) if !show_splash
      }
    )

    Do you plan to make a topic for every new thing you wanna code?
    I suggest you start learning some Ruby or recruit someone to make that code for you. I'm not going to write your game.
     
    Back
    Top