Hey I'm working on a slightly tweaked version of Leaf Green and am having trouble editing the Game corner prizes.
I haven't found a tool to edit them and I'm so new to hex editing it's a bit over my head
Any help would be appreciated
thanks in advance
Changing the Game Corner prizes requires two changes to be made, firstly, editing the prizes given (and their associate prices) which can be done easily through scripting and secondly, changing the multichoice box which will require some hex editing as you're using LG. FR has a multichoice box editor that would make the second part a lot easier but it isn't available for LG. I'd strongly recommend that you change over to a FR ROM as almost all of the community's research and tool development has been focused on it while LG is rarely given a second thought. Anyway, here's a guide on how to change the Game Corner prizes in LG. As always, make a back-up of your ROM before you make any major changes in case something goes horribly, horribly wrong.
Firstly, it is pretty simple to change the rewards you receive through scripting with a tool like XSE. Here's the script for the left-most attendant with dynamic pointers and some comments I added to help better understand what is happening in the script.
The parts that you want to pay attention to are the @Choice pointers as they determine what you will receive depending on your answer. Variable 0x4001 is the ID for the item that you will receive while 0x4002 determines how much it costs in coins. For example, @Choice1 sets 0x4001 to 0xC2 (Smoke Ball) and 0x4002 to 0x320 (800 coins). You can find a list of item IDs in
diegoisawesome's XSE tutorial, though you will need to convert them into hexadecimal notation. These variables are checked for several different uses later on: buffering the item's name, checking if you have enough coins and checking if your bag is full before finally giving you the item and subtracting the price.
The other two attendants vary slightly but ultimately function similarly. Just search for the parts of their scripts that are similar to the @Choice parts and you'll be able to easily edit what they give you. If you were to play your game after changing the attendant's scripts you will receive your new prizes, however the multichoice boxes will still display their original text. Here is the tricky part where we need to hex edit.
This thread gives an overview of how to edit multichoice boxes in FR and is largely applicable to LG, however the pointers are different between the two versions. The FR table of multichoice boxes starts at 0x3E04B0 while the LG ones start at 0x3E035C. The mutlichoice box numbers that we're looking for are 0xE (Pokemon attendant), 0x1E (TM attendant) and 0x29 (Item attendant). For this example I'm going to continue using the item attendant, but all three tables can be edited in exactly the same way.
Firstly, you need to find the pointer to your chosen multichoice box. Since we know how the table is constructed (thanks to JPAN's thread) we only need to do a little bit of maths to figure out which pointer we need. The length of each table entry is 8 bytes with the first occurring at 0x3E035C. Knowing this, we can find any entry with the mathematical operation: (0x8 * 0xTableID) + 0x3E035C. When I replace 0xTableID with 0x29 we get the result 0x3E04A4. When you go to that pointer in the editor you should see the data string "2C FE 3D 08 06 00 00 00" - this is the data for our multichoice box. An easy way to check if you've gotten the correct location is to check the fifth byte and make sure that it lines up with the number of choices in your multichoice box. Since our fifth byte is 06 we can be sure that this is the data we're looking for as that is the number of options available to use (five items and an exit command). You can also edit this byte to another number (no greater than 08) to change the number of options available. If you want to have more options than six for multichoice 0x29 you will need to do some more repointing that I won't be covering unless you need it.
The part that we're interested in is the reversed pointer making up the first four bytes of the table entry. To make the pointer usable we need to swap its constituent parts around, reversing the order of each byte. Our pointer should look like this:
2CFE3D08 - > [2C] [FE] [3D] [08] -> [08] [3D] [FE] [2C] -> 083DFE2C - > 0x3DFE2C
Goto the resulting pointer in your hex editor and you should see a another data table with the structure "XXXXXXXX 00000000" where the Xs are a reversed pointer. These ones are a different to the ones we were messing with above as these are text pointers and point to the text strings that we see in the multichoice box. At this pointer we can open up XSE again and prepare a new string to replace these ones. You can make a simple text pointer by compiling this script:
The '\c\h13\h50' part of the text is a special command that shifts the following text to the right-most side of the box. The '' part miniaturises the text, making it look more stylish.
Write down the location where the text script is inserted and make a reverse pointer of it. Using the example I showed above, if the text was inserted at 08812345 our reversed pointer would be 45238108. Overwrite the original pointer and save it. When you test it out in game the first option's text should have changed to a Lucky Egg. Go 8 bytes ahead to the next pointer and repeat this until you've changed every option with custom text.
I know that you said that hex editing is a bit over your head at this point in time, but since you're using LG there are no tools to change multichoice boxes. Hopefully this is helpful - I'm pretty sleepy so I'm sure there's something that I explained pretty badly somewhere in there. If you have any questions feel free to post them and I'll try to help out again.