• 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!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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] Putting Eerie Spell into my game

  • 3
    Posts
    4
    Years
    • Seen Nov 24, 2020
    Hi! This is my first time coming to this forum, as I have a question about Pokemon Essentials.

    So I was able to get every move (not including ZMoves and GMax moves) into the PBS files of my game, except for one: Eerie Impulse, the signature move of Galarian Slowking. The problem is that most moves have an already assigned function code, which I got from the essentials wiki, that tells the game what effects each move has. But since Eerie Impulse has an effect that no move has done before, (attacking+reducing 3pp from targets last used move), there is no code as a result. I think I am going to have to define the pp reducing effect in the code, but I have no idea how to do this.

    Can someone please help?
     
    Hi! This is my first time coming to this forum, as I have a question about Pokemon Essentials.

    So I was able to get every move (not including ZMoves and GMax moves) into the PBS files of my game, except for one: Eerie Impulse, the signature move of Galarian Slowking. The problem is that most moves have an already assigned function code, which I got from the essentials wiki, that tells the game what effects each move has. But since Eerie Impulse has an effect that no move has done before, (attacking+reducing 3pp from targets last used move), there is no code as a result. I think I am going to have to define the pp reducing effect in the code, but I have no idea how to do this.

    Can someone please help?

    You're going to have a lot more than just Eerie Spell to add move effects for if all you've edited so far is the PBS file. You can find the implementation of Eerie Spell in these places:

    v17: https://www.pokecommunity.com/showthread.php?p=10229796#post1022979

    v18: https://www.pokecommunity.com/threads/441199
     
    Ah! Thank you very much. After adding the moves into the script, how do I know what function codes to use in the pbs?
     
    Ah! Thank you very much. After adding the moves into the script, how do I know what function codes to use in the pbs?

    You use whichever one is mentioned in Pokebattle_MoveEffects (where you add the new functions). I'll give an example below:
    Code:
    ################################################################################
    # Puts the target to sleep.
    ################################################################################
    class PokeBattle_Move_[B]003[/B] < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
        return -1 if pbTypeImmunityByAbility(pbType(@type,attacker,opponent),attacker,opponent)
        if opponent.pbCanSleep?(attacker,true,self)
          pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
          opponent.pbSleep
          return 0
        end
        return -1
      end
    
      def pbAdditionalEffect(attacker,opponent)
        return if opponent.damagestate.substitute
        if opponent.pbCanSleep?(attacker,false,self)
          opponent.pbSleep
        end
      end
    
      def pbEffectAfterHit(attacker,opponent,turneffects)
        if isConst?(@id,PBMoves,:RELICSONG)
          if isConst?(attacker.species,PBSpecies,:MELOETTA) &&
             !attacker.effects[PBEffects::Transform] &&
             !(attacker.hasWorkingAbility(:SHEERFORCE) && self.addlEffect>0) &&
             !attacker.fainted?
            attacker.form=(attacker.form+1)%2
            attacker.pbUpdate(true)
            @battle.scene.pbChangePokemon(attacker,attacker.pokemon)
            @battle.pbDisplay(_INTL("{1} transformed!",attacker.pbThis))
            PBDebug.log("[Form changed] #{attacker.pbThis} changed to form #{attacker.form}")
          end
        end
      end
    end
    The "003" which I bolded above is the function code you would use in the PBS file.
     
    Back
    Top