shithub: pokecrystal

Download patch

ref: 07a12b37b643941192271383e242a3613dec587a
parent: 86c13acf8465923d4153a50165ed457ca763017b
author: IIMarckus <[email protected]>
date: Fri Jul 10 02:08:03 EDT 2015

Add more event flags.

--- a/constants/event_flags.asm
+++ b/constants/event_flags.asm
@@ -30,11 +30,14 @@
 EVENT_REFUSED_TO_HELP_LANCE_AT_LAKE_OF_RAGE            EQU $026
 EVENT_GOT_BERRY_FROM_ROUTE_30_HOUSE                    EQU $027
 EVENT_MADE_WHITNEY_CRY                                 EQU $028
+EVENT_HERDED_FARFETCHD                                 EQU $029
 EVENT_FOUGHT_SUDOWOODO                                 EQU $02a
 EVENT_CLEARED_SLOWPOKE_WELL                            EQU $02b
 EVENT_REFUSED_TO_TAKE_EGG_FROM_ELMS_AIDE               EQU $02c
 EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE                    EQU $02d
 EVENT_MADE_UNOWN_APPEAR_IN_RUINS                       EQU $02e
+EVENT_FAST_SHIP_DESTINATION_OLIVINE                    EQU $02f
+EVENT_JASMINE_EXPLAINED_AMPHYS_SICKNESS                EQU $037
 EVENT_HEALED_MOOMOO                                    EQU $03d
 EVENT_GOT_TM13_SNORE_FROM_MOOMOO_FARM                  EQU $03e
 EVENT_TALKED_TO_FARMER_ABOUT_MOOMOO                    EQU $03f
@@ -98,7 +101,14 @@
 EVENT_GOT_MASTER_BALL_FROM_ELM                         EQU $07c
 EVENT_FOUND_REVIVE_IN_ROCKET_BASE_B1F                  EQU $086
 EVENT_MET_FLORIA                                       EQU $0b9
+EVENT_BUGGING_KURT_TOO_MUCH                            EQU $0bb
+EVENT_TALKED_TO_RUINS_COWARD                           EQU $0bc
+EVENT_GOT_DRATINI                                      EQU $0bd
 EVENT_CAN_GIVE_GS_BALL_TO_KURT                         EQU $0be
+EVENT_GAVE_GS_BALL_TO_KURT                             EQU $0bf
+EVENT_FOREST_IS_RESTLESS                               EQU $0c0
+EVENT_ANSWERED_DRAGON_MASTER_QUIZ_WRONG                EQU $0c1
+EVENT_GOT_NUGGET_FROM_GUY                              EQU $0c8
 EVENT_RETURNED_MACHINE_PART                            EQU $0c9
 EVENT_MET_MANAGER_AT_POWER_PLANT                       EQU $0ca
 EVENT_MET_ROCKET_GRUNT_AT_CERULEAN_GYM                 EQU $0cb
@@ -113,6 +123,7 @@
 EVENT_LISTENED_TO_FAN_CLUB_PRESIDENT                   EQU $0d4
 EVENT_TALKED_TO_SEAFOAM_GYM_GUY_ONCE                   EQU $0d5
 EVENT_ENABLE_DIPLOMA_PRINTING                          EQU $0d6
+EVENT_CINNABAR_ROCKS_CLEARED                           EQU $0d7
 EVENT_CLEARED_NUGGET_BRIDGE                            EQU $0d8
 EVENT_TALKED_TO_WARDENS_GRANDDAUGHTER                  EQU $0d9
 EVENT_GOT_TM03_CURSE                                   EQU $0da
@@ -126,9 +137,10 @@
 EVENT_GOT_HP_UP_FROM_VERMILION_GUY                     EQU $0e2
 EVENT_GOT_TM29_PSYCHIC                                 EQU $0e3
 EVENT_FOUND_LEFTOVERS_IN_CELADON_CAFE                  EQU $0f9
+EVENT_FOUND_BERSERK_GENE_IN_CERULEAN_CITY              EQU $0fa
 EVENT_FOUND_MACHINE_PART_IN_CERULEAN_GYM               EQU $0fb
 EVENT_JACK_ASKED_FOR_PHONE_NUMBER                      EQU $25f
-EVENT_SHOWED_BEVERLY_MARILL                            EQU $261
+EVENT_BEVERLY_ASKED_FOR_PHONE_NUMBER                   EQU $261
 EVENT_HUEY_ASKED_FOR_PHONE_NUMBER                      EQU $263
 EVENT_GOT_PROTEIN_FROM_HUEY                            EQU $265
 EVENT_GOT_HP_UP_FROM_JOEY                              EQU $266
@@ -207,6 +219,13 @@
 EVENT_EXPLODING_TRAP_22                                EQU $2fe
 EVENT_LEARNED_HAIL_GIOVANNI                            EQU $2ff
 EVENT_OPENED_DOOR_TO_ROCKET_HIDEOUT_TRANSMITTER        EQU $300
+EVENT_LEARNED_SLOWPOKETAIL                             EQU $301
+EVENT_LEARNED_RATICATE_TAIL                            EQU $302
+EVENT_OPENED_DOOR_TO_GIOVANNIS_OFFICE                  EQU $303
+EVENT_WAREHOUSE_LAYOUT_1                               EQU $304
+EVENT_WAREHOUSE_LAYOUT_2                               EQU $305
+EVENT_WAREHOUSE_LAYOUT_3                               EQU $306
+EVENT_WAREHOUSE_BLOCKED_OFF                            EQU $307
 EVENT_WILLS_ROOM_EXIT_OPEN                             EQU $30a
 EVENT_WILLS_ROOM_ENTRANCE_CLOSED                       EQU $30b
 EVENT_KOGAS_ROOM_EXIT_OPEN                             EQU $30c
@@ -242,6 +261,8 @@
 EVENT_WILTON_HAS_ULTRA_BALL                            EQU $32f
 EVENT_WILTON_HAS_GREAT_BALL                            EQU $330
 EVENT_WILTON_HAS_POKE_BALL                             EQU $331
+EVENT_HOLE_IN_BURNED_TOWER                             EQU $332
+EVENT_FOUGHT_EUSINE                                    EQU $333
 EVENT_KOJI_ALLOWS_YOU_PASSAGE_TO_TIN_TOWER             EQU $334
 EVENT_FOUGHT_SUICUNE                                   EQU $335
 EVENT_GOT_RAINBOW_WING                                 EQU $336
@@ -630,9 +651,11 @@
 EVENT_BOULDER_IN_ICE_PATH_2                            EQU $70e
 EVENT_BOULDER_IN_ICE_PATH_3                            EQU $70f
 EVENT_BOULDER_IN_ICE_PATH_4                            EQU $710
+EVENT_MET_BILL                                         EQU $712
 EVENT_OPENED_MT_SILVER                                 EQU $74f
 EVENT_FOUGHT_SNORLAX                                   EQU $750
 EVENT_RED_IN_MT_SILVER                                 EQU $762
+EVENT_RANG_CLEAR_BELL                                  EQU $767
 EVENT_FLORIA_AT_SUDOWOODO                              EQU $769
 EVENT_TRAINERS_IN_CERULEAN_GYM                         EQU $76f
 EVENT_BLUE_IN_CINNABAR                                 EQU $775
@@ -654,6 +677,7 @@
 EVENT_PICKED_UP_MOON_STONE_FROM_AERODACTYL_ITEM_ROOM   EQU $7a1
 EVENT_PICKED_UP_HEAL_POWDER_FROM_AERODACTYL_ITEM_ROOM  EQU $7a2
 EVENT_PICKED_UP_ENERGY_ROOT_FROM_AERODACTYL_ITEM_ROOM  EQU $7a3
+EVENT_EUSINE_IN_BURNED_TOWER                           EQU $7aa
 EVENT_SAW_SUICUNE_AT_CIANWOOD_CITY                     EQU $7ae
 EVENT_SAW_SUICUNE_ON_ROUTE_42                          EQU $7af
 EVENT_SAW_SUICUNE_ON_ROUTE_36                          EQU $7b0
--- a/engine/std_scripts.asm
+++ b/engine/std_scripts.asm
@@ -291,7 +291,7 @@
 	end
 
 RadioTowerRocketsScript:
-	setflag $0013
+	setflag ENGINE_BIKE_SHOP_CALL_ENABLED
 	setevent $06cf
 	setevent $06d1
 	clearevent $06ce
@@ -377,7 +377,7 @@
 	setevent $0727
 	setevent $0728
 	setevent $0729
-	setflag $0051
+	setflag ENGINE_51
 	special PlayMapMusic
 	end
 ; 0xbc31e
@@ -583,7 +583,7 @@
 	setevent $06ed
 	setevent $06f0
 	setevent $07a9
-	setevent $07aa
+	setevent EVENT_EUSINE_IN_BURNED_TOWER
 	setevent $06c8
 	setevent $07ac
 	setevent $07ad
--- a/main.asm
+++ b/main.asm
@@ -12384,9 +12384,9 @@
 ; 122c1
 
 UnknownScript_0x122c1: ; 0x122c1
-	checkflag $0011
+	checkflag ENGINE_BUG_CONTEST_TIMER
 	iffalse .script_122cd
-	setflag $0051
+	setflag ENGINE_51
 	special Function13a31
 .script_122cd
 	end
@@ -12721,7 +12721,7 @@
 	special Function8c084
 	pause 40
 	special HealParty
-	checkflag $0011
+	checkflag ENGINE_BUG_CONTEST_TIMER
 	iftrue .script_64f2
 	callasm HalveMoney
 	callasm Function12527
@@ -49267,7 +49267,7 @@
 	closetext
 	callasm Function506ef
 	iffalse UnknownScript_0x506e9
-	checkflag $0011
+	checkflag ENGINE_BUG_CONTEST_TIMER
 	iftrue UnknownScript_0x506e5
 	battlecheck
 	startbattle
--- a/maps/AzaleaTown.asm
+++ b/maps/AzaleaTown.asm
@@ -157,7 +157,7 @@
 	closetext
 	verbosegiveitem GS_BALL, 1
 	spriteface $d, LEFT
-	setflag $0064
+	setflag ENGINE_HAVE_EXAMINED_GS_BALL
 	clearevent $06ed
 	setevent $06eb
 	dotrigger $0
