• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Eevee Expo's webhost has been having technical issues since Nov. 20th and you might be unable to connect to our site. Staff are also facing issues connecting, so please send a DM to Cat on-site or through Discord directly for faster service!
Mass Berry Picker Script (v19/v18)

v19 Mass Berry Picker Script (v19/v18) 2021-07-17

This resource pertains to version 19 of Pokémon Essentials.
Pokémon Essentials Version
v19.1 ➖
Hey there!
This is a simple script which allows the player to pick all the berries in a map at the same time, so they don't have to go around picking each one, one berry tree at a time.
You can see this script in action in @NocTurn's fangame, Pokémon Champions, which is what I originally made this for.

All you need to do is put the script in a new section above main, and call it in an event using pbMassBerryPicker(num1,num2,map) where num1 is the lowest ID of all the berry tree events, num2 is the highest ID of all the berry tree events, and map is the ID of the map where the berries are (if map is left blank, it will use the ID of the map where the player currently is).

v18:
Script:
Expand Collapse Copy
################################################################################
# Mass Berry Picker Script by:
# - PurpleZaffre
# Please give credits when using this.
################################################################################

if defined?(PluginManager)
  PluginManager.register({
    :name => "Mass Berry Picker Script",
    :version => "1.0",
    :credits => "PurpleZaffre",
  })
end

# num1 : lowest ID of all the berry tree events
# num2 : highest ID of all the berry tree events
# map  : ID of the map where the berries are (if left blank, the ID of the map
# where the player currently is will be used)
def pbMassBerryPicker(num1,num2,map=nil)
  map = $game_map.map_id if map == nil
  harvestedBerries = false
  for i in num1..num2
    berryData = $PokemonGlobal.eventvars[[map,i]]
    if berryData
      berryToReceive=berryData[1]
      if berryData[0] == 5
        berryvalues=pbGetBerryPlantData(berryData[1])
        berrycount=1
        if berryData.length>6
          berrycount=[berryvalues[3]-berryData[6],berryvalues[2]].max
        else
          if berryData[4]>0
            randomno=rand(1+berryvalues[3]-berryvalues[2])
            berrycount=(((berryvalues[3]-berryvalues[2])*(berryData[4]-1)+randomno)/4).floor+berryvalues[2]
          else
            berrycount=berryvalues[2]
          end
        end
        $PokemonBag.pbStoreItem(berryToReceive,berrycount)
        harvestedBerries = true
        $PokemonGlobal.eventvars[[map,i]][0]=0
        $game_map.refresh
        pbWait(1)
        $PokemonGlobal.eventvars[[map,i]]=nil
        $game_map.refresh
        pbWait(1)
        if NEW_BERRY_PLANTS
          berryData=[0,0,0,0,0,0,0,0]
        else
          berryData=[0,0,false,0,0,0]
        end
      end
    end
  end
# Change these messages to whatever you want
  if harvestedBerries == true
    pbMessage(_INTL("\\me[Item get]\\PN got some berries!\\wtnp[30]"))
  else
    pbMessage(_INTL("There are no berries to pick right now."))
  end
end

v19.1:
Script:
Expand Collapse Copy
################################################################################
# Mass Berry Picker Script by:
# - PurpleZaffre
# - ThatWelshOne_
# Please give credits when using this.
################################################################################

if defined?(PluginManager)
  PluginManager.register({
    :name => "Mass Berry Picker Script",
    :version => "1.0",
    :credits => ["PurpleZaffre","ThatWelshOne_"]
  })
end

# num1 : lowest ID of all the berry tree events
# num2 : highest ID of all the berry tree events
# map  : ID of the map where the berries are (if left blank, the ID of the map
# where the player currently is will be used)
def pbMassBerryPicker(num1,num2,map=nil)
  map = $game_map.map_id if map == nil
  harvestedBerries = false
  for i in num1..num2
    berryData = $PokemonGlobal.eventvars[[map,i]]
    if berryData
      berryToReceive=berryData[1]
      if berryData[0] == 5
        berryvalues=GameData::BerryPlant.get(berryData[1])
        berrycount=1
        if berryData.length>6
          berrycount=[berryvalues.maximum_yield-berryData[6],berryvalues.minimum_yield].max
        else
          if berryData[4]>0
            randomno=rand(1+berryvalues.maximum_yield-berryvalues.minimum_yield)
            berrycount=(((berryvalues.maximum_yield-berryvalues.minimum_yield)*(berryData[4]-1)+randomno)/4).floor+berryvalues.minimum_yield
          else
            berrycount=berryvalues.minimum_yield
          end
        end
        $PokemonBag.pbStoreItem(berryToReceive,berrycount)
        harvestedBerries = true
        $PokemonGlobal.eventvars[[map,i]][0]=0
        $game_map.refresh
        pbWait(1)
        $PokemonGlobal.eventvars[[map,i]]=nil
        $game_map.refresh
        pbWait(1)
        if Settings::NEW_BERRY_PLANTS
          berryData=[0,0,0,0,0,0,0,0]
        else
          berryData=[0,0,false,0,0,0]
        end
      end
    end
  end
# Change these messages to whatever you want
  if harvestedBerries == true
    pbMessage(_INTL("\\me[Item get]\\PN got some berries!\\wtnp[30]"))
  else
    pbMessage(_INTL("There are no berries to pick right now."))
  end
end

Please do not redistribute this anywhere else.
Credits
PurpleZaffre
ThatWelshOne_ (if using the v19.1 version)
Author
PurpleZaffre
Views
2,047
First release
Last update

Ratings

5.00 star(s) 1 ratings

More resources from PurpleZaffre

Latest updates

  1. Now compatible for v19.1!

    Thanks to @ThatWelshOne_, the script is now compatible for v19.1!

Latest reviews

Perfect for berrry farms thank you for updating this WelshOne!
Back
Top