• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Setting forms for wild Pokémon

KID VEGITO

Charmareian
  • 3
    Posts
    10
    Years
    • Seen Oct 15, 2015
    Hi I need help with Pokemon Essentials scripting. How do you script a wild pokemon event to be in a different form. Ex) A wild battle event with Black Kyurem or shaymin in its second form in a wild battle.
     
    In Pokemon_MultipleForms you can add the following (in red) to the script:
    Code:
    MultipleForms.register(:SHAYMIN,{
    [COLOR=Red]"getFormOnCreation"=>proc{|pokemon|
       next 1
    },
    [/COLOR]"type2"=>proc{|pokemon|
       next if pokemon.form==0     # Land Forme
       next getID(PBTypes,:FLYING) # Sky Forme
    },
    "ability"=>proc{|pokemon|
       next if pokemon.form==0              # Land Forme
       next getID(PBAbilities,:SERENEGRACE) # Sky Forme
    },
    "weight"=>proc{|pokemon|
       next if pokemon.form==0 # Land Forme
       next 52                 # Sky Forme
    },
    "getBaseStats"=>proc{|pokemon|
       next if pokemon.form==0      # Land Forme
       next [100,103,75,127,120,75] # Sky Forme
    },
    "evYield"=>proc{|pokemon|
       next if pokemon.form==0 # Land Forme
       next [0,0,0,3,0,0]      # Sky Forme
    },
    "getForm"=>proc{|pokemon|
       next 0 if PBDayNight.isNight?(pbGetTimeNow) ||
                 pokemon.hp<=0 || pokemon.status==PBStatuses::FROZEN
       next nil
    },
    "getMoveList"=>proc{|pokemon|
       next if pokemon.form==0
       movelist=[]
       case pokemon.form
       when 1; movelist=[[1,:GROWTH],[10,:MAGICALLEAF],[19,:LEECHSEED],
                         [28,:QUICKATTACK],[37,:SWEETSCENT],[46,:NATURALGIFT],
                         [55,:WORRYSEED],[64,:AIRSLASH],[73,:ENERGYBALL],
                         [82,:SWEETKISS],[91,:LEAFSTORM],[100,:SEEDFLARE]]
       end
       for i in movelist
         i[1]=getConst(PBMoves,i[1])
       end
       next movelist
    },
    "onSetForm"=>proc{|pokemon,form|
       pbSeenForm(pokemon)
    }
    })
    This particular code ensures the Shaymin you encounter will be in its Sky Forme.
     
    A better way is to use a switch and an encounter modifier.

    Code:
    Events.onWildPokemonCreate+=proc {|sender,e|
       pokemon=e[0]
       if $game_switches[XX] #Where XX is whatever switch ID you use
         pokemon.form=1
       end
    }
     
    Back
    Top