--- a/maps/BluesHouse.asm
+++ b/maps/BluesHouse.asm
@@ -16,7 +16,7 @@
 	end
 
 UnknownScript_0x19b0de:
-	checkflag $005c
+	checkflag ENGINE_TEA_IN_BLUES_HOUSE
 	iftrue UnknownScript_0x19b11e
 	writetext UnknownText_0x19b1b6
 	yesorno
@@ -24,9 +24,9 @@
 	writetext UnknownText_0x19b244
 	closetext
 	special Function741d
-	if_equal $0, UnknownScript_0x19b124
-	if_equal $1, UnknownScript_0x19b12a
-	setflag $005c
+	if_equal 0, UnknownScript_0x19b124
+	if_equal 1, UnknownScript_0x19b12a
+	setflag ENGINE_TEA_IN_BLUES_HOUSE
 	writetext UnknownText_0x19b266
 	closetext
 	loadmovesprites
--- a/maps/BurnedTower1F.asm
+++ b/maps/BurnedTower1F.asm
@@ -25,14 +25,14 @@
 	end
 
 UnknownScript_0x185bf8:
-	checkevent $0332
-	iftrue UnknownScript_0x185c02
-	changeblock $a, $8, $32
-UnknownScript_0x185c02:
+	checkevent EVENT_HOLE_IN_BURNED_TOWER
+	iftrue .Next
+	changeblock $a, $8, $32 ; hole
+.Next
 	checkevent EVENT_RELEASED_THE_BEASTS
-	iftrue UnknownScript_0x185c0c
-	changeblock $6, $e, $9
-UnknownScript_0x185c0c:
+	iftrue .Done
+	changeblock $6, $e, $9 ; ladder
+.Done
 	return
 
 UnknownScript_0x185c0d:
@@ -114,7 +114,7 @@
 	writetext UnknownText_0x185e75
 	closetext
 	loadmovesprites
-	setevent $0332
+	setevent EVENT_HOLE_IN_BURNED_TOWER
 	pause 15
 	warpcheck
 	end
--- a/maps/BurnedTowerB1F.asm
+++ b/maps/BurnedTowerB1F.asm
@@ -259,4 +259,4 @@
 	person_event SPRITE_ENTEI, 7, 16, $6, $0, 255, 255, $d0, 0, ObjectEvent, $074b
 	person_event SPRITE_SUICUNE, 8, 14, $6, $0, 255, 255, $d0, 0, ObjectEvent, $074b
 	person_event SPRITE_POKE_BALL, 8, 20, $1, $0, 255, 255, $1, 0, ItemFragment_0x186231, $0657
-	person_event SPRITE_SUPER_NERD, 16, 14, $7, $0, 255, 255, $90, 0, SuperNerdScript_0x186212, $07aa
+	person_event SPRITE_SUPER_NERD, 16, 14, $7, $0, 255, 255, $90, 0, SuperNerdScript_0x186212, EVENT_EUSINE_IN_BURNED_TOWER
--- a/maps/CeruleanCity.asm
+++ b/maps/CeruleanCity.asm
@@ -86,7 +86,7 @@
 	writetext UnknownText_0x1842a9
 	closetext
 	loadmovesprites
-	checkevent $00fa
+	checkevent EVENT_FOUND_BERSERK_GENE_IN_CERULEAN_CITY
 	iffalse UnknownScript_0x184072
 	end
 
@@ -141,7 +141,7 @@
 	jumpstd martsign
 
 MapCeruleanCitySignpostItem8:
-	dw $00fa
+	dw EVENT_FOUND_BERSERK_GENE_IN_CERULEAN_CITY
 	db BERSERK_GENE
 
 UnknownText_0x1840bc:
--- a/maps/CherrygroveCity.asm
+++ b/maps/CherrygroveCity.asm
@@ -68,7 +68,7 @@
 	keeptextopen
 	stringtotext .mapcardname, $1
 	scall .UnknownScript_0x19c097
-	setflag $0001
+	setflag ENGINE_MAP_CARD
 	writetext GotMapCardText
 	keeptextopen
 	writetext GuideGentPokegearText
@@ -177,7 +177,7 @@
 TeacherScript_0x19c146:
 	faceplayer
 	loadfont
-	checkflag $0001
+	checkflag ENGINE_MAP_CARD
 	iftrue UnknownScript_0x19c154
 	writetext UnknownText_0x19c650
 	closetext
@@ -193,7 +193,7 @@
 YoungsterScript_0x19c15a:
 	faceplayer
 	loadfont
-	checkflag $000b
+	checkflag ENGINE_POKEDEX
 	iftrue UnknownScript_0x19c168
 	writetext UnknownText_0x19c6d6
 	closetext
--- a/maps/CianwoodCity.asm
+++ b/maps/CianwoodCity.asm
@@ -20,8 +20,8 @@
 
 .FlyPointAndSuicune
 	setflag ENGINE_FLYPOINT_CIANWOOD
-	setevent $07aa
-	checkevent $0333
+	setevent EVENT_EUSINE_IN_BURNED_TOWER
+	checkevent EVENT_FOUGHT_EUSINE
 	iffalse UnknownScript_0x1a001d
 	disappear $c
 UnknownScript_0x1a001d:
@@ -42,9 +42,9 @@
 	dotrigger $0
 	clearevent EVENT_SAW_SUICUNE_ON_ROUTE_42
 	domaptrigger GROUP_ROUTE_42, MAP_ROUTE_42, $1
-	checkevent $0333
-	iftrue UnknownScript_0x1a0083
-	setevent $0333
+	checkevent EVENT_FOUGHT_EUSINE
+	iftrue .Done
+	setevent EVENT_FOUGHT_EUSINE
 	playmusic MUSIC_MYSTICALMAN_ENCOUNTER
 	appear $c
 	applymovement $c, MovementData_0x1a00e7
@@ -69,7 +69,7 @@
 	special Functionc48f
 	playmapmusic
 	pause 10
-UnknownScript_0x1a0083:
+.Done
 	end
 
 PokefanFScript_0x1a0084:
--- a/maps/CianwoodPharmacy.asm
+++ b/maps/CianwoodPharmacy.asm
@@ -16,11 +16,11 @@
 	loadfont
 	checkevent EVENT_GOT_SECRETPOTION_FROM_PHARMACY
 	iftrue .Mart
-	checkevent $0037
+	checkevent EVENT_JASMINE_EXPLAINED_AMPHYS_SICKNESS
 	iffalse .Mart
 	writetext PharmacistGiveSecretpotionText
 	keeptextopen
-	giveitem SECRETPOTION, $1
+	giveitem SECRETPOTION, 1
 	writetext ReceivedSecretpotionText
 	playsound SFX_KEY_ITEM
 	waitbutton
--- a/maps/CopycatsHouse2F.asm
+++ b/maps/CopycatsHouse2F.asm
@@ -10,7 +10,7 @@
 	dbw 2, CopycatsHouse2FCallback
 
 CopycatsHouse2FCallback:
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue .Part1
 	disappear $7
 	appear $2
@@ -29,7 +29,7 @@
 	iftrue .Part13
 	checkitem LOST_ITEM
 	iftrue .Part12
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue .Part1
 	applymovement $2, MovementData_0x18afd0
 	faceplayer
@@ -45,7 +45,7 @@
 	checkevent EVENT_RETURNED_MACHINE_PART
 	iftrue .Part7
 	loadfont
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue .Part3
 	writetext UnknownText_0x18afda
 	jump .Part4
@@ -55,7 +55,7 @@
 .Part4
 	closetext
 	loadmovesprites
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue .Part5
 	applymovement $2, MovementData_0x18afd0
 	jump .Part6
@@ -74,7 +74,7 @@
 
 .Part7
 	loadfont
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue .Part8
 	writetext UnknownText_0x18b064
 	jump .Part9
@@ -84,7 +84,7 @@
 .Part9
 	closetext
 	loadmovesprites
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue .Part10
 	applymovement $2, MovementData_0x18afd0
 	jump .Part11
@@ -125,7 +125,7 @@
 	end
 
 .Part15
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue .Part16
 	applymovement $2, MovementData_0x18afd0
 	faceplayer
@@ -139,7 +139,7 @@
 .Part17
 	special Function14209
 	loadfont
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue .Part18
 	writetext UnknownText_0x18b298
 	jump .Part19
@@ -149,7 +149,7 @@
 .Part19
 	closetext
 	loadmovesprites
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue .Part20
 	applymovement $2, MovementData_0x18afd0
 	jump .Part21
--- a/maps/DanceTheatre.asm
+++ b/maps/DanceTheatre.asm
@@ -160,7 +160,7 @@
 	jump UnknownScript_0x99505
 
 UnknownScript_0x994f3:
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue UnknownScript_0x994ff
 	writetext UnknownText_0x99891
 	closetext
--- a/maps/DayCare.asm
+++ b/maps/DayCare.asm
@@ -10,7 +10,7 @@
 	dbw 2, UnknownScript_0x62f7b
 
 UnknownScript_0x62f7b:
-	checkflag $0005
+	checkflag ENGINE_DAYCARE_MONS_ARE_COMPATIBLE
 	iftrue UnknownScript_0x62f88
 	clearevent $06e5
 	setevent $06e6
@@ -58,7 +58,7 @@
 GrannyScript_0x62fc3:
 	faceplayer
 	loadfont
-	checkflag $0005
+	checkflag ENGINE_DAYCARE_MONS_ARE_COMPATIBLE
 	iftrue UnknownScript_0x62fd1
 	special Function1672a
 	closetext
--- a/maps/DragonShrine.asm
+++ b/maps/DragonShrine.asm
@@ -99,7 +99,7 @@
 	writetext UnknownText_0x18d816
 	closetext
 	loadmovesprites
-	setevent $00c1
+	setevent EVENT_ANSWERED_DRAGON_MASTER_QUIZ_WRONG
 	loadfont
 	checkevent $0005
 	iftrue UnknownScript_0x18d091
@@ -156,7 +156,7 @@
 	loadfont
 	writetext UnknownText_0x18d9bf
 	closetext
-	setflag $0022
+	setflag ENGINE_RISINGBADGE
 	playsound SFX_GET_BADGE
 	waitbutton
 	special RestartMapMusic
@@ -194,7 +194,7 @@
 	iftrue UnknownScript_0x18d1f9
 	checkevent $0006
 	iftrue UnknownScript_0x18d1ff
