Jump to content

[GEN 3] Mystery Event/Gift Research


Guest

Recommended Posts

@suloku That should work.

Well, a while ago I made this. It's a script to reset the clock. Unfortunately it doesn't really do what I wanted. I just wanted to be able to change the current ingame time, but if you set the clock with this script (it was actually taken from the clock in the players room) you will start from day 0 again. This script is based on the e-Card script, so you have to talk to Norman.

The first script is how it looked like in the ROM after compiling. The second script is how it should look like in the script region to actually work, you have to use virtual commands there instead of the regular ones.

It seems these virtual commands are not even supported by script editors, so you have to compile with the regular commands first and exchange them manually afterwards.

Here's a list of commands http://www.pokecommunity.com/showpost.php?p=7562756&postcount=24063

#org 0x874011E
'-----------------------------------
msgbox 0x8740136 ' It seems your clock ...
callstd MSG_NOCLOSE ' Non-closing message
call 0x874012E
releaseall
end

#org 0x87412E
'-----------------------------------
fadescreen FADEOUT_BLACK
special 0x9A
waitspecial
return


#org 0x8740136
= It seems your clock is stopped...\nYou should reset it now!

#org 0x61
'-----------------------------------
setvirtualaddress 0x2000061
lock
faceplayer
virtualmsgbox 0x200007F
waitmsg
waitkeypress
virtualcall 0x2000077
releaseall
end

#org 0x2000077
'-----------------------------------
fadescreen FADEOUT_BLACK
special 0x9A
waitspecial
return


#org 0x200007F
= It seems your clock is stopped...\nYou should reset it now!

It can be injected into EU/US Ruby/Sapphire with this AR code.

USE IT AT YOUR OWN RISK, this sets the day count back to 0!

0351287E F5F78C1D
AEEDC387 EB8C645D
04C86E13 651B7FB2
2E0EE9EA 67F78B4B
8F4FB9E0 A420904C
766287E0 09773817
AE4E89A0 2EB38036
34AF5042 25EF53C2
92F69ECF 2EC688B0
FE19CFC0 5D9C78AC
B308FD76 FA4A040A
8DA3E1C3 D33A936F
4DEC42A1 9BCEC7C8
5B178BD6 E3F7E779
67FCEFBA 903E53C7
6FEEFBA1 E2B255FC
507E849D 56173E4B
B144B5C8 4E4B5710
1EAF8A1D 9C869AB4
2E478D14 812CFCEE
A17EFA38 7C0BF4DB
7AF8D5C1 A39CB5CF
70E9BCBA F6185AA4
945E4E19 90771006
8A8FE89E 9335482C
E4BFF120 B454166E
5FBFD3DE 08C6287D
8AB50B78 048668FB

Link to comment
Share on other sites

That's really interesting. I still don't know how to create the scripts... but well, I'm only interested in modifying event scripts to re-create them if necessary, and making a give item, give egg and give pokemon scripts for wondercard usage (configurable in the editor).

Morfeo's regi dolls script might be interesting too, since the decorations are stored elswere, but it's probably just the command used in-game to give decorations.

Btw, I've went and added a decoration inventory editor to my tool since a-save didn't have one: http://puu.sh/oF3Bo/93e0c088c1.png

Current status of editor: http://puu.sh/oF3CV/15c8fb860b.png

There's an option to fix checksums and another one to enable mistery gift/event flags (for the lazy people).

I'm gonna work on the .ect (e-Card Trainers) editor.

It seems the berry one (.ecb for e-Card Berries) will need further investigation, trainer card is all documented so easy to code.

EDIT: ect editor is progressing fine: http://puu.sh/oFk84/c2cd0ac038.png

Implementing the easy chat system words was a pain.

Edited by suloku
Link to comment
Share on other sites

ajxpkm said:
It's cool. But we would need a save file where the Doll is still unclaimed.

The Mystery Events usually have a "terminate Script" command at the end of the Script.

