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

[Essentials v17.2] Gen 8 stuffs (Abilities, Items & Move)

Hi! Court Change didn't seem to be working correctly, it was losing a side's effects, but I managed to fix it!

Code:
################################################################################
# Swaps barriers, veils and other effects between each side of the battlefield.
# (Court Change)
################################################################################
class PokeBattle_Move_178 < PokeBattle_Move
  def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    changeside=false
    for i in 0...2
      next if @battle.sides[i].effects[PBEffects::Spikes]==0 && 
              @battle.sides[i].effects[PBEffects::ToxicSpikes]==0 && 
             [email protected][i].effects[PBEffects::StealthRock] && 
             [email protected][i].effects[PBEffects::StickyWeb] && 
              @battle.sides[i].effects[PBEffects::Reflect]==0 && 
              @battle.sides[i].effects[PBEffects::LightScreen]==0 && 
              @battle.sides[i].effects[PBEffects::AuroraVeil]==0 && 
              @battle.sides[i].effects[PBEffects::Tailwind]==0
      changeside=true
    end
    if !changeside
      @battle.pbDisplay(_INTL("But it failed!"))
      return -1
    else
      pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
      [email protected][0]; [email protected][1]
      ownside.effects[PBEffects::Spikes],oppside.effects[PBEffects::Spikes]=oppside.effects[PBEffects::Spikes],ownside.effects[PBEffects::Spikes]
      ownside.effects[PBEffects::ToxicSpikes],oppside.effects[PBEffects::ToxicSpikes]=oppside.effects[PBEffects::ToxicSpikes],ownside.effects[PBEffects::ToxicSpikes]
      ownside.effects[PBEffects::StealthRock],oppside.effects[PBEffects::StealthRock]=oppside.effects[PBEffects::StealthRock],ownside.effects[PBEffects::StealthRock]
      ownside.effects[PBEffects::StickyWeb],oppside.effects[PBEffects::StickyWeb]=oppside.effects[PBEffects::StickyWeb],ownside.effects[PBEffects::StickyWeb]
      ownside.effects[PBEffects::Reflect],oppside.effects[PBEffects::Reflect]=oppside.effects[PBEffects::Reflect],ownside.effects[PBEffects::Reflect]
      ownside.effects[PBEffects::LightScreen],oppside.effects[PBEffects::LightScreen]=oppside.effects[PBEffects::LightScreen],ownside.effects[PBEffects::LightScreen]
      ownside.effects[PBEffects::AuroraVeil],oppside.effects[PBEffects::AuroraVeil]=oppside.effects[PBEffects::AuroraVeil],ownside.effects[PBEffects::AuroraVeil]
      ownside.effects[PBEffects::Tailwind],oppside.effects[PBEffects::Tailwind]=oppside.effects[PBEffects::Tailwind],ownside.effects[PBEffects::Tailwind]      
      @battle.pbDisplay(_INTL("{1} swapped the battle effects affecting each side of the field!",attacker.pbThis))
      return 0
    end
  end
end
 
Hello! Does anyone have the updated scripts for defog, howl, and teleport?

Defog now removes Terrains in addition to Entry Hazards and Screens
Howl boosts Attack for both user and any ally on the field
Teleport switches the user out at -6 priority in trainer battles
 
Hello! Does anyone have the updated scripts for defog, howl, and teleport?

Defog now removes Terrains in addition to Entry Hazards and Screens
Howl boosts Attack for both user and any ally on the field
Teleport switches the user out at -6 priority in trainer battles

For Howl, you just need to change the number of targets in the PBS to '40' (User Side Effects)

For Teleport, until someone codes it, we can change the function code of it to 0EE and priority to -6 in the PBS

For Defog, add(don't replace) to the code of the move in PBMove_MoveEffects under both instances of:
Code:
opponent.pbOpposingSide.effects[PBEffects::StealthRock] = false
Spoiler:

(I'm on Mobile rn so someone might need to test this code)
 
Last edited:
For Defog, add (don't replace) this to the code of the move in PBMove_MoveEffects:

Code:
terrainArr=[@battle.field.effects[PBEffects::ElectricTerrain],@battle.field.effects[PBEffects::GrassyTerrain],@battle.field.effects[PBEffects::MistyTerrain],@battle.field.effects[PBEffects::PsychicTerrain]]
for i in 0...terrainArr.length
  if terrainArr[i]>0
     terrainArr[i]=0
     @battle.pbDisplay(_INTL("The terrain effect disappeared from the battlefield!"))
     end
  end
end
(I'm on Mobile rn so someone might need to test this code. Also I don't know the official dialogue for when terrains disappear so someone might have to help me with that)

Thanks for the help! Where should I put the code for the terrains? If I put it after all 4 of the lists it will say "The terrain effect disappeared from the battlefield!" every time defog is used, even if there isn't anything to defog away, and if I just put it at the end of the script I get a no method error for "field"

Here's the code for defog:

Code:
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]  = false
    opponent.pbOwnSide.effects[PBEffects::StickyWeb]    = false
    opponent.pbOwnSide.effects[PBEffects::ToxicSpikes]  = 0
    opponent.pbOwnSide.effects[PBEffects::MoltenQuills] = false
    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]  = false
      opponent.pbOpposingSide.effects[PBEffects::StickyWeb]    = false
      opponent.pbOpposingSide.effects[PBEffects::ToxicSpikes]  = 0
      opponent.pbOpposingSide.effects[PBEffects::MoltenQuills] = false
    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]  = false
    opponent.pbOwnSide.effects[PBEffects::StickyWeb]    = false
    opponent.pbOwnSide.effects[PBEffects::ToxicSpikes]  = 0
    opponent.pbOwnSide.effects[PBEffects::MoltenQuills] = false
    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]  = false
      opponent.pbOpposingSide.effects[PBEffects::StickyWeb]    = false
      opponent.pbOpposingSide.effects[PBEffects::ToxicSpikes]  = 0
      opponent.pbOpposingSide.effects[PBEffects::MoltenQuills] = false
    end
  end
