- 2
- Posts
- 2
- Years
- Seen Jul 26, 2023
Hey there, I made some easy to replace Scripts so that editing would become simpler for the newer people here!
Just a heads up, the flags that are recommended for use are 1200 and 1300 flags, since those aren't in use. Just replace the XX in the script, and remember to keep track of what flag you have used so far.
Where it says item, it means the Item's code (i.e. 0x44 for a rare candy) and where it says item, the amount is in HEX (you can use the hex calculator that XSE has included in it)
GIVE ITEM
Simple item gift by an NPC
In the case of the following one, Species also goes in HEX (again, refer to the calculator in XSE, and if needed for the Pokémon's ACTUAL number in G3T, as not every Pokémon has the same... reference number? pointer? not sure what it's called, but they don't have the same number as their Pokédex entry.)
Here you can see what I mean. While Treecko is Pokémon #252 in the dex entry, it is 277 in the game registry, therefore you use the 277 in the XSE hex/dec calculator.
![[PokeCommunity.com] Couple of Scripts I reworked for ease of use and modding. [PokeCommunity.com] Couple of Scripts I reworked for ease of use and modding.](https://data.pokecommunity.com/attachments/19/19071-28183709b671f598429b2e948af9f37d.jpg)
Level and held item go in Hex. Example, if you want to gift a level 10 Treecko holding a rare candy, then it should say "0x115 (277 converted to hex) 0xA (10 in hex) 0x44 0x0 0x0 0x0" (the last three numbers are filler)
GIVE POKEMON
A script to give a Pokémon, but it also checks your party for space, then pc, and then next available box
Next up is a nifty one I thought up of, based on one time sale items. It starts off as a yes or no question, that proceeds to become a transaction. Once again, items in hex, amount in hex using the XSE calculator, as well as money in hex. You can repeat the "additem0xITEM 0xAMOUNT" as many times as you like, so that the player receives multiple items. Like say multiple Poké balls, different types of berries, TMs, etc.
It even pops up the players money and changes text colors, because why not, amirite?
ONE TIME ITEM SALE
and finally, selling a Pokémon. Very much like the Magikarp vendor. This one is a doozy, I will highlight every single thing that needs to be changed.
SELLING A POKEMON
Also checks for party and pc space.
Basically, all you have to do, is pay attention to what you are doing, and keep track of what you have changed.
That would be all for today, hope this helps!
Just a heads up, the flags that are recommended for use are 1200 and 1300 flags, since those aren't in use. Just replace the XX in the script, and remember to keep track of what flag you have used so far.
Where it says item, it means the Item's code (i.e. 0x44 for a rare candy) and where it says item, the amount is in HEX (you can use the hex calculator that XSE has included in it)
GIVE ITEM
Simple item gift by an NPC
Code:
#dynamic 0x800000
#org @start //or if this doesn't work for you, then use the original pointer, followed immediately by goto @giveitem and start the string with #org @giveitem
lock
faceplayer
checkflag 0x13XX
if 0x1 goto @ok
msgbox @give 0x4
additem 0xITEM 0xAMOUNT
textcolor 0x3
msgbox @received 0x4
textcolor 0x1
setflag 0x13XX
goto @done
#org @done
msgbox @ok 0x4
release
end
#org @give
= thing that will be given
#org @received
= [player] received thing //when writing this line, write on the text adjuster "[player]", so that it refers to player by name, makes it look a bit classier
#org @ok
an outro once the item has been given
In the case of the following one, Species also goes in HEX (again, refer to the calculator in XSE, and if needed for the Pokémon's ACTUAL number in G3T, as not every Pokémon has the same... reference number? pointer? not sure what it's called, but they don't have the same number as their Pokédex entry.)
Here you can see what I mean. While Treecko is Pokémon #252 in the dex entry, it is 277 in the game registry, therefore you use the 277 in the XSE hex/dec calculator.
![[PokeCommunity.com] Couple of Scripts I reworked for ease of use and modding. [PokeCommunity.com] Couple of Scripts I reworked for ease of use and modding.](https://data.pokecommunity.com/attachments/19/19071-28183709b671f598429b2e948af9f37d.jpg)
Level and held item go in Hex. Example, if you want to gift a level 10 Treecko holding a rare candy, then it should say "0x115 (277 converted to hex) 0xA (10 in hex) 0x44 0x0 0x0 0x0" (the last three numbers are filler)
GIVE POKEMON
A script to give a Pokémon, but it also checks your party for space, then pc, and then next available box
Code:
'---------------
#dynamic 0x800000
#org WHATEVER IS ALREADY HERE
goto @givescript
#org @givescript
lock
faceplayer
checkflag 0x12XX
if 0x1 goto @done
msgbox @spk1 0x4
setvar 0x4001[COLOR="Magenta"] 0xSPECIES[/COLOR]
givepokemon [COLOR="Magenta"]0xSPECIES 0xLEVEL 0xHELD ITEM[/COLOR] [COLOR="Yellow"]0x0 0x0 0x0[/COLOR]
compare LASTRESULT 0x0
if 0x1 goto @pokemon1
compare LASTRESULT 0x1
if 0x1 goto @pokemon2
compare LASTRESULT 0x2
if 0x1 goto 0x81A927C
release
end
'---------------
#org @done
msgbox @close 0x4
release
end
'---------------
#org @pokemon1
textcolor 0x3
fanfare 0x101
preparemsg @recieve
waitmsg
waitfanfare
bufferpokemon 0x0 [COLOR="Magenta"]0xSPECIES[/COLOR]
msgbox 0x81A56A7 MSG_YESNO '"Do you want to give a nickname to\..."
compare LASTRESULT 0x0
if 0x1 goto @outro
call 0x81A8C27
call 0x81A74EB
goto @outro
'---------------
#org @pokemon2
textcolor 0x3
fanfare 0x101
preparemsg @recieve
waitmsg
waitfanfare
bufferpokemon 0x0 [COLOR="Magenta"]0xSPECIES[/COLOR]
msgbox 0x81A56A7 MSG_YESNO '"Do you want to give a nickname to\..."
compare LASTRESULT 0x0
if 0x1 goto @callout
call 0x81A8C33
goto @callout
'---------------
#org 0x1A927C
textcolor 0x3
msgbox 0x81A5E31 MSG_KEEPOPEN '"There's no more room for Pokémon!\..."
release
end
'---------------
#org @outro
textcolor 0x0
msgbox @final 0x4
setflag 0x12XX
release
end
'---------------
#org 0x1A8C27
countpokemon
subvar LASTRESULT 0x1
copyvar 0x8004 LASTRESULT
return
'---------------
#org 0x1A74EB
fadescreen 0x1
special 0x9E
waitstate
return
'---------------
#org @callout
call 0x81A8C3C
goto @outro
'---------------
#org 0x1A8C33
fadescreen 0x1
special 0x166
waitstate
lock
faceplayer
return
'---------------
#org 0x1A8C3C
bufferboxname 0x0 0x4037
bufferpokemon 0x1 0x4001
checkflag 0x834
if 0x0 call 0x81A8C57
checkflag 0x834
if 0x1 call 0x81A8C82
return
'---------------
#org 0x1A8C57
special2 LASTRESULT 0x165
compare LASTRESULT 0x1
if 0x1 goto 0x81A8C70
msgbox 0x81A5CF1 MSG_KEEPOPEN '"[buffer2] was transferred to\nSome..."
return
'---------------
#org 0x1A8C82
special2 LASTRESULT 0x165
compare LASTRESULT 0x1
if 0x1 goto 0x81A8C9B
msgbox 0x81A5D31 MSG_KEEPOPEN '"[buffer2] was transferred to\nBill..."
return
'---------------
#org 0x1A8C70
special2 LASTRESULT 0x18A
bufferboxname 0x2 LASTRESULT
msgbox 0x81A5D6E MSG_KEEPOPEN '"Box ["][buffer3]" on\nSomeone's PC..."
return
'---------------
#org 0x1A8C9B
special2 LASTRESULT 0x18A
bufferboxname 0x2 LASTRESULT
msgbox 0x81A5DB1 MSG_KEEPOPEN '"Box ["][buffer3]" on\nBill's PC wa..."
return
'---------
' Strings
'---------
#org @spk1
Intro
#org @close
thing said after action is finished
#org @recieve
= [player] obtained a Pokémon!
#org 0x1A56A7
= Do you want to give a nickname to\nthis [buffer1]?
#org 0x1A5E31
= There's no more room for Pokémon!\pThe Pokémon Boxes are full and\ncan't accept any more!
#org @final
Description of pokemon
#org 0x1A5CF1
= [buffer2] was transferred to\nSomeone's PC.\pIt was placed in \nBox ["][buffer1]."
#org 0x1A5D31
= [buffer2] was transferred to\nBill's PC.\pIt was placed in \nBox ["][buffer1]."
#org 0x1A5D6E
= Box ["][buffer3]" on\nSomeone's PC was full.\p[buffer2] was transferred to\nBox ["][buffer1]."
#org 0x1A5DB1
= Box ["][buffer3]" on\nBill's PC was full.\p[buffer2] was transferred to\nBox ["][buffer1]."
Next up is a nifty one I thought up of, based on one time sale items. It starts off as a yes or no question, that proceeds to become a transaction. Once again, items in hex, amount in hex using the XSE calculator, as well as money in hex. You can repeat the "additem0xITEM 0xAMOUNT" as many times as you like, so that the player receives multiple items. Like say multiple Poké balls, different types of berries, TMs, etc.
It even pops up the players money and changes text colors, because why not, amirite?
ONE TIME ITEM SALE
Code:
#dynamic 0x800000
#org original
goto @action
#org @action
lock
faceplayer
checkflag 0x13XX
if 0x1 goto @done
showmoney 0x0 0x0 0x0
goto @intro
end
#org @done
hidemoney 0x0 0x0
msgbox @thanksagain 0x4
release
end
#org @intro
msgbox @question 0x5
compare LASTRESULT 0x0
if 0x1 goto @goodbye
checkmoney [COLOR="Lime"]0xHEXAMOUNTOFMONEY[/COLOR] 0x0
compare LASTRESULT 0x0
if 0x1 goto @whoops
textcolor 0x3
paymoney [COLOR="Lime"]0xHEXAMOUNTOFMONEY[/COLOR] 0x0
msgbox @item 0x4
additem[COLOR="Yellow"] 0xITEM 0xAMOUNT[/COLOR]
updatemoney 0x0 0x0 0x0
fanfare 0x101
preparemsg @transaction
waitmsg
textcolor 0x1
waitfanfare
setflag 0x13XX
goto @done
#org @goodbye
hidemoney 0x0 0x0
msgbox @bye 0x4
release
end
#org @whoops
msgbox @oops 0x4
hidemoney 0x0 0x0
release
end
#org @item
item received
#org @thanksagain
post greeting
#org @question
y/n sale statement of item
#org @bye
player said no
#org @oops
player broke
#org @transaction
puttin the item in the bag
and finally, selling a Pokémon. Very much like the Magikarp vendor. This one is a doozy, I will highlight every single thing that needs to be changed.
SELLING A POKEMON
Also checks for party and pc space.
Code:
#dynamic 0x800000
#org WHATEVER WAS HERE
goto @sellpoke
'---------------
#org @sellpoke
lock
faceplayer
checkflag [COLOR="Magenta"]0x13XX[/COLOR]
if 0x1 goto @goodbye
showmoney 0x0 0x0 0x0
goto @yesno
'---------------
#org @goodbye
msgbox @outro 0x4
release
end
'---------------
#org @yesno
msgbox @question 0x5
compare LASTRESULT 0x0
if 0x1 goto @no
checkmoney [COLOR="Magenta"]0xHEX AMOUNT MONEY[/COLOR] 0x0
compare LASTRESULT 0x0
if 0x1 goto @playerbroke
textcolor 0x3
paymoney [COLOR="Magenta"]0xHEX AMOUNT MONEY[/COLOR] 0x0
msgbox @pokereceive 0x4
givepokemon [COLOR="Magenta"]0xSPECIES 0xLEVEL 0xITEM[/COLOR] 0x0 0x0 0x0
compare LASTRESULT 0x0
if 0x1 goto @get1
compare LASTRESULT 0x1
if 0x1 goto @get2
compare LASTRESULT 0x2
if 0x1 goto 0x81A927C
updatemoney 0x0 0x0 0x0
fanfare 0x101
preparemsg @reaction
waitmsg
textcolor 0x1
waitfanfare
setflag [COLOR="Magenta"]0x13XX[/COLOR]
goto @goodbye
'---------------
#org @no
hidemoney 0x0 0x0
msgbox @yourloss 0x4
release
end
'---------------
#org @playerbroke
msgbox @getmoney 0x4
hidemoney 0x0 0x0
release
end
'---------------
#org @get1
textcolor 0x3
fanfare 0x101
preparemsg @Pokegot
waitmsg
waitfanfare
bufferpokemon 0x0 [COLOR="Magenta"]0xHEX SPECIES[/COLOR]
msgbox 0x81A56A7 MSG_YESNO '"Do you want to give a nickname to\..."
compare LASTRESULT 0x0
if 0x1 goto @goodbye
call 0x81A8C27
call 0x81A74EB
goto @goodbye
'---------------
#org @get2
textcolor 0x3
fanfare 0x101
preparemsg @Pokegot
waitmsg
waitfanfare
bufferpokemon 0x0 [COLOR="Magenta"]0xHEX SPECIES[/COLOR]
msgbox 0x81A56A7 MSG_YESNO '"Do you want to give a nickname to\..."
compare LASTRESULT 0x0
if 0x1 goto @callout
call 0x81A8C33
goto 0x880129B
'---------------
#org 0x1A927C
textcolor 0x3
msgbox 0x81A5E31 MSG_KEEPOPEN '"There's no more room for Pokémon!\..."
release
end
'---------------
#org 0x1A8C27
countpokemon
subvar LASTRESULT 0x1
copyvar 0x8004 LASTRESULT
return
'---------------
#org 0x1A74EB
fadescreen 0x1
special 0x9E
waitstate
return
'---------------
#org @callout
call 0x81A8C3C
goto @goodbye
'---------------
#org 0x1A8C33
fadescreen 0x1
special 0x166
waitstate
lock
faceplayer
return
'---------------
#org 0x1A8C3C
bufferboxname 0x0 0x4037
bufferpokemon 0x1 0x4001
checkflag 0x834
if 0x0 call 0x81A8C57
checkflag 0x834
if 0x1 call 0x81A8C82
return
'---------------
#org 0x1A8C57
special2 LASTRESULT 0x165
compare LASTRESULT 0x1
if 0x1 goto 0x81A8C70
msgbox 0x81A5CF1 MSG_KEEPOPEN '"[buffer2] was transferred to\nSome..."
return
'---------------
#org 0x1A8C82
special2 LASTRESULT 0x165
compare LASTRESULT 0x1
if 0x1 goto 0x81A8C9B
msgbox 0x81A5D31 MSG_KEEPOPEN '"[buffer2] was transferred to\nBill..."
return
'---------------
#org 0x1A8C70
special2 LASTRESULT 0x18A
bufferboxname 0x2 LASTRESULT
msgbox 0x81A5D6E MSG_KEEPOPEN '"Box ["][buffer3]" on\nSomeone's PC..."
return
'---------------
#org 0x1A8C9B
special2 LASTRESULT 0x18A
bufferboxname 0x2 LASTRESULT
msgbox 0x81A5DB1 MSG_KEEPOPEN '"Box ["][buffer3]" on\nBill's PC wa..."
return
'---------
' Strings
'---------
#org @outro
message that plays once transaction is done
#org @question
pokemon sale question
#org @pokereceive
the pokemon you are getting
#org @reaction
players reaction, not needed but you can add humor here
#org @yourloss
player said no
#org @getmoney
Player was broke
#org @Pokegot
= [player] received a {Pokemon name goes here}
#org 0x1A56A7
= Do you want to give a nickname to\nthis [buffer1]?
#org 0x1A5E31
= There's no more room for Pokémon!\pThe Pokémon Boxes are full and\ncan't accept any more!
#org 0x1A5CF1
= [buffer2] was transferred to\nSomeone's PC.\pIt was placed in \nBox ["][buffer1]."
#org 0x1A5D31
= [buffer2] was transferred to\nBill's PC.\pIt was placed in \nBox ["][buffer1]."
#org 0x1A5D6E
= Box ["][buffer3]" on\nSomeone's PC was full.\p[buffer2] was transferred to\nBox ["][buffer1]."
#org 0x1A5DB1
= Box ["][buffer3]" on\nBill's PC was full.\p[buffer2] was transferred to\nBox ["][buffer1]."
Basically, all you have to do, is pay attention to what you are doing, and keep track of what you have changed.
That would be all for today, hope this helps!