I'm using Lunos' wonder trade script and it all works well. However, right now the Pokemon you receive is at level five no matter what, as seen here:
givepokemon 0x8000
0x5 0x0 0x0 0x0 0x0
Is there some way to store your chosen Pokemon's level in a variable, then give you a random Pokemon at that same level? I have JPAN's hacked engine applied, if that helps.
Here's the script I'm using:
Code:
'---------------
#org 0x834DAB
faceplayer
lockall
msgbox 0x88BBDDE MSG_YESNO '"Wanna wonder trade?"
compare LASTRESULT 0x1
if 0x1 goto 0x88F83F4
msgbox 0x88EEFED MSG_NORMAL '"Come back anytime."
releaseall
end
'---------------
#org 0x8F83F4
countpokemon
compare LASTRESULT 0x1
if 0x1 goto 0x88F3419
msgbox 0x88FEF7D MSG_NORMAL '"Select the Pokémon you wanna trade..."
special 0x9F
waitstate
special2 0x8003 0x147
compare 0x8003 0x19C
if 0x1 goto 0x88BA2AA
compare 0x8004 0x6
if 0x4 goto 0x88BEEE1
goto 0x88EDAB2
'---------------
#org 0x8F3419
msgbox 0x8866BC4 MSG_NORMAL '"Sorry, you need two Pokémon\nto us..."
releaseall
end
'---------------
#org 0x8BA2AA
msgbox 0x8812385 MSG_NORMAL '"I'm sorry, you cannot trade\na Pok..."
releaseall
end
'---------------
#org 0x8BEEE1
msgbox 0x88EEFED MSG_NORMAL '"Come back anytime."
releaseall
end
'---------------
#org 0x8EDAB2
random 0x19C
compare LASTRESULT 0x0
if 0x1 goto 0x88EDAB2
compare LASTRESULT 0xFB
if 0x3 goto 0x88BB32D
compare LASTRESULT 0x115
if 0x4 goto 0x88BB32D
goto 0x88EDAB2
'---------------
#org 0x8BB32D
copyvar 0x8000 LASTRESULT
bufferpokemon 0x0 0x8000
showpokepic 0x8000 0xA 0x3
waitcry
callasm 0x871E751
givepokemon 0x8000 0x5 0x0 0x0 0x0 0x0
pause 0x13
fanfare 0x13E
msgbox 0x88BFC33 MSG_KEEPOPEN '"[player] got a [buffer1]!"
waitfanfare
closeonkeypress
hidepokepic
msgbox 0x88D4343 MSG_YESNO '"Wanna give it a nickname?"
compare LASTRESULT 0x1
if 0x1 call 0x8844FED
msgbox 0x88EEFED MSG_NORMAL '"Come back anytime."
releaseall
end
'---------------
#org 0x844FED
countpokemon
subvar LASTRESULT 0x1
copyvar 0x8004 LASTRESULT
fadescreen 0x1
special 0x9E
waitstate
return
'---------
' Strings
'---------
#org 0x8BBDDE
= Wanna wonder trade?
#org 0x8EEFED
= Come back anytime.
#org 0x8FEF7D
= Select the Pokémon you wanna trade.
#org 0x866BC4
= Sorry, you need two Pokémon\nto use the Wonder Trade.\pCome back anytime.
#org 0x812385
= I'm sorry, you cannot trade\na Pokémon Egg using the\lWonder Trade System.\pCome back anytime.
#org 0x8BFC33
= [player] got a [buffer1]!
#org 0x8D4343
= Wanna give it a nickname?
It's probably a simple question, but I'm just having trouble figuring it out. Thanks!