The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Help with give egg

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old October 24th, 2020 (5:00 PM).
darthbr darthbr is offline
Banned
 
Join Date: Dec 2015
Posts: 237
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]!
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old October 25th, 2020 (3:08 PM).
mcferaligatr's Avatar
mcferaligatr mcferaligatr is offline
 
Join Date: Nov 2018
Posts: 120
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.
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:16 AM.