• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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
    7
    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?
     
    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?
     
    Yea im fine with the stacking with speed boost and how it lowers with contrary.
     
    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:
    It worked fine thanks!
     
    Back
    Top