• 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.

Consecutive Fishing/Shiny FIshing Chaining (v16.2)

1,680
Posts
8
Years
  • Age 24
  • Seen yesterday
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)<bitechance) && hasencounter
	  frames=rand(21)+20
	  if !pbWaitForInput(msgwindow,message+_INTL("\r\nOh! A bite!"),frames)
		pbFishingEnd
		$game_player.setDefaultCharName(nil,oldpattern)
		Kernel.pbMessageDisplay(msgwindow,_INTL("The Pok?mon got away..."))
		Kernel.pbDisposeMessageWindow(msgwindow)
		$PokemonTemp.fishingStreak=0 #edit
		return false
	  end
	  if rand(100)<hookchance || FISHINGAUTOHOOK
		Kernel.pbMessageDisplay(msgwindow,_INTL("Landed a Pok?mon!"))
		Kernel.pbDisposeMessageWindow(msgwindow)
		pbFishingEnd
		$game_player.setDefaultCharName(nil,oldpattern)
		$PokemonTemp.fishingStreak+=1 #edit
		$PokemonTemp.fishingStreak=[$PokemonTemp.fishingStreak,FISHINGMAXSTREAK].max #edit
		return true
	  end
#	  bitechance+=15
#	  hookchance+=15
	else
	  pbFishingEnd
	  $game_player.setDefaultCharName(nil,oldpattern)
	  Kernel.pbMessageDisplay(msgwindow,_INTL("Not even a nibble..."))
	  Kernel.pbDisposeMessageWindow(msgwindow)
	  $PokemonTemp.fishingStreak=0 #edit
	  return false
	end
  end
  Kernel.pbDisposeMessageWindow(msgwindow)
  return false
end
 
def checkBordering # of the bobber #edit
  p=$game_player
  ret=0
  case p.direction
  when 2 # down
	ret+=1 if !p.passable?(p.x,p.y+1,4)
	ret+=1 if !p.passable?(p.x,p.y+1,6)
	ret+=1 if !p.passable?(p.x,p.y+1,8)
  when 4 # left
	ret+=1 if !p.passable?(p.x-1,p.y,2)
	ret+=1 if !p.passable?(p.x-1,p.y,6)
	ret+=1 if !p.passable?(p.x-1,p.y,8)
  when 6 # right
	ret+=1 if !p.passable?(p.x+1,p.y,2)
	ret+=1 if !p.passable?(p.x+1,p.y,4)
	ret+=1 if !p.passable?(p.x+1,p.y,8)
  when 8 # up
	ret+=1 if !p.passable?(p.x,p.y-1,2)
	ret+=1 if !p.passable?(p.x,p.y-1,4)
	ret+=1 if !p.passable?(p.x,p.y-1,6)
  end
  return ret
end
 
alias _fishing_pbGenerateWildPokemon pbGenerateWildPokemon #edit
 
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
 
Last edited:
16
Posts
7
Years
  • Age 33
  • Seen Feb 5, 2018
Thank you!! I was looking for a script like this! I just tested it and it works really nice!
 
60
Posts
13
Years
  • Seen Jun 2, 2023
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
---------------------------
 
1,680
Posts
8
Years
  • Age 24
  • Seen yesterday
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.
 
60
Posts
13
Years
  • Seen Jun 2, 2023
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 ^^
 
180
Posts
6
Years
  • Age 20
  • Seen Apr 15, 2024
I've got this error:
---------------------------
Pokemon Essentials Esp v16.2
---------------------------
Script 'Cadena de Pesca' line 39: SyntaxError occurred.
---------------------------
Aceptar
---------------------------

:(
 
Back
Top