From 0bc7fb92db8658c461f81ef57bc9bc4f3ee80c7b Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 21 Jan 2018 12:36:11 +0100 Subject: start decompiling mystery event script --- data/mystery_event_msg.s | 96 --------------------------------- data/mystery_event_script_cmd_table.s | 22 ++++++++ data/mystery_event_scripts.s | 72 +++++++++++++++++++++++++ data/script_funcs.s | 21 -------- data/scripts/maps/PetalburgCity_Gym.inc | 4 +- data/specials.inc | 2 +- 6 files changed, 97 insertions(+), 120 deletions(-) delete mode 100644 data/mystery_event_msg.s create mode 100644 data/mystery_event_script_cmd_table.s create mode 100644 data/mystery_event_scripts.s delete mode 100644 data/script_funcs.s (limited to 'data') diff --git a/data/mystery_event_msg.s b/data/mystery_event_msg.s deleted file mode 100644 index e5525477d..000000000 --- a/data/mystery_event_msg.s +++ /dev/null @@ -1,96 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -gText_MysteryGiftBerry:: @ 8674AE4 - .string "Obtained a {STR_VAR_2} BERRY!\nDad has it at PETALBURG GYM.$" - -gText_MysteryGiftBerryTransform:: @ 8674B16 - .string "The {STR_VAR_1} BERRY transformed into\none {STR_VAR_2} BERRY.$" - -gText_MysteryGiftBerryObtained:: @ 8674B42 - .string "The {STR_VAR_1} BERRY has already been\nobtained.$" - -gText_MysteryGiftSpecialRibbon:: @ 8674B6A - .string "A special RIBBON was awarded to\nyour party POKéMON.$" - -gText_MysteryGiftNationalDex:: @ 8674B9E - .string "The POKéDEX has been upgraded\nwith the NATIONAL MODE.$" - -gText_MysteryGiftRareWord:: @ 8674BD4 - .string "A rare word has been added.$" - -gText_MysteryGiftSentOver:: @ 8674BF0 - .string "{STR_VAR_1} was sent over!$" - -gText_MysteryGiftFullParty:: @ 8674C02 - .string "Your party is full.\n{STR_VAR_1} could not be sent over.$" - -gText_MysteryGiftNewTrainer:: @ 8674C31 - .string "A new TRAINER has arrived in\nHOENN.$" - .string "A new adversary has arrived in the\nBATTLE TOWER.$" - -gText_MysteryGiftCantBeUsed:: @ 8674C86 - .string "This data can’t be used in\nthis version.$" - -gUnknown_08674CAF:: @ 8674CAF - .incbin "baserom.gba", 0x00674caf, 0x2e - -gText_MysteryGiftStampCard:: - .string "Thank you for using the STAMP CARD\nSystem.\pYou have {STR_VAR_1} more to collect to\nfill your STAMP CARD.$" - -gUnknown_08674D3D:: @ 8674D3D - .incbin "baserom.gba", 0x00674d3d, 0xa1 - -gText_MysteryGiftEgg:: - .string "Thank you for using the MYSTERY\nGIFT System.\pFrom the POKéMON CENTER we\nhave a gift--a POKéMON EGG!\pPlease raise it with love and\nkindness.$" - .string "Oh, your party appears to be full.\pPlease come see me after storing\na POKéMON on a PC.$" - -gUnknown_08674EC1:: @ 8674EC1 - .incbin "baserom.gba", 0x00674ec1, 0x29 - -gText_MysteryGiftVisitingTrainer:: - .string "Thank you for using the MYSTERY\nGIFT System.\pBy holding this WONDER CARD, you\nmay take part in a survey at a\lPOKéMON MART.\pUse these surveys to invite\nTRAINERS to SOOTOPOLIS CITY.\p…Let me give you a secret\npassword for a survey:\p“GIVE ME\nAWESOME TRAINER”\pWrite that in on a survey and send\nit to the WIRELESS\lCOMMUNICATION SYSTEM.$" - .string "Thank you for using the MYSTERY\nGIFT System.\pA TRAINER has arrived in\nSOOTOPOLIS CITY looking for you.\pWe hope you will enjoy\nbattling the visiting TRAINER.\pYou may invite other TRAINERS by\nentering other passwords.\pTry looking for other passwords\nthat may work.$" - -gUnknown_0867513C:: @ 867513C - .incbin "baserom.gba", 0x0067513c, 0x48 - -gText_MysteryGiftBattleCountCard:: - .string "Thank you for using the MYSTERY\nGIFT System.\pYour BATTLE COUNT CARD keeps\ntrack of your battle record against\lTRAINERS with the same CARD.\pLook for and battle TRAINERS who\nhave the same CARD as you.\pYou may check the overall rankings\nby reading the NEWS.\pPlease do give it a try!$" - .string "Thank you for using the MYSTERY\nGIFT System.\pCongratulations!\pYou have won a prize for winning\nthree battles!\pWe hope you will be inspired to\nbattle some more.$" - -gUnknown_0867533C:: @ 867533C - .incbin "baserom.gba", 0x0067533c, 0x6d - -gText_MysteryGiftTicket1:: - .string "Thank you for using the MYSTERY\nGIFT System.\pYou must be {PLAYER}.\nThere is a ticket here for you.$" - .string "It appears to be for use at the\nLILYCOVE CITY port.\pWhy not give it a try and see what\nit is about?$" - .string "Thank you for using the MYSTERY\nGIFT System.$" - .string "Oh, I’m sorry, {PLAYER}.\nYour BAG’s KEY ITEMS POCKET is full.\pPlease store something on your PC,\nthen come back for this.$" - -gUnknown_0867550B:: @ 867550B - .incbin "baserom.gba", 0x0067550b, 0x76 - -gText_MysteryGiftTicket2:: - .string "Thank you for using the MYSTERY\nGIFT System.\pYou must be {PLAYER}.\nThere is a ticket here for you.$" - .string "It appears to be for use at the\nLILYCOVE CITY port.\pWhy not give it a try and see what\nit is about?$" - .string "Thank you for using the MYSTERY\nGIFT System.$" - .string "Oh, I’m sorry, {PLAYER}.\nYour BAG’s KEY ITEMS POCKET is full.\pPlease store something on your PC,\nthen come back for this.$" - -gUnknown_086756E3:: @ 86756E3 - .incbin "baserom.gba", 0x006756e3, 0x25 - -gText_MysteryGiftAlteringCave:: - .string "Thank you for using the MYSTERY\nGIFT System.\pThere appears to be a rumor about\nrare POKéMON sightings.\pThe sightings reportedly came from\nthe ALTERING CAVE on ROUTE 103.\pPerhaps it would be worthwhile for\nyou to investigate this rumor.$" - -gUnknown_086757F4:: @ 86757F4 - .incbin "baserom.gba", 0x006757f4, 0x6d - -gText_MysteryGiftOldSeaMap:: - .string "Thank you for using the MYSTERY\nGIFT System.\pLet me confirm--you are {PLAYER}?\pWe received this OLD SEA MAP\naddressed to you.$" - .string "It appears to be for use at the\nLILYCOVE CITY port.\pWhy not give it a try and see what\nit is about?$" - .string "Thank you for using the MYSTERY\nGIFT System.$" - .string "Oh, I’m sorry, {PLAYER}.\nYour BAG’s KEY ITEMS POCKET is full.\pPlease store something on your PC,\nthen come back for this.$" - .align 2 diff --git a/data/mystery_event_script_cmd_table.s b/data/mystery_event_script_cmd_table.s new file mode 100644 index 000000000..867b05e07 --- /dev/null +++ b/data/mystery_event_script_cmd_table.s @@ -0,0 +1,22 @@ + .section script_data, "aw", %progbits + + .align 2 +gMysteryEventScriptCmdTable:: @ 82DED2C + .4byte MEScrCmd_nop + .4byte MEScrCmd_checkcompat + .4byte MEScrCmd_end + .4byte MEScrCmd_setmsg + .4byte MEScrCmd_setstatus + .4byte MEScrCmd_runscript + .4byte MEScrCmd_initramscript + .4byte MEScrCmd_setenigmaberry + .4byte MEScrCmd_giveribbon + .4byte MEScrCmd_givenationaldex + .4byte MEScrCmd_addrareword + .4byte MEScrCmd_setrecordmixinggift + .4byte MEScrCmd_givepokemon + .4byte MEScrCmd_addtrainer + .4byte MEScrCmd_enableresetrtc + .4byte MEScrCmd_checksum + .4byte MEScrCmd_crc +gMysteryEventScriptCmdTableEnd:: diff --git a/data/mystery_event_scripts.s b/data/mystery_event_scripts.s new file mode 100644 index 000000000..ea94c671e --- /dev/null +++ b/data/mystery_event_scripts.s @@ -0,0 +1,72 @@ +#include "constants/flags.h" +#include "constants/items.h" +#include "constants/moves.h" +#include "constants/songs.h" +#include "constants/species.h" +#include "constants/vars.h" + .include "asm/macros.inc" + .include "asm/macros/event.inc" + .include "constants/constants.inc" + + .section .rodata + +gUnknown_08674CB0:: @ 8674CB0 + .incbin "baserom.gba", 0x00674cb0, 0x2d + +gText_MysteryGiftStampCard:: + .string "Thank you for using the STAMP CARD\nSystem.\pYou have {STR_VAR_1} more to collect to\nfill your STAMP CARD.$" + +gUnknown_08674D3D:: @ 8674D3D + .incbin "baserom.gba", 0x00674d3d, 0xa1 + +gText_MysteryGiftEgg:: + .string "Thank you for using the MYSTERY\nGIFT System.\pFrom the POKéMON CENTER we\nhave a gift--a POKéMON EGG!\pPlease raise it with love and\nkindness.$" + .string "Oh, your party appears to be full.\pPlease come see me after storing\na POKéMON on a PC.$" + +gUnknown_08674EC1:: @ 8674EC1 + .incbin "baserom.gba", 0x00674ec1, 0x29 + +gText_MysteryGiftVisitingTrainer:: + .string "Thank you for using the MYSTERY\nGIFT System.\pBy holding this WONDER CARD, you\nmay take part in a survey at a\lPOKéMON MART.\pUse these surveys to invite\nTRAINERS to SOOTOPOLIS CITY.\p…Let me give you a secret\npassword for a survey:\p“GIVE ME\nAWESOME TRAINER”\pWrite that in on a survey and send\nit to the WIRELESS\lCOMMUNICATION SYSTEM.$" + .string "Thank you for using the MYSTERY\nGIFT System.\pA TRAINER has arrived in\nSOOTOPOLIS CITY looking for you.\pWe hope you will enjoy\nbattling the visiting TRAINER.\pYou may invite other TRAINERS by\nentering other passwords.\pTry looking for other passwords\nthat may work.$" + +gUnknown_0867513C:: @ 867513C + .incbin "baserom.gba", 0x0067513c, 0x48 + +gText_MysteryGiftBattleCountCard:: + .string "Thank you for using the MYSTERY\nGIFT System.\pYour BATTLE COUNT CARD keeps\ntrack of your battle record against\lTRAINERS with the same CARD.\pLook for and battle TRAINERS who\nhave the same CARD as you.\pYou may check the overall rankings\nby reading the NEWS.\pPlease do give it a try!$" + .string "Thank you for using the MYSTERY\nGIFT System.\pCongratulations!\pYou have won a prize for winning\nthree battles!\pWe hope you will be inspired to\nbattle some more.$" + +gUnknown_0867533C:: @ 867533C + .incbin "baserom.gba", 0x0067533c, 0x6d + +gText_MysteryGiftTicket1:: + .string "Thank you for using the MYSTERY\nGIFT System.\pYou must be {PLAYER}.\nThere is a ticket here for you.$" + .string "It appears to be for use at the\nLILYCOVE CITY port.\pWhy not give it a try and see what\nit is about?$" + .string "Thank you for using the MYSTERY\nGIFT System.$" + .string "Oh, I’m sorry, {PLAYER}.\nYour BAG’s KEY ITEMS POCKET is full.\pPlease store something on your PC,\nthen come back for this.$" + +gUnknown_0867550B:: @ 867550B + .incbin "baserom.gba", 0x0067550b, 0x76 + +gText_MysteryGiftTicket2:: + .string "Thank you for using the MYSTERY\nGIFT System.\pYou must be {PLAYER}.\nThere is a ticket here for you.$" + .string "It appears to be for use at the\nLILYCOVE CITY port.\pWhy not give it a try and see what\nit is about?$" + .string "Thank you for using the MYSTERY\nGIFT System.$" + .string "Oh, I’m sorry, {PLAYER}.\nYour BAG’s KEY ITEMS POCKET is full.\pPlease store something on your PC,\nthen come back for this.$" + +gUnknown_086756E3:: @ 86756E3 + .incbin "baserom.gba", 0x006756e3, 0x25 + +gText_MysteryGiftAlteringCave:: + .string "Thank you for using the MYSTERY\nGIFT System.\pThere appears to be a rumor about\nrare POKéMON sightings.\pThe sightings reportedly came from\nthe ALTERING CAVE on ROUTE 103.\pPerhaps it would be worthwhile for\nyou to investigate this rumor.$" + +gUnknown_086757F4:: @ 86757F4 + .incbin "baserom.gba", 0x006757f4, 0x6d + +gText_MysteryGiftOldSeaMap:: + .string "Thank you for using the MYSTERY\nGIFT System.\pLet me confirm--you are {PLAYER}?\pWe received this OLD SEA MAP\naddressed to you.$" + .string "It appears to be for use at the\nLILYCOVE CITY port.\pWhy not give it a try and see what\nit is about?$" + .string "Thank you for using the MYSTERY\nGIFT System.$" + .string "Oh, I’m sorry, {PLAYER}.\nYour BAG’s KEY ITEMS POCKET is full.\pPlease store something on your PC,\nthen come back for this.$" + .align 2 diff --git a/data/script_funcs.s b/data/script_funcs.s deleted file mode 100644 index 276807fa5..000000000 --- a/data/script_funcs.s +++ /dev/null @@ -1,21 +0,0 @@ - .section script_data, "aw", %progbits - - .align 2 -gUnknown_082DED2C:: @ 82DED2C - .4byte sub_8153A80 - .4byte sub_8153A30 - .4byte script_status_stop_and_ret_1 - .4byte sub_8153A94 - .4byte sub_8153A84 - .4byte sub_8153ACC - .4byte sub_8153BE4 - .4byte sub_8153AE8 - .4byte sub_8153BB0 - .4byte sub_8153C4C - .4byte sub_8153C70 - .4byte sub_8153C9C - .4byte sub_8153CC8 - .4byte sub_8153DD4 - .4byte sub_8153E1C - .4byte sub_8153E40 - .4byte sub_8153E88 diff --git a/data/scripts/maps/PetalburgCity_Gym.inc b/data/scripts/maps/PetalburgCity_Gym.inc index 060531c97..627ae904c 100644 --- a/data/scripts/maps/PetalburgCity_Gym.inc +++ b/data/scripts/maps/PetalburgCity_Gym.inc @@ -393,7 +393,7 @@ PetalburgCity_Gym_EventScript_204DCE:: @ 8204DCE checkpcitem ITEM_ENIGMA_BERRY, 1 compare VAR_RESULT, 1 goto_eq PetalburgCity_Gym_EventScript_204E17 - compare VAR_0x402D, 0 + compare VAR_ENIGMA_BERRY_AVAILABLE, 0 goto_eq PetalburgCity_Gym_EventScript_204E17 msgbox PetalburgCity_Gym_Text_2A6D3D, 4 setvar VAR_RESULT, 1 @@ -407,7 +407,7 @@ PetalburgCity_Gym_EventScript_204E1D:: @ 8204E1D giveitem_std ITEM_ENIGMA_BERRY compare VAR_RESULT, 0 goto_eq PetalburgCity_Gym_EventScript_272054 - setvar VAR_0x402D, 0 + setvar VAR_ENIGMA_BERRY_AVAILABLE, 0 release end diff --git a/data/specials.inc b/data/specials.inc index f0c1fa114..03964c8eb 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -256,7 +256,7 @@ gSpecials:: @ 81DBA64 def_special sub_81B9B80 def_special sub_81B9D08 def_special sub_80F9490 - def_special sub_81652B4 + def_special ValidateEReaderTrainer def_special sub_8139228 def_special sub_80F94E8 def_special sub_816AE58 -- cgit v1.2.3