-	checkevent $00bd
+	checkevent EVENT_GOT_DRATINI
 	iffalse UnknownScript_0x18d1c5
 	checkevent EVENT_BEAT_RIVAL_IN_MT_MOON
 	iftrue UnknownScript_0x18d1f3
@@ -212,9 +212,9 @@
 	playsound SFX_CAUGHT_MON
 	waitbutton
 	givepoke DRATINI, 15, 0, 0
-	checkevent $00c1
+	checkevent EVENT_ANSWERED_DRAGON_MASTER_QUIZ_WRONG
 	special SpecialDratini
-	setevent $00bd
+	setevent EVENT_GOT_DRATINI
 	setevent $0006
 	writetext UnknownText_0x18d6ca
 	closetext
--- a/maps/EcruteakHouse.asm
+++ b/maps/EcruteakHouse.asm
@@ -30,7 +30,7 @@
 
 UnknownScript_0x98022:
 	clearevent $0766
-	setevent $0767
+	setevent EVENT_RANG_CLEAR_BELL
 	setevent $07b1
 	checkitem CLEAR_BELL
 	iftrue UnknownScript_0x98032
@@ -43,7 +43,7 @@
 	return
 
 UnknownScript_0x98037:
-	checkevent $0767
+	checkevent EVENT_RANG_CLEAR_BELL
 	iftrue UnknownScript_0x98061
 	applymovement $3, MovementData_0x980c7
 	moveperson $2, $4, $6
@@ -70,7 +70,7 @@
 	loadfont
 	checkevent EVENT_CLEARED_RADIO_TOWER
 	iftrue UnknownScript_0x9807c
-	checkflag $001e
+	checkflag ENGINE_FOGBADGE
 	iftrue UnknownScript_0x98076
 	writetext UnknownText_0x980d1
 	closetext
@@ -100,7 +100,7 @@
 	closetext
 	loadmovesprites
 	dotrigger $1
-	setevent $0767
+	setevent EVENT_RANG_CLEAR_BELL
 	clearevent $0766
 	setevent $0000
 	end
@@ -299,6 +299,6 @@
 	; people-events
 	db 4
 	person_event SPRITE_SAGE, 10, 8, $6, $0, 255, 255, $0, 0, SageScript_0x98062, $0766
-	person_event SPRITE_SAGE, 10, 9, $6, $0, 255, 255, $0, 0, SageScript_0x98062, $0767
+	person_event SPRITE_SAGE, 10, 9, $6, $0, 255, 255, $0, 0, SageScript_0x98062, EVENT_RANG_CLEAR_BELL
 	person_event SPRITE_SAGE, 13, 10, $2, $11, 255, 255, $0, 0, SageScript_0x980b0, $07b1
 	person_event SPRITE_GRAMPS, 15, 7, $2, $11, 255, 255, $0, 0, GrampsScript_0x980c4, $07b1
--- a/maps/EcruteakPokeCenter1F.asm
+++ b/maps/EcruteakPokeCenter1F.asm
@@ -46,8 +46,8 @@
 	applymovement $6, MovementData_0x98ece
 	playsound SFX_EXIT_BUILDING
 	disappear $6
-	clearevent $0712
-	setflag $0053
+	clearevent EVENT_MET_BILL
+	setflag ENGINE_TIME_CAPSULE
 	dotrigger $1
 	waitbutton
 	end
--- a/maps/ElmsLab.asm
+++ b/maps/ElmsLab.asm
@@ -95,7 +95,7 @@
 UnknownScript_0x78bee:
 	checkevent EVENT_GOT_MASTER_BALL_FROM_ELM
 	iftrue UnknownScript_0x78bfa
-	checkflag $0022
+	checkflag ENGINE_RISINGBADGE
 	iftrue ElmGiveMasterBallScript
 UnknownScript_0x78bfa:
 	checkevent EVENT_GOT_EVERSTONE_FROM_ELM
@@ -132,7 +132,7 @@
 UnknownScript_0x78c41:
 	checkevent EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE ; why are we checking it again?
 	iftrue ElmWaitingEggHatchScript
-	checkflag $001b
+	checkflag ENGINE_ZEPHYRBADGE
 	iftrue ElmAideHasEggScript
 	checkevent EVENT_GAVE_MYSTERY_EGG_TO_ELM
 	iftrue ElmStudyingEggScript
@@ -337,7 +337,7 @@
 	writetext ElmAfterTheftText5
 	keeptextopen
 	setevent EVENT_GAVE_MYSTERY_EGG_TO_ELM
-	setflag $0010
+	setflag ENGINE_BUG_CONTEST_ON
 	domaptrigger GROUP_ROUTE_29, MAP_ROUTE_29, $1
 	clearevent $0715
 	setevent $0714
@@ -564,7 +564,7 @@
 
 ElmsLabWindow:
 	loadfont
-	checkflag $0043
+	checkflag ENGINE_FLYPOINT_VIOLET
 	iftrue .Normal
 	checkevent EVENT_ELM_CALLED_ABOUT_STOLEN_POKEMON
 	iftrue .BreakIn
--- a/maps/FastShip1F.asm
+++ b/maps/FastShip1F.asm
@@ -43,14 +43,14 @@
 	loadfont
 	checkevent $0031
 	iftrue UnknownScript_0x7517a
-	checkevent $002f
-	iftrue UnknownScript_0x75174
+	checkevent EVENT_FAST_SHIP_DESTINATION_OLIVINE
+	iftrue .Olivine
 	writetext UnknownText_0x7523b
 	closetext
 	loadmovesprites
 	end
 
-UnknownScript_0x75174:
+.Olivine
 	writetext UnknownText_0x7529b
 	closetext
 	loadmovesprites
@@ -57,8 +57,8 @@
 	end
 
 UnknownScript_0x7517a:
-	checkevent $002f
-	iftrue UnknownScript_0x7519c
+	checkevent EVENT_FAST_SHIP_DESTINATION_OLIVINE
+	iftrue .Olivine
 	writetext UnknownText_0x754be
 	closetext
 	loadmovesprites
@@ -71,7 +71,7 @@
 	warp GROUP_VERMILION_PORT, MAP_VERMILION_PORT, $7, $11
 	end
 
-UnknownScript_0x7519c:
+.Olivine
 	writetext UnknownText_0x7548d
 	closetext
 	loadmovesprites
--- a/maps/FastShipCabins_SE_SSE_CaptainsCabin.asm
+++ b/maps/FastShipCabins_SE_SSE_CaptainsCabin.asm
@@ -48,7 +48,7 @@
 	showemote $0, $3, 15
 	applymovement $4, MovementData_0x7600c
 	spriteface $3, RIGHT
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue UnknownScript_0x75f03
 	loadfont
 	writetext UnknownText_0x76284
--- a/maps/GoldenrodBikeShop.asm
+++ b/maps/GoldenrodBikeShop.asm
@@ -19,12 +19,12 @@
 	writetext UnknownText_0x547f8
 	keeptextopen
 	waitbutton
-	giveitem BICYCLE, $1
+	giveitem BICYCLE, 1
 	writetext UnknownText_0x54848
 	playsound SFX_KEY_ITEM
 	waitbutton
 	itemnotify
-	setflag $0014
+	setflag ENGINE_14
 	setevent EVENT_GOT_BICYCLE
 UnknownScript_0x54775:
 	writetext UnknownText_0x5485f
--- a/maps/GoldenrodBillsHouse.asm
+++ b/maps/GoldenrodBillsHouse.asm
@@ -49,7 +49,7 @@
 BillsMom:
 	faceplayer
 	loadfont
-	checkevent $0712
+	checkevent EVENT_MET_BILL
 	iffalse UnknownScript_0x54c33
 	writetext UnknownText_0x54ea8
 	closetext
@@ -257,6 +257,6 @@
 
 	; people-events
 	db 3
-	person_event SPRITE_BILL, 7, 6, $9, $0, 255, 255, $0, 0, BillsHouseBill, $0712
+	person_event SPRITE_BILL, 7, 6, $9, $0, 255, 255, $0, 0, BillsHouseBill, EVENT_MET_BILL
 	person_event SPRITE_POKEFAN_F, 7, 9, $6, $0, 255, 255, $0, 0, BillsMom, $ffff
 	person_event SPRITE_TWIN, 8, 9, $2, $11, 255, 255, $a0, 0, BillsSister, $ffff
--- a/maps/GoldenrodCity.asm
+++ b/maps/GoldenrodCity.asm
@@ -170,7 +170,7 @@
 CooltrainerFScript_0x1989fd:
 	faceplayer
 	loadfont
-	checkflag $0000
+	checkflag ENGINE_RADIO_CARD
 	iftrue UnknownScript_0x198a0b
 	writetext UnknownText_0x198b73
 	closetext
--- a/maps/GoldenrodDeptStore5F.asm
+++ b/maps/GoldenrodDeptStore5F.asm
@@ -58,7 +58,7 @@
 	loadfont
 	checkcode VAR_WEEKDAY
 	if_not_equal SUNDAY, UnknownScript_0x56112
-	checkflag $005b
+	checkflag ENGINE_GOLDENROD_MALL_5F_HAPPINESS_EVENT
 	iftrue UnknownScript_0x56112
 	special Function718d
 	writetext UnknownText_0x56143
@@ -72,7 +72,7 @@
 	keeptextopen
 	verbosegiveitem TM_RETURN, 1
 	iffalse UnknownScript_0x56116
-	setflag $005b
+	setflag ENGINE_GOLDENROD_MALL_5F_HAPPINESS_EVENT
 	loadmovesprites
 	end
 
@@ -87,7 +87,7 @@
 	keeptextopen
 	verbosegiveitem TM_FRUSTRATION, 1
 	iffalse UnknownScript_0x56116
-	setflag $005b
+	setflag ENGINE_GOLDENROD_MALL_5F_HAPPINESS_EVENT
 	loadmovesprites
 	end
 
--- a/maps/GoldenrodDeptStoreB1F.asm
+++ b/maps/GoldenrodDeptStoreB1F.asm
@@ -21,23 +21,23 @@
 	jump UnknownScript_0x7d791
 
 UnknownScript_0x7d791:
