• 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.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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.

[Scripting Question] Embargo Ability Help

  • 26
    Posts
    7
    Years
    • Seen Dec 19, 2018
    Hey guys. So I've been trying to turn Magician into an auto Embargo ability instead, where when the Pokemon with Magician enters the battle, the opponent can't use items for 5 turns, and if they reenter during those 5 turns, it will display that the opponent is still currently under the effect of Embargo. I can't seem to get this to work JUST for the opponent. It prevents me from using items, but not them. I've tried a few variations of this such as "opponent.effects[PBEffects::Embargo]=5" which is what is used in the Embargo move script, but PokeBattle_Battler doesn't seem to recognize the "opponent" variable. Could anyone help me out? Here is the script I've been working with:

    Code:
    # Magician
        if self.hasWorkingAbility(:MAGICIAN) && onactive
          if @effects[PBEffects::Embargo]>0
            @battle.pbDisplay(_INTL("The foe can already not use items!"))
            @effects[PBEffects::Embargo]=5
            @battle.pbDisplay(_INTL("The foe can no longer use items!!"))
          end
       end
     
    Last edited:
    @effects refers to the Pokémon being sent in. You might want something more like pbOpposing1.effects (and probably pbOpposing2.effects too for double-battles).
     
    @effects refers to the Pokémon being sent in. You might want something more like pbOpposing1.effects (and probably pbOpposing2.effects too for double-battles).

    Ah thank you that seemed to work perfectly! Quick question though, if I wanted it to apply to both Pokemon in a double battle would I do something like this?

    Code:
    if self.hasWorkingAbility(:MAGICIAN) && onactive
          if pbOpposing1.effects[PBEffects::Embargo]>0 || pbOpposing2.effects[PBEffects::Embargo]>0
             @battle.pbDisplay(_INTL("The foe already can't use items!"))
             else
             pbOpposing1.effects[PBEffects::Embargo]=5 && pbOpposing2.effects[PBEffects::Embargo]=5
             @battle.pbDisplay(_INTL("The foe can no longer use items!"))
           end
          end

    What I've tested so far it seems that Embargo will still run out after 5 turns but the game seems to think that Embargo is still in effect because Magician wont work after it runs out the first time. I'm not sure if it's applying 5 twice or what but I can't seem to get this to work properly when defining both opposing Pokemon.
     
    Last edited:
    What I've tested so far it seems that Embargo will still run out after 5 turns but the game seems to think that Embargo is still in effect because Magician wont work after it runs out the first time. I'm not sure if it's applying 5 twice or what but I can't seem to get this to work properly when defining both opposing Pokemon.

    Hmm, maybe you need to check (and set Embargo for) pbOpposing1 and pbOpposing2 independently? Perhaps Essentials doesn't tick down for pbOpposing2 in a single battle, and so you'll need to check that there's actually a Pokémon there? Not too sure what bug you're reporting.
     
    Back
    Top