So with an already claimed Regi Doll we can't get the Script. Would be cool if you could provide us with a save file that still has the Script on it.

Well, if you could just transfer the Regi dolls to a different save. If I'm not mistaken, I was able to scan the cards into that save twice. I only scanned in each one, one time. It might be possible to scan in 2-3 Regi dolls of each if you want. I never tried.

suloku said:
So, it would be far more interesting to have the saves from the e-reader that have scanned the cards (if you are willing to share them), as that would allows to use vba-link (or my boy in android) to actually enable the event.

I'd be more than happy to share anything and everything I have. I just have absolutely no idea how I could possibly go about doing so.

suloku said:
I seem to be stuck with the regi dolls promotional card.

I've tried using this emulator: https://projectpokemon.org/forums/showthread.php?42433-RELEASE-VBA-LINK-E-READER

E-reader raw code reading works. Cable linking works. But I don't seem to be able to transfer anything to japanesse ruby.

Here are some screenshots, if someone knows japanesse or can describe how to transfer the dolls:

Message after scanning the card: http://puu.sh/oEJpA/44e54bb529.png

After pressing A once: http://puu.sh/oEJq8/a857314ec3.png

After pressing A again: http://puu.sh/oEJqA/a3312fef80.png

I thought at the last screen I could connect trough mistery event (japanesse rom and save) to get the doll, but nothing happens.

BTW, I think I should go step by step, since trainer seems to be easier than berry. I'd also like to auto-detect japanesse saves...but this might be difficult.

The Regi dolls are simple as can be. (If I'm not mistaken.)

You scan them in. Hit A on the one you want to transfer. Then just hit A on the Ruby/Sapphire save and you game should receive them.

Once again, I think the berry is the exact same way if I'm not mistaken. Scan the berry and hit A, then hit A on Ruby. That terrible video I showed before shows the video from the Ruby perspective (Slightly) and an HD view of the E-reader perspective.

Edited by HaxAras
Link to comment
Share on other sites

That's really interesting. I still don't know how to create the scripts... but well, I'm only interested in modifying event scripts to re-create them if necessary, and making a give item, give egg and give pokemon scripts for wondercard usage (configurable in the editor).

Morfeo's regi dolls script might be interesting too, since the decorations are stored elswere, but it's probably just the command used in-game to give decorations.

Btw, I've went and added a decoration inventory editor to my tool since a-save didn't have one: http://puu.sh/oF3Bo/93e0c088c1.png

Current status of editor: http://puu.sh/oF3CV/15c8fb860b.png

There's an option to fix checksums and another one to enable mistery gift/event flags (for the lazy people).

I'm gonna work on the .ect (e-Card Trainers) editor.

It seems the berry one (.ecb for e-Card Berries) will need further investigation, trainer card is all documented so easy to code.

EDIT: ect editor is progressing fine: http://puu.sh/oFk84/c2cd0ac038.png

Implementing the easy chat system words was a pain.

Looking good! Any way we'll be able to convert .ect and .ecb files to dot codes (or at least work them into the DS and GC/Wii injectors)?

Edited by Invader TAK
Link to comment
Share on other sites

Looking good! Any way we'll be able to convert .ect and .ecb files to dot codes (or at least work them into the DS and GC/Wii injectors)?

If there is open source dotcode->bin source code, why not.

Berries are far more complicated than trainers, so a full berry editor will take time.

Link to comment
Share on other sites

Well, if you could just transfer the Regi dolls to a different save. If I'm not mistaken, I was able to scan the cards into that save twice. I only scanned in each one, one time. It might be possible to scan in 2-3 Regi dolls of each if you want. I never tried.

Yeah, sorry. I thought it was like the Eon Ticket e-Card ect. were you get a Script.

I didn't knew at the moment that it works different... suloku informed me about it already.

Thx a bunch for your save files and all the stuff!

Link to comment
Share on other sites

Guys, was the altering cave event never distribuited? In no language, right?

No, was never officially distributed. Not even in Japan.

Link to comment
Share on other sites

E-card trainer editor is fully done, seems to work well. Aparently you can't make trainer pokemon shiny (I used a-save's pid generation tool to test, male/female pid worked). Everything can be edited.

