From d8d111abf5e998ac87236f9400ea57d6108837fc Mon Sep 17 00:00:00 2001 From: Llinos Evans <36418502+PlagueVonKarma@users.noreply.github.com> Date: Fri, 12 Jul 2024 11:23:25 +0100 Subject: [PATCH] Fossil scientist is now functional tm There's a couple bugs here and there, but it's good enough and I think the bugs are related to how I tested it. Doesn't use specials because it seems to just cause comical glitches to occur. The Museum and Ruins of Alph fossil guys will talk differently, implying they're different individuals. The Museum one talks like in HGSS, the RoA one talks like the RBY one and comments on the Unown researcher's lack of care for fossils. Also reused some PokeCom centre lore. --- constants/event_flags.asm | 14 +- constants/map_constants.asm | 2 +- constants/script_constants.asm | 8 + data/events/special_pointers.asm | 2 +- data/maps/scripts.asm | 6 +- engine/events/specials.asm | 6 +- main.asm | 2 +- maps/DebugRoom.asm | 305 ++++++++++++++++++++++++- maps/PewterMuseumOfScience1F.asm | 288 ++++++++++++++++++++++- maps/RuinsOfAlphResearchCenter.ablk | 2 +- maps/RuinsOfAlphResearchCenter.asm | 340 ++++++++++++++++++++++++++-- scan_includes.exe.stackdump | 43 ++-- 12 files changed, 965 insertions(+), 53 deletions(-) diff --git a/constants/event_flags.asm b/constants/event_flags.asm index 3f86a5b..c950278 100644 --- a/constants/event_flags.asm +++ b/constants/event_flags.asm @@ -136,9 +136,15 @@ const EVENT_TIN_TOWER_5F_HIDDEN_FULL_RESTORE const EVENT_TIN_TOWER_5F_HIDDEN_CARBOS const EVENT_BURNED_TOWER_1F_HIDDEN_ETHER - const_skip ; unused in Crystal - const_skip ; unused in Crystal - const_skip ; unused in Crystal + + ; These are now fossil-related pieces. + ; adapted from https://github.com/pret/pokecrystal/wiki/Reviving-Pok%C3%A9mon-from-Fossils-(Gen-I) + const EVENT_GAVE_SCIENTIST_OLD_AMBER + const EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + const EVENT_GAVE_SCIENTIST_DOME_FOSSIL + const EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + const EVENT_GAVE_SCIENTIST_WING_FOSSIL + const EVENT_NATIONAL_PARK_HIDDEN_FULL_HEAL const EVENT_OLIVINE_LIGHTHOUSE_5F_HIDDEN_HYPER_POTION const EVENT_TEAM_ROCKET_BASE_B1F_HIDDEN_REVIVE @@ -202,7 +208,7 @@ const EVENT_GAVE_GS_BALL_TO_KURT const EVENT_FOREST_IS_RESTLESS const EVENT_ANSWERED_DRAGON_MASTER_QUIZ_WRONG -; Unused: next 6 events +; Unused: next 4 events const_next 200 ; Kanto story events diff --git a/constants/map_constants.asm b/constants/map_constants.asm index 26e8ae3..6505ae7 100644 --- a/constants/map_constants.asm +++ b/constants/map_constants.asm @@ -90,7 +90,7 @@ ENDM map_const RUINS_OF_ALPH_OMANYTE_CHAMBER, 4, 5 ; 25 map_const RUINS_OF_ALPH_AERODACTYL_CHAMBER, 4, 5 ; 26 map_const RUINS_OF_ALPH_INNER_CHAMBER, 10, 14 ; 27 - map_const RUINS_OF_ALPH_RESEARCH_CENTER, 4, 4 ; 28 + map_const RUINS_OF_ALPH_RESEARCH_CENTER, 6, 4 ; 28 map_const RUINS_OF_ALPH_HO_OH_ITEM_ROOM, 4, 5 ; 29 map_const RUINS_OF_ALPH_KABUTO_ITEM_ROOM, 4, 5 ; 30 map_const RUINS_OF_ALPH_OMANYTE_ITEM_ROOM, 4, 5 ; 31 diff --git a/constants/script_constants.asm b/constants/script_constants.asm index 4b909d9..38601f9 100644 --- a/constants/script_constants.asm +++ b/constants/script_constants.asm @@ -328,3 +328,11 @@ DEF NUM_UNOWN_PUZZLES EQU const_value const MOVETUTOR_FLAMETHROWER ; 1 const MOVETUTOR_THUNDERBOLT ; 2 const MOVETUTOR_ICE_BEAM ; 3 + +; Fossil Scientist setvals + const_def 1 + const REVIVE_OLD_AMBER ; 1 + const REVIVE_DOME_FOSSIL ; 2 + const REVIVE_HELIX_FOSSIL ; 3 + const REVIVE_CLUB_FOSSIL ; 4 + const REVIVE_WING_FOSSIL ; 5 diff --git a/data/events/special_pointers.asm b/data/events/special_pointers.asm index a292ab1..1580cfa 100644 --- a/data/events/special_pointers.asm +++ b/data/events/special_pointers.asm @@ -186,4 +186,4 @@ SpecialsPointers:: ; Tradeback NPC tutorial add_special TradebackNPC - add_special FossilScientist \ No newline at end of file + ;add_special FossilScientist diff --git a/data/maps/scripts.asm b/data/maps/scripts.asm index 64813c6..c0f7db2 100644 --- a/data/maps/scripts.asm +++ b/data/maps/scripts.asm @@ -498,6 +498,9 @@ INCLUDE "maps/LakeOfRageTraderHouse.asm" INCLUDE "maps/LakeOfRagePokecenter1F.asm" INCLUDE "maps/LakeOfRageMart.asm" INCLUDE "maps/LakeOfRagePrycesHouse.asm" + +SECTION "Map Scripts 26", ROMX + INCLUDE "maps/DebugRoom.asm" INCLUDE "maps/CliffCave.asm" INCLUDE "maps/Route49.asm" @@ -505,9 +508,6 @@ INCLUDE "maps/BlueForest.asm" INCLUDE "maps/QuietCave.asm" INCLUDE "maps/Route49_2.asm" INCLUDE "maps/SilversHouse.asm" - -SECTION "Map Scripts 26", ROMX - INCLUDE "maps/SilentHillsPokecenter1F.asm" INCLUDE "maps/NihonPokecenter2F.asm" INCLUDE "maps/KantoPokecenter2F.asm" diff --git a/engine/events/specials.asm b/engine/events/specials.asm index 2efdde7..b78f60f 100644 --- a/engine/events/specials.asm +++ b/engine/events/specials.asm @@ -426,6 +426,6 @@ TradebackNPC: farcall TradebackGuy ret -FossilScientist: - farcall FossilScientistGuy - ret +;FossilScientist: +; farcall FossilScientistGuy +; ret diff --git a/main.asm b/main.asm index 76b91bb..cfbe5f7 100644 --- a/main.asm +++ b/main.asm @@ -477,7 +477,6 @@ INCLUDE "engine/events/play_slow_cry.asm" INCLUDE "engine/link/time_capsule.asm" INCLUDE "engine/link/time_capsule_2.asm" INCLUDE "engine/events/magikarp.asm" -INCLUDE "engine/events/fossil_scientist.asm" SECTION "bank3Econtcont", ROMX @@ -491,6 +490,7 @@ INCLUDE "engine/tilesets/tileset_anims.asm" INCLUDE "engine/events/npc_trade.asm" INCLUDE "engine/events/mom_phone.asm" INCLUDE "engine/events/tradeback_npc.asm" ; Tradeback NPC tutorial +;INCLUDE "engine/events/fossil_scientist.asm" INCLUDE "engine/battle/misc.asm" SECTION "mobile40", ROMX diff --git a/maps/DebugRoom.asm b/maps/DebugRoom.asm index d3638d6..7fff4f1 100644 --- a/maps/DebugRoom.asm +++ b/maps/DebugRoom.asm @@ -8,23 +8,23 @@ DebugRoom_MapScripts: DebugPokemon1Script: opentext - getmonname STRING_BUFFER_3, DECILLA + getmonname STRING_BUFFER_3, LUXWAN writetext ReceivedDebugPokemonText playsound SFX_CAUGHT_MON waitsfx promptbutton - givepoke DECILLA, 39, POISON_STONE + givepoke LUXWAN, 24, POISON_STONE closetext end DebugPokemon2Script: opentext - getmonname STRING_BUFFER_3, FERADACTYL + getmonname STRING_BUFFER_3, MACHAMP writetext ReceivedDebugPokemonText playsound SFX_CAUGHT_MON waitsfx promptbutton - givepoke FERADACTYL, 39, TM_ROCK_SMASH + givepoke MACHAMP, 31, TM_ROCK_SMASH closetext end @@ -176,6 +176,11 @@ DebugItemScript: giveitem RARE_CANDY, 99 giveitem BICYCLE, 1 giveitem SUPER_ROD, 1 + giveitem CLUB_FOSSIL, 2 + giveitem WING_FOSSIL, 2 + giveitem DOME_FOSSIL, 2 + giveitem HELIX_FOSSIL, 2 + giveitem OLD_AMBER, 2 closetext end @@ -184,6 +189,294 @@ DebugTextE: line "many items!" done +DebugFossilScientist: + faceplayer + opentext + checkevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove the next two lines to immediately receive the fossil + iftrue .GaveScientistFossil + checkevent EVENT_GAVE_SCIENTIST_OLD_AMBER + iftrue .GiveDecilla + checkevent EVENT_GAVE_SCIENTIST_DOME_FOSSIL + iftrue .GiveKabuto + checkevent EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + iftrue .GiveOmanyte + checkevent EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + iftrue .GiveXylodon + checkevent EVENT_GAVE_SCIENTIST_WING_FOSSIL + iftrue .GiveFeradactyl + writetext FossilScientistIntroText + waitbutton + loadmenu .MoveMenuHeader + verticalmenu + closewindow + ifequal REVIVE_OLD_AMBER, .OldAmber + ifequal REVIVE_DOME_FOSSIL, .DomeFossil + ifequal REVIVE_HELIX_FOSSIL, .HelixFossil + ifequal REVIVE_CLUB_FOSSIL, .ClubFossil + ifequal REVIVE_WING_FOSSIL, .WingFossil + sjump .No + +.OldAmber + checkitem OLD_AMBER + iffalse .No + getmonname STRING_BUFFER_3, DECILLA + writetext FossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_OLD_AMBER + takeitem OLD_AMBER + writetext FossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.DomeFossil: + checkitem DOME_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, KABUTO + writetext FossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_DOME_FOSSIL + takeitem DOME_FOSSIL + opentext + writetext FossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.HelixFossil: + checkitem HELIX_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, OMANYTE + writetext FossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + takeitem HELIX_FOSSIL + writetext FossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.ClubFossil: + checkitem HELIX_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, XYLODON + writetext FossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + takeitem HELIX_FOSSIL + writetext FossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.WingFossil: + checkitem HELIX_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, FERADACTYL + writetext FossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_WING_FOSSIL + takeitem HELIX_FOSSIL + writetext FossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.No + writetext FossilScientistNoText + waitbutton + closetext + end + +.GaveScientistFossil: + writetext FossilScientistTimeText + waitbutton + closetext + ; older versions will use FadeBlackQuickly below instead + ; special FadeOutToBlack ; uncomment the next five lines to immediately receive the fossil + ; special ReloadSpritesNoPalettes + ; playsound SFX_WARP_TO + ; waitsfx + ; pause 35 + end ; replace this with "sjump FossilScientist" to immediately receive the fossil + +.GiveDecilla: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_OLD_AMBER + writetext FossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, DECILLA + writetext FossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext FossilScientistMonText + givepoke DECILLA, 30 + closetext + end + +.GiveKabuto: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_DOME_FOSSIL + writetext FossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, KABUTO + writetext FossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext FossilScientistMonText + givepoke KABUTO, 30 + closetext + end + +.GiveOmanyte: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + writetext FossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, OMANYTE + writetext FossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext FossilScientistMonText + givepoke OMANYTE, 30 + closetext + end + +.GiveXylodon: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + writetext FossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, XYLODON + writetext FossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext FossilScientistMonText + givepoke XYLODON, 30 + closetext + end + +.GiveFeradactyl: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_WING_FOSSIL + writetext FossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, FERADACTYL + writetext FossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext FossilScientistMonText + givepoke FERADACTYL, 30 + closetext + end + +.NoRoom: + writetext FossilScientistPartyFullText + waitbutton + closetext + end + +.MoveMenuHeader: + db MENU_BACKUP_TILES ; flags + menu_coords 0, 0, 15, TEXTBOX_Y + 1 + dw .MenuData + db 1 ; default option + +.MenuData: + db STATICMENU_CURSOR ; flags + db 6 ; items + db "OLD AMBER@" + db "DOME FOSSIL@" + db "HELIX FOSSIL@" + db "CLUB FOSSIL@" + db "WING FOSSIL@" + db "CANCEL@" + +FossilScientistIntroText: + text "Hiya!" + + para "I am important" + line "doctor!" + + para "I study here rare" + line "#MON fossils!" + + para "You! Have you a" + line "fossil for me?" + done + +FossilScientistNoText: + text "No! Is too bad!" + + para "You come again!" + done + +FossilScientistPartyFullText: + text "No! Is too bad!" + + para "Your party is" + line "already full!" + done + +FossilScientistTimeText: + text "I take a little" + line "time!" + + para "You go for walk a" + line "little while!" + done + +FossilScientistDoneText: + text "Where were you?" + + para "Your fossil is" + line "back to life!" + done + +FossilScientistMonText: + text "Oh! That is" + line "a fossil!" + + para "It is fossil of" + line "@" + text_ram wStringBuffer3 + text ", a" + + + para "#MON that is" + line "already extinct!" + + para "My Resurrection" + line "Machine will make" + cont "that #MON live" + cont "again!" + done + +FossilScientistGiveText: + text "So! You hurry and" + line "give me that!" + + para " handed" + line "over the fossil." + done + +FossilScientistReceiveText: + text " received" + line "@" + text_ram wStringBuffer3 + text "!" + done + DebugRoom_MapEvents: db 0, 0 ; filler @@ -200,7 +493,7 @@ DebugRoom_MapEvents: warp_event 19, 34, BLUE_FOREST, 1 ; southern warp warp_event 33, 33, BLUE_FOREST, 1 ; southeast warp warp_event 5, 3, AZALEA_TOWN, 1 - warp_event 34, 11, ROUTE_48, 1 + warp_event 34, 11, RUINS_OF_ALPH_RESEARCH_CENTER, 1 def_coord_events @@ -214,4 +507,4 @@ DebugRoom_MapEvents: object_event 17, 13, SPRITE_NURSE, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_PURPLE, OBJECTTYPE_SCRIPT, 0, DebugFlyScript, -1 object_event 16, 13, SPRITE_NURSE, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_PURPLE, OBJECTTYPE_SCRIPT, 0, DebugDexScript, -1 object_event 19, 13, SPRITE_NURSE, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_PURPLE, OBJECTTYPE_SCRIPT, 0, DebugItemScript, -1 - + object_event 18, 13, SPRITE_NURSE, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, DebugFossilScientist, -1 diff --git a/maps/PewterMuseumOfScience1F.asm b/maps/PewterMuseumOfScience1F.asm index 2594083..8e2ca76 100644 --- a/maps/PewterMuseumOfScience1F.asm +++ b/maps/PewterMuseumOfScience1F.asm @@ -5,7 +5,290 @@ PewterMuseumOfScience1F_MapScripts: def_scene_scripts def_callbacks - + +; This scientist will use the HGSS Fossil Scientist's script, albeit slightly altered. +MuseumFossilScientist: + faceplayer + opentext + checkevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove the next two lines to immediately receive the fossil + iftrue .GaveScientistFossil + checkevent EVENT_GAVE_SCIENTIST_OLD_AMBER + iftrue .GiveDecilla + checkevent EVENT_GAVE_SCIENTIST_DOME_FOSSIL + iftrue .GiveKabuto + checkevent EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + iftrue .GiveOmanyte + checkevent EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + iftrue .GiveXylodon + checkevent EVENT_GAVE_SCIENTIST_WING_FOSSIL + iftrue .GiveFeradactyl + writetext MuseumFossilScientistIntroText + waitbutton + loadmenu .MoveMenuHeader + verticalmenu + closewindow + ifequal REVIVE_OLD_AMBER, .OldAmber + ifequal REVIVE_DOME_FOSSIL, .DomeFossil + ifequal REVIVE_HELIX_FOSSIL, .HelixFossil + ifequal REVIVE_CLUB_FOSSIL, .ClubFossil + ifequal REVIVE_WING_FOSSIL, .WingFossil + sjump .No + +.OldAmber + checkitem OLD_AMBER + iffalse .No + getmonname STRING_BUFFER_3, DECILLA + writetext MuseumFossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_OLD_AMBER + takeitem OLD_AMBER + writetext MuseumFossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.DomeFossil: + checkitem DOME_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, KABUTO + writetext MuseumFossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_DOME_FOSSIL + takeitem DOME_FOSSIL + opentext + writetext MuseumFossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.HelixFossil: + checkitem HELIX_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, OMANYTE + writetext MuseumFossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + takeitem HELIX_FOSSIL + writetext MuseumFossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.ClubFossil: + checkitem HELIX_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, XYLODON + writetext MuseumFossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + takeitem HELIX_FOSSIL + writetext MuseumFossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.WingFossil: + checkitem HELIX_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, FERADACTYL + writetext MuseumFossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_WING_FOSSIL + takeitem HELIX_FOSSIL + writetext MuseumFossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.No + writetext MuseumFossilScientistNoText + waitbutton + closetext + end + +.GaveScientistFossil: + writetext MuseumFossilScientistTimeText + waitbutton + closetext + ; older versions will use FadeBlackQuickly below instead + ; special FadeOutToBlack ; uncomment the next five lines to immediately receive the fossil + ; special ReloadSpritesNoPalettes + ; playsound SFX_WARP_TO + ; waitsfx + ; pause 35 + end ; replace this with "sjump FossilScientist" to immediately receive the fossil + +.GiveDecilla: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_OLD_AMBER + writetext MuseumFossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, DECILLA + writetext MuseumFossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext MuseumFossilScientistMonText + givepoke DECILLA, 30 + closetext + end + +.GiveKabuto: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_DOME_FOSSIL + writetext MuseumFossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, KABUTO + writetext MuseumFossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext MuseumFossilScientistMonText + givepoke KABUTO, 30 + closetext + end + +.GiveOmanyte: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + writetext MuseumFossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, OMANYTE + writetext MuseumFossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext MuseumFossilScientistMonText + givepoke OMANYTE, 30 + closetext + end + +.GiveXylodon: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + writetext MuseumFossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, XYLODON + writetext MuseumFossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext MuseumFossilScientistMonText + givepoke XYLODON, 30 + closetext + end + +.GiveFeradactyl: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_WING_FOSSIL + writetext MuseumFossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, FERADACTYL + writetext MuseumFossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext MuseumFossilScientistMonText + givepoke FERADACTYL, 30 + closetext + end + +.NoRoom: + writetext MuseumFossilScientistPartyFullText + waitbutton + closetext + end + +.MoveMenuHeader: + db MENU_BACKUP_TILES ; flags + menu_coords 0, 0, 15, TEXTBOX_Y + 1 + dw .MenuData + db 1 ; default option + +.MenuData: + db STATICMENU_CURSOR ; flags + db 6 ; items + db "OLD AMBER@" + db "DOME FOSSIL@" + db "HELIX FOSSIL@" + db "CLUB FOSSIL@" + db "WING FOSSIL@" + db "CANCEL@" + +MuseumFossilScientistIntroText: + text "Did you know you" + line "can revive #MON" + cont "from fossils?" + + para "If you need to," + line "let me take care" + cont "of it for you!" + done + +MuseumFossilScientistNoText: + text "Ah, alright." + + para "Come again though," + line "you hear?" + done + +MuseumFossilScientistPartyFullText: + text "Oops!" + + para "Your party is" + line "full!" + done + +MuseumFossilScientistTimeText: + text "It'll take a bit" + line "to revive the" + cont "fossil." + + para "PEWTER CITY is" + line "great. Why not" + cont "go on a little" + cont "walkabout?" + done + +MuseumFossilScientistDoneText: + text "There you are!" + + para "Here's your" + line "#MON!" + done + +MuseumFossilScientistMonText: + text "Ah, yes!" + + para "That's a fossil" + line "@" + text_ram wStringBuffer3 + text "!" + + para "Want me to revive" + line "it?" + done + +MuseumFossilScientistGiveText: + text "Alright! Careful," + line "now..." + + para " handed" + line "over the fossil." + done + +MuseumFossilScientistReceiveText: + text " received" + line "@" + text_ram wStringBuffer3 + text "!" + done + PewterMuseumOfScience1F_MapEvents: db 0, 0 ; filler @@ -20,4 +303,5 @@ PewterMuseumOfScience1F_MapEvents: def_bg_events - def_object_events \ No newline at end of file + def_object_events + object_event 2, 9, SPRITE_SCIENTIST, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, MuseumFossilScientist, -1 diff --git a/maps/RuinsOfAlphResearchCenter.ablk b/maps/RuinsOfAlphResearchCenter.ablk index 051b602..afc458d 100644 --- a/maps/RuinsOfAlphResearchCenter.ablk +++ b/maps/RuinsOfAlphResearchCenter.ablk @@ -1 +1 @@ -;()  \ No newline at end of file +; (()   \ No newline at end of file diff --git a/maps/RuinsOfAlphResearchCenter.asm b/maps/RuinsOfAlphResearchCenter.asm index 7f789fb..3d108c9 100644 --- a/maps/RuinsOfAlphResearchCenter.asm +++ b/maps/RuinsOfAlphResearchCenter.asm @@ -167,6 +167,8 @@ RuinsOfAlphResearchCenterPrinter: closetext end +; There isn't even a tileset piece for this, it was removed very early. +; Could reuse somewhere. RuinsOfAlphResearchCenterPhoto: ; unreferenced jumptext RuinsOfAlphResearchCenterProfSilktreePhotoText @@ -306,19 +308,22 @@ RuinsOfAlphResearchCenterScientist2Text_UnownAppeared: cont "kinds of them…" done -RuinsOfAlphResearchCenterUnusedText1: ; unreferenced +RuinsOfAlphResearchCenterPokeCom: + faceplayer + opentext + writetext RuinsOfAlphResearchCenterPokeComText + waitbutton + closetext + end + +RuinsOfAlphResearchCenterPokeComText: ; previously unreferenced, now reused text "We think something" line "caused the cryptic" para "patterns to appear" line "in the RUINS." - - para "We've focused our" - line "studies on that." - done - -RuinsOfAlphResearchCenterUnusedText2: ; unreferenced - text "According to my" + + para "According to my" line "research…" para "Those mysterious" @@ -387,21 +392,324 @@ RuinsOfAlphResearchCenterAcademicBooksText: cont "Ancients…" done +; This scientist uses the funny Kantonian Fossil Scientist's script. +RoAFossilScientist: + faceplayer + opentext + checkevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove the next two lines to immediately receive the fossil + iftrue .GaveScientistFossil + checkevent EVENT_GAVE_SCIENTIST_OLD_AMBER + iftrue .GiveDecilla + checkevent EVENT_GAVE_SCIENTIST_DOME_FOSSIL + iftrue .GiveKabuto + checkevent EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + iftrue .GiveOmanyte + checkevent EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + iftrue .GiveXylodon + checkevent EVENT_GAVE_SCIENTIST_WING_FOSSIL + iftrue .GiveFeradactyl + writetext RoAFossilScientistIntroText + waitbutton + loadmenu .MoveMenuHeader + verticalmenu + closewindow + ifequal REVIVE_OLD_AMBER, .OldAmber + ifequal REVIVE_DOME_FOSSIL, .DomeFossil + ifequal REVIVE_HELIX_FOSSIL, .HelixFossil + ifequal REVIVE_CLUB_FOSSIL, .ClubFossil + ifequal REVIVE_WING_FOSSIL, .WingFossil + sjump .No + +.OldAmber + checkitem OLD_AMBER + iffalse .No + getmonname STRING_BUFFER_3, DECILLA + writetext RoAFossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_OLD_AMBER + takeitem OLD_AMBER + writetext RoAFossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.DomeFossil: + checkitem DOME_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, KABUTO + writetext RoAFossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_DOME_FOSSIL + takeitem DOME_FOSSIL + opentext + writetext RoAFossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.HelixFossil: + checkitem HELIX_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, OMANYTE + writetext RoAFossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + takeitem HELIX_FOSSIL + writetext RoAFossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.ClubFossil: + checkitem HELIX_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, XYLODON + writetext RoAFossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + takeitem HELIX_FOSSIL + writetext RoAFossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.WingFossil: + checkitem HELIX_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, FERADACTYL + writetext RoAFossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_WING_FOSSIL + takeitem HELIX_FOSSIL + writetext RoAFossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.No + writetext RoAFossilScientistNoText + waitbutton + closetext + end + +.GaveScientistFossil: + writetext RoAFossilScientistTimeText + waitbutton + closetext + ; older versions will use FadeBlackQuickly below instead + ; special FadeOutToBlack ; uncomment the next five lines to immediately receive the fossil + ; special ReloadSpritesNoPalettes + ; playsound SFX_WARP_TO + ; waitsfx + ; pause 35 + end ; replace this with "sjump FossilScientist" to immediately receive the fossil + +.GiveDecilla: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_OLD_AMBER + writetext RoAFossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, DECILLA + writetext RoAFossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext RoAFossilScientistMonText + givepoke DECILLA, 30 + closetext + end + +.GiveKabuto: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_DOME_FOSSIL + writetext RoAFossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, KABUTO + writetext RoAFossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext RoAFossilScientistMonText + givepoke KABUTO, 30 + closetext + end + +.GiveOmanyte: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + writetext RoAFossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, OMANYTE + writetext RoAFossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext RoAFossilScientistMonText + givepoke OMANYTE, 30 + closetext + end + +.GiveXylodon: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + writetext RoAFossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, XYLODON + writetext RoAFossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext RoAFossilScientistMonText + givepoke XYLODON, 30 + closetext + end + +.GiveFeradactyl: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_WING_FOSSIL + writetext RoAFossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, FERADACTYL + writetext RoAFossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext RoAFossilScientistMonText + givepoke FERADACTYL, 30 + closetext + end + +.NoRoom: + writetext RoAFossilScientistPartyFullText + waitbutton + closetext + end + +.MoveMenuHeader: + db MENU_BACKUP_TILES ; flags + menu_coords 0, 0, 15, TEXTBOX_Y + 1 + dw .MenuData + db 1 ; default option + +.MenuData: + db STATICMENU_CURSOR ; flags + db 6 ; items + db "OLD AMBER@" + db "DOME FOSSIL@" + db "HELIX FOSSIL@" + db "CLUB FOSSIL@" + db "WING FOSSIL@" + db "CANCEL@" + +RoAFossilScientistIntroText: + text "Hiya!" + + para "I am important" + line "doctor!" + + para "I study here rare" + line "#MON fossils!" + + para "You! Have you a" + line "fossil for me?" + done + +RoAFossilScientistNoText: + text "No! Is too bad!" + + para "You come again!" + done + +RoAFossilScientistPartyFullText: + text "No! Is too bad!" + + para "Your party is" + line "already full!" + done + +RoAFossilScientistTimeText: + text "I take a little" + line "time!" + + para "You go for walk a" + line "little while!" + done + +RoAFossilScientistDoneText: + text "Where were you?" + + para "Your fossil is" + line "back to life!" + done + +RoAFossilScientistMonText: + text "Oh! That is" + line "a fossil!" + + para "It is fossil of" + line "@" + text_ram wStringBuffer3 + text ", a" + + + para "#MON that is" + line "already extinct!" + + para "My Resurrection" + line "Machine will make" + cont "that #MON live" + cont "again!" + done + +RoAFossilScientistGiveText: + text "So! You hurry and" + line "give me that!" + + para " handed" + line "over the fossil." + done + +RoAFossilScientistReceiveText: + text " received" + line "@" + text_ram wStringBuffer3 + text "!" + + ; Since he's now in the Ruins of Alph centre... + ; Let's have him complain. + ; This text is transliterated Chinese, character-for-character. + ; 他们不明白宝可梦化石!比Unown有趣! (maybe a 更 thrown in). + ; The way the broken English works seems similar enough. + para "They no understand" + line "#MON fossils!" + + para "Compare UNOWN," + line "they more have" + cont "interest!" + done + RuinsOfAlphResearchCenter_MapEvents: db 0, 0 ; filler def_warp_events - warp_event 2, 7, RUINS_OF_ALPH_OUTSIDE, 6 - warp_event 3, 7, RUINS_OF_ALPH_OUTSIDE, 6 + warp_event 6, 7, RUINS_OF_ALPH_OUTSIDE, 6 + warp_event 7, 7, RUINS_OF_ALPH_OUTSIDE, 6 def_coord_events def_bg_events - bg_event 6, 5, BGEVENT_READ, RuinsOfAlphResearchCenterBookshelf - bg_event 3, 4, BGEVENT_READ, RuinsOfAlphResearchCenterComputer - bg_event 7, 1, BGEVENT_READ, RuinsOfAlphResearchCenterPrinter + bg_event 10, 5, BGEVENT_READ, RuinsOfAlphResearchCenterBookshelf + bg_event 7, 4, BGEVENT_READ, RuinsOfAlphResearchCenterComputer + bg_event 11, 1, BGEVENT_READ, RuinsOfAlphResearchCenterPrinter def_object_events - object_event 4, 5, SPRITE_SCIENTIST, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, RuinsOfAlphResearchCenterScientist1Script, -1 - object_event 5, 2, SPRITE_SCIENTIST, SPRITEMOVEDATA_WANDER, 2, 1, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, RuinsOfAlphResearchCenterScientist2Script, -1 - object_event 2, 5, SPRITE_SCIENTIST, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, RuinsOfAlphResearchCenterScientist3Script, EVENT_RUINS_OF_ALPH_RESEARCH_CENTER_SCIENTIST + object_event 6, 5, SPRITE_SCIENTIST, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, RuinsOfAlphResearchCenterScientist1Script, -1 + object_event 7, 2, SPRITE_SCIENTIST, SPRITEMOVEDATA_WANDER, 2, 1, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, RuinsOfAlphResearchCenterScientist2Script, -1 + object_event 4, 5, SPRITE_SCIENTIST, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, RuinsOfAlphResearchCenterScientist3Script, EVENT_RUINS_OF_ALPH_RESEARCH_CENTER_SCIENTIST + object_event 0, 5, SPRITE_SCIENTIST, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, RoAFossilScientist, -1 + object_event 3, 3, SPRITE_SCIENTIST, SPRITEMOVEDATA_WANDER, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, RuinsOfAlphResearchCenterPokeCom, -1 diff --git a/scan_includes.exe.stackdump b/scan_includes.exe.stackdump index 0ad3fcb..33ee18b 100644 --- a/scan_includes.exe.stackdump +++ b/scan_includes.exe.stackdump @@ -1,19 +1,32 @@ -Exception: STATUS_ACCESS_VIOLATION at rip=00100401246 -rax=FFFFFFF7FFF8E981 rbx=0000000000000230 rcx=0000000800000010 -rdx=0000000000000000 rsi=00000008000715EC rdi=0000000000000000 -r8 =00000000FFFFC744 r9 =0000000000000000 r10=0000000100000000 -r11=0000000100401282 r12=0000000800071680 r13=0000000100403148 +Exception: STATUS_ACCESS_VIOLATION at rip=000100401246 +rax=FFFFFFF5FFFD90D1 rbx=000000000000165C rcx=0000000A00000010 +rdx=0000000000000000 rsi=0000000A000257CB rdi=0000000000000000 +r8 =00000007FFFFC764 r9 =0000000000000000 r10=0000000800000000 +r11=0000000100401282 r12=0000000A00026F30 r13=0000000100403148 r14=0000000000000000 r15=0000000000000001 -rbp=0000000100403156 rsp=00000000FFFFC9E0 -program=C:\cygwin64\home\chipp\jep-hack\tools\scan_includes.exe, pid 7298, thread main +rbp=0000000100403156 rsp=00000007FFFFCA00 +program=C:\cygwin64\home\User\jep-hack\tools\scan_includes.exe, pid 8896, thread main cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B Stack trace: -Frame Function Args -00100403156 00100401246 (008000715EC, 00000000022, 00100403166, 00100403148) -00100403156 00100401409 (008000596E3, 00000000022, 00100403166, 000FFFFCB90) -00100403156 00100401409 (00000000000, 00100000001, 00180227860, 00100407000) -00100403178 00100401C87 (00000000020, 00000000000, 00180049B11, 00180048A70) -000FFFFCD30 00180049B7D (00000000000, 00000000000, 00000000000, 00000000000) -000FFFFFFF0 00180047746 (00000000000, 00000000000, 00000000000, 00000000000) -000FFFFFFF0 001800477F4 (00000000000, 00000000000, 00000000000, 00000000000) +Frame Function Args +000100403156 000100401246 (000A000257CB, 000000000022, 000100403166, 000100403148) scan_includes.exe+0x1246 +000100403156 000100401409 (000A00010A51, 000000000022, 000100403166, 0007FFFFCBB0) scan_includes.exe+0x1409 +000100403156 000100401409 (7FFA3CE2F0C0, 7FFA3CD45800, 7FFA3CE2F160, 000100407000) scan_includes.exe+0x1409 +000100403178 000100401C77 (000000000000, 000000000000, 000000000000, 000000000000) scan_includes.exe+0x1C77 +0007FFFFCD30 7FFA3CB580A3 (000000000000, 000000000000, 000000000000, 000000000000) cygwin1.dll+0x80A3 +0007FFFFFFF0 7FFA3CB55C86 (000000000000, 000000000000, 000000000000, 000000000000) cygwin1.dll+0x5C86 +0007FFFFFFF0 7FFA3CB55D34 (000000000000, 000000000000, 000000000000, 000000000000) cygwin1.dll+0x5D34 End of stack trace +Loaded modules: +000100400000 scan_includes.exe +7FFA8B470000 ntdll.dll +7FFA8B2B0000 KERNEL32.DLL +7FFA88E00000 KERNELBASE.dll +7FFA3CB50000 cygwin1.dll +7FFA8AD00000 advapi32.dll +7FFA8B200000 msvcrt.dll +7FFA8B150000 sechost.dll +7FFA88DD0000 bcrypt.dll +7FFA8ADC0000 RPCRT4.dll +7FFA88010000 CRYPTBASE.DLL +7FFA888C0000 bcryptPrimitives.dll