end
 
Thanks for the help! Where should I put the code for the terrains? If I put it after all 4 of the lists it will say "The terrain effect disappeared from the battlefield!" every time defog is used, even if there isn't anything to defog away, and if I just put it at the end of the script I get a no method error for "field"

Yeah I see why that was happening. I added and extra 'end' in the terrain code. I've edited my previous post, so it should behave properly now.
 
Last edited:
Yeah I see why that was happening. I added and extra 'end' in the terrain code. I've edited my previous post, so it should behave properly now.

Thanks a bunch! Tested and it works. Would you happen to have the scripts for Aurora Veil? The one I used just sets light screen and reflect, so it's not its own effect like in the defog script.
 
Mints' Mechanic:
Spoiler:


You shall give credits to MR. GELA and me (WolfPP) if used.
 
Last edited:
Wait, so once Neutralising Gas is done, all Gen 8 stuff should be done right? That's kinda amazing that its all done so fast, considering that we are still not done with all the Syntax Errors in Gen 7 Scripts.
 
Wait, so once Neutralising Gas is done, all Gen 8 stuff should be done right? That's kinda amazing that its all done so fast, considering that we are still not done with all the Syntax Errors in Gen 7 Scripts.

If you added what Marin posted, unfortunately some of his script has bug.
You need to add what mybusiness made (and he created a thread for it) or what I added/improved in gen 7 thread.
 
If you added what Marin posted, unfortunately some of his script has bug.
You need to add what mybusiness made (and he created a thread for it) or what I added/improved in gen 7 thread.
Wait, so once Neutralising Gas is done, all Gen 8 stuff should be done right? That's kinda amazing that its all done so fast, considering that we are still not done with all the Syntax Errors in Gen 7 Scripts.

The reason why gen 7 stuff isn't done yet, is because nobody seems to have bothered to after the initial wave of interest. The reason my own project is very unstable is because they were some of the first scripts I've ever written, and because I lost interest very quickly after initially starting it.
 
The reason why gen 7 stuff isn't done yet, is because nobody seems to have bothered to after the initial wave of interest. The reason my own project is very unstable is because they were some of the first scripts I've ever written, and because I lost interest very quickly after initially starting it.

All fine, when I have time and interest, I'll make a thread about gen 7 mechanic.
 
Ball Fetch is good, but I noticed it doesn't work in the Safari Zone. I'm not sure how exactly to fix it myself. I know since the Safari Zone isn't Gen. 8, but is there a way for them to be together?

Yep, that is why I didn't make for that case. o.o
But if in the Safari Zone you only have the option to feed the wild pokémon, throw a poké ball or run away, how'd Ball Fetch work if you don't send your pokémon to fight?
Kind of nonsense what you want, IMO. However, tell me how it could work and I'd try to do it later.
 
I just realized what a massive undertaking it's going to be to convert all these scripts to be compatible with Essentials v18 because there have been alot of changes to the battle system and Maruno has said "I may have broken every third party battle script possible".
 
I just realized what a massive undertaking it's going to be to convert all these scripts to be compatible with Essentials v18 because there have been alot of changes to the battle system and Maruno has said "I may have broken every third party battle script possible".

Essentials v18's battle system should be much more intuitive and therefore much easier to edit, with more tools and routines available.
 
I just realized what a massive undertaking it's going to be to convert all these scripts to be compatible with Essentials v18 because there have been alot of changes to the battle system and Maruno has said "I may have broken every third party battle script possible".

Ern, keep calm because if you don't know how to convert them, pretty sure someone will do that for you (like me LOL).
Am aware about v18 with different defs etc. So, let's just wait until v18 be released to adapt our codes there. :)
 
Last edited:
I just realized what a massive undertaking it's going to be to convert all these scripts to be compatible with Essentials v18 because there have been alot of changes to the battle system and Maruno has said "I may have broken every third party battle script possible".

Most of the work is just gonna be changing variable names and finding the correct place to put the code. There isn't gonna be any major new code that needs to be made so I don't think it's something to worry about. It isn't gonna take very long to port the code to v18. And if we're lucky, the creator may just code in the Gen 8 stuff into Essentials.
 
Yep, that is why I didn't make for that case. o.o
But if in the Safari Zone you only have the option to feed the wild pokémon, throw a poké ball or run away, how'd Ball Fetch work if you don't send your pokémon to fight?
Kind of nonsense what you want, IMO. However, tell me how it could work and I'd try to do it later.

Yes, I understand, but it still crashes the game if I miss a Safari Ball catch. Even when there's no Pokémon sent out. I'm just saying if it can be disabled while in the Zone.
 
Yes, I understand, but it still crashes the game if I miss a Safari Ball catch. Even when there's no Pokémon sent out. I'm just saying if it can be disabled while in the Zone.

Just add 'return if isConst?(ball,PBItems,:SAFARIBALL)' inside 'def pbBallFetch(ball)', like:
Code:
  def pbBallFetch(ball)
    return if isConst?(ball,PBItems,:SAFARIBALL)
    for i in 0...4
      if self.battlers[i].hasWorkingAbility(:BALLFETCH) && self.battlers[i].item==0
        self.battlers[i].effects[PBEffects::BallFetch]=ball
      end
    end
  end

Edited the main post about the ability. Thanks for the feedback!
 
Last edited:
Back
Top