The only detail is that the Pokemon and moves words from the easy chat system apparently don't follow the same logic as all the other categories, so those words are basically broken right now.

Even though the e-Reader doesn't store the Regi Dolls into the save file, you can actually store them there by save hacking.

Team Fail did this with his tool for e-Reader Trainers [GEN 3] e-Reader Event Injection

Basically you have to decompress the raw e-Card and extract the VPK from it. Unfortunately his tool doesn't support multi-strip VPKs so it can't be used for the Regi-Dolls.

I was able to do all that manually, I used his tool for checksum fixing though.

I attached the Japanese Berryfix as well. Both tested and working!

Which tool did you use to decompress the raw files? EDIT: ok, nedcenc is the tool

Could you explain the merge process a little more? Getting raw into savs is really interesting. Also, the regi dolls present probably has the ROM code somewhere in it, meaning it can probably be easily modified for other regions... but for what I've seen what it does is send a script to RS, then it gets executed in the mnistery event screen and kills itself when it's done doing its job.

Also, I've looked a little into it and the trainer structure is easily found in the decompressed vpk from a trainer card (using Team Fail's tool to extract it). The only difference is that it doesn't have the checksum in the vpk file (I guess it's because the vpk itself has a checksum for its data?).

With Team Fail's tool making a save with a custom trainer is really easy (still needs hex editing though). I may add a export as decompressed vpk button by using an already decompressed vpk file as "template" to make the process easier. May including a decompressed vpk file in the program infringe copyright?

Also, for the one asking about conversion to dotcodes: in caithsith page you can read the following:

- Nintendo E-Reader dotcode bin maker - A tool to make a set of Nintendo E-Reader dotcode bin files, given a vpk file. Source code is included

- VBA 1.7.2 e-reader: this VBA can load either bin or raw files. When loading bin files you will be prompted to save it as a raw dotcode.

EDIT: for bin<-> raw conversion there's nedcenc.exe

As you can see raw dotcodes can already be generated, the process is not as difficult. With a couple batch files it's a matter of drag and drop (compress vpk -> convert to bin -> load in vba to save as raw)

Link to comment
Share on other sites

By the way, VBA-M supports loading e-reader dotcodes just fine, along with multiplayer. No need to bother with outdated versions of VBA :P

Link to comment
Share on other sites

In the post I linked above should be the source code for PSavFix, it has the section sizes for RS and FRLG.

short FLMAP[] = { 0xF24,0xF80,0xF80,0xF80,0xEC0,0xF80,0xF80,0xF80,0xF80,0xF80,0xF80,0xF80,0xF80,0x7D0,0x01C,0x100};
short RSMAP[] = { 0x890,0xF80,0xF80,0xF80,0xC40,0xF80,0xF80,0xF80,0xF80,0xF80,0xF80,0xF80,0xF80,0x7D0,0xF80,0xF80};

This one is for Emerald.

short EMAP[]   = { 0xF2C,0xF80,0xF80,0xF80,0xF08,0xF80,0xF80,0xF80,0xF80,0xF80,0xF80,0xF80,0xF80,0x7D0,0xF80,0xF80 };

Also, I wanted to ask about these maps. I used the FRLG map and the checksum calculation was non-valid and the save was erased. Are you sure these are correct?

Link to comment
Share on other sites

ajxpkm said:
Yeah, sorry. I thought it was like the Eon Ticket e-Card ect. were you get a Script.

I didn't knew at the moment that it works different... suloku informed me about it already.

Thx a bunch for your save files and all the stuff!

Absolutely. I can't do much, but I'll do everything I can.

Edited by HaxAras
Link to comment
Share on other sites