-	checkevent $0305
-	iftrue UnknownScript_0x7d7a2
-	checkevent $0306
-	iftrue UnknownScript_0x7d7a7
+	checkevent EVENT_WAREHOUSE_LAYOUT_2
+	iftrue .Layout2
+	checkevent EVENT_WAREHOUSE_LAYOUT_3
+	iftrue .Layout3
 	changeblock $a, $8, $d
 	return
 
-UnknownScript_0x7d7a2:
+.Layout2
 	changeblock $4, $a, $d
 	return
 
-UnknownScript_0x7d7a7:
+.Layout3
 	changeblock $a, $c, $d
 	return
 
 UnknownScript_0x7d7ac:
-	clearevent $0307
+	clearevent EVENT_WAREHOUSE_BLOCKED_OFF
 	return
 
 BlackBeltScript_0x7d7b0:
--- a/maps/GoldenrodDeptStoreElevator.asm
+++ b/maps/GoldenrodDeptStoreElevator.asm
@@ -9,38 +9,38 @@
 	loadfont
 	elevator Elevator_0x566e0
 	loadmovesprites
-	iffalse UnknownScript_0x566df
+	iffalse .Done
 	pause 5
 	playsound SFX_ELEVATOR
 	earthquake 60
 	waitbutton
-	checkevent $0307
-	iftrue UnknownScript_0x566df
-	checkevent $0304
-	iftrue UnknownScript_0x566cb
-	checkevent $0305
-	iftrue UnknownScript_0x566d5
-	checkevent $0306
-	iftrue UnknownScript_0x566c1
-UnknownScript_0x566c1: ;0x566c1
-	setevent $0304
-	clearevent $0305
-	clearevent $0306
+	checkevent EVENT_WAREHOUSE_BLOCKED_OFF
+	iftrue .Done
+	checkevent EVENT_WAREHOUSE_LAYOUT_1
+	iftrue .BoxLayout1
+	checkevent EVENT_WAREHOUSE_LAYOUT_2
+	iftrue .BoxLayout2
+	checkevent EVENT_WAREHOUSE_LAYOUT_3
+	iftrue .BoxLayout3
+.BoxLayout3
+	setevent EVENT_WAREHOUSE_LAYOUT_1
+	clearevent EVENT_WAREHOUSE_LAYOUT_2
+	clearevent EVENT_WAREHOUSE_LAYOUT_3
 	end
 
-UnknownScript_0x566cb:
-	clearevent $0304
-	setevent $0305
-	clearevent $0306
+.BoxLayout1
+	clearevent EVENT_WAREHOUSE_LAYOUT_1
+	setevent EVENT_WAREHOUSE_LAYOUT_2
+	clearevent EVENT_WAREHOUSE_LAYOUT_3
 	end
 
-UnknownScript_0x566d5:
-	clearevent $0304
-	clearevent $0305
-	setevent $0306
+.BoxLayout2
+	clearevent EVENT_WAREHOUSE_LAYOUT_1
+	clearevent EVENT_WAREHOUSE_LAYOUT_2
+	setevent EVENT_WAREHOUSE_LAYOUT_3
 	end
 
-UnknownScript_0x566df:
+.Done
 	end
 
 
--- a/maps/GoldenrodDeptStoreRoof.asm
+++ b/maps/GoldenrodDeptStoreRoof.asm
@@ -12,7 +12,7 @@
 	dbw 2, UnknownScript_0x5672b
 
 UnknownScript_0x5671b:
-	checkflag $0061
+	checkflag ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
 	iftrue UnknownScript_0x56722
 	return
 
@@ -22,7 +22,7 @@
 	return
 
 UnknownScript_0x5672b:
-	checkflag $0061
+	checkflag ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
 	iftrue UnknownScript_0x56738
 	setevent $06f0
 	clearevent $06f1
--- a/maps/GoldenrodFlowerShop.asm
+++ b/maps/GoldenrodFlowerShop.asm
@@ -14,7 +14,7 @@
 	iffalse UnknownScript_0x5539f
 	checkevent $00ba
 	iffalse UnknownScript_0x5538f
-	checkflag $001d
+	checkflag ENGINE_PLAINBADGE
 	iffalse UnknownScript_0x5539c
 	faceplayer
 	loadfont
--- a/maps/IlexForest.asm
+++ b/maps/IlexForest.asm
@@ -79,7 +79,7 @@
 YoungsterScript_0x6eb7b:
 	faceplayer
 	loadfont
-	checkevent $0029
+	checkevent EVENT_HERDED_FARFETCHD
 	iftrue UnknownScript_0x6eb89
 	writetext UnknownText_0x6ef5c
 	closetext
@@ -294,7 +294,7 @@
 	loadvar FarfetchdPosition, $a
 	appear $4
 	setevent $06f7
-	setevent $0029
+	setevent EVENT_HERDED_FARFETCHD
 	end
 
 UnknownScript_0x6ed74:
@@ -439,7 +439,7 @@
 	jumptext UnknownText_0x6f2de
 
 MapIlexForestSignpost4Script:
-	checkevent $00c0
+	checkevent EVENT_FOREST_IS_RESTLESS
 	iftrue UnknownScript_0x6ee30
 	jump UnknownScript_0x6ee35
 
@@ -459,7 +459,7 @@
 
 UnknownScript_0x6ee42:
 	takeitem GS_BALL, 1
-	clearevent $00c0
+	clearevent EVENT_FOREST_IS_RESTLESS
 	setevent $07a4
 	disappear $8
 	clearevent $06eb
--- a/maps/IndigoPlateauPokeCenter1F.asm
+++ b/maps/IndigoPlateauPokeCenter1F.asm
@@ -43,7 +43,7 @@
 UnknownScript_0x180053:
 	checkevent EVENT_BEAT_RIVAL_IN_MT_MOON
 	iffalse UnknownScript_0x18012b
-	checkflag $005d
+	checkflag ENGINE_INDIGO_PLATEAU_RIVAL_FIGHT
 	iftrue UnknownScript_0x18012b
 	checkcode VAR_WEEKDAY
 	if_equal SUNDAY, UnknownScript_0x18012b
@@ -65,7 +65,7 @@
 UnknownScript_0x180094:
 	checkevent EVENT_BEAT_RIVAL_IN_MT_MOON
 	iffalse UnknownScript_0x18012b
-	checkflag $005d
+	checkflag ENGINE_INDIGO_PLATEAU_RIVAL_FIGHT
 	iftrue UnknownScript_0x18012b
 	checkcode VAR_WEEKDAY
 	if_equal SUNDAY, UnknownScript_0x18012b
@@ -128,7 +128,7 @@
 	disappear $5
 	dotrigger $0
 	playmapmusic
-	setflag $005d
+	setflag ENGINE_INDIGO_PLATEAU_RIVAL_FIGHT
 UnknownScript_0x18012b:
 	end
 
--- a/maps/KrissHouse1F.asm
+++ b/maps/KrissHouse1F.asm
@@ -35,8 +35,8 @@
 	keeptextopen
 	stringtotext GearName, $1
 	scall UnknownScript_0x7a57e
-	setflag $0004
-	setflag $0002
+	setflag ENGINE_POKEGEAR
+	setflag ENGINE_PHONE_CARD
 	addcellnum $1
 	dotrigger $1
 	setevent $06c7
--- a/maps/KurtsHouse.asm
+++ b/maps/KurtsHouse.asm
@@ -12,9 +12,9 @@
 UnknownScript_0x18e154:
 	checkevent EVENT_CLEARED_SLOWPOKE_WELL
 	iffalse UnknownScript_0x18e177
-	checkevent $00c0
+	checkevent EVENT_FOREST_IS_RESTLESS
 	iftrue UnknownScript_0x18e177
-	checkflag $0050
+	checkflag ENGINE_KURT_MAKING_BALLS
 	iftrue UnknownScript_0x18e16f
 	disappear $5
 	appear $2
@@ -164,7 +164,7 @@
 
 UnknownScript_0x18e299:
 	setevent $0000
-	setflag $0050
+	setflag ENGINE_KURT_MAKING_BALLS
 UnknownScript_0x18e29f:
 	writetext UnknownText_0x18e779
 	closetext
@@ -187,7 +187,7 @@
 	end
 
 UnknownScript_0x18e2b4:
-	checkflag $0050
+	checkflag ENGINE_KURT_MAKING_BALLS
 	iftrue UnknownScript_0x18e3c5
 	writetext UnknownText_0x18e7fb
 	keeptextopen
@@ -198,7 +198,7 @@
 	jump UnknownScript_0x18e2ab
 
 UnknownScript_0x18e2ca:
-	checkflag $0050
+	checkflag ENGINE_KURT_MAKING_BALLS
 	iftrue UnknownScript_0x18e3c5
 	writetext UnknownText_0x18e7fb
 	keeptextopen
@@ -209,7 +209,7 @@
 	jump UnknownScript_0x18e2ab
 
 UnknownScript_0x18e2e0:
-	checkflag $0050
+	checkflag ENGINE_KURT_MAKING_BALLS
 	iftrue UnknownScript_0x18e3c5
 	writetext UnknownText_0x18e7fb
 	keeptextopen
@@ -220,7 +220,7 @@
 	jump UnknownScript_0x18e2ab
 
 UnknownScript_0x18e2f6:
-	checkflag $0050
+	checkflag ENGINE_KURT_MAKING_BALLS
 	iftrue UnknownScript_0x18e3c5
 	writetext UnknownText_0x18e7fb
 	keeptextopen
@@ -231,7 +231,7 @@
 	jump UnknownScript_0x18e2ab
 
 UnknownScript_0x18e30c:
-	checkflag $0050
+	checkflag ENGINE_KURT_MAKING_BALLS
 	iftrue UnknownScript_0x18e3c5
 	writetext UnknownText_0x18e7fb
 	keeptextopen
@@ -242,7 +242,7 @@
 	jump UnknownScript_0x18e2ab
 
 UnknownScript_0x18e322:
-	checkflag $0050
+	checkflag ENGINE_KURT_MAKING_BALLS
 	iftrue UnknownScript_0x18e3c5
 	writetext UnknownText_0x18e7fb
 	keeptextopen
@@ -253,7 +253,7 @@
 	jump UnknownScript_0x18e2ab
 
 UnknownScript_0x18e338:
-	checkflag $0050
+	checkflag ENGINE_KURT_MAKING_BALLS
 	iftrue UnknownScript_0x18e3c5
 	writetext UnknownText_0x18e7fb
 	keeptextopen
