• 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] Script to make Egg Groups have effects in battle! (v20.1)

  • 8
    Posts
    2
    Years
    • Seen Oct 12, 2023
    Hello! I'm relatively new to scripting and want to know how to make Egg Groups have properties when in battle! (Example: The Flying group will always be counted as Airborne, even if you don't have the Flying type)! Thank you for your help in advance
     

    Frost the Fox

    FroststormFrenzy
  • 16
    Posts
    2
    Years
    • Seen Jun 14, 2023
    If you're still looking for this, the following code is the main thing you'll need:
    Code:
    pkmn.species_data.egg_groups.include?(:<insert_group_here>)

    For the example stated, you're gonna want to find this section:

    Code:
    def airborne?
        return false if hasActiveItem?(:IRONBALL)
        return false if @effects[PBEffects::Ingrain]
        return false if @effects[PBEffects::SmackDown]
        return false if @battle.field.effects[PBEffects::Gravity] > 0
        return true if pbHasType?(:FLYING)
        return true if hasActiveAbility?(:LEVITATE) && [email protected]
        return true if hasActiveItem?(:AIRBALLOON)
        return true if @effects[PBEffects::MagnetRise] > 0
        return true if @effects[PBEffects::Telekinesis] > 0
        return false
      end

    At some point in this code, you'll want to add:
    Code:
    return true if pkmn.species_data.egg_groups.include?(:Flying)

    I'd suggest this being placed with the other "return true" lines, as the top lines take priority.
     
    Back
    Top