Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Draconius GO
Reply
 
Thread Tools
  #76    
Old May 8th, 2017 (9:59 AM).
DoomKiller13's Avatar
DoomKiller13 DoomKiller13 is offline
     
    Join Date: Apr 2017
    Posts: 11
    Quote:
    Originally Posted by Rot8er_ConeX View Post
    as for the first question, Deltas are supposed to be below the EBS scripts. Why is it crashing when you enter battle?

    As for the special symbol, you'd need to edit the EBS GUI scripts.



    That would require editing the Pokedex, something I don't want to do since custom Pokedex GUIs are common.
    When entering a battle, I got this error:
    Spoiler:
    Exception: RuntimeError
    Message: Script error within event 4, map 42 (Route 1):
    Exception: NoMethodError
    Message: Section187:249:in `setPokemonBitmap'undefined method `bitmap' for nil:NilClass
    ***Full script:
    pbWildBattle(PBSpecies::DITTO,10)

    Interpreter:243:in `pbExecuteScript'
    EliteBattle_Scene:290:in `pbStartBattle'
    EliteBattle_Battle:65:in `pbStartBattleCore'
    PokeBattle_Battle:2461:in `pbStartBattle'
    PField_Field:902:in `pbWildBattle_ebs'
    PField_Field:901:in `pbSceneStandby'
    PField_Field:903:in `pbWildBattle_ebs'
    PField_Field:900:in `pbBattleAnimation'
    PField_Field:900:in `pbWildBattle_ebs'
    EliteBattle_EntryAnimations:248:in `pbWildBattle'

    Interpreter:276:in `pbExecuteScript'
    Interpreter:1606:in `command_355'
    Interpreter:494:in `execute_command'
    Interpreter:193:in `update'
    Interpreter:106:in `loop'
    Interpreter:198:in `update'
    Scene_Map:103:in `follow_update'
    Scene_Map:101:in `loop'
    Scene_Map:114:in `follow_update'
    Follow_Pokémon:1548:in `update'


    Please help
    __________________
    Reply With Quote

    Relevant Advertising!

      #77    
    Old May 8th, 2017 (5:31 PM).
    Rot8er_ConeX's Avatar
    Rot8er_ConeX Rot8er_ConeX is offline
       
      Join Date: May 2015
      Location: The Dissa Region
      Gender: Male
      Posts: 823
      Quote:
      Originally Posted by DoomKiller13 View Post
      When entering a battle, I got this error:
      Spoiler:
      Exception: RuntimeError
      Message: Script error within event 4, map 42 (Route 1):
      Exception: NoMethodError
      Message: Section187:249:in `setPokemonBitmap'undefined method `bitmap' for nil:NilClass
      ***Full script:
      pbWildBattle(PBSpecies::DITTO,10)

      Interpreter:243:in `pbExecuteScript'
      EliteBattle_Scene:290:in `pbStartBattle'
      EliteBattle_Battle:65:in `pbStartBattleCore'
      PokeBattle_Battle:2461:in `pbStartBattle'
      PField_Field:902:in `pbWildBattle_ebs'
      PField_Field:901:in `pbSceneStandby'
      PField_Field:903:in `pbWildBattle_ebs'
      PField_Field:900:in `pbBattleAnimation'
      PField_Field:900:in `pbWildBattle_ebs'
      EliteBattle_EntryAnimations:248:in `pbWildBattle'

      Interpreter:276:in `pbExecuteScript'
      Interpreter:1606:in `command_355'
      Interpreter:494:in `execute_command'
      Interpreter:193:in `update'
      Interpreter:106:in `loop'
      Interpreter:198:in `update'
      Scene_Map:103:in `follow_update'
      Scene_Map:101:in `loop'
      Scene_Map:114:in `follow_update'
      Follow_Pokémon:1548:in `update'


      Please help
      I'm literally seeing nothing here from my code.
      __________________
      Features of Pokemon Entropy

      The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
      Reply With Quote
        #78    
      Old May 11th, 2017 (6:04 AM).
      Letzebuerger Letzebuerger is offline
         
        Join Date: Sep 2010
        Gender: Male
        Posts: 10
        Hello, where do I need to add make.Pokemondelta part, for a custom trainer? I tried it several times in several ways and all I got are errors, or the normal Kantonian Pokémons or Pikachus in a fight. I have the custom trainer script, I dont use EBS, nor follow me Pokémon.
        I have no issues getting wild Alolan Pokémon encounters.
        Reply With Quote
          #79    
        Old May 11th, 2017 (5:31 PM).
        Jazerules Jazerules is offline
           
          Join Date: Apr 2017
          Posts: 29
          Quote:
          Originally Posted by Letzebuerger View Post
          Hello, where do I need to add make.Pokemondelta part, for a custom trainer? I tried it several times in several ways and all I got are errors, or the normal Kantonian Pokémons or Pikachus in a fight. I have the custom trainer script, I dont use EBS, nor follow me Pokémon.
          I have no issues getting wild Alolan Pokémon encounters.
          Code:
          p0=createPokemon("MEOWTH",38)
          p1=createPokemon("RATTATA",39)
          p2=createPokemon("RAICHU",39)
          p0.makeDelta
          p2.makeDelta
          party=[p0,p1,p2]
          trainer=createTrainer(10,"Epoy",party)
          result=customTrainerBattle(trainer,"Oh no, you defeated me!")
          pbSet(1, result == BR_WIN ? 0 : 1)
          copy paste it to try.
          Reply With Quote
            #80    
          Old May 12th, 2017 (4:10 AM).
          Letzebuerger Letzebuerger is offline
             
            Join Date: Sep 2010
            Gender: Male
            Posts: 10
            Thanks Jazerules, that did the trick!
            Reply With Quote
              #81    
            Old May 12th, 2017 (6:23 AM).
            Jazerules Jazerules is offline
               
              Join Date: Apr 2017
              Posts: 29
              Quote:
              Originally Posted by Letzebuerger View Post
              Thanks Jazerules, that did the trick!
              You are welcome.
              Reply With Quote
                #82    
              Old May 14th, 2017 (2:49 AM). Edited May 15th, 2017 by Letzebuerger.
              Letzebuerger Letzebuerger is offline
                 
                Join Date: Sep 2010
                Gender: Male
                Posts: 10
                Hey it is me again, I was wondering if the scripts of Alolan Pokemons are compatible with the Pokerus script. Whenever I try to define a give Pokemon event with an Alolan Pokemon that also has the pokerus it crashes. I am sure it is not because of, the short length of my text because I use extendtext.exe every time.

                Edit: Nevermind I made a mistake on my part.
                Reply With Quote
                  #83    
                Old July 9th, 2017 (6:39 PM).
                TruePotatoQ TruePotatoQ is offline
                   
                  Join Date: Jul 2017
                  Posts: 3
                  Hey a little help? How do I set it up so the player can pick up a Alolan or Delta Pokemon. If it's just a script paste can you please make it for Sandshrew.
                  Reply With Quote
                    #84    
                  Old July 30th, 2017 (8:46 PM).
                  Keundt's Avatar
                  Keundt Keundt is offline
                     
                    Join Date: Jul 2017
                    Posts: 3
                    I got this when trying to enter a battle.
                    Spoiler:
                    ---------------------------
                    Pokemon Essentials
                    ---------------------------
                    Exception: NoMethodError

                    Message: undefined method `bitmap' for nil:NilClass

                    EliteBattle_Sprites:249:in `setPokemonBitmap'

                    EliteBattle_Scene:303:in `pbStartBattle'

                    EliteBattle_Battle:65:in `pbStartBattleCore'

                    PokeBattle_Battle:2484:in `pbStartBattle'

                    PField_Field:905:in `pbWildBattle_ebs'

                    PField_Field:904:in `pbSceneStandby'

                    PField_Field:906:in `pbWildBattle_ebs'

                    PField_Field:903:in `pbBattleAnimation'

                    PField_Field:903:in `pbWildBattle_ebs'

                    EliteBattle_EntryAnimations:248:in `pbWildBattle'



                    This exception was logged in

                    C:\Users\Keith\Saved Games/Pokemon Essentials/errorlog.txt.

                    Press Ctrl+C to copy this message to the clipboard.
                    ---------------------------
                    OK
                    ---------------------------


                    Also, the evolution scene also crashes. I got this when trying to evolve a duosion:
                    Spoiler:
                    ---------------------------
                    Pokemon Essentials
                    ---------------------------
                    Exception: NoMethodError

                    Message: undefined method `width' for nil:NilClass

                    Delta_Forms:1019:in `pbStartScreen'

                    PItem_Items:336:in `pbChangeLevel'

                    PItem_Items:334:in `pbFadeOutInWithMusic'

                    PSystem_Utilities:884:in `pbFadeOutIn'

                    PSystem_Utilities:884:in `pbFadeOutInWithMusic'

                    PItem_Items:334:in `pbChangeLevel'

                    PItem_ItemEffects:759

                    PItem_ItemEffects:754:in `call'

                    Event:150:in `trigger'

                    PItem_Items:243:in `triggerUseOnPokemon'



                    This exception was logged in

                    C:\Users\Keith\Saved Games/Pokemon Essentials/errorlog.txt.

                    Press Ctrl+C to copy this message to the clipboard.
                    ---------------------------
                    OK
                    ---------------------------


                    The sprites don't appear in the summary screen, and like DoomKiller13, I don't have these problems when loading above EBS, although I'm unsure if the forms are usable if I do that.

                    :/
                    Reply With Quote
                      #85    
                    Old August 9th, 2017 (8:41 PM).
                    Tea-Rex's Avatar
                    Tea-Rex Tea-Rex is offline
                       
                      Join Date: Oct 2016
                      Location: Australia
                      Gender: Male
                      Nature: Modest
                      Posts: 27
                      I know that Rot8er_ConeX has already discussed how to mega evolve your alolan/delta Pokemon but what if you want a separate mega stone sprite for the alolan form?
                      Reply With Quote
                        #86    
                      Old August 24th, 2017 (5:24 PM). Edited August 29th, 2017 by AndromedaKerova.
                      AndromedaKerova AndromedaKerova is offline
                         
                        Join Date: Aug 2015
                        Gender: Female
                        Nature: Sassy
                        Posts: 32
                        Hey. I was wondering if someone could help me.
                        I use the show species intro script by FL but it doesn't work with showing the delta forms.
                        It doesn't accept having a "d" added to the number or instead of "_1".
                        Is there a way to make this delta script and the show intro one work nicely together?

                        Also I'm getting errors when trying to evolve my delta pokemon.

                        Rare Candy use causes this:
                        Spoiler:
                        ---------------------------
                        Pokemon ******
                        ---------------------------
                        Exception: TypeError

                        Message: cannot convert Array into Integer

                        DELTA POKEMON (Alola):2244:in `[]'

                        DELTA POKEMON (Alola):2244

                        DELTA POKEMON (Alola):2243:in `each'

                        DELTA POKEMON (Alola):2243

                        DELTA POKEMON (Alola):2233:in `call'

                        Pokemon_MultipleForms:185:in `call'

                        Pokemon_MultipleForms:89:in `getMoveList'

                        PItem_Items:312:in `pbChangeLevel'

                        PItem_ItemEffects:759

                        PItem_ItemEffects:754:in `call'



                        This exception was logged in

                        C:\Users\User\Saved Games/Pokemon ******/errorlog.txt.

                        Press Ctrl+C to copy this message to the clipboard.
                        ---------------------------
                        OK
                        ---------------------------

                        Evolving Kirlia into Gallade by using Dawn Stone:
                        Spoiler:
                        ---------------------------
                        Pokemon ******
                        ---------------------------
                        Exception: TypeError

                        Message: cannot convert Array into Integer

                        DELTA POKEMON (Alola):2428:in `[]'

                        DELTA POKEMON (Alola):2428

                        DELTA POKEMON (Alola):2427:in `each'

                        DELTA POKEMON (Alola):2427

                        DELTA POKEMON (Alola):2417:in `call'

                        Pokemon_MultipleForms:185:in `call'

                        Pokemon_MultipleForms:89:in `getMoveList'

                        Pokemon_Evolution:833:in `pbEvolution'

                        PItem_ItemEffects:294

                        PItem_ItemEffects:291:in `pbFadeOutInWithMusic'



                        This exception was logged in

                        C:\Users\User\Saved Games/Pokemon ******/errorlog.txt.

                        Press Ctrl+C to copy this message to the clipboard.
                        ---------------------------
                        OK
                        ---------------------------

                        Evolving Kirlia into Gardevoir by level up:
                        Spoiler:
                        ---------------------------
                        Pokemon ******
                        ---------------------------
                        Exception: TypeError

                        Message: cannot convert Array into Integer

                        DELTA POKEMON (Alola):2370:in `[]'

                        DELTA POKEMON (Alola):2370

                        DELTA POKEMON (Alola):2369:in `each'

                        DELTA POKEMON (Alola):2369

                        DELTA POKEMON (Alola):2359:in `call'

                        Pokemon_MultipleForms:185:in `call'

                        Pokemon_MultipleForms:89:in `getMoveList'

                        Pokemon_Evolution:833:in `pbEvolution'

                        PField_Field:1038:in `pbEvolutionCheck'

                        PField_Field:1030:in `each'



                        This exception was logged in

                        C:\Users\User\Saved Games/Pokemon Mirror/errorlog.txt.

                        Press Ctrl+C to copy this message to the clipboard.
                        ---------------------------
                        OK
                        ---------------------------
                        __________________
                        Currently working on 2 projects.
                        Chromia (banner to be added)
                        Mirror (banner to be added)
                        Reply With Quote
                          #87    
                        Old September 24th, 2017 (1:35 AM). Edited October 2nd, 2017 by Arkadious.
                        Arkadious's Avatar
                        Arkadious Arkadious is offline
                        Developer of Fragmentum
                           
                          Join Date: Nov 2015
                          Location: New Zealand
                          Age: 20
                          Gender: Male
                          Nature: Careful
                          Posts: 50
                          Heya,

                          I tried installing the script (completely unmodified) but then was told there was a syntax error on line 301. I've tried both the printable and non-printable versions but the same error comes up. Since my knowledge with Ruby isn't the greatest, I'm not sure what the syntax error is.

                          Thanks for your time.
                          Edit: Probably should've mentioned earlier, but this was tested with Essentials 17.1
                          Reply With Quote
                            #88    
                          Old October 1st, 2017 (5:09 AM).
                          Obermarschall Obermarschall is offline
                             
                            Join Date: Apr 2016
                            Gender: Male
                            Posts: 24
                            Quote:
                            Originally Posted by Arkadious View Post
                            Heya,

                            I tried installing the script (completely unmodified) but then was told there was a syntax error on line 301. I've tried both the printable and non-printable versions but the same error comes up. Since my knowledge with Ruby isn't the greatest, I'm not sure what the syntax error is.

                            Thanks for your time.
                            Same issue here and I also noticed the evolution for Vulpix and Sandshrew just disappeared. Unfortunately I replaced the old script with the new one and now nothing works!

                            Does anyone have an older (functional) version of that script?
                            Reply With Quote
                              #89    
                            Old October 2nd, 2017 (5:53 AM). Edited October 2nd, 2017 by AndromedaKerova.
                            AndromedaKerova AndromedaKerova is offline
                               
                              Join Date: Aug 2015
                              Gender: Female
                              Nature: Sassy
                              Posts: 32
                              I have an older version from before the main script changed.
                              I did modify it a bit however, I did try to remove all the modifications I did to it.
                              I may have missed some parts but it should be fine.
                              Bear in mind I was having issues with the script even at this point so it may still not work as it is meant to with evolution methods.


                              Again, USE PRINT THREAD VIEW! (Stupid smileys! Dx)

                              Spoiler:
                              #########################################################################
                              # Delta Pokemon/Alolan Form code
                              # This is compatible with Essentials v16.2
                              # Also compatible with Luka's Elite Battle System (EBS),
                              # Klien's BW Essentials kit,
                              # and mej's Following Pokemon script
                              # Note that this code adds the Alolan forms as code within the game
                              # It does not automatically create the Alolan forms as possible
                              # encounters.
                              # You as the game developer need to decide how you want players to
                              # encounter the Alolan Pokemon.
                              #########################################################################
                              # To use
                              # 1.) place in a new script section below "PSystem_Utilities" but
                              # above "Main"
                              # - if using the EBS or Following Pokemon scripts, place below those
                              # scripts as well as "PSystem_Utilities"
                              # 2.) Decide how you want the player to encounter Delta/Alolan Pokemon
                              # - see the bottom of this script for an example that makes Alolan
                              # Exeggutor appear on a certain map
                              #########################################################################
                              # Please note that the breeding mechanics for Deltaness work under the
                              # assumption that your fangame will NOT be taking place in Alola.
                              # Likewise, the evolution mechanics for Pikachu, Cubone, and Exeggcute
                              # work under the assumption that your fangame will NOT be taking
                              # place in Alola, but that you DO wish the players to be able to
                              # obtain Alolan Raichu, Alolan Marowak, and Alolan Exeggutor in
                              # some way.
                              #########################################################################

                              # Battlers

                              class PokeBattle_Battler
                              def isDelta?
                              return (@pokemon) ? @pokemon.isDelta? : false
                              end

                              def isAlolan?
                              return (@pokemon) ? @pokemon.isDelta? : false
                              end

                              def isEgg?
                              return (@pokemon) ? (@pokemon.isEgg? rescue @pokemon.egg? rescue false) : false
                              end

                              def isAlolaForm?
                              return (@pokemon) ? @pokemon.isDelta? : false
                              end
                              end

                              class PokeBattle_FakeBattler
                              def isDelta?; return @pokemon.isDelta?; end
                              def isAlolan?; return @pokemon.isDelta?; end
                              def isAlolaForm?; return @pokemon.isDelta?; end
                              end

                              # Pokemon

                              class PokeBattle_Pokemon
                              alias ____mf_getAbilityList getAbilityList
                              def getAbilityList
                              v=MultipleForms.call("getAbilityList",self)
                              return v if v!=nil && v.length>0
                              return self.____mf_getAbilityList
                              end

                              # generates the list of Egg Moves
                              def possibleEggMoves
                              v=MultipleForms.call("possibleEggMoves",self)
                              return v if v!=nil
                              pbRgssOpen("Data/eggEmerald.dat","rb"){|f|
                              f.pos=(self.species-1)*8
                              offset=f.fgetdw
                              length=f.fgetdw
                              if length>0
                              bob=[]
                              f.pos=offset
                              i=0; loop do break unless i=6
                              raise _INTL("Can't store the egg")
                              end
                              pokemon0=$PokemonGlobal.daycare[0][0]
                              pokemon1=$PokemonGlobal.daycare[1][0]
                              mother=nil
                              father=nil
                              babyspecies=0
                              ditto0=pbIsDitto?(pokemon0)
                              ditto1=pbIsDitto?(pokemon1)
                              if (pokemon0.isFemale? || ditto0)
                              babyspecies=(ditto0) ? pokemon1.species : pokemon0.species
                              mother=pokemon0
                              father=pokemon1
                              else
                              babyspecies=(ditto1) ? pokemon0.species : pokemon1.species
                              mother=pokemon1
                              father=pokemon0
                              end
                              babyspecies=pbGetBabySpecies(babyspecies,mother.item,father.item)
                              if isConst?(babyspecies,PBSpecies,:MANAPHY) && hasConst?(PBSpecies,HIONE)
                              babyspecies=getConst(PBSpecies,HIONE)
                              elsif (isConst?(babyspecies,PBSpecies,:NIDORANfE) && hasConst?(PBSpecies,:NIDORANmA)) ||
                              (isConst?(babyspecies,PBSpecies,:NIDORANmA) && hasConst?(PBSpecies,:NIDORANfE))
                              babyspecies=[getConst(PBSpecies,:NIDORANmA),
                              getConst(PBSpecies,:NIDORANfE)][rand(2)]
                              elsif (isConst?(babyspecies,PBSpecies,:VOLBEAT) && hasConst?(PBSpecies,:ILLUMISE)) ||
                              (isConst?(babyspecies,PBSpecies,:ILLUMISE) && hasConst?(PBSpecies,:VOLBEAT))
                              babyspecies=[getConst(PBSpecies,:VOLBEAT),
                              getConst(PBSpecies,:ILLUMISE)][rand(2)]
                              end
                              # Generate egg
                              egg=PokeBattle_Pokemon.new(babyspecies,EGGINITIALLEVEL,$Trainer)
                              # Randomise personal ID
                              pid=rand(65536)
                              pid|=(rand(65536)<<16)
                              egg.personalID=pid
                              # Inheriting form
                              if isConst?(babyspecies,PBSpecies,:BURMY) ||
                              isConst?(babyspecies,PBSpecies,HELLOS) ||
                              isConst?(babyspecies,PBSpecies,:BASCULIN) ||
                              isConst?(babyspecies,PBSpecies,:MINIOR) ||
                              isConst?(babyspecies,PBSpecies,:ORICORIO)
                              egg.form=mother.form
                              end
                              # Inheriting Delta-ness
                              if (mother.isDelta? && isConst?(mother.item,PBItems,:EVERSTONE)) ||
                              (mother.isDelta? && isConst?(mother.item,PBItems,TRANGESOUVENIR)) ||
                              (father.isDelta? && isConst?(father.item,PBItems,:EVERSTONE)) ||
                              (father.isDelta? && isConst?(father.item,PBItems,TRANGESOUVENIR))
                              egg.makeDelta
                              end
                              # Inheriting Moves
                              moves=[]
                              othermoves=[]
                              movefather=father; movemother=mother
                              if pbIsDitto?(movefather) && !mother.isFemale?
                              movefather=mother; movemother=father
                              end
                              # Initial Moves
                              initialmoves=egg.getMoveList
                              moop=egg.possibleEggMoves
                              for k in initialmoves
                              if k[0]<=EGGINITIALLEVEL
                              moves.push(k[1])
                              else
                              othermoves.push(k[1]) if mother.knowsMove?(k[1]) && father.knowsMove?(k[1])
                              end
                              end
                              # Inheriting Natural Moves
                              for move in othermoves
                              moves.push(move)
                              end
                              # Inheriting Machine Moves
                              if !USENEWBATTLEMECHANICS
                              for i in 0...$ItemData.length
                              next if !$ItemData[i]
                              atk=$ItemData[i][ITEMMACHINE]
                              next if !atk || atk==0
                              if egg.isCompatibleWithMove?(atk)
                              moves.push(atk) if movefather.knowsMove?(atk)
                              end
                              end
                              end
                              # Inheriting Egg Moves
                              if moop.length>0 && movefather.isMale?
                              for i in moop
                              moves.push(i) if movefather.knowsMove?(i)
                              end
                              end
                              if USENEWBATTLEMECHANICS && moop.length>0 && movemother.isFemale?
                              for i in moop
                              moves.push(i) if movemother.knowsMove?(i)
                              end
                              end
                              # Volt Tackle
                              lightball=false
                              if (isConst?(father.species,PBSpecies,IKACHU) ||
                              isConst?(father.species,PBSpecies,:RAICHU)) &&
                              isConst?(father.item,PBItems,:LIGHTBALL)
                              lightball=true
                              end
                              if (isConst?(mother.species,PBSpecies,IKACHU) ||
                              isConst?(mother.species,PBSpecies,:RAICHU)) &&
                              isConst?(mother.item,PBItems,:LIGHTBALL)
                              lightball=true
                              end
                              if lightball && isConst?(babyspecies,PBSpecies,ICHU) &&
                              hasConst?(PBMoves,:VOLTTACKLE)
                              moves.push(getConst(PBMoves,:VOLTTACKLE))
                              end
                              moves|=[] # remove duplicates
                              # Assembling move list
                              finalmoves=[]
                              listend=moves.length-4
                              listend=0 if listend<0
                              j=0
                              for i in listend..listend+3
                              moveid=(i>=moves.length) ? 0 : moves[i]
                              finalmoves[j]=PBMove.new(moveid)
                              j+=1
                              end
                              # Inheriting Individual Values
                              ivs=[]
                              for i in 0...6
                              ivs[i]=rand(32)
                              end
                              ivinherit=[]
                              for i in 0...2
                              parent=[mother,father][i]
                              ivinherit[i]=PBStats::HP if isConst?(parent.item,PBItems,OWERWEIGHT)
                              ivinherit[i]=PBStats::ATTACK if isConst?(parent.item,PBItems,OWERBRACER)
                              ivinherit[i]=PBStats::DEFENSE if isConst?(parent.item,PBItems,OWERBELT)
                              ivinherit[i]=PBStats:PEED if isConst?(parent.item,PBItems,OWERANKLET)
                              ivinherit[i]=PBStats:PATK if isConst?(parent.item,PBItems,OWERLENS)
                              ivinherit[i]=PBStats:PDEF if isConst?(parent.item,PBItems,OWERBAND)
                              end
                              num=0; r=rand(2)
                              for i in 0...2
                              if ivinherit[r]!=nil
                              parent=[mother,father][r]
                              ivs[ivinherit[r]]=parent.iv[ivinherit[r]]
                              num+=1
                              break
                              end
                              r=(r+1)%2
                              end
                              stats=[PBStats::HP,PBStats::ATTACK,PBStats::DEFENSE,
                              PBStats:PEED,PBStats:PATK,PBStats:PDEF]
                              limit=(USENEWBATTLEMECHANICS && (isConst?(mother.item,PBItems,:DESTINYKNOT) ||
                              isConst?(father.item,PBItems,:DESTINYKNOT))) ? 5 : 3
                              loop do
                              freestats=[]
                              for i in stats
                              freestats.push(i) if !ivinherit.include?(i)
                              end
                              break if freestats.length==0
                              r=freestats[rand(freestats.length)]
                              parent=[mother,father][rand(2)]
                              ivs[r]=parent.iv[r]
                              ivinherit.push(r)
                              num+=1
                              break if num>=limit
                              end
                              # Inheriting nature
                              newnatures=[]
                              newnatures.push(mother.nature) if isConst?(mother.item,PBItems,:EVERSTONE)
                              newnatures.push(father.nature) if isConst?(father.item,PBItems,:EVERSTONE)
                              if newnatures.length>0
                              egg.setNature(newnatures[rand(newnatures.length)])
                              end
                              # Masuda method and Shiny Charm
                              shinyretries=0
                              shinyretries+=5 if father.language!=mother.language
                              shinyretries+=2 if hasConst?(PBItems,HINYCHARM) &&
                              $PokemonBag.pbQuantity(HINYCHARM)>0
                              if shinyretries>0
                              for i in 0...shinyretries
                              break if egg.isShiny?
                              egg.personalID=rand(65536)|(rand(65536)<<16)
                              end
                              end
                              # Inheriting ability from the mother
                              if (!ditto0 && !ditto1)
                              if mother.hasHiddenAbility?
                              egg.setAbility(mother.abilityIndex) if rand(10)<6
                              else
                              if rand(10)<8
                              egg.setAbility(mother.abilityIndex)
                              else
                              egg.setAbility((mother.abilityIndex+1)%2)
                              end
                              end
                              elsif ((!ditto0 && ditto1) || (!ditto1 && ditto0)) && USENEWBATTLEMECHANICS
                              parent=(!ditto0) ? mother : father
                              if parent.hasHiddenAbility?
                              egg.setAbility(parent.abilityIndex) if rand(10)<6
                              end
                              end
                              # Inheriting Poké Ball from the mother
                              if mother.isFemale? &&
                              !isConst?(pbBallTypeToBall(mother.ballused),PBItems,:MASTERBALL) &&
                              !isConst?(pbBallTypeToBall(mother.ballused),PBItems,:CHERISHBALL)
                              egg.ballused=mother.ballused
                              end
                              egg.iv[0]=ivs[0]
                              egg.iv[1]=ivs[1]
                              egg.iv[2]=ivs[2]
                              egg.iv[3]=ivs[3]
                              egg.iv[4]=ivs[4]
                              egg.iv[5]=ivs[5]
                              egg.moves[0]=finalmoves[0]
                              egg.moves[1]=finalmoves[1]
                              egg.moves[2]=finalmoves[2]
                              egg.moves[3]=finalmoves[3]
                              egg.calcStats
                              egg.obtainText=_INTL("Day-Care Couple")
                              egg.name=_INTL("Egg")
                              dexdata=pbOpenDexData
                              pbDexDataOffset(dexdata,babyspecies,21)
                              eggsteps=dexdata.fgetw
                              dexdata.close
                              egg.eggsteps=eggsteps
                              if rand(65536)0 ? pbLoadSpeciesBitmap(species,female,form,shiny,shadow,back,egg,delta) : nil
                              [email protected]_iconbitmap ? @_iconbitmap.bitmap : nil
                              end
                              end

                              class PokemonEggHatchScene
                              def pbStartScene(pokemon)
                              @sprites={}
                              @pokemon=pokemon
                              @nicknamed=false
                              @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
                              @viewport.z=99999
                              addBackgroundOrColoredPlane(@sprites,"background","hatchbg",
                              Color.new(248,248,248),@viewport)
                              @sprites["pokemon"]=PokemonSprite.new(@viewport)
                              @sprites["pokemon"].setSpeciesBitmap(@pokemon.species,@pokemon.isFemale?,
                              (@pokemon.form rescue 0),@pokemon.isShiny?,
                              false,false,true,(@pokemon.isDelta? rescue false)) # Egg sprite
                              @sprites["pokemon"].x=Graphics.width/[email protected]["pokemon"].bitmap.width/2
                              @sprites["pokemon"].y=48+([email protected]["pokemon"].bitmap.height)/2
                              @sprites["hatch"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
                              @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
                              @sprites["overlay"].z=200
                              @sprites["overlay"].bitmap=Bitmap.new(Graphics.width,Graphics.height)
                              @sprites["overlay"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height,
                              Color.new(255,255,255))
                              @sprites["overlay"].opacity=0
                              pbFadeInAndShow(@sprites)
                              end
                              end

                              def pbLoadPokemonBitmap(pokemon, back=false, scale=nil)
                              return pbLoadPokemonBitmapSpecies(pokemon,pokemon.species,back,scale)
                              end

                              # Note: Returns an AnimatedBitmap, not a Bitmap
                              def pbLoadPokemonBitmapSpecies(pokemon, species, back=false, scale=nil)
                              ret=nil
                              if scale==nil
                              scale=1
                              if defined?(POKEMONSPRITESCALE)
                              scale=POKEMONSPRITESCALE if POKEMONSPRITESCALE != nil
                              end
                              end
                              if pokemon.isEgg?
                              bitmapFileName=sprintf("Graphics/Battlers/%segg",getConstantName(PBSpecies,species)) rescue nil
                              if !pbResolveBitmap(bitmapFileName)
                              bitmapFileName=sprintf("Graphics/Battlers/%03degg",species)
                              if !pbResolveBitmap(bitmapFileName)
                              bitmapFileName=sprintf("Graphics/Battlers/egg")
                              end
                              end
                              bitmapFileName=pbResolveBitmap(bitmapFileName)
                              else
                              bitmapFileName=pbCheckPokemonBitmapFiles([species,back,
                              (pokemon.isFemale?),
                              pokemon.isShiny?,
                              (pokemon.form rescue 0),
                              (pokemon.isShadow? rescue false),
                              (pokemon.isDelta? rescue false)])
                              # Alter bitmap if supported
                              alterBitmap=(MultipleForms.getFunction(species,"alterBitmap") rescue nil)
                              end
                              if bitmapFileName && alterBitmap
                              animatedBitmap=AnimatedBitmap.new(bitmapFileName)
                              copiedBitmap=animatedBitmap.copy
                              animatedBitmap.dispose
                              copiedBitmap.each {|bitmap|
                              alterBitmap.call(pokemon,bitmap)
                              }
                              ret=copiedBitmap
                              if defined?(DynamicPokemonSprite) # if EBS code exists
                              animatedBitmap=AnimatedBitmapWrapper.new(bitmapFileName,scale)
                              animatedBitmap.prepareStrip
                              for i in 0...animatedBitmap.totalFrames
                              alterBitmap.call(pokemon,animatedBitmap.alterBitmap(i))
                              end
                              animatedBitmap.compileStrip
                              ret=animatedBitmap
                              end
                              elsif bitmapFileName
                              ret=AnimatedBitmap.new(bitmapFileName)
                              ret=AnimatedBitmapWrapper.new(bitmapFileName,scale) if defined?(DynamicPokemonSprite) # if EBS code exists
                              end
                              return ret
                              end

                              # Note: Returns an AnimatedBitmap, not a Bitmap
                              def pbLoadSpeciesBitmap(species,female=false,form=0,shiny=false,shadow=false,back=false,egg=false,delta=false)
                              ret=nil
                              if egg
                              bitmapFileName=sprintf("Graphics/Battlers/%segg",getConstantName(PBSpecies,species)) rescue nil
                              if !pbResolveBitmap(bitmapFileName)
                              bitmapFileName=sprintf("Graphics/Battlers/%03degg",species)
                              if !pbResolveBitmap(bitmapFileName)
                              bitmapFileName=sprintf("Graphics/Battlers/egg")
                              end
                              end
                              bitmapFileName=pbResolveBitmap(bitmapFileName)
                              else
                              bitmapFileName=pbCheckPokemonBitmapFiles([species,back,female,shiny,form,shadow,delta])
                              end
                              if bitmapFileName
                              ret=AnimatedBitmap.new(bitmapFileName)
                              end
                              return ret
                              end

                              def pbCheckPokemonBitmapFiles(params)
                              species=params[0]
                              back=params[1]
                              factors=[]
                              factors.push([5,params[5],false]) if params[5] && params[5]!=false # shadow
                              factors.push([2,params[2],false]) if params[2] && params[2]!=false # gender
                              factors.push([3,params[3],false]) if params[3] && params[3]!=false # shiny
                              factors.push([4,params[4].to_s,""]) if params[4] && params[4].to_s!="" &&
                              params[4].to_s!="0" # form
                              factors.push([6,params[6],false]) if params[6] && params[6]!=false # shiny
                              tshadow=false
                              tgender=false
                              tshiny=false
                              tdelta=false
                              tform=""
                              for i in 0...2**factors.length
                              for j in 0...factors.length
                              case factors[j][0]
                              when 2 # gender
                              tgender=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              when 3 # shiny
                              tshiny=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              when 4 # form
                              tform=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              when 5 # shadow
                              tshadow=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              when 6 # delta
                              tdelta=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              end
                              end
                              folder=""
                              if defined?(DUALSCREENHEIGHT) # if BW data exists
                              folder="Front/"
                              folder="Back/" if back
                              folder="FrontShiny/" if tshiny
                              folder="BackShiny/" if back && tshiny
                              folder+="Female/" if tgender
                              end
                              bitmapFileName=sprintf("Graphics/Battlers/%s%s%s%s%s%s%s%s",
                              folder,
                              getConstantName(PBSpecies,species),
                              tgender ? "f" : "",
                              tshiny ? "s" : "",
                              tdelta ? "d" : "",
                              back ? "b" : "",
                              (tform!="" ? "_"+tform : ""),
                              tshadow ? "_shadow" : "") rescue nil
                              ret=pbResolveBitmap(bitmapFileName)
                              return ret if ret
                              bitmapFileName=sprintf("Graphics/Battlers/%s%03d%s%s%s%s%s%s",
                              folder, species,
                              tgender ? "f" : "",
                              tshiny ? "s" : "",
                              tdelta ? "d" : "",
                              back ? "b" : "",
                              (tform!="" ? "_"+tform : ""),
                              tshadow ? "_shadow" : "")
                              ret=pbResolveBitmap(bitmapFileName)
                              return ret if ret
                              end
                              return nil
                              end

                              def pbPokemonIconFile(pokemon)
                              bitmapFileName=nil
                              bitmapFileName=pbCheckPokemonIconFiles([pokemon.species,
                              (pokemon.isFemale?),
                              pokemon.isShiny?,
                              (pokemon.form rescue 0),
                              (pokemon.isShadow? rescue false),
                              pokemon.isDelta?],
                              pokemon.isEgg?)
                              return bitmapFileName
                              end

                              def pbCheckPokemonIconFiles(params,egg=false)
                              species=params[0]
                              if egg
                              bitmapFileName=sprintf("Graphics/Icons/icon%segg",getConstantName(PBSpecies,species)) rescue nil
                              if !pbResolveBitmap(bitmapFileName)
                              bitmapFileName=sprintf("Graphics/Icons/icon%03degg",species)
                              if !pbResolveBitmap(bitmapFileName)
                              bitmapFileName=sprintf("Graphics/Icons/iconEgg")
                              end
                              end
                              return pbResolveBitmap(bitmapFileName)
                              else
                              factors=[]
                              factors.push([4,params[4],false]) if params[4] && params[4]!=false # shadow
                              factors.push([1,params[1],false]) if params[1] && params[1]!=false # gender
                              factors.push([2,params[2],false]) if params[2] && params[2]!=false # shiny
                              factors.push([5,params[5],false]) if params[5] && params[5]!=false # delta
                              factors.push([3,params[3].to_s,""]) if params[3] && params[3].to_s!="" &&
                              params[3].to_s!="0" # form
                              tshadow=false
                              tgender=false
                              tshiny=false
                              tdelta=false
                              tform=""
                              for i in 0...2**factors.length
                              for j in 0...factors.length
                              case factors[j][0]
                              when 1 # gender
                              tgender=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              when 2 # shiny
                              tshiny=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              when 3 # form
                              tform=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              when 4 # shadow
                              tshadow=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              when 5 # delta
                              tdelta=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              end
                              end
                              bitmapFileName=sprintf("Graphics/Icons/icon%s%s%s%s%s%s",
                              getConstantName(PBSpecies,species),
                              tgender ? "f" : "",
                              tshiny ? "s" : "",
                              tdelta ? "d" : "",
                              (tform!="" ? "_"+tform : ""),
                              tshadow ? "_shadow" : "") rescue nil
                              ret=pbResolveBitmap(bitmapFileName)
                              return ret if ret
                              bitmapFileName=sprintf("Graphics/Icons/icon%03d%s%s%s%s%s",
                              species,
                              tgender ? "f" : "",
                              tshiny ? "s" : "",
                              tdelta ? "d" : "",
                              (tform!="" ? "_"+tform : ""),
                              tshadow ? "_shadow" : "")
                              ret=pbResolveBitmap(bitmapFileName)
                              return ret if ret
                              end
                              end
                              return nil
                              end

                              #########################################################################
                              # Following Pokemon compatibility
                              #########################################################################
                              class DependentEvents
                              def change_sprite(id, shiny=nil, animation=nil, form=nil, gender=nil, shadow=false, delta=nil)
                              events=$PokemonGlobal.dependentEvents
                              for i in 0...events.length
                              if events[i] && events[i][8]=="Dependent"
                              file=FOLLOWER_FILE_DIR+pbCheckPokemonFollowerFiles([id,gender,shiny,delta,form,shadow])
                              events[i][6]=file
                              @realEvents[i].character_name=file
                              if animation
                              $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                              end
                              $game_variables[Walking_Time_Variable]=0
                              end
                              end
                              end

                              def refresh_sprite(animation=true)
                              if $game_variables[Current_Following_Variable]!=0
                              return unless $game_switches[Toggle_Following_Switch]
                              return if $PokemonGlobal.bicycle
                              if $Trainer.party[0].isShiny?
                              shiny=true
                              else
                              shiny=false
                              end
                              if defined?($Trainer.party[0].isDelta?)
                              delta = $Trainer.party[0].isDelta?
                              else
                              delta = false
                              end
                              if $Trainer.party[0].form>0
                              form=$Trainer.party[0].form
                              else
                              form=nil
                              end
                              if defined?($Trainer.party[0].isShadow?)
                              shadow = $Trainer.party[0].isShadow?
                              else
                              shadow = false
                              end
                              if $PokemonGlobal.surfing
                              if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $Trainer.party[0].hasType?(:WATER)
                              events=$PokemonGlobal.dependentEvents
                              if animation
                              for i in 0...events.length
                              $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                              pbWait(10)
                              end
                              end
                              change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
                              elsif ALWAYS_ANIMATED_CAN_SURF && ($Trainer.party[0].hasType?(:FLYING) ||
                              isConst?($Trainer.party[0].ability,PBAbilities,:LEVITATE) ||
                              ALWAYS_ANIMATED_FOLLOWERS.include?($Trainer.party[0].species)) &&
                              !(ALWAYS_ANIMATED_EXCEPTION.include?($Trainer.party[0].species)) &&
                              $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg?
                              events=$PokemonGlobal.dependentEvents
                              if animation
                              for i in 0...events.length
                              $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                              pbWait(10)
                              end
                              end
                              change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
                              else
                              remove_sprite(false)
                              end
                              elsif $PokemonGlobal.diving
                              if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $Trainer.party[0].hasType?(:WATER) && WATERPOKEMONCANDIVE
                              events=$PokemonGlobal.dependentEvents
                              if animation
                              for i in 0...events.length
                              $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                              pbWait(10)
                              end
                              end
                              change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
                              else
                              remove_sprite(false)
                              end
                              else
                              if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $scene.is_a?(Scene_Map)
                              events=$PokemonGlobal.dependentEvents
                              if animation
                              for i in 0...events.length
                              $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                              pbWait(10)
                              end
                              end
                              change_sprite($Trainer.party[0].species, shiny, false, form, $Trainer.party[0].gender, shadow, delta)
                              elsif $Trainer.party[0].hp<=0 || $Trainer.party[0].isEgg?
                              remove_sprite(animation)
                              end
                              end
                              else
                              check_faint
                              end
                              end

                              def Come_back(shiny=nil, animation=nil, delta=nil)
                              return if !$game_variables[Following_Activated_Switch]
                              return if $Trainer.party.length==0
                              $PokemonTemp.dependentEvents.pbMoveDependentEvents
                              events=$PokemonGlobal.dependentEvents
                              if $game_variables[Current_Following_Variable]==$Trainer.party[0]
                              remove_sprite(false)
                              if $scene.is_a?(Scene_Map)
                              for i in 0...events.length
                              $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                              end
                              end
                              end
                              if $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg?
                              $game_variables[Current_Following_Variable]=$Trainer.party[0]
                              refresh_sprite(animation)
                              end
                              for i in 0...events.length
                              if events[i] && events[i][8]=="Dependent"
                              file=FOLLOWER_FILE_DIR+pbCheckPokemonFollowerFiles([id,gender,shiny,delta,form,shadow])
                              events[i][6]=file
                              @realEvents[i].character_name=file
                              if animation
                              $scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents[i].x,@realEvents[i].y)
                              end
                              end
                              end
                              end
                              end

                              # this is an entirely new function, not found in the official release of Following Pokemon
                              # it searches for Follower sprites the same way base Essentials searches for battlers and icons
                              # rather than a series of "if-than" events
                              def pbCheckPokemonFollowerFiles(params)
                              species=params[0]
                              factors=[]
                              factors.push([1,params[1],false]) if params[1] && params[1]!=false # gender
                              factors.push([2,params[2],false]) if params[2] && params[2]!=false # shiny
                              factors.push([3,params[3],false]) if params[3] && params[3]!=false # delta
                              factors.push([4,params[4].to_s,""]) if params[4] && params[4].to_s!="" # form
                              factors.push([5,params[5],false]) if params[5] && params[5]!=false # shadow
                              tshadow=false
                              tgender=false
                              tshiny=false
                              tdelta=false
                              tform=""
                              for i in 0...2**factors.length
                              for j in 0...factors.length
                              case factors[j][0]
                              when 1 # gender
                              tgender=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              when 2 # shiny
                              tshiny=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              when 3 # delta
                              tdelta=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              when 4 # form
                              tform=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              when 5 # shadow
                              tshadow=((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
                              end
                              end
                              bitmapFileName=sprintf("%s%s%s%s%s%s",
                              getConstantName(PBSpecies,species),
                              tgender ? "f" : "",
                              tshiny ? "s" : "",
                              tdelta ? "d" : "",
                              (tform!="" ? "_"+tform : ""),
                              tshadow ? "_shadow" : "") rescue nil
                              ret=pbResolveBitmap(sprintf("%s%s%s",FOLLOWER_FILE_PATH,FOLLOWER_FILE_DIR,bitmapFileName))
                              return bitmapFileName if ret
                              bitmapFileName=sprintf("%03d%s%s%s%s%s",
                              species,
                              tgender ? "f" : "",
                              tshiny ? "s" : "",
                              tdelta ? "d" : "",
                              (tform!="" ? "_"+tform : ""),
                              tshadow ? "_shadow" : "")
                              ret=pbResolveBitmap(sprintf("%s%s%s",FOLLOWER_FILE_PATH,FOLLOWER_FILE_DIR,bitmapFileName))
                              return bitmapFileName if ret
                              end
                              end

                              ##############################################################
                              # Hybrid AnimatedBitmapWrapper class to encompass both the
                              # EBS version's inputs and the BW version's ones
                              ##############################################################
                              class AnimatedBitmapWrapper
                              attr_reader :width
                              attr_reader :height
                              attr_reader :totalFrames
                              attr_reader :animationFrames
                              attr_reader :currentIndex
                              attr_accessor :scale

                              def initialize(file,twoframe_scale=2)
                              raise "filename is nil" if file==nil
                              if scale.is_a?(Numeric) # EBS version
                              @scale = twoframe_scale
                              @twoframe = false
                              elsif !!scale == scale # BW version
                              @scale = 2
                              @twoframe = twoframe_scale
                              end
                              if @scale==nil
                              @scale=2
                              end
                              @width = 0
                              @height = 0
                              @frame = 0
                              @frames = 2
                              @direction = +1
                              @animationFinish = false
                              @totalFrames = 0
                              @currentIndex = 0
                              @speed = 1
                              # 0 - not moving at all
                              # 1 - normal speed
                              # 2 - medium speed
                              # 3 - slow speed
                              bmp = BitmapCache.load_bitmap(file)
                              #bmp = Bitmap.new(file)
                              @bitmapFile=Bitmap.new(bmp.width,bmp.height); @bitmapFile.blt(0,0,bmp,Rect.new(0,0,bmp.width,bmp.height))
                              # initializes full Pokemon bitmap
                              @bitmap=Bitmap.new(@bitmapFile.width,@bitmapFile.height)
                              @bitmap.blt(0,0,@bitmapFile,Rect.new(0,0,@bitmapFile.width,@bitmapFile.height))
                              @[email protected]*@scale
                              @[email protected]*@scale

                              @[email protected]/@bitmap.height
                              @[email protected]*@frames
                              # calculates total number of frames
                              @loop_points=[0,@totalFrames]
                              # first value is start, second is end

                              @actualBitmap=Bitmap.new(@width,@height)
                              @actualBitmap.clear
                              @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
                              end
                              alias initialize_elite initialize

                              def length; @totalFrames; end
                              def disposed?; @actualBitmap.disposed?; end
                              def dispose; @actualBitmap.dispose; end
                              def copy; @actualBitmap.clone; end
                              def bitmap; @actualBitmap; end
                              def bitmap=(val); @actualBitmap=val; end
                              def each; end
                              def alterBitmap(index); return @strip[index]; end

                              def prepareStrip
                              @strip=[]
                              for i in [email protected]
                              bitmap=Bitmap.new(@width,@height)
                              bitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmapFile,Rect.new((@width/@scale)*i,0,@width/@scale,@height/@scale))
                              @strip.push(bitmap)
                              end
                              end
                              def compileStrip
                              @bitmap.clear
                              for i in [email protected]
                              @bitmap.stretch_blt(Rect.new((@width/@scale)*i,0,@width/@scale,@height/@scale),@strip[i],Rect.new(0,0,@width,@height))
                              end
                              end

                              def reverse
                              if @direction > 0
                              @direction=-1
                              elsif @direction < 0
                              @direction=+1
                              end
                              end

                              def setLoop(start, finish)
                              @loop_points=[start,finish]
                              end

                              def setSpeed(value)
                              @speed=value
                              end

                              def toFrame(frame)
                              if frame.is_a?(String)
                              if frame=="last"
                              [email protected]
                              else
                              frame=0
                              end
                              end
                              [email protected] if frame > @totalFrames
                              frame=0 if frame < 0
                              @currentIndex=frame
                              @actualBitmap.clear
                              @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
                              end

                              def play
                              return if @currentIndex >= @loop_points[1]-1
                              self.update
                              end

                              def finished?
                              return (@[email protected])
                              end

                              def update
                              return false if @actualBitmap.disposed?
                              return false if @speed < 1
                              case @speed
                              # frame skip
                              when 1
                              @frames=2
                              when 2
                              @frames=4
                              when 3
                              @frames=5
                              end
                              @frame+=1

                              if @frame >[email protected]
                              # processes animation speed
                              @[email protected]
                              @[email protected]_points[0] if @currentIndex >[email protected]_points[1]
                              @[email protected]_points[1]-1 if @currentIndex < @loop_points[0]
                              @frame=0
                              end
                              @actualBitmap.clear
                              @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
                              # updates the actual bitmap
                              end
                              alias update_elite update

                              # returns bitmap to original state
                              def deanimate
                              @frame=0
                              @currentIndex=0
                              @actualBitmap.clear
                              @actualBitmap.stretch_blt(Rect.new(0,0,@width,@height),@bitmap,Rect.new(@currentIndex*(@width/@scale),0,@width/@scale,@height/@scale))
                              end
                              end

                              ##############################################################
                              # Evolution differences
                              ##############################################################
                              def pbGetEvolvedFormData(species,delta=false)
                              ret=[]
                              _EVOTYPEMASK=0x3F
                              _EVODATAMASK=0xC0
                              _EVONEXTFORM=0x00
                              pbRgssOpen("Data/evolutions.dat","rb"){|f|
                              f.pos=(species-1)*8
                              offset=f.fgetdw
                              length=f.fgetdw
                              if length>0
                              f.pos=offset
                              i=0; loop do break unless i0
                              end
                              return ret
                              end

                              # Pikachu, Cubone (at night), and Exeggcute holding the Strange Souvenir
                              # will evolve into Alolan Raichu, Alolan Marowak, and Alolan Exeggutor
                              # respectively. (The item will not be consumed.)
                              # Remove this function if you wish this not to be the case.
                              class PokemonEvolutionScene
                              def pbStartScreen(pokemon,newspecies)
                              @sprites={}
                              @bgviewport=Viewport.new(0,0,Graphics.width,Graphics.height)
                              @bgviewport.z=99999
                              @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
                              @viewport.z=99999
                              @msgviewport=Viewport.new(0,0,Graphics.width,Graphics.height)
                              @msgviewport.z=99999
                              @pokemon=pokemon
                              @newspecies=newspecies
                              addBackgroundOrColoredPlane(@sprites,"background","evolutionbg",
                              Color.new(248,248,248),@bgviewport)
                              rsprite1=PokemonSprite.new(@viewport)
                              rsprite2=PokemonSprite.new(@viewport)
                              rsprite1.setPokemonBitmap(@pokemon,false)
                              if isConst?(pokemon.item,PBItems,TRANGESOUVENIR)
                              if (isConst?(@newspecies,PBSpecies,:MAROWAK) && PBDayNight.isNight?) ||
                              isConst?(@newspecies,PBSpecies,:RAICHU) ||
                              isConst?(@newspecies,PBSpecies,:EXEGGUTOR)
                              @pokemon.makeDelta
                              end
                              end
                              rsprite2.setPokemonBitmapSpecies(@pokemon,@newspecies,false)
                              rsprite1.ox=rsprite1.bitmap.width/2
                              rsprite1.oy=rsprite1.bitmap.height/2
                              rsprite2.ox=rsprite2.bitmap.width/2
                              rsprite2.oy=rsprite2.bitmap.height/2
                              rsprite1.x=Graphics.width/2
                              rsprite1.y=(Graphics.height-64)/2
                              rsprite2.x=rsprite1.x
                              rsprite2.y=rsprite1.y
                              rsprite2.opacity=0
                              @sprites["rsprite1"]=rsprite1
                              @sprites["rsprite2"]=rsprite2
                              pbGenerateMetafiles(rsprite1.ox,rsprite1.oy,rsprite2.ox,rsprite2.oy)
                              @sprites["msgwindow"]=Kernel.pbCreateMessageWindow(@msgviewport)
                              pbFadeInAndShow(@sprites) { pbUpdate }
                              end
                              end

                              ##############################################################
                              # Alolan Form differences
                              ##############################################################

                              MultipleForms.register(:RATTATA,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type1"=>proc{|pokemon|
                              next getID(PBTypes,:DARK) if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              next [[getID(PBAbilities,:GLUTTONY),0],
                              [getID(PBAbilities,:HUSTLE),1],
                              [getID(PBAbilities,:THICKFAT),2]]
                              end
                              next
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :TOXIC,:HIDDENPOWER,UNNYDAY,:TAUNT,:ICEBEAM,
                              :BLIZZARD,ROTECT,:RAINDANCE,:FRUSTRATION,:RETURN,
                              HADOWBALL,:DOUBLETEAM,LUDGEBOMB,:TORMENT,:FACADE,
                              :REST,:ATTRACT,:THIEF,:ROUND,:QUASH,
                              :EMBARGO,HADOWCLAW,:GRASSKNOT,WAGGER,LEEPTALK,
                              :UTURN,UBSTITUTE,NARL,:DARKPULSE,:CONFIDE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "possibleEggMoves"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[:COUNTER,:FINALGAMBIT,:FURYSWIPES,:MEFIRST,:REVENGE,
                              :REVERSAL,NATCH,TOCKPILE,WALLOW,WITCHEROO,
                              :UPROAR]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:RATICATE,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type1"=>proc{|pokemon|
                              next getID(PBTypes,:DARK) if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 25.5 if pokemon.isDelta?
                              next
                              },
                              "getBaseStats"=>proc{|pokemon|
                              next [75,71,70,77,40,80] if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              next [[getID(PBAbilities,:GLUTTONY),0],
                              [getID(PBAbilities,:HUSTLE),1],
                              [getID(PBAbilities,:THICKFAT),2]]
                              end
                              next
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :TOXIC,:HIDDENPOWER,UNNYDAY,:TAUNT,:ICEBEAM,
                              :BLIZZARD,ROTECT,:RAINDANCE,:FRUSTRATION,:RETURN,
                              HADOWBALL,:DOUBLETEAM,LUDGEBOMB,:TORMENT,:FACADE,
                              :REST,:ATTRACT,:THIEF,:ROUND,:QUASH,
                              :EMBARGO,HADOWCLAW,:GRASSKNOT,WAGGER,LEEPTALK,
                              :UTURN,UBSTITUTE,NARL,:DARKPULSE,:CONFIDE,
                              :ROAR,:BULKUP,:VENOSHOCK,UNNYDAY,:HYPERBEAM,
                              LUDGEWAVE,:GIGAIMPACT,WORDSDANCE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:RAICHU,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,SYCHIC) if pokemon.isDelta?
                              next
                              },
                              "height"=>proc{|pokemon|
                              next 0.7 if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 21.0 if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              next [[getID(PBAbilities,URGESURFER),0],
                              [getID(PBAbilities,URGESURFER),2]]
                              end
                              next
                              },
                              "getBaseStats"=>proc{|pokemon|
                              next [60,85,50,110,95,85] if pokemon.isDelta?
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              movelist=[[1,SYCHIC],[1,PEEDSWAP],[1,:THUNDERSHOCK],
                              [1,:TAILWHIP],[1,:QUICKATTACK],[1,:THUNDERBOLT]]
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              SYSHOCK,:CALMMIND,:TOXIC,:HIDDENPOWER,:HYPERBEAM,
                              :LIGHTSCREEN,ROTECT,:RAINDANCE,AFEGUARD,:FRUSTRATION,
                              :THUNDERBOLT,:THUNDER,:RETURN,SYCHIC,:BRICKBREAK,
                              :DOUBLETEAM,:REFLECT,:FACADE,:REST,:ATTRACT,
                              :THIEF,:ROUND,:ECHOEDVOICE,:FOCUSBLAST,:FLING,
                              :CHARGEBEAM,:GIGAIMPACT,:VOLTSWITCH,:THUNDERWAVE,
                              :GRASSKNOT,WAGGER,LEEPTALK,UBSTITUTE,
                              :WILDCHARGE,:CONFIDE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(ANDSHREW,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type1"=>proc{|pokemon|
                              next getID(PBTypes,:ICE) if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,TEEL) if pokemon.isDelta?
                              next
                              },
                              "height"=>proc{|pokemon|
                              next 0.6 if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 40.0 if pokemon.isDelta?
                              next
                              },
                              "getBaseStats"=>proc{|pokemon|
                              next [50,75,90,40,10,35] if pokemon.isDelta?
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,CRATCH],[1,:DEFENSECURL],[3,:BIDE],[5,ODERSNOW],
                              [7,:ICEBALL],[9,:RAPIDSPIN],[11,:FURYCUTTER],[14,:METALCLAW],
                              [17,WIFT],[20,:FURYSWIPES],[23,:IRONDEFENSE],[26,LASH],
                              [30,:IRONHEAD],[34,:GYROBALL],[38,WORDSDANCE],[42,:HAIL],
                              [46,:BLIZZARD]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :WORKUP,:TOXIC,:HAIL,:HIDDENPOWER,UNNYDAY,
                              :BLIZZARD,ROTECT,AFEGUARD,:FRUSTRATION,:EARTHQUAKE,
                              :RETURN,:LEECHLIFE,:BRICKBREAK,:DOUBLETEAM,:AERIALACE,
                              :FACADE,:REST,:ATTRACT,:THIEF,:ROUND,
                              :FLING,HADOWCLAW,:AURORAVEIL,:GYROBALL,WORDSDANCE,
                              :BULLDOZE,:FROSTBREATH,:ROCKSLIDE,:XSCISSOR,
                              OISONJAB,WAGGER,LEEPTALK,UBSTITUTE,
                              :CONFIDE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "possibleEggMoves"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[:AMNESIA,:CHIPAWAY,:COUNTER,:CRUSHCLAW,:CURSE,
                              :ENDURE,:FLAIL,:ICICLECRASH,:ICICLESPEAR,:METALCLAW,
                              :NIGHTSLASH]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              next [[getID(PBAbilities,NOWCLOAK),0]] if getID(PBAbilities,LUSHRUSH)==nil
                              next [[getID(PBAbilities,NOWCLOAK),0],
                              [getID(PBAbilities,LUSHRUSH),2]]
                              end
                              next
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(ANDSLASH,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type1"=>proc{|pokemon|
                              next getID(PBTypes,:ICE) if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,TEEL) if pokemon.isDelta?
                              next
                              },
                              "height"=>proc{|pokemon|
                              next 1.2 if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 55.0 if pokemon.isDelta?
                              next
                              },
                              "getBaseStats"=>proc{|pokemon|
                              next [75,100,120,65,25,65] if pokemon.isDelta?
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,:ICICLESPEAR],[1,:METALBURST],[1,:ICICLECRASH],[1,LASH],
                              [1,:DEFENSECURL],[1,:ICEBALL],[1,:METALCLAW]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :WORKUP,:TOXIC,:HAIL,:HIDDENPOWER,UNNYDAY,
                              :BLIZZARD,ROTECT,AFEGUARD,:FRUSTRATION,:EARTHQUAKE,
                              :RETURN,:LEECHLIFE,:BRICKBREAK,:DOUBLETEAM,:AERIALACE,
                              :FACADE,:REST,:ATTRACT,:THIEF,:ROUND,
                              :FLING,HADOWCLAW,:AURORAVEIL,:GYROBALL,WORDSDANCE,
                              :BULLDOZE,:FROSTBREATH,:ROCKSLIDE,:XSCISSOR,
                              OISONJAB,WAGGER,LEEPTALK,UBSTITUTE,
                              :CONFIDE,:HYPERBEAM,:FOCUSBLAST,:GIGAIMPACT]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              next [[getID(PBAbilities,NOWCLOAK),0]] if getID(PBAbilities,LUSHRUSH)==nil
                              next [[getID(PBAbilities,NOWCLOAK),0],
                              [getID(PBAbilities,LUSHRUSH),2]]
                              end
                              next
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:VULPIX,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type1"=>proc{|pokemon|
                              next getID(PBTypes,:ICE) if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,:ICE) if pokemon.isDelta?
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,OWDERSNOW],[4,:TAILWHIP],[7,:ROAR],[9,:BABYDOLLEYES],
                              [10,:ICESHARD],[12,:CONFUSERAY],[15,:ICYWIND],
                              [18,AYBACK],[20,:MIST],[23,:FEINTATTACK],[26,:HEX],
                              [28,:AURORABEAM],[31,:EXTRASENSORY],[34,AFEGUARD],
                              [36,:ICEBEAM],[39,:IMPRISON],[42,:BLIZZARD],[44,:GRUDGE],
                              [47,:CAPTIVATE],[50,HEERCOLD]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :ROAR,:TOXIC,:HAIL,:HIDDENPOWER,:ICEBEAM,
                              :BLIZZARD,ROTECT,:RAINDANCE,AFEGUARD,:FRUSTRATION,
                              :RETURN,:DOUBLETEAM,:FACADE,:REST,:ATTRACT,:ROUND,
                              AYBACK,:AURORAVEIL,SYCHUP,:FROSTBREATH,
                              WAGGER,LEEPTALK,UBSTITUTE,
                              :CONFIDE,:DARKPULSE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "possibleEggMoves"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[:AGILITY,:CHARM,:DISABLE,:ENCORE,:EXTRASENSORY,
                              :FLAIL,:FREEZEDRY,:HOWL,:HYPNOSIS,:MOONBLAST,
                              OWERSWAP,PITE,ECRETPOWER,:TAILSLAP]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              next [[getID(PBAbilities,NOWCLOAK),0],
                              [getID(PBAbilities,NOWWARNING),2]]
                              end
                              next
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:NINETAILS,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type1"=>proc{|pokemon|
                              next getID(PBTypes,:ICE) if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,:FAIRY) if pokemon.isDelta?
                              next
                              },
                              "getBaseStats"=>proc{|pokemon|
                              next [73,67,75,109,81,100] if pokemon.isDelta?
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,:DAZZLINGGLEAM],[1,:IMPRISON],[1,:NASTYPLOT],[1,:ICEBEAM],
                              [1,:ICESHARD],[1,:CONFUSERAY],[1,AFEGUARD]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :ROAR,:TOXIC,:HAIL,:HIDDENPOWER,:ICEBEAM,
                              :BLIZZARD,ROTECT,:RAINDANCE,AFEGUARD,:FRUSTRATION,
                              :RETURN,:DOUBLETEAM,:FACADE,:REST,:ATTRACT,:ROUND,
                              AYBACK,:AURORAVEIL,SYCHUP,:FROSTBREATH,
                              WAGGER,LEEPTALK,UBSTITUTE,:CONFIDE,:DARKPULSE,
                              SYSHOCK,:CALMMIND,:GIGAIMPACT,:DREAMEATER,:DAZZLINGGLEAM]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              next [[getID(PBAbilities,NOWCLOAK),0],
                              [getID(PBAbilities,NOWWARNING),2]]
                              end
                              next
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:DIGLETT,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,TEEL) if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 1.0 if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              if getID(PBAbilities,:TANGLINGHAIR)==nil
                              next [[getID(PBAbilities,ANDVEIL),0],
                              [getID(PBAbilities,:GOOEY),1],
                              [getID(PBAbilities,ANDFORCE),2]]
                              end
                              next [[getID(PBAbilities,ANDVEIL),0],
                              [getID(PBAbilities,:TANGLEDHAIR),1],
                              [getID(PBAbilities,ANDFORCE),2]]
                              end
                              next
                              },
                              "getBaseStats"=>proc{|pokemon|
                              next [10,55,30,90,35,45] if pokemon.isDelta?
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,ANDATTACK],[1,:METALCLAW],[4,:GROWL],[7,:ASTONISH],
                              [10,:MUDSLAP],[14,:MAGNITUDE],[18,:BULLDOZE],
                              [22,UCKERPUNCH],[25,:MUDBOMB],[28,:EARTHPOWER],[31,:DIG],
                              [35,:IRONHEAD],[39,:EARTHQUAKE],[43,:FISSURE]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :WORKUP,:TOXIC,:HIDDENPOWER,UNNYDAY,ROTECT,
                              :FRUSTRATION,:EARTHQUAKE,:RETURN,:DOUBLETEAM,
                              LUDGEBOMB,ANDSTORM,:ROCKTOMB,:AERIELACE,:FACADE,
                              :REST,:ATTRACT,:THIEF,:ROUND,:ECHOEDVOICE,
                              HADOWCLAW,:BULLDOZE,:ROCKSLIDE,WAGGER,LEEPTALK,
                              UBSTITUTE,:FLASHCANNON,:CONFIDE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "possibleEggMoves"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[:ANCIENTPOWER,:BEATUP,:ENDURE,:FEINTATTACK,
                              :FINALGAMBIT,:HEADBUTT,:MEMENTO,:METALSOUND,
                              URSUIT,:REVERSAL,:THRASH]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:DUGTRIO,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,TEEL) if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 66.6 if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              if getID(PBAbilities,:TANGLINGHAIR)==nil
                              next [[getID(PBAbilities,ANDVEIL),0],
                              [getID(PBAbilities,:GOOEY),1],
                              [getID(PBAbilities,ANDFORCE),2]]
                              end
                              next [[getID(PBAbilities,ANDVEIL),0],
                              [getID(PBAbilities,:TANGLEDHAIR),1],
                              [getID(PBAbilities,ANDFORCE),2]]
                              end
                              next
                              },
                              "getBaseStats"=>proc{|pokemon|
                              next [35,100,60,110,50,70] if pokemon.isDelta?
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,ANDTOMB],[1,:ROTOTILLER],[1,:NIGHTSLASH],
                              [1,:TRIATTACK],[1,ANDATTACK],[1,:METALCLAW],
                              [1,:GROWL],[4,:GROWL],[7,:ASTONISH],
                              [10,:MUDSLAP],[14,:MAGNITUDE],[18,:BULLDOZE],
                              [22,UCKERPUNCH],[25,:MUDBOMB],[30,:EARTHPOWER],[35,:DIG],
                              [41,:IRONHEAD],[47,:EARTHQUAKE],[53,:FISSURE]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :WORKUP,:TOXIC,:HIDDENPOWER,UNNYDAY,ROTECT,
                              :FRUSTRATION,:EARTHQUAKE,:RETURN,:DOUBLETEAM,
                              LUDGEBOMB,ANDSTORM,:ROCKTOMB,:AERIELACE,:FACADE,
                              :REST,:ATTRACT,:THIEF,:ROUND,:ECHOEDVOICE,
                              HADOWCLAW,:BULLDOZE,:ROCKSLIDE,WAGGER,LEEPTALK,
                              UBSTITUTE,:FLASHCANNON,:CONFIDE,:HYPERBEAM,
                              LUDGEWAVE,:GIGAIMPACT,TONEEDGE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:MEOWTH,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type1"=>proc{|pokemon|
                              next getID(PBTypes,:DARK) if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,:DARK) if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              next [[getID(PBAbilities,ICKUP),0],
                              [getID(PBAbilities,:TECHNICIAN),1],
                              [getID(PBAbilities,:RATTLED),2]]
                              end
                              next
                              },
                              "getBaseStats"=>proc{|pokemon|
                              next [40,35,34,90,50,40] if pokemon.isDelta?
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,CRATCH],[1,:GROWL],[6,:BITE],[9,:FAKEOUT],
                              [14,:FURYSWIPES],[17,CREECH],[22,:FEINTATTACK],
                              [25,:TAUNT],[30,AYDAY],[33,LASH],[38,:NASTYPLOT],
                              [41,:ASSURANCE],[46,:CAPTIVATE],[49,:NIGHTSLASH],
                              [50,:FEINT],[55,:DARKPULSE]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :WORKUP,:TOXIC,:HIDDENPOWER,UNNYDAY,:TAUNT,ROTECT,
                              :RAINDANCE,:FRUSTRATION,:THUNDERBOLT,:THUNDER,:RETURN,
                              HADOWBALL,:DOUBLETEAM,:AERIELACE,:TORMENT,:FACADE,
                              :REST,:ATTRACT,:THIEF,:ROUND,:ECHOEDVOICE,:QUASH,
                              :EMBARGO,HADOWCLAW,AYBACK,SYCHUP,:DREAMEATER,
                              WAGGER,LEEPTALK,:UTURN,UBSTITUTE,:DARKPULSE,
                              :CONFIDE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "possibleEggMoves"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[:AMNESIA,:ASSIST,:CHARM,:COVET,:FLAIL,:FLATTER,
                              :FOULPLAY,:HYPNOSIS,ARTINGSHOT,UNISHMENT,
                              NATCH,PITE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(ERSIAN,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type1"=>proc{|pokemon|
                              next getID(PBTypes,:DARK) if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,:DARK) if pokemon.isDelta?
                              next
                              },
                              "height"=>proc{|pokemon|
                              next 1.1 if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 33.0 if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              next [[getID(PBAbilities,:FURCOAT),0],
                              [getID(PBAbilities,:TECHNICIAN),1],
                              [getID(PBAbilities,:RATTLED),2]]
                              end
                              next
                              },
                              "getBaseStats"=>proc{|pokemon|
                              next [65,60,60,115,75,65] if pokemon.isDelta?
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,WIFT],[1,:QUASH],[1,LAYROUGH],[1,WITCHEROO],
                              [1,CRATCH],[1,:GROWL],[1,:BITE],[1,:FAKEOUT],
                              [6,:BITE],[9,:FAKEOUT],[14,:FURYSWIPES],[17,CREECH],
                              [22,:FEINTATTACK],[25,:TAUNT],[32,OWERGEM],[37,LASH],
                              [44,:NASTYPLOT],[49,:ASSURANCE],[56,:CAPTIVATE],
                              [61,:NIGHTSLASH],[65,:FEINT],[69,:DARKPULSE]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :WORKUP,:TOXIC,:HIDDENPOWER,UNNYDAY,:TAUNT,ROTECT,
                              :RAINDANCE,:FRUSTRATION,:THUNDERBOLT,:THUNDER,:RETURN,
                              HADOWBALL,:DOUBLETEAM,:AERIELACE,:TORMENT,:FACADE,
                              :REST,:ATTRACT,:THIEF,:ROUND,:ECHOEDVOICE,:QUASH,
                              :EMBARGO,HADOWCLAW,AYBACK,SYCHUP,:DREAMEATER,
                              WAGGER,LEEPTALK,:UTURN,UBSTITUTE,:DARKPULSE,
                              :CONFIDE,:ROAR,:HYPERBEAM,:GIGAIMPACT,NARL]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:GEODUDE,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,:ELECTRIC) if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 20.3 if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              if getID(PBAbilities,:GALVANIZE)==nil
                              next [[getID(PBAbilities,:MAGNETPULL),0],
                              [getID(PBAbilities,TURDY),1]]
                              end
                              next [[getID(PBAbilities,:MAGNETPULL),0],
                              [getID(PBAbilities,TURDY),1],
                              [getID(PBAbilities,:GALVANIZE),2]]
                              end
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,:TACKLE],[1,:DEFENSECURL],[4,:CHARGE],[6,:ROCKPOLISH],
                              [10,:ROLLOUT],[12,PARK],[16,:ROCKTHROW],[18,MACKDOWN],
                              [22,:THUNDERPUNCH],[24,ELFDESTRUCT],[28,TEALTHROCK],
                              [30,:ROCKBLAST],[34,:DISCHARGE],[36,:EXPLOSION],
                              [40,:DOUBLEEDGE],[42,TONEEDGE]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :TOXIC,:HIDDENPOWER,UNNYDAY,ROTECT,MACKDOWN,
                              :THUNDERBOLT,:THUNDER,:EARTHQUAKE,:RETURN,:BRICKBREAK,
                              :DOUBLETEAM,:FLAMETHROWER,ANDSTORM,:FIREBLAST,
                              :ROCKTOMB,:FACADE,:REST,:ATTRACT,:ROUND,
                              :FLING,:CHARGEBEAM,:BRUTALSWING,:EXPLOSION,
                              :ROCKPOLISH,TONEEDGE,:VOLTSWITCH,:GYROBALL,
                              :BULLDOZE,:ROCKSLIDE,WAGGER,LEEPTALK,
                              UBSTITUTE,:NATUREPOWER,:CONFIDE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "possibleEggMoves"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[:AUTOTOMIZE,:BLOCK,:COUNTER,:CURSE,:ENDURE,:FLAIL,
                              :MAGNETRISE,:ROCKCLIMB,CREECH,:WIDEGUARD]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:GRAVELER,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,:ELECTRIC) if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 110.0 if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              if getID(PBAbilities,:GALVANIZE)==nil
                              next [[getID(PBAbilities,:MAGNETPULL),0],
                              [getID(PBAbilities,TURDY),1]]
                              end
                              next [[getID(PBAbilities,:MAGNETPULL),0],
                              [getID(PBAbilities,TURDY),1],
                              [getID(PBAbilities,:GALVANIZE),2]]
                              end
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,:TACKLE],[1,:DEFENSECURL],[1,:CHARGE],[1,:ROCKPOLISH],
                              [4,:CHARGE],[6,:ROCKPOLISH],[10,:ROLLOUT],[12,PARK],
                              [16,:ROCKTHROW],[18,MACKDOWN],[22,:THUNDERPUNCH],
                              [24,ELFDESTRUCT],[30,TEALTHROCK],[34,:ROCKBLAST],
                              [40,:DISCHARGE],[44,:EXPLOSION],[50,:DOUBLEEDGE],
                              [54,TONEEDGE]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :TOXIC,:HIDDENPOWER,UNNYDAY,ROTECT,MACKDOWN,
                              :THUNDERBOLT,:THUNDER,:EARTHQUAKE,:RETURN,:BRICKBREAK,
                              :DOUBLETEAM,:FLAMETHROWER,ANDSTORM,:FIREBLAST,
                              :ROCKTOMB,:FACADE,:REST,:ATTRACT,:ROUND,
                              :FLING,:CHARGEBEAM,:BRUTALSWING,:EXPLOSION,
                              :ROCKPOLISH,TONEEDGE,:VOLTSWITCH,:GYROBALL,
                              :BULLDOZE,:ROCKSLIDE,WAGGER,LEEPTALK,
                              UBSTITUTE,:NATUREPOWER,:CONFIDE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:GOLEM,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,:ELECTRIC) if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 110.0 if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              if getID(PBAbilities,:GALVANIZE)==nil
                              next [[getID(PBAbilities,:MAGNETPULL),0],
                              [getID(PBAbilities,TURDY),1]]
                              end
                              next [[getID(PBAbilities,:MAGNETPULL),0],
                              [getID(PBAbilities,TURDY),1],
                              [getID(PBAbilities,:GALVANIZE),2]]
                              end
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,:HEAVYSLAM],[1,:TACKLE],[1,:DEFENSECURL],[1,:CHARGE],
                              [1,:ROCKPOLISH],[4,:CHARGE],[6,:ROCKPOLISH],
                              [10,TEAMROLLER],[12,PARK],[16,:ROCKTHROW],
                              [18,MACKDOWN],[22,:THUNDERPUNCH],[24,ELFDESTRUCT],
                              [30,TEALTHROCK],[34,:ROCKBLAST],[40,:DISCHARGE],
                              [44,:EXPLOSION],[50,:DOUBLEEDGE],[54,TONEEDGE],
                              [60,:HEAVYSLAM]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :TOXIC,:HIDDENPOWER,UNNYDAY,ROTECT,MACKDOWN,
                              :THUNDERBOLT,:THUNDER,:EARTHQUAKE,:RETURN,:BRICKBREAK,
                              :DOUBLETEAM,:FLAMETHROWER,ANDSTORM,:FIREBLAST,
                              :ROCKTOMB,:FACADE,:REST,:ATTRACT,:ROUND,
                              :FLING,:CHARGEBEAM,:BRUTALSWING,:EXPLOSION,
                              :ROCKPOLISH,TONEEDGE,:VOLTSWITCH,:GYROBALL,
                              :BULLDOZE,:ROCKSLIDE,WAGGER,LEEPTALK,
                              UBSTITUTE,:NATUREPOWER,:CONFIDE,:ROAR,:HYPERBEAM,
                              :FRUSTRATION,:ECHOEDVOICE,:FOCUSBLAST,:GIGAIMPACT,
                              :WILDCHARGE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:GRIMER,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,:DARK) if pokemon.isDelta?
                              next
                              },
                              "height"=>proc{|pokemon|
                              next 0.7 if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 42.0 if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              if getID(PBAbilities,OWEROFALCHEMY)==nil
                              if getID(PBAbilities,:RECEIVER)==nil
                              next [[getID(PBAbilities,OISONTOUCH),0],
                              [getID(PBAbilities,:GLUTTONY),1]]
                              end
                              next [[getID(PBAbilities,OISONTOUCH),0],
                              [getID(PBAbilities,:GLUTTONY),1],
                              [getID(PBAbilities,:RECEIVER),2]]
                              end
                              next [[getID(PBAbilities,OISONTOUCH),0],
                              [getID(PBAbilities,:GLUTTONY),1],
                              [getID(PBAbilities,OWEROFALCHEMY),2]]
                              end
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,OUND],[1,OISONGAS],[4,:HARDEN],[7,:BITE],[12,:DISABLE],
                              [15,:ACIDSPRAY],[18,OISONFANG],[21,:MINIMIZE],[26,:FLING],
                              [29,:KNOCKOFF],[32,:CRUNCH],[37,CREECH],[40,:GUNKSHOT],
                              [43,:ACIDARMOR],[46,:BELCH],[48,:MEMENTO]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :TOXIC,:VENOSHOCK,:HIDDENPOWER,UNNYDAY,:TAUNT,
                              ROTECT,:RAINDANCE,:FRUSTRATION,:RETURN,HADOWBALL,
                              :DOUBLETEAM,LUDGEWAVE,:FLAMETHROWER,LUDGEBOMB,
                              :FIREBLAST,:ROCKTOMB,:TORMENT,:FACADE,:REST,:ATTRACT,
                              :THIEF,:ROUND,:FLING,:BRUTALSWING,:QUASH,:EMBARGO,
                              :EXPLOSION,AYBACK,:ROCKPOLISH,TONEEDGE,:INFESTATION,
                              OISONJAB,WAGGER,LEEPTALK,UBSTITUTE,NARL,:CONFIDE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "possibleEggMoves"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[:ASSURANCE,:CLEARSMOG,:CURSE,:IMPRISION,:MEANLOOK,URSUIT,
                              CARYFACE,HADOWSNEAK,PITE,TOCKPILE,PITUP,WALLOW]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:MUK,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,:DARK) if pokemon.isDelta?
                              next
                              },
                              "height"=>proc{|pokemon|
                              next 1.0 if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 52.0 if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              if getID(PBAbilities,OWEROFALCHEMY)==nil
                              if getID(PBAbilities,:RECEIVER)==nil
                              next [[getID(PBAbilities,OISONTOUCH),0],
                              [getID(PBAbilities,:GLUTTONY),1]]
                              end
                              next [[getID(PBAbilities,OISONTOUCH),0],
                              [getID(PBAbilities,:GLUTTONY),1],
                              [getID(PBAbilities,:RECEIVER),2]]
                              end
                              next [[getID(PBAbilities,OISONTOUCH),0],
                              [getID(PBAbilities,:GLUTTONY),1],
                              [getID(PBAbilities,OWEROFALCHEMY),2]]
                              end
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,:VENOMDRENCH],[1,OUND],[1,OISONGAS],[1,:HARDEN],
                              [1,:BITE],[4,:HARDEN],[7,:BITE],[12,:DISABLE],
                              [15,:ACIDSPRAY],[18,OISONFANG],[21,:MINIMIZE],[26,:FLING],
                              [29,:KNOCKOFF],[32,:CRUNCH],[37,CREECH],[40,:GUNKSHOT],
                              [46,:ACIDARMOR],[52,:BELCH],[57,:MEMENTO]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :TOXIC,:VENOSHOCK,:HIDDENPOWER,UNNYDAY,:TAUNT,
                              ROTECT,:RAINDANCE,:FRUSTRATION,:RETURN,HADOWBALL,
                              :DOUBLETEAM,LUDGEWAVE,:FLAMETHROWER,LUDGEBOMB,
                              :FIREBLAST,:ROCKTOMB,:TORMENT,:FACADE,:REST,:ATTRACT,
                              :THIEF,:ROUND,:FLING,:BRUTALSWING,:QUASH,:EMBARGO,
                              :EXPLOSION,AYBACK,:ROCKPOLISH,TONEEDGE,:INFESTATION,
                              OISONJAB,WAGGER,LEEPTALK,UBSTITUTE,NARL,
                              :CONFIDE,:HYPERBEAM,:BRICKBREAK,:FOCUSBLAST,
                              :GIGAIMPACT,:DARKPULSE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:EXEGGUTOR,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,:DRAGON) if pokemon.isDelta?
                              next
                              },
                              "height"=>proc{|pokemon|
                              next 10.9 if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 415.6 if pokemon.isDelta?
                              next
                              },
                              "getBaseStats"=>proc{|pokemon|
                              next [95,105,85,45,125,75] if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              next [[getID(PBAbilities,:FRISK),0],
                              [getID(PBAbilities,:HARVEST),2]]
                              end
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,:DRAGONHAMMER],[1,EEDBOMB],[1,:BARRAGE],[1,:HYPNOSIS],
                              [1,:CONFUSION],[17,SYSHOCK],[27,:EGGBOMB],[37,:WOODHAMMER],
                              [47,:LEAFSTORM]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1])
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              SYSHOCK,:TOXIC,:HIDDENPOWER,UNNYDAY,:HYPERBEAM,
                              :LIGHTSCREEN,ROTECT,:FRUSTRATION,OLARBEAM,:EARTHQUAKE,
                              :RETURN,SYCHIC,:BRICKBREAK,:DOUBLETEAM,:REFLECT,
                              :FLAMETHROWER,LUDGEBOMB,:FACADE,:REST,:ATTRACT,
                              :THIEF,:ROUND,:ENERGYBALL,:BRUTALSWING,:EXPLOSION,
                              :GIGAIMPACT,WORDSDANCE,SYCHUP,:BULLDOZE,:DRAGONTAIL,
                              :INFESTATION,:DREAMEATER,:GRASSKNOT,WAGGER,LEEPTALK,
                              UBSTITUTE,:TRICKEROOM,:NATUREPOWER,:CONFIDE,:DRACOMETEOR]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              MultipleForms.register(:MAROWAK,{
                              "getFormName"=>proc{|pokemon|
                              next _INTL("Alola Form") if pokemon.isDelta?
                              next
                              },
                              "type1"=>proc{|pokemon|
                              next getID(PBTypes,:FIRE) if pokemon.isDelta?
                              next
                              },
                              "type2"=>proc{|pokemon|
                              next getID(PBTypes,:GHOST) if pokemon.isDelta?
                              next
                              },
                              "weight"=>proc{|pokemon|
                              next 34.0 if pokemon.isDelta?
                              next
                              },
                              "getAbilityList"=>proc{|pokemon|
                              if pokemon.isDelta?
                              next [[getID(PBAbilities,:CURSEDBODY),0],
                              [getID(PBAbilities,:LIGHTNINGROD),1],
                              [getID(PBAbilities,:ROCKHEAD),2]]
                              end
                              next
                              },
                              "getMoveList"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[]
                              if pokemon.isDelta?
                              movelist=[[1,:GROWL],[1,:TAILWHIP],[1,:BONECLUB],[1,:FLAMEWHEEL],
                              [3,:TAILWHIP],[7,:BONECLUB],[11,:FLAMEWHEEL],[13,:LEER],
                              [17,:HEX],[21,:BONEMERANG],[23,:WILLOWISP],[27,HADOWBONE],
                              [33,:THRASH],[37,:FLING],[43,TOMPINGTANTRUM],[49,:ENDEAVOR],
                              [53,:FLAREBLITZ],[59,:RETALIATE],[65,:BONERUSH]]
                              end
                              for i in movelist
                              i[1]=getConst(PBMoves,i[1])
                              end
                              next movelist
                              },
                              "getMoveCompatibility"=>proc{|pokemon|
                              next if !pokemon.isDelta?
                              movelist=[# TMs
                              :TOXIC,:HIDDENPOWER,UNNYDAY,:ICEBEAM,:BLIZZARD,:HYPERBEAM,
                              ROTECT,:RAINDANCE,:FRUSTRATION,MACKDOWN,:THUNDERBOLT,
                              :THUNDER,:EARTHQUAKE,:RETURN,HADOWBALL,:BRICKBREAK,:DOUBLETEAM,
                              :FLAMETHROWER,ANDSTORM,:FIREBLAST,:ROCKTOMB,:AERIALACE,:FACADE,
                              :FLAMECHARGE,:REST,:ATTRACT,:THIEF,:ROUND,:ECHOEDVOICE,
                              :FOCUSBLAST,:FALSESWIPE,:FLING,:BRUTALSWING,:WILLOWISP,
                              :GIGAIMPACT,TONEEDGE,WORDSDANCE,:BULLDOZE,:ROCKSLIDE,
                              :DREAMEATER,WAGGER,LEEPTALK,UBSTITUTE,:DARKPULSE,
                              :CONFIDE]
                              for i in 0...movelist.length
                              movelist[i]=getConst(PBMoves,movelist[i]) if getConst(PBMoves,movelist[i])!=nil
                              end
                              next movelist
                              },
                              "onSetForm"=>proc{|pokemon,form|
                              pbSeenForm(pokemon)
                              }
                              })

                              ###################################################################
                              # EXAMPLE ENCOUNTER MODIFIER
                              # This makes Exeggutor that are created on a particular map
                              # become Alolan Exeggutor automatically.
                              # Evolving Exeggcute on this map will not make them become Alolan
                              # Exeggutor. Only wild Exeggutor.
                              # "pokemon.makeDelta" is how to make the Pokemon a Delta/Alolan
                              ###################################################################
                              Events.onWildPokemonCreate+=proc {|sender,e|
                              pokemon=e[0]
                              maps=[81,83,84,85,86] # Map IDs for delta form
                              if $game_map && maps.include?($game_map.map_id)
                              pokemon.makeDelta
                              end
                              }

                              ###################################################################
                              # EXAMPLE RANDOM SPAWNER MODIFIER
                              # This makes Delta/Alolan Pokemon spawn randomly, at the same rate
                              # as Shiny Pokemon do
                              # Note that this method doesn't allow for Shiny Delta/Alolan
                              # Pokemon, as the possible numbers for it don't overlap.
                              # Note also that this does not make a Delta for every species.
                              # If a species doesn't have a Delta/Alolan Form defined, than
                              # this function is meaningless.
                              ###################################################################
                              # class PokeBattle_Pokemon
                              # def isDelta?
                              # return @deltaflag if @deltaflag!=nil
                              # [email protected]^@trainerID
                              # b=a&0xFFFF
                              # c=(a>>16)&0xFFFF
                              # d=b^c
                              # return (d>65536-SHINYPOKEMONCHANCE)
                              # end
                              # end
                              __________________
                              Currently working on 2 projects.
                              Chromia (banner to be added)
                              Mirror (banner to be added)
                              Reply With Quote
                                #90    
                              Old October 4th, 2017 (2:08 AM).
                              Tea-Rex's Avatar
                              Tea-Rex Tea-Rex is offline
                                 
                                Join Date: Oct 2016
                                Location: Australia
                                Gender: Male
                                Nature: Modest
                                Posts: 27
                                I've come across a problem with trying to mega evolve my non-delta pokemon. Whenever I add in details for a delta pokemon that has a non-delta mega evolution it prevents the popup for allowing the player to activate mega evolution. I've set out my pokemon just like the mega Steelix example and I've looked over my script 17 times and I don't see any problems with it. Does anyone else experience this and if so do you know how to fix it?
                                Reply With Quote
                                  #91    
                                Old October 4th, 2017 (5:15 PM).
                                komaoto's Avatar
                                komaoto komaoto is online now
                                   
                                  Join Date: Mar 2014
                                  Location: Brazil
                                  Gender: Male
                                  Posts: 90
                                  Quote:
                                  Originally Posted by Tea-Rex View Post
                                  I've come across a problem with trying to mega evolve my non-delta pokemon. Whenever I add in details for a delta pokemon that has a non-delta mega evolution it prevents the popup for allowing the player to activate mega evolution. I've set out my pokemon just like the mega Steelix example and I've looked over my script 17 times and I don't see any problems with it. Does anyone else experience this and if so do you know how to fix it?
                                  If you're using 17.1, there's no need to use this script due to pokemonforms PBS.
                                  Reply With Quote
                                    #92    
                                  Old October 5th, 2017 (3:09 PM).
                                  Tea-Rex's Avatar
                                  Tea-Rex Tea-Rex is offline
                                     
                                    Join Date: Oct 2016
                                    Location: Australia
                                    Gender: Male
                                    Nature: Modest
                                    Posts: 27
                                    Quote:
                                    Originally Posted by komaoto View Post
                                    If you're using 17.1, there's no need to use this script due to pokemonforms PBS.
                                    Oh wow. Never realised that there was an update to essentials. I feel like an idiot XD. Thanks
                                    Reply With Quote
                                      #93    
                                    Old 2 Weeks Ago (12:05 PM).
                                    Bluephoenix97x Bluephoenix97x is online now
                                       
                                      Join Date: Aug 2015
                                      Gender: Male
                                      Posts: 29
                                      I'm using the most recent version of Pokemon Essentials, is there any changes that I would have to make to have this function properly. Also, I'll be using a different name than Delta or Alolan... What changes would I have to make to give it my own title?...
                                      __________________
                                      http://pokemon-mindxmatter.wikia.com/wiki/Pokemon_MindXMatter_Wikia
                                      Reply With Quote
                                        #94    
                                      Old 2 Weeks Ago (12:06 PM). Edited 2 Weeks Ago by AndromedaKerova.
                                      AndromedaKerova AndromedaKerova is offline
                                         
                                        Join Date: Aug 2015
                                        Gender: Female
                                        Nature: Sassy
                                        Posts: 32
                                        In the pokemonforms pbs.

                                        Vanilla Pokemon form info:
                                        #-------------------------------
                                        [GENESECT-4]
                                        FormName=Douse Drive

                                        What I did:
                                        #-------------------------------
                                        [GARDEVOIR-2]
                                        FormName=Banshee

                                        It works fine. Shows up as Banshee in the forms part of the pokedex alongside the male and female options. :D
                                        Hope that helps.
                                        __________________
                                        Currently working on 2 projects.
                                        Chromia (banner to be added)
                                        Mirror (banner to be added)
                                        Reply With Quote
                                          #95    
                                        Old 2 Weeks Ago (12:39 PM).
                                        Bluephoenix97x Bluephoenix97x is online now
                                           
                                          Join Date: Aug 2015
                                          Gender: Male
                                          Posts: 29
                                          Quote:
                                          Originally Posted by AndromedaKerova View Post
                                          In the pokemonforms pbs.

                                          Vanilla Pokemon form info:
                                          #-------------------------------
                                          [GENESECT-4]
                                          FormName=Douse Drive

                                          What I did:
                                          #-------------------------------
                                          [GARDEVOIR-2]
                                          FormName=Banshee

                                          It works fine. Shows up as Banshee in the forms part of the pokedex alongside the male and female options. :D
                                          Hope that helps.
                                          So, does this work in tandem with Rot8er's script or is the script still needed at all?
                                          __________________
                                          http://pokemon-mindxmatter.wikia.com/wiki/Pokemon_MindXMatter_Wikia
                                          Reply With Quote
                                            #96    
                                          Old 2 Weeks Ago (12:46 PM).
                                          AndromedaKerova AndromedaKerova is offline
                                             
                                            Join Date: Aug 2015
                                            Gender: Female
                                            Nature: Sassy
                                            Posts: 32
                                            Quote:
                                            Originally Posted by Bluephoenix97x View Post
                                            So, does this work in tandem with Rot8er's script or is the script still needed at all?
                                            If you're using the latest version of essentials, 17.x, the delta/alolan forms scripts will NOT work.
                                            Far as we've seen in earlier posts, its functions were designed for 16.2 and previous. 17.x makes these scripts no longer needed. The functions are part of the base 17.x.
                                            __________________
                                            Currently working on 2 projects.
                                            Chromia (banner to be added)
                                            Mirror (banner to be added)
                                            Reply With Quote
                                              #97    
                                            Old 2 Weeks Ago (12:52 PM).
                                            Bluephoenix97x Bluephoenix97x is online now
                                               
                                              Join Date: Aug 2015
                                              Gender: Male
                                              Posts: 29
                                              Where can I find said functions?
                                              __________________
                                              http://pokemon-mindxmatter.wikia.com/wiki/Pokemon_MindXMatter_Wikia
                                              Reply With Quote
                                                #98    
                                              Old 2 Weeks Ago (12:57 PM).
                                              AndromedaKerova AndromedaKerova is offline
                                                 
                                                Join Date: Aug 2015
                                                Gender: Female
                                                Nature: Sassy
                                                Posts: 32
                                                Quote:
                                                Originally Posted by Bluephoenix97x View Post
                                                Where can I find said functions?
                                                Literally as I said. The pokemonforms file in the PBS folder.
                                                To define new forms, the number in the name indicates the sprite to be used. The vanilla shows genesect using _4 for the douse drive form and _2 for my gardevoir form.
                                                The other data in the pokemonforms file needs defining such as the forms move sets if any are different from its base form, stat changes, evo methods ect.

                                                Have a look in the pokemonforms file to see how some thing like that are listed.

                                                Not sure if the wiki page for forms has been updated yet.
                                                __________________
                                                Currently working on 2 projects.
                                                Chromia (banner to be added)
                                                Mirror (banner to be added)
                                                Reply With Quote
                                                  #99    
                                                Old 1 Week Ago (2:55 PM).
                                                BwAetherTrainer284's Avatar
                                                BwAetherTrainer284 BwAetherTrainer284 is offline
                                                   
                                                  Join Date: Jun 2017
                                                  Location: Ecuador
                                                  Gender: Male
                                                  Nature: Adamant
                                                  Posts: 2
                                                  I tried this script in version 1.6.2 of the Pokémon Essentials, but when I start the project it gives me this error:

                                                  Code:
                                                  ???? 'Delta_Alola_Forms' ? 301 ??? SyntaxError ??????
                                                  What should I do to avoid this error?
                                                  Reply With Quote
                                                  Reply

                                                  Quick Reply

                                                  Join the conversation!

                                                  Create an account to post a reply in this thread, participate in other discussions, and more!

                                                  Create a PokéCommunity Account

                                                  Sponsored Links
                                                  Thread Tools

                                                  Posting Rules
                                                  You may not post new threads
                                                  You may not post replies
                                                  You may not post attachments
                                                  You may not edit your posts

                                                  BB code is On
                                                  Smilies are On
                                                  [IMG] code is On
                                                  HTML code is Off

                                                  Forum Jump


                                                  All times are GMT -8. The time now is 2:49 PM.