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

[Scripting Question] Defog error

13
Posts
6
Years
    • Seen Dec 25, 2019
    I'm using essentials v16 and I have a problem with the move defog because it doesn't work like in the games, you know... removing hazards for both sides

    class PokeBattle_Move_049 < PokeBattle_Move
    def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
    pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
    opponent.pbReduceStat(PBStats::EVASION,1,attacker,false,self)
    opponent.pbOwnSide.effects[PBEffects::Reflect] = 0
    opponent.pbOwnSide.effects[PBEffects::LightScreen] = 0
    opponent.pbOwnSide.effects[PBEffects::Mist] = 0
    opponent.pbOwnSide.effects[PBEffects::Safeguard] = 0
    opponent.pbOwnSide.effects[PBEffects::Spikes] = 0
    opponent.pbOwnSide.effects[PBEffects::StealthRock] = -1
    opponent.pbOwnSide.effects[PBEffects::StickyWeb] = -1
    opponent.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0
    if USENEWBATTLEMECHANICS
    opponent.pbOpposingSide.effects[PBEffects::Reflect] = 0
    opponent.pbOpposingSide.effects[PBEffects::LightScreen] = 0
    opponent.pbOpposingSide.effects[PBEffects::Mist] = 0
    opponent.pbOpposingSide.effects[PBEffects::Safeguard] = 0
    opponent.pbOpposingSide.effects[PBEffects::Spikes] = 0
    opponent.pbOpposingSide.effects[PBEffects::StealthRock] = -1
    opponent.pbOpposingSide.effects[PBEffects::StickyWeb] = -1
    opponent.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0
    end
    return 0
    end

    def pbAdditionalEffect(attacker,opponent)
    if !opponent.damagestate.substitute
    if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
    opponent.pbReduceStat(PBStats::EVASION,1,attacker,false,self)
    end
    end
    opponent.pbOwnSide.effects[PBEffects::Reflect] = 0
    opponent.pbOwnSide.effects[PBEffects::LightScreen] = 0
    opponent.pbOwnSide.effects[PBEffects::Mist] = 0
    opponent.pbOwnSide.effects[PBEffects::Safeguard] = 0
    opponent.pbOwnSide.effects[PBEffects::Spikes] = 0
    opponent.pbOwnSide.effects[PBEffects::StealthRock] = -1
    opponent.pbOwnSide.effects[PBEffects::StickyWeb] = -1
    opponent.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0
    if USENEWBATTLEMECHANICS
    opponent.pbOpposingSide.effects[PBEffects::Reflect] = 0
    opponent.pbOpposingSide.effects[PBEffects::LightScreen] = 0
    opponent.pbOpposingSide.effects[PBEffects::Mist] = 0
    opponent.pbOpposingSide.effects[PBEffects::Safeguard] = 0
    opponent.pbOpposingSide.effects[PBEffects::Spikes] = 0
    opponent.pbOpposingSide.effects[PBEffects::StealthRock] = -1
    opponent.pbOpposingSide.effects[PBEffects::StickyWeb] = -1
    opponent.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0
    end
    end
    end

    I need help please :(
     
    Back
    Top