@@ -264,7 +264,7 @@
 	jump UnknownScript_0x18e2ab
 
 UnknownScript_0x18e34e:
-	checkevent $00bf
+	checkevent EVENT_GAVE_GS_BALL_TO_KURT
 	iftrue UnknownScript_0x18e368
 	checkitem GS_BALL
 	iffalse UnknownScript_0x18e202
@@ -271,13 +271,13 @@
 	writetext UnknownText_0x18e8ab
 	closetext
 	loadmovesprites
-	setevent $00bf
+	setevent EVENT_GAVE_GS_BALL_TO_KURT
 	takeitem GS_BALL, 1
-	setflag $0050
+	setflag ENGINE_KURT_MAKING_BALLS
 	end
 
 UnknownScript_0x18e368:
-	checkflag $0050
+	checkflag ENGINE_KURT_MAKING_BALLS
 	iffalse UnknownScript_0x18e378
 	writetext UnknownText_0x18e934
 	closetext
@@ -290,9 +290,9 @@
 	writetext UnknownText_0x18e95c
 	closetext
 	loadmovesprites
-	setevent $00c0
+	setevent EVENT_FOREST_IS_RESTLESS
 	clearevent EVENT_CAN_GIVE_GS_BALL_TO_KURT
-	clearevent $00bf
+	clearevent EVENT_GAVE_GS_BALL_TO_KURT
 	special Functionc48f
 	pause 20
 	showemote $0, $2, 30
@@ -319,10 +319,10 @@
 KurtScript_0x18e3bd:
 	faceplayer
 	loadfont
-	checkevent $00bf
+	checkevent EVENT_GAVE_GS_BALL_TO_KURT
 	iftrue UnknownScript_0x18e3e0
 UnknownScript_0x18e3c5:
-	checkevent $00bb
+	checkevent EVENT_BUGGING_KURT_TOO_MUCH
 	iffalse UnknownScript_0x18e3d4
 	writetext UnknownText_0x18e7d8
 	closetext
@@ -335,7 +335,7 @@
 	closetext
 	loadmovesprites
 	spriteface $5, UP
-	setevent $00bb
+	setevent EVENT_BUGGING_KURT_TOO_MUCH
 	end
 
 UnknownScript_0x18e3e0:
@@ -353,7 +353,7 @@
 	iftrue KurtsGranddaughter2Subscript
 	checkevent $0001
 	iftrue KurtsGranddaughterFunScript
-	checkevent $00c0
+	checkevent EVENT_FOREST_IS_RESTLESS
 	iftrue .Lonely
 	checkevent $0030
 	iftrue .Dad
@@ -392,7 +392,7 @@
 	faceplayer
 KurtsGranddaughter2Subscript:
 	loadfont
-	checkevent $00bf
+	checkevent EVENT_GAVE_GS_BALL_TO_KURT
 	iftrue .GSBall
 	writetext KurtsGranddaughterHelpText
 	closetext
--- a/maps/LavRadioTower1F.asm
+++ b/maps/LavRadioTower1F.asm
@@ -17,7 +17,7 @@
 GentlemanScript_0x7ee6c:
 	faceplayer
 	loadfont
-	checkflag $0003
+	checkflag ENGINE_EXPN_CARD
 	iftrue .UnknownScript_0x7ee8e
 	checkevent EVENT_RETURNED_MACHINE_PART
 	iftrue .UnknownScript_0x7ee80
@@ -31,7 +31,7 @@
 	keeptextopen
 	stringtotext .expncardname, $1
 	scall .UnknownScript_0x7ee94
-	setflag $0003
+	setflag ENGINE_EXPN_CARD
 .UnknownScript_0x7ee8e
 	writetext UnknownText_0x7f141
 	closetext
@@ -48,7 +48,7 @@
 SuperNerdScript_0x7eea2:
 	faceplayer
 	loadfont
-	checkflag $0003
+	checkflag ENGINE_EXPN_CARD
 	iftrue UnknownScript_0x7eeb0
 	writetext UnknownText_0x7f193
 	closetext
--- a/maps/MahoganyRedGyaradosSpeechHouse.asm
+++ b/maps/MahoganyRedGyaradosSpeechHouse.asm
@@ -11,7 +11,7 @@
 TeacherScript_0x199982:
 	faceplayer
 	loadfont
-	checkflag $0013
+	checkflag ENGINE_BIKE_SHOP_CALL_ENABLED
 	iftrue UnknownScript_0x199990
 	writetext UnknownText_0x199a0e
 	closetext
--- a/maps/ManiasHouse.asm
+++ b/maps/ManiasHouse.asm
@@ -28,7 +28,7 @@
 	end
 
 UnknownScript_0x9d2a4:
-	checkflag $0055
+	checkflag ENGINE_SHUCKLE_GIVEN
 	iffalse UnknownScript_0x9d2bc
 	writetext UnknownText_0x9d3ed
 	closetext
--- a/maps/MountMoonSquare.asm
+++ b/maps/MountMoonSquare.asm
@@ -26,7 +26,7 @@
 	return
 
 UnknownScript_0x7709a:
-	checkflag $0058
+	checkflag ENGINE_MT_MOON_SQUARE_CLEFAIRY
 	iftrue UnknownScript_0x77117
 	checkcode VAR_WEEKDAY
 	if_not_equal MONDAY, UnknownScript_0x77117
@@ -69,7 +69,7 @@
 	disappear $3
 	stopfollow
 	clearevent $00ec
-	setflag $0058
+	setflag ENGINE_MT_MOON_SQUARE_CLEFAIRY
 	end
 
 UnknownScript_0x77117:
--- a/maps/MrPokemonsHouse.asm
+++ b/maps/MrPokemonsHouse.asm
@@ -92,7 +92,7 @@
 	writetext UnknownText_0x1973cc
 	playsound SFX_ITEM
 	waitbutton
-	setflag $000b
+	setflag ENGINE_POKEDEX
 	writetext UnknownText_0x1973de
 	closetext
 	loadmovesprites
--- a/maps/NationalPark.asm
+++ b/maps/NationalPark.asm
@@ -244,11 +244,11 @@
 	iftrue UnknownScript_0x5c19b
 	checkpoke MARILL
 	iffalse UnknownScript_0x5c189
-	checkevent EVENT_SHOWED_BEVERLY_MARILL
+	checkevent EVENT_BEVERLY_ASKED_FOR_PHONE_NUMBER
 	iftrue UnknownScript_0x5c160
 	writetext UnknownText_0x5c5bd
 	keeptextopen
-	setevent EVENT_SHOWED_BEVERLY_MARILL
+	setevent EVENT_BEVERLY_ASKED_FOR_PHONE_NUMBER
 	scall UnknownScript_0x5c18f
 	jump UnknownScript_0x5c163
 
--- a/maps/OlivineLighthouse6F.asm
+++ b/maps/OlivineLighthouse6F.asm
@@ -10,11 +10,11 @@
 	loadfont
 	checkitem SECRETPOTION
 	iftrue UnknownScript_0x60bab
-	checkevent $0037
+	checkevent EVENT_JASMINE_EXPLAINED_AMPHYS_SICKNESS
 	iftrue UnknownScript_0x60ba5
 	writetext UnknownText_0x60c81
 	keeptextopen
-	setevent $0037
+	setevent EVENT_JASMINE_EXPLAINED_AMPHYS_SICKNESS
 UnknownScript_0x60ba5:
 	writetext UnknownText_0x60d64
 	closetext
--- a/maps/PokeCenter2F.asm
+++ b/maps/PokeCenter2F.asm
@@ -295,9 +295,9 @@
 	end
 
 LinkReceptionistScript_0x192a2d:
-	checkevent $0712
+	checkevent EVENT_MET_BILL
 	iftrue UnknownScript_0x192a25
-	checkflag $0053
+	checkflag ENGINE_TIME_CAPSULE
 	iftrue UnknownScript_0x192a25
 	special Function29cfa
 	faceplayer
@@ -410,7 +410,7 @@
 	end
 
 UnknownScript_0x192b04:
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue UnknownScript_0x192b12
 	applymovement2 MovementData_0x192cca
 	applymovement $0, MovementData_0x192cde
@@ -434,7 +434,7 @@
 	writebyte $80
 	special Functionc225
 	applymovement $0, MovementData_0x192d1c
-	setflag $009f
+	setflag ENGINE_KRIS_IN_CABLE_CLUB
 	special Functione4a
 	loadfont
 	writetext UnknownText_0x19329a
@@ -445,7 +445,7 @@
 	end
 
 UnknownScript_0x192b50:
-	checkflag $009f
+	checkflag ENGINE_KRIS_IN_CABLE_CLUB
 	iftrue UnknownScript_0x192b63
 	applymovement $2, MovementData_0x192d04
 	applymovement $0, MovementData_0x192cf5
@@ -455,7 +455,7 @@
 UnknownScript_0x192b63:
 	applymovement $2, MovementData_0x192d04
 	applymovement $0, MovementData_0x192d28
-	clearflag $009f
+	clearflag ENGINE_KRIS_IN_CABLE_CLUB
 	playsound SFX_TINGLE
 	applymovement $0, MovementData_0x192d17
 	writebyte $90
@@ -467,7 +467,7 @@
 	end
 
 UnknownScript_0x192b8a:
-	checkflag $009f
+	checkflag ENGINE_KRIS_IN_CABLE_CLUB
 	iftrue UnknownScript_0x192b9d
 	applymovement $3, MovementData_0x192d04
 	applymovement $0, MovementData_0x192cf5
@@ -477,7 +477,7 @@
 UnknownScript_0x192b9d:
 	applymovement $3, MovementData_0x192d04
 	applymovement $0, MovementData_0x192d28
-	clearflag $009f
+	clearflag ENGINE_KRIS_IN_CABLE_CLUB
 	playsound SFX_TINGLE
 	applymovement $0, MovementData_0x192d17
 	writebyte $90
@@ -489,7 +489,7 @@
 	end
 
 UnknownScript_0x192bc4:
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue UnknownScript_0x192bec
 	checkcode VAR_FACING
 	if_equal $2, UnknownScript_0x192bdc
@@ -543,7 +543,7 @@
 	special Functionc225
 	applymovement $0, MovementData_0x192d22
 	faceperson $0, $4
