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

[Essentials Tutorial] Gen II Berries

PiaCRT

[i]Orange Dev[/i]
936
Posts
13
Years
Quick Edit: I am not sure if editing how the Mystery Berry heals PP will affect Ether. It may need to be defined separately. Sorry if it messes with it, I didn't think about it. If you want to make it 10 again, go to PokeBattle_Battler and find "pokemove.pp=5" change the 5 to 10.

Hello again PC, I'm just feeling nice today so I've decided to release my Generation II berries. This will simply replace a few berries in your items.txt and I have also included the PBS files for Pokemon that have these berries in the wild. If a trainer has a berry that Essentials does not recognize, it WILL let you know, do just open up Trainers.txt and replace any berries (by default there's a trainer with Sitrus Berry, replace it with Gold Berry). It's a lot of script editing due to the item name changes, but it's good practice for those who want to do something similar. Without further ado, here we go:

First off, go into your items.txt go to line 389. Now, replace lines 389 through 398 with this:
Code:
389,PRZCUREBERRY,PrzCureBerry,5,20,A self-cure for paralysis. (HOLD),1,1,1,
390,MINTBERRY,Mint Berry,5,20,A self-awakening for sleep. (HOLD),1,1,1,
391,PSNCUREBERRY,PsnCureBerry,5,20,A self-cure for poison. (HOLD),1,1,1,
392,ICEBERRY,Ice Berry,5,20,A self-heal for a burn. (HOLD),1,1,1,
393,BURNTBERRY,Burnt Berry,5,20,A self-cure for freezing. (HOLD),1,1,1,
394,MYSTERYBERRY,MysteryBerry,5,20,A self-restore for PP. (HOLD),1,1,1,
395,BERRY,Berry,5,20,"A self-restore item. (10HP, HOLD)",1,1,1,
396,BITTERBERRY,Bitter Berry,5,20,A self-cure for confusion. (HOLD),0,1,1,
397,MIRACLEBERRY,MiracleBerry,5,20,Eliminates all status problems.,1,1,1,
398,GOLDBERRY,Gold Berry,5,20,"A self-restore item. (30HP, HOLD)",1,1,1,

Now, replace your Pokemon.txt with this: https://www.dropbox.com/s/hvenh8cog0hxzzo/pokemon.txt
If you have a custom Pokedex, you'll have to replace them manually. I suggest Notepad++

Now to make them work ingame.
First, go to the script PokeBattle_Battler, line 1044.

Replace 1044-1141 with this:
Code:
        if isConst?(self.item,PBItems,:BERRY) && self.hp<=(self.totalhp/2).floor
          self.pbRecoverHP(10,true)
          @battle.pbDisplay(_INTL("{1}'s {2} restored health!",pbThis,itemname))   
          @pokemon.itemRecycle=self.item
          @pokemon.itemInitial=0 if @pokemon.itemInitial==self.item
          self.item=0
        end
        if isConst?(self.item,PBItems,:GOLDBERRY) && self.hp<=(self.totalhp/2).floor
          self.pbRecoverHP((self.totalhp/4).floor,true)
          @battle.pbDisplay(_INTL("{1}'s {2} restored health!",pbThis,itemname))   
          @pokemon.itemRecycle=self.item
          @pokemon.itemInitial=0 if @pokemon.itemInitial==self.item
          self.item=0
        end
      end
      if isConst?(self.item,PBItems,:PRZCUREBERRY) && self.status==PBStatuses::PARALYSIS
        self.status=0
        @battle.pbDisplay(_INTL("{1}'s {2} cured its paralysis problem!",pbThis,itemname))
        @pokemon.itemRecycle=self.item
        @pokemon.itemInitial=0 if @pokemon.itemInitial==self.item
        self.item=0
      end
      if isConst?(self.item,PBItems,:MINTBERRY) && self.status==PBStatuses::SLEEP
        self.status=0
        @battle.pbDisplay(_INTL("{1}'s {2} cured its sleep problem!",pbThis,itemname))
        @pokemon.itemRecycle=self.item
        @pokemon.itemInitial=0 if @pokemon.itemInitial==self.item
        self.item=0
      end
      if isConst?(self.item,PBItems,:PSNCUREBERRY) && self.status==PBStatuses::POISON
        self.status=0
        @battle.pbDisplay(_INTL("{1}'s {2} cured its poison problem!",pbThis,itemname))
        @pokemon.itemRecycle=self.item
        @pokemon.itemInitial=0 if @pokemon.itemInitial==self.item
        self.item=0
      end
      if isConst?(self.item,PBItems,:ICEBERRY) && self.status==PBStatuses::BURN
        self.status=0
        @battle.pbDisplay(_INTL("{1}'s {2} cured its burn problem!",pbThis,itemname))
        @pokemon.itemRecycle=self.item
        @pokemon.itemInitial=0 if @pokemon.itemInitial==self.item
        self.item=0
      end
      if isConst?(self.item,PBItems,:BURNTBERRY) && self.status==PBStatuses::FROZEN
        self.status=0
        @battle.pbDisplay(_INTL("{1}'s {2} cured its ice problem!",pbThis,itemname))
        @pokemon.itemRecycle=self.item
        @pokemon.itemInitial=0 if @pokemon.itemInitial==self.item
        self.item=0
      end
      if hpcure && isConst?(self.item,PBItems,:MYSTERYBERRY)
        for i in [email protected]
          [email protected][i]
          battlermove=self.moves[i]
          if pokemove.pp==0 && pokemove.id!=0
            movename=PBMoves.getName(pokemove.id)
            pokemove.pp=5
            pokemove.pp=pokemove.totalpp if pokemove.pp>pokemove.totalpp 
            battlermove.pp=pokemove.pp
            @battle.pbDisplay(_INTL("{1}'s {2} restored {3}'s PP!",pbThis,itemname,movename)) 
            @pokemon.itemRecycle=self.item
            @pokemon.itemInitial=0 if @pokemon.itemInitial==self.item
            self.item=0
            break
          end
        end
      end
      if isConst?(self.item,PBItems,:BITTERBERRY) && @effects[PBEffects::Confusion]>0
        @effects[PBEffects::Confusion]=0
        @battle.pbDisplay(_INTL("{1}'s {2} cured its confusion problem!",pbThis,itemname))
        @pokemon.itemRecycle=self.item
        @pokemon.itemInitial=0 if @pokemon.itemInitial==self.item
        self.item=0
      end
      if isConst?(self.item,PBItems,:MIRACLEBERRY) && (self.status>0 || @effects[PBEffects::Confusion]>0)
        st=self.status; conf=@effects[PBEffects::Confusion]
        self.status=0
        @effects[PBEffects::Confusion]=0
        if conf
          @battle.pbDisplay(_INTL("{1}'s {2} cured its confusion problem!",pbThis,itemname))
        else
          case st
            when PBStatuses::PARALYSIS
              @battle.pbDisplay(_INTL("{1}'s {2} cured its paralysis problem!",pbThis,itemname))
            when PBStatuses::SLEEP
              @battle.pbDisplay(_INTL("{1}'s {2} cured its sleep problem!",pbThis,itemname))
            when PBStatuses::POISON
             @battle.pbDisplay(_INTL("{1}'s {2} cured its poison problem!",pbThis,itemname))
            when PBStatuses::BURN
              @battle.pbDisplay(_INTL("{1}'s {2} cured its burn problem!",pbThis,itemname))
            when PBStatuses::FROZEN
              @battle.pbDisplay(_INTL("{1}'s {2} cured its frozen problem!",pbThis,itemname))
          end
        end
        @pokemon.itemRecycle=self.item
        @pokemon.itemInitial=0 if @pokemon.itemInitial==self.item
        self.item=0
      end

This will make it so that berries will work correctly, and Mystery Berries will heal 5 PP.


Now we go to PokeBattle_MoveEffects at line 3532. We will replace this:
Spoiler:

With this:

Code:
  def pbBaseDamage(basedmg,attacker,opponent)
    damagearray={
       60 => [:PSNCUREBERRY,:MINTBERRY,:PRZCUREBERRY,:ICEBERRY,:BURNTBERRY,
              :MYSTERYBERRY,:BERRY,:BITTERBERRY,:MIRACLEBERRY,:GOLDBERRY,
              :FIGYBERRY,:WIKIBERRY,:MAGOBERRY,:AGUAVBERRY,:IAPAPABERRY,
              :RAZZBERRY,:OCCABERRY,:PASSHOBERRY,:WACANBERRY,:RINDOBERRY,
              :YACHEBERRY,:CHOPLEBERRY,:KEBIABERRY,:SHUCABERRY,:COBABERRY,
              :PAYAPABERRY,:TANGABERRY,:CHARTIBERRY,:KASIBBERRY,:HABANBERRY,
              :COLBURBERRY,:BABIRIBERRY,:CHILANBERRY],
       70 => [:BLUKBERRY,:NANABBERRY,:WEPEARBERRY,:PINAPBERRY,:POMEGBERRY,
              :KELPSYBERRY,:QUALOTBERRY,:HONDEWBERRY,:GREPABERRY,:TAMATOBERRY,
              :CORNNBERRY,:MAGOSTBERRY,:RABUTABERRY,:NOMELBERRY,:SPELONBERRY,
              :PAMTREBERRY],
       80 => [:WATMELBERRY,:DURINBERRY,:BELUEBERRY,:LIECHIBERRY,:GANLONBERRY,
              :SALACBERRY,:PETAYABERRY,:APICOTBERRY,:LANSATBERRY,:STARFBERRY,
              :ENIGMABERRY,:MICLEBERRY,:CUSTAPBERRY,:JACOBABERRY,:ROWAPBERRY]
    }

Just a little under that at line 3560-3579, replace with this:
Spoiler:

Now, we need to fix berry plants.

In the script PokemonBerryPlants, on line 14 you will be replacing everything from class to the last berry array (right before "Replants=9")

Spoiler:

Now, we go to PokemonItemEffects. This one is sprawled out so I'll let you do the editing, but I'll tell you where to go and what to do.

Line 204. Replace ORANBERRY and SITRUSBERRY with BERRY and GOLDBERRY, respectively.
Line 225, replace CHESTOBERRY with MINTBERRY.
Line 240, PECHABERRY to PSNCUREBERRY.
Line 254, RAWSTBERRY to ICEBERRY.
Line 269, CHERIBERRY to PRZCUREBERRY.
Line 283, ASPEARBERRY to BURNTBERRY.
Line 299, LUMBERRY to MIRACLEBERRY.
Line 403, LEPPABERRY to MYSTERYBERRY.
Line 1021, Replace ORANBERRY and SITRUSBERRY with BERRY and GOLDBERRY, respectively.
Line 1043, replace CHESTOBERRY with MINTBERRY.
Line 1059, PECHABERRY to PSNCUREBERRY.
Line 1074, RAWSTBERRY to ICEBERRY.
Line 1089, CHERIBERRY to PRZCUREBERRY.
Line 1104, ASPEARBERRY to BURNTBERRY.
Line 1122, LUMBERRY to MIRACLEBERRY.
Line 1250, LEPPABERRY to MYSTERYBERRY.

(Again, programs like Notepad++ help a ton!)

One script left to edit.
PokemonOrgBattleGenerator

Replace the array at line 385 with this:
Code:
    itemlist=[
       :BERRY,:GOLDBERRY,:ADAMANTORB,:BABIRIBERRY,
       :BLACKSLUDGE,:BRIGHTPOWDER,:CHESTOBERRY,:CHOICEBAND,
       :CHOICESCARF,:CHOICESPECS,:CHOPLEBERRY,:DAMPROCK,
       :DEEPSEATOOTH,:EXPERTBELT,:FLAMEORB,:FOCUSSASH,
       :FOCUSBAND,:HEATROCK,:LEFTOVERS,:LIFEORB,:LIGHTBALL,
       :LIGHTCLAY,:MYSTERYBERRY,:OCCABERRY,:PETAYABERRY,:SALACBERRY,
       :SCOPELENS,:SHEDSHELL,:SHELLBELL,:SHUCABERRY,:LIECHIBERRY,
       :SILKSCARF,:THICKCLUB,:TOXICORB,:WIDELENS,:YACHEBERRY,
       :HABANBERRY,:SOULDEW,:PASSHOBERRY,:QUICKCLAW,:WHITEHERB
    ]

Line 476, Replace ORANBERRY and SITRUSBERRY with BERRY and GOLDBERRY, respectively.
Do the same at line 480.
Line 598, replace LUMBERRY and CHESTOBERRY with MIRACLEBERRY and MINTBERRY, respectively.

And you should be done! I may have missed a line of code, but it's working just fine for me. Let me know if a bug occurs. The reason why I did this myself is because I was tired of calling for Oran Berries when it was called a Berry ingame.

In any new release of Essentials always check for berries when using this. Maruno may sneak something in there :I

Enjoy, and feedback is appreciated.
 
Last edited:
Back
Top