• 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!
  • 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] [help-me] Battle with trainers drop items, I only want with Wild Pokemons

I found this ready script of wild Pokémon dropping items, but the trainer Pokémon drop also, I just want the wild ones, can someone help me?



SCRIPT:

class PokeBattle_Battler

def pbFaint(showMessage=true)

unless fainted?

PBDebug.log("!!!***Can't faint with HP greater than 0")

return true

end

if @fainted

# PBDebug.log("!!!***Can't faint if already fainted")

return true

end

@battle.scene.pbFainted(self)

pbInitEffects(false)

# Reset status

self.status=0

self.statusCount=0

if @pokemon && @battle.internalbattle

@pokemon.changeHappiness("faint")

end

@pokemon.makeUnmega if self.isMega?

@pokemon.makeUnprimal if self.isPrimal?

@fainted=true

# reset choice

@battle.choices[@index]=[0,0,nil,-1]

pbOwnSide.effects[PBEffects::LastRoundFainted][email protected]

@battle.pbDisplayPaused(_INTL("{1} fainted!",pbThis)) if showMessage

if !@opponent && @pokemon.item >0 && showMessage

$PokemonBag.pbStoreItem(@pokemon.item,1)

itemname=PBItems.getName(@pokemon.item)

pocket=pbGetPocket(@pokemon.item)

@battle.pbDisplayPaused(_INTL("The wild {1} dropped\n{2} <icon=bagPocket#{pocket}> x 1!",@pokemon.name,itemname,@pokemon.item))

end

PBDebug.log("[Pokémon fainted] #{pbThis}")

return true

end

end
 
Back
Top