-	setflag $009f
+	setflag ENGINE_KRIS_IN_CABLE_CLUB
 	special Functione4a
 	loadfont
 	writetext UnknownText_0x19329a
@@ -555,7 +555,7 @@
 
 UnknownScript_0x192c4e:
 	special Function29c92
-	checkflag $009f
+	checkflag ENGINE_KRIS_IN_CABLE_CLUB
 	iftrue UnknownScript_0x192c66
 	applymovement $4, MovementData_0x192d08
 	applymovement $0, MovementData_0x192cf9
@@ -565,7 +565,7 @@
 UnknownScript_0x192c66:
 	applymovement $4, MovementData_0x192d08
 	applymovement $0, MovementData_0x192cfc
-	clearflag $009f
+	clearflag ENGINE_KRIS_IN_CABLE_CLUB
 	playsound SFX_TINGLE
 	applymovement $0, MovementData_0x192d17
 	writebyte $90
--- a/maps/RadioTower1F.asm
+++ b/maps/RadioTower1F.asm
@@ -8,7 +8,7 @@
 ReceptionistScript_0x5cd29:
 	faceplayer
 	loadfont
-	checkflag $0013
+	checkflag ENGINE_BIKE_SHOP_CALL_ENABLED
 	iftrue UnknownScript_0x5cd37
 	writetext UnknownText_0x5ce77
 	closetext
@@ -31,8 +31,8 @@
 	special Functionc422
 UnknownScript_0x5cd4c:
 	special Function4d9d3
-	checkflag $004e
-	iftrue UnknownScript_0x5cd84
+	checkflag ENGINE_LUCKY_NUMBER_SHOW
+	iftrue .GameOver
 	writetext UnknownText_0x5cf3a
 	keeptextopen
 	loadmovesprites
@@ -49,51 +49,51 @@
 	loadmovesprites
 	applymovement $6, MovementData_0x5ce74
 	loadfont
-	if_equal $1, UnknownScript_0x5cd8a
-	if_equal $2, UnknownScript_0x5cd9f
-	if_equal $3, UnknownScript_0x5cdb4
-	jump UnknownScript_0x5cdc9
+	if_equal 1, .FirstPlace
+	if_equal 2, .SecondPlace
+	if_equal 3, .ThirdPlace
+	jump .NoPrize
 
-UnknownScript_0x5cd84:
+.GameOver
 	writetext UnknownText_0x5cf7e
 	closetext
 	loadmovesprites
 	end
 
-UnknownScript_0x5cd8a:
+.FirstPlace
 	writetext UnknownText_0x5cfb5
 	playsound SFX_1ST_PLACE
 	waitbutton
 	keeptextopen
-	giveitem MASTER_BALL, $1
+	giveitem MASTER_BALL, 1
 	iffalse UnknownScript_0x5cdcf
 	itemnotify
-	setflag $004e
-	jump UnknownScript_0x5cd84
+	setflag ENGINE_LUCKY_NUMBER_SHOW
+	jump .GameOver
 
-UnknownScript_0x5cd9f:
+.SecondPlace
 	writetext UnknownText_0x5d023
 	playsound SFX_2ND_PLACE
 	waitbutton
 	keeptextopen
-	giveitem EXP_SHARE, $1
+	giveitem EXP_SHARE, 1
 	iffalse UnknownScript_0x5cdcf
 	itemnotify
-	setflag $004e
-	jump UnknownScript_0x5cd84
+	setflag ENGINE_LUCKY_NUMBER_SHOW
+	jump .GameOver
 
-UnknownScript_0x5cdb4:
+.ThirdPlace
 	writetext UnknownText_0x5d076
 	playsound SFX_3RD_PLACE
 	waitbutton
 	keeptextopen
-	giveitem PP_UP, $1
+	giveitem PP_UP, 1
 	iffalse UnknownScript_0x5cdcf
 	itemnotify
-	setflag $004e
-	jump UnknownScript_0x5cd84
+	setflag ENGINE_LUCKY_NUMBER_SHOW
+	jump .GameOver
 
-UnknownScript_0x5cdc9:
+.NoPrize
 	writetext UnknownText_0x5d0c0
 	closetext
 	loadmovesprites
@@ -108,7 +108,7 @@
 CooltrainerFScript_0x5cdd5:
 	faceplayer
 	loadfont
-	checkflag $0000
+	checkflag ENGINE_RADIO_CARD
 	iftrue UnknownScript_0x5ce2d
 	writetext UnknownText_0x5d12d
 	yesorno
@@ -144,7 +144,7 @@
 	scall UnknownScript_0x5ce3e
 	writetext UnknownText_0x5d3c0
 	keeptextopen
-	setflag $0000
+	setflag ENGINE_RADIO_CARD
 UnknownScript_0x5ce2d:
 	writetext UnknownText_0x5d3e5
 	closetext
--- a/maps/RadioTower2F.asm
+++ b/maps/RadioTower2F.asm
@@ -14,7 +14,7 @@
 TeacherScript_0x5d701:
 	faceplayer
 	loadfont
-	checkflag $0013
+	checkflag ENGINE_BIKE_SHOP_CALL_ENABLED
 	iftrue UnknownScript_0x5d70f
 	writetext UnknownText_0x5d956
 	closetext
@@ -152,15 +152,15 @@
 Buena:
 	faceplayer
 	loadfont
-	checkflag $0013
+	checkflag ENGINE_BIKE_SHOP_CALL_ENABLED
 	iftrue UnknownScript_0x5d865
 	checkevent EVENT_MET_BUENA
 	iffalse UnknownScript_0x5d800
-	checkflag $0060
+	checkflag ENGINE_60
 	iftrue UnknownScript_0x5d82f
 	checkcode VAR_HOUR
 	if_less_than $12, UnknownScript_0x5d893
-	checkflag $005f
+	checkflag ENGINE_5F
 	iffalse UnknownScript_0x5d80a
 	checkitem BLUE_CARD
 	iffalse UnknownScript_0x5d86b
@@ -197,7 +197,7 @@
 	writevarcode VAR_BLUECARDBALANCE
 	waitbutton
 	playsound SFX_TRANSACTION
-	setflag $0060
+	setflag ENGINE_60
 	pause 20
 	spriteface $b, RIGHT
 	loadfont
@@ -252,7 +252,7 @@
 	end
 
 UnknownScript_0x5d845:
-	setflag $0060
+	setflag ENGINE_60
 	loadfont
 	writetext UnknownText_0x5e01c
 	closetext
--- a/maps/Route16.asm
+++ b/maps/Route16.asm
@@ -14,7 +14,7 @@
 	if_less_than $5, UnknownScript_0x1ad328
 	checkcode VAR_XCOORD
 	if_greater_than $d, UnknownScript_0x1ad328
-	setflag $0019
+	setflag ENGINE_ALWAYS_ON_BIKE
 	return
 
 UnknownScript_0x1ad328:
--- a/maps/Route17.asm
+++ b/maps/Route17.asm
@@ -10,8 +10,8 @@
 	dbw 5, UnknownScript_0x1ad0ab
 
 UnknownScript_0x1ad0ab:
-	setflag $0019
-	setflag $001a
+	setflag ENGINE_ALWAYS_ON_BIKE
+	setflag ENGINE_DOWNHILL
 	return
 
 TrainerBikerCharles:
--- a/maps/Route19.asm
+++ b/maps/Route19.asm
@@ -7,11 +7,11 @@
 
 	; callbacks
 
-	dbw 1, UnknownScript_0x19e9de
+	dbw 1, .ClearRocks
 
-UnknownScript_0x19e9de:
-	checkevent $00d7
-	iftrue UnknownScript_0x19e9fc
+.ClearRocks
+	checkevent EVENT_CINNABAR_ROCKS_CLEARED
+	iftrue .Done
 	changeblock $6, $6, $7a
 	changeblock $8, $6, $7a
 	changeblock $a, $6, $7a
@@ -18,7 +18,7 @@
 	changeblock $c, $8, $7a
 	changeblock $4, $8, $7a
 	changeblock $a, $a, $7a
-UnknownScript_0x19e9fc:
+.Done
 	return
 
 TrainerSwimmerfDawn:
@@ -132,7 +132,7 @@
 FisherScript_0x19ea4d:
 	faceplayer
 	loadfont
-	checkevent $00d7
+	checkevent EVENT_CINNABAR_ROCKS_CLEARED
 	iftrue UnknownScript_0x19ea5b
 	writetext UnknownText_0x19ecaf
 	closetext
@@ -148,7 +148,7 @@
 FisherScript_0x19ea61:
 	faceplayer
 	loadfont
-	checkevent $00d7
+	checkevent EVENT_CINNABAR_ROCKS_CLEARED
 	iftrue UnknownScript_0x19ea6f
 	writetext UnknownText_0x19ed45
 	closetext
--- a/maps/Route19FuchsiaGate.asm
+++ b/maps/Route19FuchsiaGate.asm
@@ -8,14 +8,14 @@
 OfficerScript_0x1ab3f6:
 	faceplayer
 	loadfont
-	checkevent $00d7
-	iftrue UnknownScript_0x1ab404
+	checkevent EVENT_CINNABAR_ROCKS_CLEARED
+	iftrue .RocksCleared
 	writetext UnknownText_0x1ab40a
 	closetext
 	loadmovesprites
 	end
 
-UnknownScript_0x1ab404:
+.RocksCleared
 	writetext UnknownText_0x1ab48a
 	closetext
 	loadmovesprites
--- a/maps/Route20.asm
+++ b/maps/Route20.asm
@@ -7,10 +7,10 @@
 
 	; callbacks
 
-	dbw 5, UnknownScript_0x1acd25
+	dbw 5, .ClearRocks
 
-UnknownScript_0x1acd25:
-	setevent $00d7
+.ClearRocks
+	setevent EVENT_CINNABAR_ROCKS_CLEARED
 	return
 
 TrainerSwimmerfNicole:
--- a/maps/Route29.asm
+++ b/maps/Route29.asm
@@ -20,7 +20,7 @@
 	end
 
 TuscanyCallback:
-	checkflag $001b
+	checkflag ENGINE_ZEPHYRBADGE
 	iftrue .DoesTuscanyAppear
 
 .TuscanyDisappears
--- a/maps/Route2NuggetSpeechHouse.asm
+++ b/maps/Route2NuggetSpeechHouse.asm
@@ -8,17 +8,17 @@
 FisherScript_0x9b847:
 	faceplayer
 	loadfont
