• 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 Trading Card Game 2 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.

[Essentials v17.2]Fixing some abilities that triggered into the end of turn

WolfPP

Spriter/ Pixel Artist
  • 1,308
    Posts
    6
    Years
    Am using this script for Power Construct. Install for Zygarde.

    Am using some part of that script for Shields Down (Battle Effect script, Move Effect script, etc). Install for Minior and check which code you will replace with mine.

    Now let's go:

    Into 'class PokeBattle_Battler', add 'attr_accessor :startform' below 'attr_accessor :captured', like this:
    Spoiler:


    Now, 'def pbInitPokemon(pkmn,pkmnIndex)', add '@startform = @form':
    Spoiler:


    Inside 'def pbCheckForm', delete what you have for Darmanitan, Zygarde, Wishiwashi and Minior.

    Then, add Wishiwashi and Minior inside 'def pbResetForm', like:
    Spoiler:


    Above Imposter's code (from PokeBattle_Battler), to change its forms when start the battle, paste:
    Spoiler:


    And now, to check into the end of round to change its forms or not, go to 'PokeBattle_Battle' script. below '# Slow Start's end message', paste:
    Spoiler:


    Now, add Minior to 'Forms' script, below HOOPA (or whatever):
    Code:
    MultipleForms.register(:MINIOR,{
    "getFormOnCreation"=>proc{|pokemon|
       next 1+rand(7)
    }
    })

    And finally, to put Meteor Form for Wild Minior, look for 'PField_Encounters' script, and inside 'def pbGenerateWildPokemon(species,level,isroamer=false)', paste above 'Events.onWildPokemonCreate.trigger(nil,genwildpoke)':
    Code:
      if isConst?(genwildpoke.species,PBSpecies,:MINIOR); genwildpoke.form=0; end

    For breeding case about Minior, go to 'PField_DayCare' and replace the code below '# Inheriting form':
    Code:
      # Inheriting form
      if isConst?(babyspecies,PBSpecies,:BURMY) ||
         isConst?(babyspecies,PBSpecies,:SHELLOS) ||
         isConst?(babyspecies,PBSpecies,:BASCULIN) ||
         isConst?(babyspecies,PBSpecies,:FLABEBE) ||
         isConst?(babyspecies,PBSpecies,:PUMPKABOO) ||
         isConst?(babyspecies,PBSpecies,:ORICORIO) ||
         isConst?(babyspecies,PBSpecies,:MINIOR)
        egg.form=mother.form
        egg.form=father.form if pbIsDitto?(mother)
      end 
      # Inheriting Moves

    And done :D
    Cya!
     
    Last edited:
    If you caught Wild Minior (Meteor Form, using Master Ball i.e.), when you turn back to Overworld, that pokémon won't change its form to Core Form. I fixed it:
    Inside 'def pbResetForm' replace Minior'code for:
    Code:
          if isConst?(self.species,PBSpecies,:MINIOR)
            if startform>0; self.form=startform; else; self.form=1+rand(7); startform=self.form; end
          end

    Atted the main post.

    EDIT 7 Oct: Changed when HP '<=' or '>=' insted only '<' or '>' for all abilities, except Schooling; level for Schooling, '>19' instead '>=20'.
     
    Last edited:
    Hey, thanks for making the code and don't know if you're still working on this, but I keep getting "NoMethodError" on "pbUpdate(true)" of
    " def pbResetForm
    if !@effects[PBEffects::Transform]
    isConst?(self.species,PBSpecies,:CASTFORM) || isConst?(self.species,PBSpecies,:CHERRIM) ||
    isConst?(self.species,PBSpecies,:DARMANITAN) || isConst?(self.species,PBSpecies,:MELOETTA) ||
    isConst?(self.species,PBSpecies,:AEGISLASH) || isConst?(self.species,PBSpecies,:XERNEAS) ||
    isConst?(self.species,PBSpecies,:WISHIWASHI)
    self.form=0
    end
    if isConst?(self.species,PBSpecies,:MINIOR)
    if startform>0; self.form=startform; else; self.form=1+rand(7); startform=self.form; end
    end
    end
    pbUpdate(true)
    end "
     
    Hey, thanks for making the code and don't know if you're still working on this, but I keep getting "NoMethodError" on "pbUpdate(true)" of
    " def pbResetForm
    if !@effects[PBEffects::Transform]
    isConst?(self.species,PBSpecies,:CASTFORM) || isConst?(self.species,PBSpecies,:CHERRIM) ||
    isConst?(self.species,PBSpecies,:DARMANITAN) || isConst?(self.species,PBSpecies,:MELOETTA) ||
    isConst?(self.species,PBSpecies,:AEGISLASH) || isConst?(self.species,PBSpecies,:XERNEAS) ||
    isConst?(self.species,PBSpecies,:WISHIWASHI)
    self.form=0
    end
    if isConst?(self.species,PBSpecies,:MINIOR)
    if startform>0; self.form=startform; else; self.form=1+rand(7); startform=self.form; end
    end
    end
    pbUpdate(true)
    end "

    Vanilla Essentials 17.2 already have 'pbUpdate(true)' and works perfectly. You just need to add Wishiwashi where we have Aegislash to turn back into its original form. Also about Minior it is just a new 'if' for that pokémon.
     
    Hey thanks for making this script. I just installed it and it mostly works. However, if Wishiwashi is already in Solo form because HP is low, and then recovers health to get back over 25%, it changes him to Schooling Form, but the text says "Wishiwashi stopped schooling". I copy and pasted the exact script you posted, any idea what I might've done wrong?
     
    Hey thanks for making this script. I just installed it and it mostly works. However, if Wishiwashi is already in Solo form because HP is low, and then recovers health to get back over 25%, it changes him to Schooling Form, but the text says "Wishiwashi stopped schooling". I copy and pasted the exact script you posted, any idea what I might've done wrong?

    I wonder if the messages are the wrong way around?
    Code:
            if i.hp>((i.totalhp/4).floor) && i.form!=1
              i.form=1
              i.pbUpdate(true)
              scene.pbChangePokemon(i,i.pokemon)
              pbDisplay(_INTL("{1} stopped schooling!",i.pbThis))
              PBDebug.log("[Form changed] #{i.pbThis} changed to form #{i.form}")
            elsif i.hp<((i.totalhp/4).floor) && i.form!=0
              i.form=0
              i.pbUpdate(true)
              scene.pbChangePokemon(i,i.pokemon)
              pbDisplay(_INTL("{1} formed a school!",i.pbThis))
              PBDebug.log("[Form changed] #{i.pbThis} changed to form #{i.form}")
            end
    This kinda looks like "when HP > 25% and not form 1 switch to form 1 and say we stopped schooling". So maybe swap the pbDisplays in the bit I quoted. (Assuming form 0 is normal, and 1 is schooling)
     
    For breeding case about Minior, go to 'PField_DayCare' and replace the code below '# Inheriting form':
    Code:
      # Inheriting form
      if isConst?(babyspecies,PBSpecies,:BURMY) ||
         isConst?(babyspecies,PBSpecies,:SHELLOS) ||
         isConst?(babyspecies,PBSpecies,:BASCULIN) ||
         isConst?(babyspecies,PBSpecies,:FLABEBE) ||
         isConst?(babyspecies,PBSpecies,:PUMPKABOO) ||
         isConst?(babyspecies,PBSpecies,:ORICORIO) ||
         isConst?(babyspecies,PBSpecies,:MINIOR)
        egg.form=mother.form
        egg.form=father.form if pbIsDitto?(mother)
      end 
      # Inheriting Moves

    Edited the main post.
     
    https://www.pokecommunity.com/posts/9968664/
    Code:
          if i.hasWorkingAbility(:SCHOOLING) && isConst?(i.species,PBSpecies,:WISHIWASHI) && i.level>19
            if i.hp>((i.totalhp/4).floor) && i.form!=1
              i.form=1
              i.pbUpdate(true)
              scene.pbChangePokemon(i,i.pokemon)
              @battle.pbDisplay(_INTL("{1} formed a school!",pbThis))
              PBDebug.log("[Form changed] #{i.pbThis} changed to form #{i.form}")
            elsif i.hp<((i.totalhp/4).floor) && i.form!=0
              i.form=0
              i.pbUpdate(true)
              scene.pbChangePokemon(i,i.pokemon)
             @battle.pbDisplay(_INTL("{1} stopped schooling!",pbThis))
              PBDebug.log("[Form changed] #{i.pbThis} changed to form #{i.form}")
            end
          end



    Hello, I'm trying to use your Schooling script for my game,but, when Wishiwashi is below 1/4 of its health and needs to transform back into its solo form, an error box appears which say that "PBThis is not defined", even though I have the "def PBThis" script in PokeBattle_Battlers.Do you know what could cause this?
     
    Last edited:
    Hello, I'm trying to use your Schooling script for my game,but, when Wishiwashi is below 1/4 of its health and needs to transform back into its solo form, an error box appears which say that "PBThis is not defined", even though I have the "def PBThis" script in PokeBattle_Battlers.Do you know what could cause this?

    Just checking, it probably isn't this, but do you know pbThis and PBThis are different? Capitalization matters.
     
    Just checking, it probably isn't this, but do you know pbThis and PBThis are different? Capitalization matters.

    Yeah, it's pbThis in my script, and it still giving me an error message. There's also an error saying that pbIsOpposing is also an undefined value. I don't know why it says that, since both pbThis and pbIsOpposing are defined in my script editor.
     
    If it helps, this is the error message that I get (It doesn't crash the game,but I still need to get rid of it):
    Code:
    Exception: NoMethodError
    Message: undefined method `pbIsOpposing?' for nil:NilClass
    PokeBattle_Battle:423:in `pbThis'
    PokeBattle_Battle:3867:in `__clauses__pbEndOfRoundPhase'
    PokeBattle_Battle:3854:in `each'
    PokeBattle_Battle:3854:in `__clauses__pbEndOfRoundPhase'
    PokeBattle_Clauses:42:in `pbEndOfRoundPhase'
    PokeBattle_Battle:2551:in `pbStartBattleCore'
    PokeBattle_Battle:2550:in `logonerr'
    PokeBattle_Battle:2550:in `pbStartBattleCore'
    PokeBattle_Battle:2532:in `loop'
    PokeBattle_Battle:2555:in `pbStartBattleCore'
    [Pokémon Essentials version 17.2]
    Exception: NoMethodError
    Message: undefined method `pbIsOpposing?' for nil:NilClass
    PokeBattle_Battle:423:in `pbThis'
    PokeBattle_Battle:3867:in `__clauses__pbEndOfRoundPhase'
    PokeBattle_Battle:3854:in `each'
    PokeBattle_Battle:3854:in `__clauses__pbEndOfRoundPhase'
    PokeBattle_Clauses:42:in `pbEndOfRoundPhase'
    PokeBattle_Battle:2551:in `pbStartBattleCore'
    PokeBattle_Battle:2550:in `logonerr'
    PokeBattle_Battle:2550:in `pbStartBattleCore'
    PokeBattle_Battle:2532:in `loop'
    PokeBattle_Battle:2555:in `pbStartBattleCore'
     
    a Syntax error at line 483 is keeping my game from compiling and turning on.

    MultipleForms.register(:MINIOR,{
    "getFormOnCreation"=>proc{|pokemon|
    next 1+rand(7)
    }
    },
    "onSetForm"=>proc{|pokemon,form|
    pokemon.formTime=(form>0) ? pbGetTimeNow.to_i : nil
    }
    })

    That last line with the }) is causing the error. How can it be fixed?
     
    Remove the marked part. :)
    Spoiler:
     
    Really handy script helps fixes them as you stated, only issue is, wild minior wont become shield form but stay the random core color,

    now my forms are ordered different with the shield form being form 7 with the colours being 0-6, i adjusted the scripts accordingly (any mention of 0 was made into 7 and removed the 1+ in the rand bits)

    i do have the genwildpoke bit but nothing.
     
    Back
    Top