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

Held item increases speed stat

66
Posts
6
Years
    • Seen May 2, 2020
    So I've been making this game in Pokemon Essentials and I added a custom item in the game, I want it so that when this item is held by a pokemon in battle it will increase their speed stage by 1 after every 2 turns. Similar to the ability speed boost. So how would I go about doing that?
     
    188
    Posts
    9
    Years
    • Seen Jan 21, 2024
    Such an item would slow down a Pok?mon with the Contrary ability instead of speed it up; plus it would stack with the Speed Boost ability. Did you want all that to happen?
     
    188
    Posts
    9
    Years
    • Seen Jan 21, 2024
    In that case, find the Sticky Barb code in PokeBattle_Battle and add the code in red after it as follows:
    Code:
          # Sticky Barb
          if i.hasWorkingItem(:STICKYBARB) && !i.hasWorkingAbility(:MAGICGUARD)
            PBDebug.log("[Item triggered] #{i.pbThis}'s Sticky Barb")
            @scene.pbDamageAnimation(i,0)
            i.pbReduceHP((i.totalhp/8).floor)
            pbDisplay(_INTL("{1} is hurt by its {2}!",i.pbThis,PBItems.getName(i.item)))
          end
          [COLOR="Red"][COLOR="green"]# Custom item[/COLOR]
          if i.turncount>0 && i.turncount%2==0 && i.hasWorkingItem(:CUSTOM) [COLOR="Green"]#change to your item's internal name[/COLOR]
            if i.pbIncreaseStatWithCause(PBStats::SPEED,1,i,PBItems.getName(i.item))
              PBDebug.log("[Held item triggered] #{i.pbThis}'s #{PBItems.getName(i.item)}")
            end
          end[/COLOR]
    Note that if the Pok?mon holding the item is switched in mid-round, the counting will start from the next round. It's similar to how battlers don't gain weather effects on the turn the weather move is executed.
     
    Last edited:
    Back
    Top