Also, I wanted to ask about these maps. I used the FRLG map and the checksum calculation was non-valid and the save was erased. Are you sure these are correct?

Well, I'm not sure if I ever checked them but those are also used in PSavFix which always worked for me https://projectpokemon.org/forums/showthread.php?29515-GBA-save-file-checksums&p=164767&viewfull=1#post164767

EDIT:

This is how I got the Regi-Dolls vpk into the sav:

Search the decoded strip 1 for the vpk string (strip 2 doesn't have it), it should be at 0x53. I'm not sure if this can be different for other cards.

In front of the vpk string there are two bytes, that's the size of the whole vpk (without those bytes counted in) after both parts were merged. For compatibility with Team Fail's Poke-reader those two bytes should be removed.

Remove the first 0x51 bytes (some kind of signature or whatever, it contains a NINTENDO string) in both files.

Now you can merge them.

Strip 2 will have some garbage at the end (something like 00 01 02 03 04 05 06 ...), you can just remove all the bytes that go over the size defined infront of the vpk string to get the final vpk file.

To get the vpk ready for sav injection you need to recreate a 0x34 bytes header, which includes the card name and the whole vpk file size. The name was actually in the 0x51 bytes you had to remove earlier, offset was 0x30.

This is probably something that could be done in a better way than I did it.

This header starts with a 32 bit checksum. See here for the algorithm http://www.pokecommunity.com/showthread.php?p=8743602#8743602

At 0x04 is the card name and 0x2C is the vpk file size.

The only problem are the bytes at 0x26 in the created header. For the Eon Ticket those are 00 00 04 00 00 00 while they are D5 19 06 10 02 00 for the Berry fix (I totally forgot this one actually gets stored into the save file).

I just used D5 19 06 10 02 00 because 00 00 04 00 00 00 didn't work, and surprisingly it worked. I have no idea what the meaning of these bytes is, but maybe they have something to do with the card type.

Edited by BlackShark
Link to comment
Share on other sites

I just used D5 19 06 10 02 00 because 00 00 04 00 00 00 didn't work, and surprisingly it worked. I have no idea what the meaning of these bytes is, but maybe they have something to do with the card type.

Thank you! For what I've seen there should be a flag to allow storing in the save file, that might be it.

Link to comment
Share on other sites

Speaking of Berry Fix, how does that one work exactly?

You say it gets stored into the save file. Where does it get stored? And how come it doesn't get wiped if you erase the save file? (or at least I don't think it does.)

Also curious about how it actually works, how it acts on the game.

Link to comment
Share on other sites

Ammako said:
Speaking of Berry Fix, how does that one work exactly?

You say it gets stored into the save file. Where does it get stored? And how come it doesn't get wiped if you erase the save file? (or at least I don't think it does.)

Also curious about how it actually works, how it acts on the game.

In terms of the game/Pokemon itself? I don't know jack about what the rest of these guys are doing.

You basically start up the program and it deposits a Zigzagoon into your party. You can deposit as many as you like. The game needs a working battery though. Think of it as similar to the Wishmaker Jirachi in terms of setup and being deposited but you can do in infinitely. As for the patch, I assume it just writes it to the cartridge itself. I think I read on Bulbapedia something like this. After about a year or 100 hours of playtime, the game goes into some kind of dead zone for a year. The berry fix patch basically just moves the internal date forward by a year so the game can go back to working as normal. I'm sure if you search Bulbapedia, you can find a far more coherent explanation.

EDIT:

I keep forgetting. Before, somebody asked if there were FR/LG and Emerald E-reader cards. There were for Japan. I only have 1 for Japan. I'm gonna scan it in eventually and write the save to an English Emerald and see what happens.

Edited by HaxAras
Link to comment
Share on other sites

Speaking of Berry Fix, how does that one work exactly?

You say it gets stored into the save file. Where does it get stored? And how come it doesn't get wiped if you erase the save file? (or at least I don't think it does.)

