• 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!
  • 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.

Help for Custom Ability: Soul Reaper (v.18)

  • 32
    Posts
    7
    Years
    Hello! I hope this is the right thread to post.

    Edit: 15.10.2020
    The issues have now been solved, thanks to Turn20Negate.

    Content:
    With Turn20Negate's help, I've created an ability that works similarly to Leech Seed. So long as the user is in the battle, it will drain 1/8 HP of opposing Pokémon near to it.

    Code in BattleHandlers_Abilities (below Bad Dreams):
    Code:
    BattleHandlers::EOREffectAbility.add(:SOULREAPER,
      proc { |ability,battler,battle|
        splashshown = false
        battle.eachOtherSideBattler(battler.index) do |b|
          next if !battler || battler.fainted?
          next if !b.near?(battler) || !b.takesIndirectDamage?(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
          next if b.pbHasType?(:GHOST) || b.pbHasType?(:NORMAL)
          if !splashshown
            battle.pbShowAbilitySplash(battler)
            splashshown = true
          end
          oldHP = b.hp;oldHPRecipient = battler.hp
          hpLoss = b.totalhp/8
          b.pbReduceHP(hpLoss)
          battler.pbRecoverHPFromDrain(hpLoss,b,
             _INTL("{1}'s health was drained!",b.pbThis))
          battler.pbAbilitiesOnDamageTaken(oldHPRecipient);b.pbAbilitiesOnDamageTaken(oldHP)
          b.pbItemHPHealCheck
          b.pbFaint if b.fainted?
          battler.pbFaint if battler.fainted?
        end
        battle.pbHideAbilitySplash(battler)
      }
    )
     
    Last edited:
    Try changing this line:
    Code:
    next if !b.near?(battler) && !(b.pbHasType?(:GHOST) || b.pbHasType?(:Normal))
    to this:
    Code:
    next if !b.near?(battler) || b.pbHasType?(:GHOST) || b.pbHasType?(:NORMAL)
     
    Try changing this line:
    Code:
    next if !b.near?(battler) && !(b.pbHasType?(:GHOST) || b.pbHasType?(:Normal))
    to this:
    Code:
    next if !b.near?(battler) || b.pbHasType?(:GHOST) || b.pbHasType?(:NORMAL)

    Thanks for your suggestion!I've tried it out, but unfortunately, Ghost and Normal Pokémon are still affected by the ability.
     
    I'd suggest you to test, if this ability also affects battlers that are far away (in triple battles). That way you can determine if the error lies somewhere outside this line.
     
    Hello! I hope this is the right thread to post.
    Not a big deal, but it wasn't. The right place for asking questions is Pokémon Essentials.

    Scripts, Tutorials & Tools is for posting your completed things for other people to use :)
     
    I'd suggest you to test, if this ability also affects battlers that are far away (in triple battles). That way you can determine if the error lies somewhere outside this line.

    I've tried it out. Only opposing Pokémon that are near the user are affected by the ability. Opposing Pokémon that are too far away are not affected. Does that mean the error likely lies in said line?
     
    You could try if this version works for you. :)
    Spoiler:
     
    You could try if this version works for you. :)
    Spoiler:

    Thanks so much! It works perfectly. :]
    If you don't mind, I'll mention your name in the credits once I've created a bunch of custom moves/abilities for everyone to share.
     
    Back
    Top