• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Player Classes

35
Posts
9
Years
    • Seen Sep 17, 2015
    Is it possible to give players the option to choose between different classes. I wanna add a more rpg aspect the gives the player more options like starting money and what not, like picking ace trainer, breeder, etc. Any help?
     
    35
    Posts
    9
    Years
    • Seen Sep 17, 2015
    No that's not what I meant. I'm talking about having different classes and such similar to d&d. Like they can choose to be an ace trainer or breeder and depending upon what the choose different things happen like ace trainers have a better chance of catching pokemon and breeders don't take so long to hatch eggs. Also would like to incorporate skills and skill trees
     
    95
    Posts
    9
    Years
    • Seen Jun 18, 2016
    No that's not what I meant. I'm talking about having different classes and such similar to d&d. Like they can choose to be an ace trainer or breeder and depending upon what the choose different things happen like ace trainers have a better chance of catching pokemon and breeders don't take so long to hatch eggs. Also would like to incorporate skills and skill trees

    Oh, yeah, i understand. You want to ask the player in the intro which trainer class do they want to be and give them special properties...

    I think that you can do it with switches. For example, in the daycare script, check if the switch X (the breeder switch, which would activate in the intro when you select Pokémon Breeder) is on. If it's on, then the steps to hatch an egg would be half. If it's not on, then the steps would be the normal steps of the Pokémon.

    I don't know, this is just something i have improvised (i have no idea how the daycare script works), but i think it would be something like that.

    Sorry, i can't help you more =(
     
    35
    Posts
    9
    Years
    • Seen Sep 17, 2015
    Can you give me an example of how to do that. Idk how to include the switches into the script
     
    1,224
    Posts
    10
    Years
  • Can you give me an example of how to do that. Idk how to include the switches into the script

    it would just be like
    Code:
    if $game_switches[99] # where it's switch 99, and this is saying that switch 99 is true/on
    then you would put the rest of your code. You would have to plan exactly what you wanted the classes to do that though, otherwise we can't really tell you where or what you could put.
     
    35
    Posts
    9
    Years
    • Seen Sep 17, 2015
    I wanna add a switch that when it's on hatching eggs take half as long or makes all pokemon hatch rates equal the same generic number
     
    1,224
    Posts
    10
    Years
  • Find this
    Code:
    Events.onStepTaken+=proc {|sender,e|
       next if !$Trainer
       deposited=pbDayCareDeposited
       if deposited==2 && $PokemonGlobal.daycareEgg==0
         $PokemonGlobal.daycareEggSteps=0 if !$PokemonGlobal.daycareEggSteps
         $PokemonGlobal.daycareEggSteps+=1
         if $PokemonGlobal.daycareEggSteps==256
           $PokemonGlobal.daycareEggSteps=0
           compatval=[0,20,50,70][pbDayCareGetCompat]
           if hasConst?(PBItems,:OVALCHARM) && $PokemonBag.pbQuantity(PBItems::OVALCHARM)>0
             compatval=[0,40,80,88][pbDayCareGetCompat]
           end
           rnd=rand(100)
           if rnd<compatval
             # Egg is generated
             $PokemonGlobal.daycareEgg=1
           end
         end
       end
       for i in 0...2
         pkmn=$PokemonGlobal.daycare[i][0]
         next if !pkmn
         maxexp=PBExperience.pbGetMaxExperience(pkmn.growthrate)
         if pkmn.exp<maxexp
           oldlevel=pkmn.level
           pkmn.exp+=1
           if pkmn.level!=oldlevel
             pkmn.calcStats
             movelist=pkmn.getMoveList
             for i in movelist
               pkmn.pbLearnMove(i[1]) if i[0]==pkmn.level       # Learned a new move
             end
           end
         end
       end
       for egg in $Trainer.party
         if egg.eggsteps>0
           egg.eggsteps-=1
           [COLOR="Red"]egg.eggsteps-=1 if $game_switches[XX] #replace XX with whatever switch[/COLOR]
           for i in $Trainer.party
             if !i.egg? && (isConst?(i.ability,PBAbilities,:FLAMEBODY) ||
                            isConst?(i.ability,PBAbilities,:MAGMAARMOR))
               egg.eggsteps-=1
               break
             end
           end
           if egg.eggsteps<=0
             egg.eggsteps=0
             pbHatch(egg)
           end
         end
       end
    }
    add the red part.
     
    35
    Posts
    9
    Years
    • Seen Sep 17, 2015
    Awesome thanks so much. What about a switch for modified capture rate. Like they get capture specialist so it halves the capture rate
     
    1,224
    Posts
    10
    Years
  • find this
    Code:
    def pbThrowPokeBall(idxPokemon,ball,rareness=nil)
        itemname=PBItems.getName(ball)
        battler=nil
        if pbIsOpposing?(idxPokemon)
          battler=self.battlers[idxPokemon]
        else
          battler=self.battlers[idxPokemon].pbOppositeOpposing
        end
        if battler.hp<=0
          battler=battler.pbPartner
        end
        pbDisplayBrief(_INTL("{1} threw one {2}!",self.pbPlayer.name,itemname))
        if battler.hp<=0
          pbDisplay(_INTL("But there was no target..."))
          return
        end
        if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
          @scene.pbThrowAndDeflect(ball,1)
          pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
        else
          pokemon=battler.pokemon
          species=pokemon.species
          if $DEBUG && Input.press?(Input::CTRL)
            shakes=4
          else
            if !rareness
              dexdata=pbOpenDexData
              pbDexDataOffset(dexdata,species,16)
              rareness=dexdata.fgetb # Get rareness from dexdata file
              dexdata.close
            end
            a=battler.totalhp
            b=battler.hp
            rareness=BallHandlers.modifyCatchRate(ball,rareness,self,battler)
            x=(((a*3-b*2)*rareness)/(a*3)).floor
            [COLOR="Red"]x*=2 if $game_switches[XX] #Where XX is the switch number[/COLOR]
            if battler.status==PBStatuses::SLEEP || battler.status==PBStatuses::FROZEN
              x*=2
            elsif battler.status!=0
              x=(x*3/2).floor
            end
            shakes=0
            if x>255 || BallHandlers.isUnconditional?(ball,self,battler)
              shakes=4
            else
              x=1 if x==0
              y = 0x000FFFF0 / (Math.sqrt(Math.sqrt( 0x00FF0000/x ) ) )
              shakes+=1 if pbRandom(65536)<y
              shakes+=1 if pbRandom(65536)<y
              shakes+=1 if pbRandom(65536)<y
              shakes+=1 if pbRandom(65536)<y 
            end
          end
          @scene.pbThrow(ball,shakes,battler.index)
          case shakes
            when 0
              pbDisplay(_INTL("Oh no!  The Pokémon broke free!"))
            when 1
              pbDisplay(_INTL("Aww... It appeared to be caught!"))
            when 2
              pbDisplay(_INTL("Aargh!  Almost had it!"))
            when 3
              pbDisplay(_INTL("Shoot!  It was so close, too!"))
            when 4
              pbDisplayBrief(_INTL("Gotcha!  {1} was caught!",pokemon.name))
              @scene.pbThrowSuccess
              if pbIsSnagBall?(ball) && @opponent
                pbRemoveFromParty(battler.index,battler.pokemonIndex)
                battler.pbReset
                battler.participants=[]
              else
                @decision=4
              end
              if pbIsSnagBall?(ball)
                pokemon.ot=self.pbPlayer.name
                pokemon.trainerID=self.pbPlayer.id
              end
              BallHandlers.onCatch(ball,self,pokemon)
              pokemon.ballused=pbGetBallType(ball)
              if !self.pbPlayer.owned[species]
                self.pbPlayer.owned[species]=true
                if $Trainer.pokedex
                  pbDisplayPaused(_INTL("{1}'s data was added to the Pokédex.",pokemon.name))
                  @scene.pbShowPokedex(species)
                end
              end
              @scene.pbHideCaptureBall
              if pbIsSnagBall?(ball) && @opponent
                pokemon.pbUpdateShadowMoves rescue nil
                @snaggedpokemon.push(pokemon)
              else
                pbStorePokemon(pokemon)
              end
          end
        end
      end
    end
    add the red part, I'm pretty sure this will work.
     
    35
    Posts
    9
    Years
    • Seen Sep 17, 2015
    Mej71 you are my savior thanks so much for your help. I'll add them in and let you know if they work
     
    35
    Posts
    9
    Years
    • Seen Sep 17, 2015
    One last one for tonight. Ace trainer which will give a boost to exp gain for all your pokemon
     
    1,224
    Posts
    10
    Years
  • find this add the red part
    Code:
    exp=(exp*3/2).floor if isConst?(thispoke.item,PBItems,:LUCKYEGG) ||
                                         isConst?(thispoke.itemInitial,PBItems,:LUCKYEGG)
                  [COLOR="Red"]exp=(exp*3/2).floor if $game_switches[XX] #switch number[/COLOR]
                  growthrate=thispoke.growthrate
     
    Back
    Top