• 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] Putting Eerie Spell into my game

3
Posts
3
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?
     
    285
    Posts
    5
    Years
    • Seen Oct 1, 2023
    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/showthread.php?t=441199
     
    3
    Posts
    3
    Years
    • Seen Nov 24, 2020
    Ah! Thank you very much. After adding the moves into the script, how do I know what function codes to use in the pbs?
     
    285
    Posts
    5
    Years
    • Seen Oct 1, 2023
    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