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

[Other] Script for legendary encounters?

97
Posts
9
Years
    • Seen Nov 22, 2021
    Hello!

    This is probably a very dumb question, but for my ROM hack I was hoping to include legendary POKéMON such as Deoxys, or Jirachi, etc. and I was wondering if there was some sort of script I could go off of to include them in the same way normal legendary POKéMON are included? Thanks!
     
    3,044
    Posts
    9
    Years
  • What do you mean by normal? Sorry, but, I can't remember because its been a long time since I played vanilla FireRed.
     
    97
    Posts
    9
    Years
    • Seen Nov 22, 2021
    What do you mean by normal? Sorry, but, I can't remember because its been a long time since I played vanilla FireRed.
    Oh, it's fine. I mean the legendary POKéMON that stand right in they're static spots and battle you when you talk to them, vanishing when you're done, i.e. Zapdos, Moltres, Articuno, Mewtwo etc.
     
    10,078
    Posts
    15
    Years
    • UK
    • Seen Oct 17, 2023
    Hello!

    This is probably a very dumb question, but for my ROM hack I was hoping to include legendary POKéMON such as Deoxys, or Jirachi, etc. and I was wondering if there was some sort of script I could go off of to include them in the same way normal legendary POKéMON are included? Thanks!

    If you find one of the events in a normal FR ROM you can take the script and tweak it to your needs - in this it'll just be repointing text to whatever you'd like and changing any pokemon numbers to your new one :) (EG - Mewtwo = 0x96, as seen in the script below).

    Spoiler: Mewtwo's script
    '---------------
    #org 0x1624F5
    special 0x187
    compare LASTRESULT 0x2
    if 0x1 goto 0x81A7AE0
    special 0x188
    lock
    faceplayer
    checksound
    cry 0x96 0x2
    preparemsg 0x8177F9F '"Mew!"
    waitmsg
    waitcry
    pause 0x14
    playsong 0x156 0x0
    waitkeypress
    setwildbattle 0x96 0x46 0x0
    setflag 0x807
    special 0x138
    waitstate
    clearflag 0x807
    special2 LASTRESULT 0xB4
    compare LASTRESULT 0x1
    if 0x1 goto 0x8162558
    compare LASTRESULT 0x4
    if 0x1 goto 0x8162561
    compare LASTRESULT 0x5
    if 0x1 goto 0x8162561
    setflag 0x2BC
    release
    end

    '---------------
    #org 0x1A7AE0
    release
    end

    '---------------
    #org 0x162558
    setflag 0x2BC
    goto 0x81A922D

    '---------------
    #org 0x162561
    setvar 0x8004 0x96
    goto 0x81A9236

    '---------------
    #org 0x1A922D
    fadescreen 0x1
    hidesprite LASTTALKED
    fadescreen 0x0
    release
    end

    '---------------
    #org 0x1A9236
    fadescreen 0x1
    hidesprite LASTTALKED
    fadescreen 0x0
    bufferpokemon 0x0 0x8004
    msgbox 0x81A63C4 MSG_KEEPOPEN '"The [buffer1] flew away!"
    release
    end


    '---------
    ' Strings
    '---------
    #org 0x177F9F
    = Mew!

    #org 0x1A63C4
    = The [buffer1] flew away!
     
    97
    Posts
    9
    Years
    • Seen Nov 22, 2021
    If you find one of the events in a normal FR ROM you can take the script and tweak it to your needs - in this it'll just be repointing text to whatever you'd like and changing any pokemon numbers to your new one :) (EG - Mewtwo = 0x96, as seen in the script below).

    Spoiler: Mewtwo's script
    '---------------
    #org 0x1624F5
    special 0x187
    compare LASTRESULT 0x2
    if 0x1 goto 0x81A7AE0
    special 0x188
    lock
    faceplayer
    checksound
    cry 0x96 0x2
    preparemsg 0x8177F9F '"Mew!"
    waitmsg
    waitcry
    pause 0x14
    playsong 0x156 0x0
    waitkeypress
    setwildbattle 0x96 0x46 0x0
    setflag 0x807
    special 0x138
    waitstate
    clearflag 0x807
    special2 LASTRESULT 0xB4
    compare LASTRESULT 0x1
    if 0x1 goto 0x8162558
    compare LASTRESULT 0x4
    if 0x1 goto 0x8162561
    compare LASTRESULT 0x5
    if 0x1 goto 0x8162561
    setflag 0x2BC
    release
    end

    '---------------
    #org 0x1A7AE0
    release
    end

    '---------------
    #org 0x162558
    setflag 0x2BC
    goto 0x81A922D

    '---------------
    #org 0x162561
    setvar 0x8004 0x96
    goto 0x81A9236

    '---------------
    #org 0x1A922D
    fadescreen 0x1
    hidesprite LASTTALKED
    fadescreen 0x0
    release
    end

    '---------------
    #org 0x1A9236
    fadescreen 0x1
    hidesprite LASTTALKED
    fadescreen 0x0
    bufferpokemon 0x0 0x8004
    msgbox 0x81A63C4 MSG_KEEPOPEN '"The [buffer1] flew away!"
    release
    end


    '---------
    ' Strings
    '---------
    #org 0x177F9F
    = Mew!

    #org 0x1A63C4
    = The [buffer1] flew away!
    Okay, yeah, I figured. Is there some place where all these numbers are indexed or stored, by any chance? Or just anywhere with a list of them.
     
    97
    Posts
    9
    Years
    • Seen Nov 22, 2021
    For anyone wondering, I have a generic script that can be used for this, basically just replace all instances of "ID" with whatever you want as the Pokémon!

    special 0x187
    compare LASTRESULT 0x2
    if 0x1 goto 0x81A7AE0
    special 0x188
    lock
    faceplayer
    setwildbattle 0xID 0x32 0x0
    checksound
    cry 0xID 0x2
    preparemsg 0x81A6448 '"Gyaoo!"
    waitmsg
    waitcry
    pause 0xA
    playsong 0x156 0x0
    waitkeypress
    setflag 0x807
    special 0x138
    waitstate
    clearflag 0x807
    special2 LASTRESULT 0xB4
    compare LASTRESULT 0x1
    if 0x1 goto 0x8163B96
    compare LASTRESULT 0x4
    if 0x1 goto 0x8163B9F
    compare LASTRESULT 0x5
    if 0x1 goto 0x8163B9F
    setflag 0x2BD
    release
    end

    '---------------
    #org 0x1A7AE0
    release
    end

    '---------------
    #org 0x163B96
    setflag 0x2BD
    goto 0x81A922D

    '---------------
    #org 0x163B9F
    setvar 0x8004 0xID
    goto 0x81A9236

    '---------------
    #org 0x1A922D
    fadescreen 0x1
    hidesprite LASTTALKED
    fadescreen 0x0
    release
    end

    '---------------
    #org 0x1A9236
    fadescreen 0x1
    hidesprite LASTTALKED
    fadescreen 0x0
    bufferpokemon 0x0 0x8004
    msgbox 0x81A63C4 MSG_KEEPOPEN '"The [buffer1] flew away!"
    release
    end


    '---------
    ' Strings
    '---------
    #org 0x1A6448
    = Gyaoo!

    #org 0x1A63C4
    = The [buffer1] flew away!
     
    1
    Posts
    3
    Years
    • Seen Dec 12, 2020
    Thank you, you have saved me all this time later. I love this community and the helpful people within it!
     
    42
    Posts
    8
    Years
    • Seen yesterday
    really late here, but how do you change the pokemons level?
    After setwildbattle, the first 0x is the Pokémon's index number (so, Mewtwo is 0x96) and the next 0x is the level (0x46 = 70 in decimal, 0x32 = 50 in decimal)

    I'm not sure about the third 0x, but it's probably better to leave it as 0
     
    69
    Posts
    8
    Years
    • Seen Apr 8, 2024
    Out of curiosity, What would be the flags to allow a legendary encounter to be reactive?
     
    Back
    Top