Also curious about how it actually works, how it acts on the game.

Berry glitch:

Game starts at 1 january (year 0)

When clock reaches 1 january (year 1) it will always report the day as 1 january (year 1) thus game thinks its always 1 januaru (year 1).

When clock reaches 1 january (year 2) it starts correctly working again.

Berry fix tweaks in-game data to be at least at 1 january (year 2) afaik.

eDIT: bulbapedia is more accurate, basically it's because the RTC starts at year 2000 and the game starts at year 2001, so the game adds 0 years to the number of days passed for both 2000 and 2001 RTC reported values.

What the berry patch does (actually does it via uploading a program to gba):

"If the Berry glitch has not yet begun, these programs will set the RTC forward by 366 days, which prevents the effects of the glitch. If the game is already affected by the Berry glitch, these programs will set the RTC forward to January 2, 2002, the date at which all effects of the glitch end. If the cartridge battery is replaced and a new game is started, the fix will need to be applied again."

Here's a program to modify the RTC at will on real carts (useful for battery replacement): http://furlocks-forest.net/wiki/?page=Pokemon_Ruby%2FSapphire_New_Battery_Glitch

On emulators, this glitch can only happen if you start the game with the emulator (computer) clock set to a day in the year 2000. I guess if you start the game in the year 2001 it won't happen at all.

Edited by suloku
Link to comment
Share on other sites

Ah so it modifies the rtc on the cartridge, never thought of that.

I knew about that program to modify the rtc, never made the connection though because I didn't think it worked that way. :P It is also needed if you backup and restore save files, 'cause that'll trigger the same glitch.

Learned that the hard way when I restored my save file to Ruby after sending the Eon Ticket over via emulator, and I thought my game was now broken and couldn't be fixed, so I deleted the save file. heh

Link to comment
Share on other sites

Ammako said:
Ah so it modifies the rtc on the cartridge, never thought of that.

I knew about that program to modify the rtc, never made the connection though because I didn't think it worked that way. :P It is also needed if you backup and restore save files, 'cause that'll trigger the same glitch.

Learned that the hard way when I restored my save file to Ruby after sending the Eon Ticket over via emulator, and I thought my game was now broken and couldn't be fixed, so I deleted the save file. heh

There's quite a few ways to fix it. FR/LG, Pokemon Colosseum and bonus disk, :XD:: Gale of Darkness, Pokemon Box and Channel and obviously the Berry Fix Zigzagoon disk. The interactive: Multi game Demo Disk V16.

Edited by HaxAras
Link to comment
Share on other sites

There's quite a few ways to fix it. FR/LG, Pokemon Colosseum and bonus disk, xD: Gale of Darkness, Pokemon Box and Channel and obviously the Berry Fix Zigzagoon disk. The interactive: Multi game Demo Disk V16.

Or V14, which is what I have.

Link to comment
Share on other sites

Hi guys!

Here is my Leaf Green (ITA) save file after the game came back from Nintendo yesterday. The Aurora Ticket has not been retrieved yet. I added a little gift for all the awesome work you guys all did! It's in the first party slot, 100% legal shiny obtained through soft resets. I trained it in Emerald then back to Leaf Green. Unfortunately, I didn't know anything about EV training at the time I caught it, so you might find the stats a little crappy. Anyway, I hope you enjoy it :)

SAV file: http://www.mediafire.com/download/164w2n92mwsdhc3/POKEMON_LEAF_BPGI00.sav

Edited by Alex Nutt
Link mistake
Link to comment
Share on other sites

Thank you very much!, but you can't link the rom here. Posting the CRC32 should be more than enough if you want people to use the same rom (here it is CRC32: 16974506)

Btw, won't you happen to have a save dump of the cartridge right before you sent it to nintendo? I didn't realize it would have been very interesting to see what exactly nintendo did to the save by comparing a before and after savegame. Probably it's just the WC data being inserted but still...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...