• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[Script] Help with give egg

darthbr

Banned
  • 237
    Posts
    9
    Years
    • Seen Sep 13, 2024
    Hey guys, whats up? im new into xse scripts

    I need help in some things, im creating a hack rom based on elegant emerald, i changed lots of things, such trainers, to make it more vanilla but with 386 pokemons and events, the thing is, its almost perfect, i need to change few things but dont know how... i think its simple.. gonna post here. there is a NPC in pacificlog town that give one of the starters (i think its based on witch one u got), i dont like the idea of giving the pokemon like this script, and the pokemon description would be ''found at pacifilog town" lv 5.... i prefer giving a egg, then the egg will hatch and the pokemon will come lv 1 in my hack and after hatched in a random place... will looks more vanilla and not a ''hack rom''

    so, i need change the give pokemon to give egg...


    '---------------

    #org 0xE420F8

    lock

    faceplayer

    checkflag 0x4AE

    if 0x1 goto 0x8E42250

    msgbox 0x8E4225B MSG_YESNO '"Are you a trainer?\p. . .\pYes?!\p..."

    compare LASTRESULT 0x1

    if 0x1 goto 0x8E42121

    msgbox 0x8E42334 MSG_KEEPOPEN '"Oh no!\pWhat am I going to do now?..."

    release

    end



    '---------------

    #org 0xE42250

    msgbox 0x8E422F1 MSG_KEEPOPEN '"We may seem lost at first, we just..."

    release

    end



    '---------------

    #org 0xE42121

    copyvar 0x8000 0x4023

    compare 0x8000 0x0

    if 0x1 goto 0x8E431D8

    compare 0x8000 0x1

    if 0x1 goto 0x8E43214

    compare 0x8000 0x2

    if 0x1 goto 0x8E43250

    release

    end



    '---------------

    #org 0xE431D8

    countpokemon

    compare LASTRESULT 0x6

    if 0x1 goto 0x8E421F2

    givepokemon 0x11B 0x5 0x8B 0x0 0x0 0x0

    call 0x8E42511

    msgbox 0x8E42359 MSG_YESNO '"Would you like to give a nickname\..."

    compare LASTRESULT 0x1

    if 0x1 goto 0x8E421F2

    setflag 0x4AE

    release

    end



    '---------------

    #org 0xE43214

    countpokemon

    compare LASTRESULT 0x6

    if 0x1 goto 0x8E421F2

    givepokemon 0x115 0x5 0x8B 0x0 0x0 0x0

    call 0x8E421FD

    msgbox 0x8E42359 MSG_YESNO '"Would you like to give a nickname\..."

    compare LASTRESULT 0x1

    if 0x1 goto 0x8E42239

    setflag 0x4AE

    release

    end



    '---------------

    #org 0xE43250

    countpokemon

    compare LASTRESULT 0x6

    if 0x1 goto 0x8E421F2

    givepokemon 0x118 0x5 0x8B 0x0 0x0 0x0

    call 0x8E42225

    msgbox 0x8E42359 MSG_YESNO '"Would you like to give a nickname\..."

    compare LASTRESULT 0x1

    if 0x1 goto 0x8E42239

    setflag 0x4AE

    release

    end



    '---------------

    #org 0xE421F2

    msgbox 0x8E4238F MSG_KEEPOPEN '"Oh no!\pYou don't have room for th..."

    release

    end



    '---------------

    #org 0xE42511

    bufferpokemon 0x1 0x11B

    fanfare 0x172

    preparemsg 0x8E423E1 '"[player] recieved the [buffer2]!"

    waitmsg

    waitfanfare

    bufferpokemon 0x0 0x11B

    return



    '---------------

    #org 0xE421FD

    bufferpokemon 0x1 0x115

    fanfare 0x172

    preparemsg 0x8E423E1 '"[player] recieved the [buffer2]!"

    waitmsg

    waitfanfare

    bufferpokemon 0x0 0x115

    return



    '---------------

    #org 0xE42239

    countpokemon

    subvar LASTRESULT 0x1

    copyvar 0x8004 LASTRESULT

    fadescreen 0x1

    special 0xA1

    waitstate

    setflag 0x4AE

    release

    end



    '---------------

    #org 0xE42225

    bufferpokemon 0x1 0x118

    fanfare 0x172

    preparemsg 0x8E423E1 '"[player] recieved the [buffer2]!"

    waitmsg

    waitfanfare

    bufferpokemon 0x0 0x118

    return





    '---------

    ' Strings

    '---------

    #org 0xE4225B

    = Are you a trainer?\p. . .\pYes?!\pThat's great!\pI found this lost POKéMON, but\nI'm too young to look after it.\pCould you look after it for me?



    #org 0xE42334

    = Oh no!\pWhat am I going to do now?!



    #org 0xE422F1

    = We may seem lost at first, we just\nhaven't found the right path.



    #org 0xE42359

    = Would you like to give a nickname\nto the [buffer1]?



    #org 0xE4238F

    = Oh no!\pYou don't have room for this\nPOKéMON!\pPlease come back when you do!



    #org 0xE423E1

    = [player] recieved the [buffer2]!
     
    I am not sure if this is the answer you were looking for, but to give an egg instead of the Pokemon just replace the "givepokemon" command with the "giveegg" command.

    Below is the script written to give out an egg, I also added the countpokemon command so if you have 6 in your party you wouldn't be able to recieve the egg.

    The giveegg command only requires the Pokemon species number, so if I'd want to give out a Bulbasaur I'd write:

    #dynamic 0x800000
    #org @start
    countpokemon
    compare lastresult 0x6
    if 0x1 goto @cantobtain
    msgbox @givepokemon1 0x6
    giveegg 0x1
    release
    end

    '----------------
    #org @cantobtain
    msgbox @fullparty 0x6
    release
    end

    '----------------
    #org @givepokemon1
    = Here's a pokemon!

    #org @fullparty
    = Sorry, you need at least one\nfree space in your party.
     
    Back
    Top