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

[Custom Feature Question] Adding an item to allow the player to create Shadow Pokemon

  • 8
    Posts
    5
    Years
    • Seen Jan 12, 2022
    Hi, I'm making a game and I want the player to have an item they can use to turn regular Pokes in their party into Shadow Pokes and vice versa without the use of the purification chamber, or the relic stone, how would I use the item effects codes to make the item? I'm assuming it involves "pkmn.makeShadow", but I'm not entirely sure how I need to set that up as this is my first attempt at adding an item that serves as a game mechanic and this is my first real Essentials project.

    Thanks in advance for your help!
     
    Last edited:
  • 87
    Posts
    7
    Years
    • Seen Nov 22, 2023
    Welcome to the community!

    For what you want to do, you'll have to go into the scripts (F11).
    Do a search (CTRL + SHIFT + F) for "TIMEFLUTE".

    Paste the red part underneath the time flute item handler. It should look like so:
    Code:
    ItemHandlers::UseOnPokemon.add(:TIMEFLUTE,proc{|item,pokemon,scene|
       if !pokemon.isShadow?
         scene.pbDisplay(_INTL("It won't have any effect."))
         next false
       end
       pokemon.heartgauge=0
       pbReadyToPurify(pokemon)
       next true
    })
    
    [COLOR="Red"]# Opens or closes the heart of Pokemon
    ItemHandlers::UseOnPokemon.add(:HEARTFLUTE,proc{|item,pokemon,scene|
       if pokemon.isShadow?
         pokemon.heartgauge=0
         pokemon.pbPurify(pokemon,scene)
         next false
       end
         pokemon.makeShadow
         scene.pbDisplay(_INTL("{1}'s heart has been closed.",pokemon.name))
       next true
    })[/COLOR]

    As you can probably tell, I named the item "Heart Flute."
    In items.txt, paste this:
    526,HEARTFLUTE,Heart Flute,Heart Flutes,1,0,"This item fully opens or closes the heart of Pokémon.",1,0,0

    Don't forget to add an icon for the item as well.
    Note: You may need to adjust the item's ID (mine is 526).

    If you have any more questions on Shadow Pokemon, you should visit the Pokemon Essentials Wiki page on Shadow Pokemon.

    Let me know if something didn't work for you or if you need any more help.
     
    Last edited:
  • 8
    Posts
    5
    Years
    • Seen Jan 12, 2022
    Thank you for the quick reply!

    I'd been doing all of my research for the implementing Shadow Pokemon from the Essentials wiki and that was just the only thing I couldn't find an answer for. So hopefully I'll have everything I need now, I greatly appreciate it.

    I'll test it out in a little while and let you know how it works.
     
  • 8
    Posts
    5
    Years
    • Seen Jan 12, 2022
    Okay, I've ran a test run and it works perfectly with no issues.

    Thank you so much for your help.
     
    Back
    Top