• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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] Need help for a new Ability

  • 1
    Posts
    201
    Days
    • Seen Jan 18, 2025
    Hi, I'm new to Essentials (using v20.1). I'm trying to make an ability that settles the trick room when the Pokemon enters the field. But I have no idea of how to do it.
    I've tried to copy and modify the electric surge ability, copying and pasting the TR move to the ability and a lot more. As said It's the first time I'm digging in the scripts and I don't know about programming at all. So If anyone could help, It would be appreciated.

    (I already made the PBS changes, and defined the ability)
     
    #-------------------------------
    # Tricky
    Battle::AbilityEffects::EndOfRoundEffect.add(:TRICKY,
    proc { |ability, battler, battle|
    next unless battler.turnCount == 0 || battle.turnCount == 0 # First turn out!
    battle.pbShowAbilitySplash(battler)
    if battle.field.effects[PBEffects::TrickRoom] > 0
    battle.field.effects[PBEffects::TrickRoom] = 0
    battle.pbDisplay(_INTL("{1} reverted the dimensions!", battler.pbThis))
    else
    battle.field.effects[PBEffects::TrickRoom] = 5
    battle.pbDisplay(_INTL("{1} twisted the dimensions!", battler.pbThis))
    end
    battle.pbHideAbilitySplash(battler)
    # Room Service
    if battle.field.effects[PBEffects::TrickRoom] > 0
    battle.allBattlers.each do |b|
    next if !b.hasActiveItem?(:ROOMSERVICE)
    next if !b.pbCanLowerStatStage?(:SPEED)
    battle.pbCommonAnimation("UseItem", b)
    b.pbLowerStatStage(:SPEED, 1, nil)
    b.pbConsumeItem
    end
    end
    }
    )
     
    Back
    Top