I am trying to make a script:
Check if the player has seen at least 10 PKMN in the national dex.
Then if they have, give them an Old Rod.
It seems to work.
Script:
'---------------
#org 0x106473C
lock
faceplayer
checkflag 0x1011
if 0x1 goto 0x9064253
msgbox 0x9064269 MSG_FACE '"Ah... yes! Don't say a word! I can..."
setvar 0x8005 0x1
special 0xD4
compare 0x8005 0xA
if 0x0 goto 0x906425E
msgbox 0x90642BF MSG_FACE '"Crawling through caves...\pRunning..."
giveitem 0x106 0x1 MSG_OBTAIN
setflag 0x1011
msgbox 0x9064400 MSG_FACE '"That's my Old Rod, from when I\nfi..."
release
end
'---------------
#org 0x1064253
msgbox 0x90644F9 MSG_FACE '"Ah, yes. I hope that Old Rod will\..."
release
end
'---------------
#org 0x106425E
msgbox 0x9064559 MSG_FACE '"Hmm... Or maybe not...\nListen, co..."
release
end
'---------
' Strings
'---------
#org 0x1064269
= Ah... yes! Don't say a word! I can\ntell you are the kind of kid who\lgets around!...
#org 0x10642BF
= Crawling through caves...\pRunning through fields...\pClimbing great mountains...\pCrossing huge oceans!\pSneaking into secret hideouts!\pSeeking out hidden temples and\nancient ruins!\pBusting into the houses of\ninnocent civilians and running\laround their rooms searching for\litems! Haha! I love a good\ladventure! Listen up!
#org 0x1064400
= That's my Old Rod, from when I\nfirst went out to study and catch\lPok?mon. Now I know some people\lsay Old Rods can't catch anything\lgood! But listen, kid! I've caught\lplenty of baby Water type Pok?mon\lwith that rod, and raised them to\lbe powerful!
#org 0x10644F9
= Ah, yes. I hope that Old Rod will\nhelp you out! Remember, there are\lother types of Rods, too!
#org 0x1064559
= Hmm... Or maybe not...\nListen, come see me after you have\lseen at least 10 kinds of Pok?mon,\lI'll give you something to help\lyour adventuring! You don't have\lto catch them, just collect 10 in\lyour Pok?dex as seen!
Two things I am not 100% sure about:
-Is this the right way to check if it is 10 or greater?
Or will this only allow it if it is exactly 10?
So there is another way to compare to 10 or greater than 10?
-Secondly, I had a bug in one test where even if I had seen 10, it did not work.
Am I correctly checking the 8005 variable?
I think special D4 writes national dex seen PKMN data there?
Is it affected by something else?
Thanks. :)
Check if the player has seen at least 10 PKMN in the national dex.
Then if they have, give them an Old Rod.
It seems to work.
Script:
Spoiler:
'---------------
#org 0x106473C
lock
faceplayer
checkflag 0x1011
if 0x1 goto 0x9064253
msgbox 0x9064269 MSG_FACE '"Ah... yes! Don't say a word! I can..."
setvar 0x8005 0x1
special 0xD4
compare 0x8005 0xA
if 0x0 goto 0x906425E
msgbox 0x90642BF MSG_FACE '"Crawling through caves...\pRunning..."
giveitem 0x106 0x1 MSG_OBTAIN
setflag 0x1011
msgbox 0x9064400 MSG_FACE '"That's my Old Rod, from when I\nfi..."
release
end
'---------------
#org 0x1064253
msgbox 0x90644F9 MSG_FACE '"Ah, yes. I hope that Old Rod will\..."
release
end
'---------------
#org 0x106425E
msgbox 0x9064559 MSG_FACE '"Hmm... Or maybe not...\nListen, co..."
release
end
'---------
' Strings
'---------
#org 0x1064269
= Ah... yes! Don't say a word! I can\ntell you are the kind of kid who\lgets around!...
#org 0x10642BF
= Crawling through caves...\pRunning through fields...\pClimbing great mountains...\pCrossing huge oceans!\pSneaking into secret hideouts!\pSeeking out hidden temples and\nancient ruins!\pBusting into the houses of\ninnocent civilians and running\laround their rooms searching for\litems! Haha! I love a good\ladventure! Listen up!
#org 0x1064400
= That's my Old Rod, from when I\nfirst went out to study and catch\lPok?mon. Now I know some people\lsay Old Rods can't catch anything\lgood! But listen, kid! I've caught\lplenty of baby Water type Pok?mon\lwith that rod, and raised them to\lbe powerful!
#org 0x10644F9
= Ah, yes. I hope that Old Rod will\nhelp you out! Remember, there are\lother types of Rods, too!
#org 0x1064559
= Hmm... Or maybe not...\nListen, come see me after you have\lseen at least 10 kinds of Pok?mon,\lI'll give you something to help\lyour adventuring! You don't have\lto catch them, just collect 10 in\lyour Pok?dex as seen!
Two things I am not 100% sure about:
-Is this the right way to check if it is 10 or greater?
Or will this only allow it if it is exactly 10?
So there is another way to compare to 10 or greater than 10?
-Secondly, I had a bug in one test where even if I had seen 10, it did not work.
Am I correctly checking the 8005 variable?
I think special D4 writes national dex seen PKMN data there?
Is it affected by something else?
Thanks. :)
Last edited: