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

Item that forces evolution

1,224
Posts
10
Years
Yep, look at how the stones work

Code:
ItemHandlers::UseOnPokemon.add(:FIRESTONE,proc{|item,pokemon,scene|
   if (pokemon.isShadow? rescue false)
     scene.pbDisplay(_INTL("It won't have any effect."))
     next false
   end
   newspecies=pbCheckEvolution(pokemon,item)
   if newspecies<=0
     scene.pbDisplay(_INTL("It won't have any effect."))
     next false
   else
     pbFadeOutInWithMusic(99999){
        evo=PokemonEvolutionScene.new
        evo.pbStartScreen(pokemon,newspecies)
        evo.pbEvolution(false)
        evo.pbEndScreen
        scene.pbRefreshAnnotations(proc{|p| pbCheckEvolution(p,item)>0 })
        scene.pbRefresh
     }
     next true
   end
})

ItemHandlers::UseOnPokemon.copy(:FIRESTONE,
   :THUNDERSTONE,:WATERSTONE,:LEAFSTONE,:MOONSTONE,
   :SUNSTONE,:DUSKSTONE,:DAWNSTONE,:SHINYSTONE[COLOR="Red"],:YOURITEMHERE[/COLOR])
 
79
Posts
9
Years
  • Age 27
  • Seen Dec 8, 2015
Yep, look at how the stones work

Code:
ItemHandlers::UseOnPokemon.add(:FIRESTONE,proc{|item,pokemon,scene|
   if (pokemon.isShadow? rescue false)
     scene.pbDisplay(_INTL("It won't have any effect."))
     next false
   end
   newspecies=pbCheckEvolution(pokemon,item)
   if newspecies<=0
     scene.pbDisplay(_INTL("It won't have any effect."))
     next false
   else
     pbFadeOutInWithMusic(99999){
        evo=PokemonEvolutionScene.new
        evo.pbStartScreen(pokemon,newspecies)
        evo.pbEvolution(false)
        evo.pbEndScreen
        scene.pbRefreshAnnotations(proc{|p| pbCheckEvolution(p,item)>0 })
        scene.pbRefresh
     }
     next true
   end
})

ItemHandlers::UseOnPokemon.copy(:FIRESTONE,
   :THUNDERSTONE,:WATERSTONE,:LEAFSTONE,:MOONSTONE,
   :SUNSTONE,:DUSKSTONE,:DAWNSTONE,:SHINYSTONE[COLOR="Red"],:YOURITEMHERE[/COLOR])
I would do an item that force the evolution and devolution (?) of all pokemon :D Can you help me?
 

Radical Raptr

#BAMFPokemonNerd
1,121
Posts
13
Years
Do the same thing as before but also, on every pokemon you want to "devolve" change the evolution part in the pokemon.txt to "evolve" int the desired pokemon via the aforementioned item.
 
79
Posts
9
Years
  • Age 27
  • Seen Dec 8, 2015
i tried to do an item that force the evolutions of all pokemon. I modified the fire stone. Here is the script:
ItemHandlers::UseOnPokemon.add(:FIRESTONE,proc{|item,pokemon,scene|
if (pokemon.isShadow? rescue false)
scene.pbDisplay(_INTL("It won't have any effect."))
next false
end
if newspecies<=0
scene.pbDisplay(_INTL("It won't have any effect."))
next false
else
pbFadeOutInWithMusic(99999){
evo=PokemonEvolutionScene.new
evo.pbStartScreen(pokemon,newspecies)
evo.pbEvolution
evo.pbEndScreen
}
next true
end
It gave me an error...



---------------------------
Pokemon Essentials
---------------------------
Exception: NameError

Message: undefined local variable or method `newspecies' for nil:NilClass

PokemonItemEffects:144

PokemonItemEffects:139:in `call'

PBEvent:150:in `trigger'

PokemonItems:196:in `triggerUseOnPokemon'

PokemonItems:517:in `pbUseItem'

PokemonItems:509:in `loop'

PokemonItems:531:in `pbUseItem'

PokemonItems:505:in `pbFadeOutIn'

PokemonItems:505:in `pbUseItem'

PokemonBag:695:in `pbStartScreen'



This exception was logged in

C:\Users\Utente\Saved Games/Pokemon Essentials/errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------


I also tried to do an item that decrease the level of pokemon of one unit, but when I choose it from the bag doesn't appear the option "use"

ItemHandlers::UseOnPokemon.add(:MYSTERYCANDY,proc{|item,pokemon,scene|
if pokemon.level<=PBExperience::MINLEVEL || (pokemon.isShadow? rescue false)
scene.pbDisplay(_INTL("It won't have any effect."))
next false
else
pbChangeLevel(pokemon,pokemon.level-1,scene)
scene.pbHardRefresh
next true
end

(I don't know if "MINLEVEL" EXIST AHAH )
 

Zeak6464

Zeak #3205 - Discord
1,101
Posts
11
Years
  • Age 31
  • USA
  • Seen Oct 9, 2023
Force Evolve
Code:
def pbForceEvo(pokemon)
  for form in pbGetEvolvedFormData(pokemon.species)
    newspecies=form[2]
  end
  return if !newspecies
  if newspecies>0
    evo=PokemonEvolutionScene.new
    evo.pbStartScreen(pokemon,newspecies)
    evo.pbEvolution
    evo.pbEndScreen
  end
end

Force DeEvolve
Code:
def pbForceDeEvo(pokemon)
  for form in pbGetEvolvedFormData(pokemon.species)
    newspecies=form[1]
  end
  return if !newspecies
  if newspecies>0
    evo=PokemonEvolutionScene.new
    evo.pbStartScreen(pokemon,newspecies)
    evo.pbEvolution
    evo.pbEndScreen
  end
end
 
41
Posts
10
Years
Yep, look at how the stones work

Code:
ItemHandlers::UseOnPokemon.add(:FIRESTONE,proc{|item,pokemon,scene|
   if (pokemon.isShadow? rescue false)
     scene.pbDisplay(_INTL("It won't have any effect."))
     next false
   end
   newspecies=pbCheckEvolution(pokemon,item)
   if newspecies<=0
     scene.pbDisplay(_INTL("It won't have any effect."))
     next false
   else
     pbFadeOutInWithMusic(99999){
        evo=PokemonEvolutionScene.new
        evo.pbStartScreen(pokemon,newspecies)
        evo.pbEvolution(false)
        evo.pbEndScreen
        scene.pbRefreshAnnotations(proc{|p| pbCheckEvolution(p,item)>0 })
        scene.pbRefresh
     }
     next true
   end
})

ItemHandlers::UseOnPokemon.copy(:FIRESTONE,
   :THUNDERSTONE,:WATERSTONE,:LEAFSTONE,:MOONSTONE,
   :SUNSTONE,:DUSKSTONE,:DAWNSTONE,:SHINYSTONE[COLOR="Red"],:YOURITEMHERE[/COLOR])

What script section is this in? I have problems with adding new evolutionary items myself. In the bag I'm not seeing the "Use" option and I have selected "Use on a Pokemon" in the editor for the item and for the pokemon I set it to evolve to item, and the item I specified.
 
Back
Top