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.


Reply
 
Thread Tools
  #1    
Old June 25th, 2017 (4:13 PM). Edited August 18th, 2017 by Vendily.
Vendily's Avatar
Vendily Vendily is online now
     
    Join Date: Aug 2015
    Gender: Female
    Nature: Calm
    Posts: 736
    This is a modification of the Fishing system to add in Consecutive Fishing to v16.2.
    Consecutive fishing just allows you to get a slightly higher chance of getting a shiny pokemon if you manage to chain hooking pokemon (not battle/catch, just hook it). The default maximum streak is 20, meaning 40 more attempts at getting a shiny pokemon, but you can change that with the constant FISHINGMAXSTREAK. It also increases the chance of a bite if your bobber is surrounded by impassible tiles.
    Spoiler: Script
    Lines with #edit are newly added. Methods and classes with edit are completely new. Just makes it easier to add if you don't have a clean v16.2, or want to port it or whatever.
    Code:
    class PokemonTemp #edit
      attr_accessor :fishingSpot
      attr_accessor :fishingStreak
    end
    FISHINGMAXSTREAK	   = 20 #edit
     
    def pbFishing(hasencounter,rodtype=1)
      speedup=($Trainer.firstParty && !$Trainer.firstParty.isEgg? &&
    	 (isConst?($Trainer.firstParty.ability,PBAbilities,:STICKYHOLD) ||
    	 isConst?($Trainer.firstParty.ability,PBAbilities,:SUCTIONCUPS)))
      bitechance=20+(25*rodtype)   # 45, 70, 95
      bitechance*=1.00+(0.33*checkBordering) #edit (I don't have the exact numbers)
      bitechance=100 if checkBordering == 3 #edit
      bitechance*=1.5 if speedup
      hookchance=100
      oldpattern=$game_player.fullPattern
      currentSpot=[$game_map.map_id,$game_player.x,$game_player.y,$game_player.direction] #edit
      if !$PokemonTemp.fishingSpot || $PokemonTemp.fishingSpot != currentSpot #edit
    	$PokemonTemp.fishingSpot=currentSpot #edit
    	$PokemonTemp.fishingStreak=0 #edit
      end #edit
      pbFishingBegin
      msgwindow=Kernel.pbCreateMessageWindow
      loop do
    	time=2+rand(10)
    	time=[time,2+rand(10)].min if speedup
    	message=""
    	time.times do
    	  message+=". "
    	end
    	if pbWaitMessage(msgwindow,time)
    	  pbFishingEnd
    	  $game_player.setDefaultCharName(nil,oldpattern)
    	  Kernel.pbMessageDisplay(msgwindow,_INTL("Not even a nibble..."))
    	  Kernel.pbDisposeMessageWindow(msgwindow)
    	  $PokemonTemp.fishingStreak=0 #edit
    	  return false
    	end
    	if (rand(100)0
        for i in 0...(2*$PokemonTemp.fishingStreak)
          break if wildpoke.isShiny?
          wildpoke.personalID=rand(65536)|(rand(65536)<<16)
        end
      end
      return wildpoke
    end
    __________________
    Resources for ROM hackers has moved.

    Reply With Quote

    Relevant Advertising!

      #2    
    Old July 1st, 2017 (4:05 AM).
    pokemonequality pokemonequality is offline
       
      Join Date: Jan 2017
      Gender: Male
      Posts: 20
      Thank you!! I was looking for a script like this! I just tested it and it works really nice!
      Reply With Quote
        #3    
      Old August 18th, 2017 (11:56 AM).
      bartyboy6's Avatar
      bartyboy6 bartyboy6 is offline
         
        Join Date: Sep 2010
        Gender: Male
        Posts: 59
        I installed it together with Elite Battle system and it gives me this error whenever I encounter a wild Pokemon:
        ---------------------------
        Pokemon Essentials
        ---------------------------
        Exception: NoMethodError

        Message: undefined method `>' for nil:NilClass

        Consecutive Fishing:101:in `pbGenerateWildPokemon'

        PField_Field:895:in `pbWildBattle_ebs'

        EliteBattle_EntryAnimations:248:in `pbWildBattle'

        PField_Field:1374:in `pbBattleOnStepTaken'

        PField_Field:1398:in `pbOnStepTaken'

        Game_Player:484:in `update_old'

        Walk_Run:76:in `update'

        Scene_Map:104:in `update'

        Scene_Map:101:in `loop'

        Scene_Map:114:in `update'



        This exception was logged in

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

        Press Ctrl+C to copy this message to the clipboard.
        ---------------------------
        OK
        ---------------------------
        Reply With Quote
          #4    
        Old August 18th, 2017 (5:51 PM).
        Vendily's Avatar
        Vendily Vendily is online now
           
          Join Date: Aug 2015
          Gender: Female
          Nature: Calm
          Posts: 736
          Quote:
          Originally Posted by bartyboy6 View Post
          I installed it together with Elite Battle system and it gives me this error whenever I encounter a wild Pokemon: [---snip---}

          I am so sorry, I know exactly what caused this.

          Replace the old def pbGenerateWildPokemon with this new one.
          Code:
          def pbGenerateWildPokemon(*args) # Do the generating #edit
            wildpoke=_fishing_pbGenerateWildPokemon(*args)
            if $PokemonTemp.fishingStreak && $PokemonTemp.fishingStreak>0
              for i in 0...(2*$PokemonTemp.fishingStreak)
                break if wildpoke.isShiny?
                wildpoke.personalID=rand(65536)|(rand(65536)<<16)
              end
            end
            return wildpoke
          end
          I didn't have a nil check so if you enter any other encounter (which has to generate a wild pokemon) without ever fishing, the fishing streak is still nil and you get an error.
          I'm gonna update the top post now.
          __________________
          Resources for ROM hackers has moved.

          Reply With Quote
            #5    
          Old August 20th, 2017 (5:52 AM).
          bartyboy6's Avatar
          bartyboy6 bartyboy6 is offline
             
            Join Date: Sep 2010
            Gender: Male
            Posts: 59
            Okay, it works splendidly now. While testing this script I ran into a random shiny Barboach on the first chain and then a shiny Krabby a couple of encounters later ^^
            Reply With Quote
              #6    
            Old December 10th, 2017 (6:02 AM).
            bartyboy6's Avatar
            bartyboy6 bartyboy6 is offline
               
              Join Date: Sep 2010
              Gender: Male
              Posts: 59
              Will you update this for version 17?
              Reply With Quote
                #7    
              Old 4 Weeks Ago (3:27 PM).
              Diego Mertens Diego Mertens is offline
                 
                Join Date: Aug 2017
                Posts: 7
                I've got this error:
                ---------------------------
                Pokemon Essentials Esp v16.2
                ---------------------------
                Script 'Cadena de Pesca' line 39: SyntaxError occurred.
                ---------------------------
                Aceptar
                ---------------------------

                :(
                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 6:12 AM.