-	checkevent $00c8
-	iftrue UnknownScript_0x9b85c
+	checkevent EVENT_GOT_NUGGET_FROM_GUY
+	iftrue .GotItem
 	writetext UnknownText_0x9b865
 	keeptextopen
 	verbosegiveitem NUGGET, 1
-	iffalse UnknownScript_0x9b860
-	setevent $00c8
-UnknownScript_0x9b85c:
+	iffalse .Done
+	setevent EVENT_GOT_NUGGET_FROM_GUY
+.GotItem
 	writetext UnknownText_0x9b8e5
 	closetext
-UnknownScript_0x9b860:
+.Done
 	loadmovesprites
 	end
 
--- a/maps/Route32.asm
+++ b/maps/Route32.asm
@@ -39,7 +39,7 @@
 	loadfont
 	checkevent EVENT_GOT_MIRACLE_SEED_IN_ROUTE_32
 	iftrue UnknownScript_0x1904a5
-	checkflag $001b
+	checkflag ENGINE_ZEPHYRBADGE
 	iffalse UnknownScript_0x19049f
 	checkevent EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE
 	iftrue UnknownScript_0x19048f
@@ -211,7 +211,7 @@
 	loadfont
 	checkflag ENGINE_RALPH
 	iftrue UnknownScript_0x19057d
-	checkflag $0052
+	checkflag ENGINE_SPECIAL_WILDDATA
 	iftrue UnknownScript_0x1905f1
 	checkcellnum $11
 	iftrue UnknownScript_0x190603
--- a/maps/Route33.asm
+++ b/maps/Route33.asm
@@ -33,7 +33,7 @@
 	loadfont
 	checkflag ENGINE_ANTHONY
 	iftrue UnknownScript_0x1ac051
-	checkflag $00a0
+	checkflag ENGINE_DUNSPARCE_SWARM
 	iftrue UnknownScript_0x1ac0c5
 	checkcellnum $13
 	iftrue UnknownScript_0x1ac0d7
--- a/maps/Route34.asm
+++ b/maps/Route34.asm
@@ -10,7 +10,7 @@
 	dbw 2, UnknownScript_0x78005
 
 UnknownScript_0x78005:
-	checkflag $0005
+	checkflag ENGINE_DAYCARE_MONS_ARE_COMPATIBLE
 	iftrue UnknownScript_0x78014
 	clearevent $06e5
 	setevent $06e6
@@ -22,7 +22,7 @@
 	jump UnknownScript_0x7801d
 
 UnknownScript_0x7801d:
-	checkflag $0006
+	checkflag ENGINE_DAYCARE_MAN_HAS_MON
 	iffalse UnknownScript_0x78029
 	clearevent $06e7
 	jump UnknownScript_0x7802f
@@ -32,7 +32,7 @@
 	jump UnknownScript_0x7802f
 
 UnknownScript_0x7802f:
-	checkflag $0007
+	checkflag ENGINE_DAYCARE_LADY_HAS_MON
 	iffalse UnknownScript_0x78039
 	clearevent $06e8
 	return
@@ -48,7 +48,7 @@
 	closetext
 	loadmovesprites
 	if_equal $1, UnknownScript_0x7805a
-	clearflag $0005
+	clearflag ENGINE_DAYCARE_MONS_ARE_COMPATIBLE
 	checkcode VAR_FACING
 	if_equal $3, UnknownScript_0x7805b
 	applymovement $8, MovementData_0x78333
@@ -100,7 +100,7 @@
 	loadfont
 	checkflag ENGINE_TODD
 	iftrue UnknownScript_0x780bd
-	checkflag $0061
+	checkflag ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
 	iftrue UnknownScript_0x78131
 	checkcellnum $14
 	iftrue UnknownScript_0x78143
--- a/maps/Route34IlexForestGate.asm
+++ b/maps/Route34IlexForestGate.asm
@@ -10,7 +10,7 @@
 	dbw 2, UnknownScript_0x62d2d
 
 UnknownScript_0x62d2d:
-	checkevent $00c0
+	checkevent EVENT_FOREST_IS_RESTLESS
 	iffalse UnknownScript_0x62d38
 	disappear $2
 	appear $5
@@ -22,7 +22,7 @@
 	return
 
 UnknownScript_0x62d3d:
-	checkevent $00c0
+	checkevent EVENT_FOREST_IS_RESTLESS
 	iffalse UnknownScript_0x62d62
 	showemote $0, $5, 20
 	spriteface $5, LEFT
@@ -42,7 +42,7 @@
 TeacherScript_0x62d63:
 	faceplayer
 	loadfont
-	checkevent $00c0
+	checkevent EVENT_FOREST_IS_RESTLESS
 	iftrue UnknownScript_0x62d84
 	checkevent EVENT_GOT_TM12_SWEET_SCENT
 	iftrue UnknownScript_0x62d7e
--- a/maps/Route35.asm
+++ b/maps/Route35.asm
@@ -236,7 +236,7 @@
 	loadfont
 	checkflag ENGINE_ARNIE
 	iftrue UnknownScript_0x19c9bb
-	checkflag $00a1
+	checkflag ENGINE_YANMA_SWARM
 	iftrue UnknownScript_0x19ca2f
 	checkcellnum $17
 	iftrue UnknownScript_0x19c90f
--- a/maps/Route35NationalParkgate.asm
+++ b/maps/Route35NationalParkgate.asm
@@ -27,7 +27,7 @@
 	end
 
 UnknownScript_0x6a1a3:
-	checkflag $0011
+	checkflag ENGINE_BUG_CONTEST_TIMER
 	iftrue UnknownScript_0x6a1ac
 	dotrigger $0
 	return
@@ -41,7 +41,7 @@
 	if_equal TUESDAY, UnknownScript_0x6a1ca
 	if_equal THURSDAY, UnknownScript_0x6a1ca
 	if_equal SATURDAY, UnknownScript_0x6a1ca
-	checkflag $0011
+	checkflag ENGINE_BUG_CONTEST_TIMER
 	iftrue UnknownScript_0x6a1ac
 	disappear $2
 	appear $3
@@ -88,7 +88,7 @@
 	if_equal FRIDAY, UnknownScript_0x6a2c7
 	faceplayer
 	loadfont
-	checkflag $0051
+	checkflag ENGINE_51
 	iftrue UnknownScript_0x6a2c1
 	scall UnknownScript_0x6a2de
 	writetext UnknownText_0x6a2eb
@@ -99,7 +99,7 @@
 	special Function13a12
 	clearevent $0308
 UnknownScript_0x6a234:
-	setflag $0011
+	setflag ENGINE_BUG_CONTEST_TIMER
 	special PlayMapMusic
 	writetext UnknownText_0x6a39d
 	keeptextopen
@@ -193,7 +193,7 @@
 OfficerScript_0x6a2ca:
 	faceplayer
 	loadfont
-	checkflag $0051
+	checkflag ENGINE_51
 	iftrue UnknownScript_0x6a2c1
 	writetext UnknownText_0x6a894
 	closetext
--- a/maps/Route36NationalParkgate.asm
+++ b/maps/Route36NationalParkgate.asm
@@ -27,7 +27,7 @@
 	end
 
 UnknownScript_0x6ab17:
-	checkflag $0011
+	checkflag ENGINE_BUG_CONTEST_TIMER
 	iftrue UnknownScript_0x6ab20
 	dotrigger $0
 	return
@@ -43,7 +43,7 @@
 	if_equal TUESDAY, UnknownScript_0x6ab42
 	if_equal THURSDAY, UnknownScript_0x6ab42
 	if_equal SATURDAY, UnknownScript_0x6ab42
-	checkflag $0011
+	checkflag ENGINE_BUG_CONTEST_TIMER
 	iftrue UnknownScript_0x6ab42
 	disappear $2
 	appear $d
@@ -140,7 +140,7 @@
 	if_equal FRIDAY, UnknownScript_0x6acf1
 	faceplayer
 	loadfont
-	checkflag $0051
+	checkflag ENGINE_51
 	iftrue UnknownScript_0x6ac91
 	scall UnknownScript_0x6ad02
 	writetext UnknownText_0x6add5
@@ -151,7 +151,7 @@
 	special Function13a12
 	clearevent $0308
 UnknownScript_0x6ac10:
-	setflag $0011
+	setflag ENGINE_BUG_CONTEST_TIMER
 	special PlayMapMusic
 	writetext UnknownText_0x6ae87
 	keeptextopen
@@ -162,7 +162,7 @@
 	writetext UnknownText_0x6aecc
 	closetext
 	loadmovesprites
-	setflag $0011
+	setflag ENGINE_BUG_CONTEST_TIMER
 	special Function135db
 	spriteface $0, LEFT
 	playsound SFX_EXIT_BUILDING
@@ -286,7 +286,7 @@
 OfficerScript_0x6acf4:
 	faceplayer
 	loadfont
-	checkflag $0051
+	checkflag ENGINE_51
 	iftrue UnknownScript_0x6ac91
 	writetext UnknownText_0x6b370
 	closetext
--- a/maps/Route37.asm
+++ b/maps/Route37.asm
@@ -113,7 +113,7 @@
 	keeptextopen
 	setevent EVENT_MET_SUNNY_OF_SUNDAY
 .MetSunny
-	checkflag $0063
+	checkflag ENGINE_PLAYER_IS_FEMALE
 	iftrue .Kris
 	writetext SunnyGivesGiftText1
 	keeptextopen
--- a/maps/RuinsofAlphAerodactylChamber.asm
+++ b/maps/RuinsofAlphAerodactylChamber.asm
@@ -63,7 +63,7 @@
 UnknownScript_0x58df7:
 	setevent $0705
 	setevent $02a3
-	setflag $002d
+	setflag ENGINE_UNLOCKED_UNOWNS_3
 	domaptrigger GROUP_RUINS_OF_ALPH_INNER_CHAMBER, MAP_RUINS_OF_ALPH_INNER_CHAMBER, $1
 	earthquake 30
 	showemote $0, $0, 15
--- a/maps/RuinsofAlphHoOhChamber.asm
+++ b/maps/RuinsofAlphHoOhChamber.asm
@@ -64,7 +64,7 @@
 UnknownScript_0x585ba:
 	setevent $0705
 	setevent $02a0
