• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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] Wild ZORUA / ZOROARK ability ILLUSION

  • 9
    Posts
    5
    Years
    • Seen Apr 26, 2025
    [Essentials v20.1]

    Hi, I know that :ILLUSION ability only works with trainers. I want it to work with a hardcoded wild too.

    Does anyone know how I could hardcode a wild Zoroark event to start with the illusion of a specific pokemon? An event like this:

    Code:
    pkmn = Pokemon.new(:ZOROARK, 50)
    pkmn.ability = :ILLUSION
    pkmn.form = 0
    
    # Modify Zoroark's Illusion to (Pikachu, for example):
    
    # illusion_however_it_is_done = :PIKACHU
    
    WildBattle.start(pkmn)

    I know there's some code that needs to be touched for this to work, but I don't even know where to start.

    I need help! :D

    (Please, without using $game_switches, I don't think it's necessary for this)

    Thank you! <3
     
    Last edited:
    Try setting "@effects[PBEffects::Illusion]" during battle, as that's the way it works. With EBDX, you could just have it set in a battle script, but idk how you'd do it in vanilla Essentials without using variables/switches in some way
     
    The original Illusion script sets the species and name as the last active Pokémon in the party (unless the Illusionist is the only active member). What you want to try and do for Illusion in the wild is to set the species and name to a random local species. The easiest way I know how is to hard code two arrays, one for the species and one for the name. In a case/when statement based on the current map, set the arrays to whichever species are found locally and their names (how the species would appear in the game's text). At the end of the case statement, use wildspecies.sample to return a random element to a variable (randelem for explanation's sake) and set the wild Pokémon's species and name to the random element from the species and name arrays (use the same array index).
     
    Back
    Top