-	setflag $002e
+	setflag ENGINE_UNLOCKED_UNOWNS_4
 	domaptrigger GROUP_RUINS_OF_ALPH_INNER_CHAMBER, MAP_RUINS_OF_ALPH_INNER_CHAMBER, $1
 	earthquake 30
 	showemote $0, $0, 15
--- a/maps/RuinsofAlphKabutoChamber.asm
+++ b/maps/RuinsofAlphKabutoChamber.asm
@@ -68,7 +68,7 @@
 UnknownScript_0x58778:
 	setevent $0705
 	setevent $02a1
-	setflag $002b
+	setflag ENGINE_UNLOCKED_UNOWNS_1
 	setevent $074e
 	domaptrigger GROUP_RUINS_OF_ALPH_INNER_CHAMBER, MAP_RUINS_OF_ALPH_INNER_CHAMBER, $1
 	earthquake 30
--- a/maps/RuinsofAlphOmanyteChamber.asm
+++ b/maps/RuinsofAlphOmanyteChamber.asm
@@ -64,7 +64,7 @@
 UnknownScript_0x58c36:
 	setevent $0705
 	setevent $02a2
-	setflag $002c
+	setflag ENGINE_UNLOCKED_UNOWNS_2
 	domaptrigger GROUP_RUINS_OF_ALPH_INNER_CHAMBER, MAP_RUINS_OF_ALPH_INNER_CHAMBER, $1
 	earthquake 30
 	showemote $0, $0, 15
--- a/maps/RuinsofAlphOutside.asm
+++ b/maps/RuinsofAlphOutside.asm
@@ -20,7 +20,7 @@
 	end
 
 UnknownScript_0x5800f:
-	checkflag $000c
+	checkflag ENGINE_UNOWN_DEX
 	iftrue UnknownScript_0x5802c
 	checkevent EVENT_MADE_UNOWN_APPEAR_IN_RUINS
 	iftrue UnknownScript_0x5801e
@@ -71,12 +71,12 @@
 FisherScript_0x58061:
 	faceplayer
 	loadfont
-	checkevent $00bc
-	iftrue UnknownScript_0x58070
-	setevent $00bc
+	checkevent EVENT_TALKED_TO_RUINS_COWARD
+	iftrue .Next
+	setevent EVENT_TALKED_TO_RUINS_COWARD
 	writetext UnknownText_0x583a4
 	keeptextopen
-UnknownScript_0x58070: ;0x58070
+.Next
 	writetext UnknownText_0x58420
 	closetext
 	loadmovesprites
--- a/maps/RuinsofAlphResearchCenter.asm
+++ b/maps/RuinsofAlphResearchCenter.asm
@@ -50,7 +50,7 @@
 	writetext UnknownText_0x592fa
 	playsound SFX_ITEM
 	waitbutton
-	setflag $000c
+	setflag ENGINE_UNOWN_DEX
 	writetext UnknownText_0x59311
 	closetext
 	loadmovesprites
@@ -80,7 +80,7 @@
 	loadfont
 	checkcode VAR_UNOWNCOUNT
 	if_equal 26, UnknownScript_0x5920b
-	checkflag $000c
+	checkflag ENGINE_UNOWN_DEX
 	iftrue UnknownScript_0x59205
 	checkevent EVENT_MADE_UNOWN_APPEAR_IN_RUINS
 	iftrue UnknownScript_0x591ff
--- a/maps/TeamRocketBaseB3F.asm
+++ b/maps/TeamRocketBaseB3F.asm
@@ -29,7 +29,7 @@
 	end
 
 UnknownScript_0x6dff0:
-	checkevent $0303
+	checkevent EVENT_OPENED_DOOR_TO_GIOVANNIS_OFFICE
 	iftrue UnknownScript_0x6dff7
 	return
 
@@ -141,7 +141,7 @@
 	writetext UnknownText_0x6e611
 	closetext
 	loadmovesprites
-	setevent $0301
+	setevent EVENT_LEARNED_SLOWPOKETAIL
 	end
 
 TrainerGruntM28:
@@ -169,7 +169,7 @@
 	writetext UnknownText_0x6e737
 	closetext
 	loadmovesprites
-	setevent $0302
+	setevent EVENT_LEARNED_RATICATE_TAIL
 	end
 
 TrainerScientistRoss:
@@ -226,26 +226,25 @@
 	loadmovesprites
 	end
 
-MapTeamRocketBaseB3FSignpostPtr1:
-	dw $0303
-	dw MapTeamRocketBaseB3FSignpost1Script
+BossDoor:
+	dw EVENT_OPENED_DOOR_TO_GIOVANNIS_OFFICE
+	dw .Script
 	
-
-MapTeamRocketBaseB3FSignpost1Script:
+.Script
 	loadfont
-	checkevent $0301
-	iffalse UnknownScript_0x6e105
-	checkevent $0302
-	iffalse UnknownScript_0x6e105
-	jump UnknownScript_0x6e10b
+	checkevent EVENT_LEARNED_SLOWPOKETAIL
+	iffalse .NeedsPassword
+	checkevent EVENT_LEARNED_RATICATE_TAIL
+	iffalse .NeedsPassword
+	jump .OpenSesame
 
-UnknownScript_0x6e105:
+.NeedsPassword
 	writetext UnknownText_0x6e970
 	closetext
 	loadmovesprites
 	end
 
-UnknownScript_0x6e10b:
+.OpenSesame
 	writetext UnknownText_0x6e9a3
 	closetext
 	playsound SFX_ENTER_DOOR
@@ -252,7 +251,7 @@
 	changeblock $a, $8, $7
 	reloadmappart
 	loadmovesprites
-	setevent $0303
+	setevent EVENT_OPENED_DOOR_TO_GIOVANNIS_OFFICE
 	waitbutton
 	end
 
@@ -639,8 +638,8 @@
 
 	; signposts
 	db 10
-	signpost 9, 10, $6, MapTeamRocketBaseB3FSignpostPtr1
-	signpost 9, 11, $6, MapTeamRocketBaseB3FSignpostPtr1
+	signpost 9, 10, $6, BossDoor
+	signpost 9, 11, $6, BossDoor
 	signpost 1, 10, $0, MapTeamRocketBaseB3FSignpost9Script
 	signpost 1, 11, $0, MapTeamRocketBaseB3FSignpost9Script
 	signpost 1, 12, $0, MapTeamRocketBaseB3FSignpost9Script
--- a/maps/TrainerHouseB1F.asm
+++ b/maps/TrainerHouseB1F.asm
@@ -14,7 +14,7 @@
 UnknownScript_0x9b38b:
 	spriteface $0, UP
 	loadfont
-	checkflag $0057
+	checkflag ENGINE_FOUGHT_IN_TRAINER_HALL_TODAY
 	iftrue UnknownScript_0x9b3f7
 	writetext UnknownText_0x9b420
 	keeptextopen
@@ -31,7 +31,7 @@
 	writetext UnknownText_0x9b487
 	yesorno
 	iffalse UnknownScript_0x9b3ed
-	setflag $0057
+	setflag ENGINE_FOUGHT_IN_TRAINER_HALL_TODAY
 	writetext UnknownText_0x9b4a2
 	closetext
 	loadmovesprites
--- a/maps/UndergroundWarehouse.asm
+++ b/maps/UndergroundWarehouse.asm
@@ -119,9 +119,9 @@
 	keeptextopen
 	verbosegiveitem CARD_KEY, 1
 	setevent $004a
-	setevent $0304
-	clearevent $0305
-	clearevent $0306
+	setevent EVENT_WAREHOUSE_LAYOUT_1
+	clearevent EVENT_WAREHOUSE_LAYOUT_2
+	clearevent EVENT_WAREHOUSE_LAYOUT_3
 	writetext UnknownText_0x7dc5b
 	keeptextopen
 UnknownScript_0x7d9de:
--- a/maps/UnionCaveB2F.asm
+++ b/maps/UnionCaveB2F.asm
@@ -10,7 +10,7 @@
 	dbw 2, UnknownScript_0x5a30d
 
 UnknownScript_0x5a30d:
-	checkflag $0059
+	checkflag ENGINE_UNION_CAVE_LAPRAS
 	iftrue UnknownScript_0x5a319
 	checkcode VAR_WEEKDAY
 	if_equal FRIDAY, UnknownScript_0x5a31c
@@ -28,7 +28,7 @@
 	loadpokedata LAPRAS, 20
 	startbattle
 	disappear $7
-	setflag $0059
+	setflag ENGINE_UNION_CAVE_LAPRAS
 	returnafterbattle
 	end
 
--- a/maps/WarehouseEntrance.asm
+++ b/maps/WarehouseEntrance.asm
@@ -224,7 +224,7 @@
 
 GrampsScript_0x7c146:
 	loadfont
-	checkflag $0056
+	checkflag ENGINE_GOLDENROD_UNDERGROUND_MERCHANT_CLOSED
 	iftrue UnknownScript_0x7c300
 	checkcode VAR_WEEKDAY
 	if_equal MONDAY, UnknownScript_0x7c156
@@ -246,7 +246,7 @@
 	jump UnknownScript_0x7c300
 
 UnknownScript_0x7c173:
-	checkflag $005a
+	checkflag ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT
 	iftrue UnknownScript_0x7c208
 	special Function24ae8
 	writetext UnknownText_0x7c5f9
@@ -259,7 +259,7 @@
 	special Function7413
 	if_equal $0, UnknownScript_0x7c1fc
 	if_equal $1, UnknownScript_0x7c1fc
-	setflag $005a
+	setflag ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT
 	if_equal $2, UnknownScript_0x7c1a9
 	if_equal $3, UnknownScript_0x7c1b5
 	jump UnknownScript_0x7c1c1
@@ -329,7 +329,7 @@
 	jump UnknownScript_0x7c300
 
 UnknownScript_0x7c220:
-	checkflag $005a
+	checkflag ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT
 	iftrue UnknownScript_0x7c2b5
 	special Function24ae8
 	writetext UnknownText_0x7c75c
@@ -342,7 +342,7 @@
 	special Function7418
 	if_equal $0, UnknownScript_0x7c2a9
 	if_equal $1, UnknownScript_0x7c2a9
-	setflag $005a
+	setflag ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT
 	if_equal $2, UnknownScript_0x7c256
 	if_equal $3, UnknownScript_0x7c262
 	jump UnknownScript_0x7c26e