From fcab935a0f449246380480613ac0896e0b90a0d8 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Mon, 20 Jul 2015 18:32:02 -0700 Subject: enumerate events --- constants.asm | 1 + constants/event_constants.asm | 2562 +++++++++++++++++++++++++++++++++ engine/hall_of_fame.asm | 3 +- engine/hidden_object_functions17.asm | 12 +- engine/hidden_object_functions18.asm | 3 +- engine/hidden_object_functions7.asm | 24 +- engine/items/items.asm | 18 +- engine/menu/bills_pc.asm | 9 +- engine/menu/pc.asm | 3 +- engine/menu/start_menu.asm | 9 +- engine/overworld/cable_club_npc.asm | 3 +- engine/overworld/cinnabar_lab.asm | 4 +- engine/pokedex_rating.asm | 5 +- home/overworld.asm | 6 +- macros.asm | 426 ++++++ main.asm | 13 +- scripts/agatha.asm | 11 +- scripts/bikeshop.asm | 9 +- scripts/billshouse.asm | 18 +- scripts/blueshouse.asm | 12 +- scripts/bruno.asm | 11 +- scripts/celadoncity.asm | 13 +- scripts/celadondiner.asm | 6 +- scripts/celadongamecorner.asm | 27 +- scripts/celadongym.asm | 45 +- scripts/celadonmart3.asm | 6 +- scripts/celadonmartroof.asm | 18 +- scripts/ceruleancity.asm | 18 +- scripts/ceruleangym.asm | 26 +- scripts/cinnabargym.asm | 53 +- scripts/cinnabarisland.asm | 6 +- scripts/copycatshouse2f.asm | 6 +- scripts/fanclub.asm | 24 +- scripts/fightingdojo.asm | 45 +- scripts/fuchsiacity.asm | 5 +- scripts/fuchsiagym.asm | 42 +- scripts/fuchsiahouse2.asm | 12 +- scripts/gary.asm | 6 +- scripts/halloffameroom.asm | 8 +- scripts/indigoplateaulobby.asm | 11 +- scripts/lab3.asm | 6 +- scripts/lab4.asm | 11 +- scripts/lance.asm | 17 +- scripts/lavenderhouse1.asm | 12 +- scripts/lavenderhouse2.asm | 3 +- scripts/lavendermart.asm | 3 +- scripts/lorelei.asm | 11 +- scripts/mansion1.asm | 13 +- scripts/mansion2.asm | 13 +- scripts/mansion3.asm | 11 +- scripts/mansion4.asm | 11 +- scripts/mtmoon1.asm | 28 +- scripts/mtmoon3.asm | 40 +- scripts/mtmoonpokecenter.asm | 6 +- scripts/museum1f.asm | 15 +- scripts/oakslab.asm | 60 +- scripts/pallettown.asm | 24 +- scripts/pewtercity.asm | 6 +- scripts/pewtergym.asm | 22 +- scripts/pokemontower2.asm | 18 +- scripts/pokemontower3.asm | 12 +- scripts/pokemontower4.asm | 12 +- scripts/pokemontower5.asm | 23 +- scripts/pokemontower6.asm | 18 +- scripts/pokemontower7.asm | 18 +- scripts/powerplant.asm | 36 +- scripts/rockethideout1.asm | 31 +- scripts/rockethideout2.asm | 4 +- scripts/rockethideout3.asm | 8 +- scripts/rockethideout4.asm | 28 +- scripts/rocktunnel1.asm | 28 +- scripts/rocktunnel2.asm | 32 +- scripts/route1.asm | 4 +- scripts/route10.asm | 24 +- scripts/route11.asm | 40 +- scripts/route11gateupstairs.asm | 9 +- scripts/route12.asm | 38 +- scripts/route12gateupstairs.asm | 6 +- scripts/route13.asm | 40 +- scripts/route14.asm | 40 +- scripts/route15.asm | 40 +- scripts/route15gateupstairs.asm | 6 +- scripts/route16.asm | 34 +- scripts/route16house.asm | 6 +- scripts/route17.asm | 40 +- scripts/route18.asm | 12 +- scripts/route19.asm | 40 +- scripts/route20.asm | 52 +- scripts/route21.asm | 36 +- scripts/route22.asm | 28 +- scripts/route23.asm | 28 +- scripts/route24.asm | 46 +- scripts/route25.asm | 47 +- scripts/route2gate.asm | 6 +- scripts/route3.asm | 32 +- scripts/route4.asm | 4 +- scripts/route6.asm | 24 +- scripts/route8.asm | 36 +- scripts/route9.asm | 36 +- scripts/safarizoneentrance-yellow.asm | 5 +- scripts/safarizoneentrance.asm | 15 +- scripts/safarizonesecrethouse.asm | 6 +- scripts/saffrongym.asm | 48 +- scripts/saffronhouse2.asm | 6 +- scripts/seafoamislands1.asm | 9 +- scripts/seafoamislands2.asm | 6 +- scripts/seafoamislands3.asm | 6 +- scripts/seafoamislands4.asm | 14 +- scripts/seafoamislands5.asm | 12 +- scripts/silphco1.asm | 7 +- scripts/silphco10.asm | 17 +- scripts/silphco11.asm | 26 +- scripts/silphco2.asm | 35 +- scripts/silphco3.asm | 24 +- scripts/silphco4.asm | 25 +- scripts/silphco5.asm | 35 +- scripts/silphco6.asm | 21 +- scripts/silphco7.asm | 53 +- scripts/silphco8.asm | 21 +- scripts/silphco9.asm | 40 +- scripts/ssanne10.asm | 24 +- scripts/ssanne5.asm | 8 +- scripts/ssanne7.asm | 12 +- scripts/ssanne8.asm | 16 +- scripts/ssanne9.asm | 16 +- scripts/unknowndungeon3.asm | 4 +- scripts/vermilioncity.asm | 16 +- scripts/vermiliondock.asm | 15 +- scripts/vermiliongym.asm | 30 +- scripts/victoryroad1.asm | 17 +- scripts/victoryroad2.asm | 40 +- scripts/victoryroad3.asm | 26 +- scripts/viridiancity.asm | 21 +- scripts/viridianforest.asm | 12 +- scripts/viridiangym.asm | 57 +- scripts/viridianmart.asm | 6 +- wram.asm | 139 +- 137 files changed, 4108 insertions(+), 1655 deletions(-) create mode 100755 constants/event_constants.asm diff --git a/constants.asm b/constants.asm index 0b24ea05..e121b6b3 100644 --- a/constants.asm +++ b/constants.asm @@ -30,3 +30,4 @@ INCLUDE "constants/credits_constants.asm" INCLUDE "constants/music_constants.asm" INCLUDE "constants/tilesets.asm" INCLUDE "constants/starter_mons.asm" +INCLUDE "constants/event_constants.asm" diff --git a/constants/event_constants.asm b/constants/event_constants.asm new file mode 100755 index 00000000..64241ae6 --- /dev/null +++ b/constants/event_constants.asm @@ -0,0 +1,2562 @@ +const_value = 0 + + const EVENT_STOPPED_FROM_LEAVING_PALLET + const EVENT_001 + const EVENT_002 + const EVENT_003 + const EVENT_004 + const EVENT_005 + const EVENT_006 + const EVENT_007 + const EVENT_008 + const EVENT_009 + const EVENT_00A + const EVENT_00B + const EVENT_00C + const EVENT_00D + const EVENT_00E + const EVENT_00F + const EVENT_010 + const EVENT_011 + const EVENT_012 + const EVENT_013 + const EVENT_014 + const EVENT_015 + const EVENT_016 + const EVENT_017 + const EVENT_018 + const EVENT_019 + const EVENT_01A + const EVENT_01B + const EVENT_01C + const EVENT_01D + const EVENT_01E + const EVENT_01F + const EVENT_FOLLOWED_OAK_INSIDE_LAB + const EVENT_OAK_ASKED_TO_CHOOSE_MON + const EVENT_GOT_STARTER + const EVENT_BATTLED_RIVAL_IN_OAKS_LAB + const EVENT_GOT_POKEBALLS_FROM_OAK + const EVENT_GOT_POKEDEX + const EVENT_026 + const EVENT_027 + const EVENT_028 + const EVENT_029 + const EVENT_02A + const EVENT_02B + const EVENT_02C + const EVENT_02D + const EVENT_02E + const EVENT_02F + const EVENT_030 + const EVENT_031 + const EVENT_032 + const EVENT_033 + const EVENT_034 + const EVENT_035 + const EVENT_036 + const EVENT_037 + const EVENT_038 + const EVENT_039 + const EVENT_03A + const EVENT_03B + const EVENT_03C + const EVENT_03D + const EVENT_03E + const EVENT_03F + const EVENT_040 + const EVENT_041 + const EVENT_042 + const EVENT_043 + const EVENT_044 + const EVENT_045 + const EVENT_046 + const EVENT_047 + const EVENT_048 + const EVENT_049 + const EVENT_04A + const EVENT_04B + const EVENT_04C + const EVENT_04D + const EVENT_04E + const EVENT_04F + const EVENT_050 + const EVENT_051 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6 + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7 + const EVENT_05A + const EVENT_05B + const EVENT_05C + const EVENT_05D + const EVENT_05E + const EVENT_05F + const EVENT_060 + const EVENT_061 + const EVENT_062 + const EVENT_063 + const EVENT_064 + const EVENT_065 + const EVENT_066 + const EVENT_067 + const EVENT_068 + const EVENT_069 + const EVENT_06A + const EVENT_06B + const EVENT_06C + const EVENT_06D + const EVENT_06E + const EVENT_06F + const EVENT_070 + const EVENT_071 + const EVENT_BEAT_PEWTER_GYM_TRAINER_0 + const EVENT_073 + const EVENT_074 + const EVENT_075 + const EVENT_076 + const EVENT_077 + const EVENT_078 + const EVENT_079 + const EVENT_07A + const EVENT_07B + const EVENT_07C + const EVENT_07D + const EVENT_07E + const EVENT_07F + const EVENT_080 + const EVENT_081 + const EVENT_082 + const EVENT_083 + const EVENT_084 + const EVENT_085 + const EVENT_086 + const EVENT_087 + const EVENT_088 + const EVENT_089 + const EVENT_08A + const EVENT_08B + const EVENT_08C + const EVENT_08D + const EVENT_08E + const EVENT_08F + const EVENT_090 + const EVENT_091 + const EVENT_092 + const EVENT_093 + const EVENT_094 + const EVENT_095 + const EVENT_096 + const EVENT_097 + const EVENT_098 + const EVENT_099 + const EVENT_09A + const EVENT_09B + const EVENT_09C + const EVENT_09D + const EVENT_09E + const EVENT_09F + const EVENT_0A0 + const EVENT_0A1 + const EVENT_0A2 + const EVENT_0A3 + const EVENT_0A4 + const EVENT_0A5 + const EVENT_0A6 + const EVENT_0A7 + const EVENT_0A8 + const EVENT_0A9 + const EVENT_0AA + const EVENT_0AB + const EVENT_0AC + const EVENT_0AD + const EVENT_0AE + const EVENT_0AF + const EVENT_0B0 + const EVENT_0B1 + const EVENT_0B2 + const EVENT_0B3 + const EVENT_0B4 + const EVENT_0B5 + const EVENT_0B6 + const EVENT_0B7 + const EVENT_0B8 + const EVENT_0B9 + const EVENT_BEAT_CERULEAN_GYM_TRAINER_0 + const EVENT_BEAT_CERULEAN_GYM_TRAINER_1 + const EVENT_0BC + const EVENT_0BD + const EVENT_0BE + const EVENT_0BF + const EVENT_0C0 + const EVENT_0C1 + const EVENT_0C2 + const EVENT_0C3 + const EVENT_0C4 + const EVENT_0C5 + const EVENT_0C6 + const EVENT_0C7 + const EVENT_0C8 + const EVENT_0C9 + const EVENT_0CA + const EVENT_0CB + const EVENT_0CC + const EVENT_0CD + const EVENT_0CE + const EVENT_0CF + const EVENT_0D0 + const EVENT_0D1 + const EVENT_0D2 + const EVENT_0D3 + const EVENT_0D4 + const EVENT_0D5 + const EVENT_0D6 + const EVENT_0D7 + const EVENT_0D8 + const EVENT_0D9 + const EVENT_0DA + const EVENT_0DB + const EVENT_0DC + const EVENT_0DD + const EVENT_0DE + const EVENT_0DF + const EVENT_0E0 + const EVENT_0E1 + const EVENT_0E2 + const EVENT_0E3 + const EVENT_0E4 + const EVENT_0E5 + const EVENT_0E6 + const EVENT_0E7 + const EVENT_0E8 + const EVENT_0E9 + const EVENT_0EA + const EVENT_0EB + const EVENT_0EC + const EVENT_0ED + const EVENT_0EE + const EVENT_0EF + const EVENT_0F0 + const EVENT_BEAT_POKEMONTOWER_3_TRAINER_0 + const EVENT_BEAT_POKEMONTOWER_3_TRAINER_1 + const EVENT_BEAT_POKEMONTOWER_3_TRAINER_2 + const EVENT_0F4 + const EVENT_0F5 + const EVENT_0F6 + const EVENT_0F7 + const EVENT_0F8 + const EVENT_BEAT_POKEMONTOWER_4_TRAINER_0 + const EVENT_BEAT_POKEMONTOWER_4_TRAINER_1 + const EVENT_BEAT_POKEMONTOWER_4_TRAINER_2 + const EVENT_0FC + const EVENT_0FD + const EVENT_0FE + const EVENT_0FF + const EVENT_100 + const EVENT_101 + const EVENT_BEAT_POKEMONTOWER_5_TRAINER_0 + const EVENT_BEAT_POKEMONTOWER_5_TRAINER_1 + const EVENT_BEAT_POKEMONTOWER_5_TRAINER_2 + const EVENT_BEAT_POKEMONTOWER_5_TRAINER_3 + const EVENT_106 + const EVENT_107 + const EVENT_108 + const EVENT_BEAT_POKEMONTOWER_6_TRAINER_0 + const EVENT_BEAT_POKEMONTOWER_6_TRAINER_1 + const EVENT_BEAT_POKEMONTOWER_6_TRAINER_2 + const EVENT_10C + const EVENT_10D + const EVENT_10E + const EVENT_10F + const EVENT_110 + const EVENT_BEAT_POKEMONTOWER_7_TRAINER_0 + const EVENT_BEAT_POKEMONTOWER_7_TRAINER_1 + const EVENT_BEAT_POKEMONTOWER_7_TRAINER_2 + const EVENT_114 + const EVENT_115 + const EVENT_116 + const EVENT_117 + const EVENT_118 + const EVENT_119 + const EVENT_11A + const EVENT_11B + const EVENT_11C + const EVENT_11D + const EVENT_11E + const EVENT_11F + const EVENT_120 + const EVENT_121 + const EVENT_122 + const EVENT_123 + const EVENT_124 + const EVENT_125 + const EVENT_126 + const EVENT_127 + const EVENT_128 + const EVENT_129 + const EVENT_12A + const EVENT_12B + const EVENT_12C + const EVENT_12D + const EVENT_12E + const EVENT_12F + const EVENT_130 + const EVENT_131 + const EVENT_132 + const EVENT_133 + const EVENT_134 + const EVENT_135 + const EVENT_136 + const EVENT_137 + const EVENT_138 + const EVENT_139 + const EVENT_13A + const EVENT_13B + const EVENT_13C + const EVENT_13D + const EVENT_13E + const EVENT_13F + const EVENT_140 + const EVENT_141 + const EVENT_142 + const EVENT_143 + const EVENT_144 + const EVENT_145 + const EVENT_146 + const EVENT_147 + const EVENT_148 + const EVENT_149 + const EVENT_14A + const EVENT_14B + const EVENT_14C + const EVENT_14D + const EVENT_14E + const EVENT_14F + const EVENT_150 + const EVENT_GOT_BIKE_VOUCHER + const EVENT_152 + const EVENT_153 + const EVENT_154 + const EVENT_155 + const EVENT_156 + const EVENT_157 + const EVENT_158 + const EVENT_159 + const EVENT_15A + const EVENT_15B + const EVENT_15C + const EVENT_15D + const EVENT_15E + const EVENT_15F + const EVENT_2ND_LOCK_OPENED + const EVENT_1ST_LOCK_OPENED + const EVENT_BEAT_VERMILION_GYM_TRAINER_0 + const EVENT_BEAT_VERMILION_GYM_TRAINER_1 + const EVENT_BEAT_VERMILION_GYM_TRAINER_2 + const EVENT_165 + const EVENT_166 + const EVENT_167 + const EVENT_168 + const EVENT_169 + const EVENT_16A + const EVENT_16B + const EVENT_16C + const EVENT_16D + const EVENT_16E + const EVENT_16F + const EVENT_170 + const EVENT_171 + const EVENT_172 + const EVENT_173 + const EVENT_174 + const EVENT_175 + const EVENT_176 + const EVENT_177 + const EVENT_178 + const EVENT_179 + const EVENT_17A + const EVENT_17B + const EVENT_17C + const EVENT_17D + const EVENT_17E + const EVENT_17F + const EVENT_180 + const EVENT_181 + const EVENT_182 + const EVENT_183 + const EVENT_184 + const EVENT_185 + const EVENT_186 + const EVENT_187 + const EVENT_188 + const EVENT_189 + const EVENT_18A + const EVENT_18B + const EVENT_18C + const EVENT_18D + const EVENT_18E + const EVENT_18F + const EVENT_190 + const EVENT_191 + const EVENT_192 + const EVENT_193 + const EVENT_194 + const EVENT_195 + const EVENT_196 + const EVENT_197 + const EVENT_198 + const EVENT_199 + const EVENT_19A + const EVENT_19B + const EVENT_19C + const EVENT_19D + const EVENT_19E + const EVENT_19F + const EVENT_1A0 + const EVENT_1A1 + const EVENT_1A2 + const EVENT_1A3 + const EVENT_1A4 + const EVENT_1A5 + const EVENT_1A6 + const EVENT_1A7 + const EVENT_1A8 + const EVENT_1A9 + const EVENT_BEAT_CELADON_GYM_TRAINER_0 + const EVENT_BEAT_CELADON_GYM_TRAINER_2 + const EVENT_BEAT_CELADON_GYM_TRAINER_3 + const EVENT_BEAT_CELADON_GYM_TRAINER_4 + const EVENT_BEAT_CELADON_GYM_TRAINER_5 + const EVENT_BEAT_CELADON_GYM_TRAINER_6 + const EVENT_BEAT_CELADON_GYM_TRAINER_7 + const EVENT_1B1 + const EVENT_1B2 + const EVENT_1B3 + const EVENT_1B4 + const EVENT_1B5 + const EVENT_1B6 + const EVENT_1B7 + const EVENT_1B8 + const EVENT_1B9 + const EVENT_1BA + const EVENT_1BB + const EVENT_1BC + const EVENT_1BD + const EVENT_1BE + const EVENT_1BF + const EVENT_1C0 + const EVENT_1C1 + const EVENT_1C2 + const EVENT_1C3 + const EVENT_1C4 + const EVENT_1C5 + const EVENT_1C6 + const EVENT_1C7 + const EVENT_1C8 + const EVENT_1C9 + const EVENT_1CA + const EVENT_1CB + const EVENT_1CC + const EVENT_1CD + const EVENT_1CE + const EVENT_1CF + const EVENT_1D0 + const EVENT_1D1 + const EVENT_1D2 + const EVENT_1D3 + const EVENT_1D4 + const EVENT_1D5 + const EVENT_1D6 + const EVENT_1D7 + const EVENT_1D8 + const EVENT_1D9 + const EVENT_1DA + const EVENT_1DB + const EVENT_1DC + const EVENT_1DD + const EVENT_1DE + const EVENT_1DF + const EVENT_1E0 + const EVENT_1E1 + const EVENT_1E2 + const EVENT_1E3 + const EVENT_1E4 + const EVENT_1E5 + const EVENT_1E6 + const EVENT_1E7 + const EVENT_1E8 + const EVENT_1E9 + const EVENT_1EA + const EVENT_1EB + const EVENT_1EC + const EVENT_1ED + const EVENT_1EE + const EVENT_1EF + const EVENT_1F0 + const EVENT_1F1 + const EVENT_1F2 + const EVENT_1F3 + const EVENT_1F4 + const EVENT_1F5 + const EVENT_1F6 + const EVENT_1F7 + const EVENT_1F8 + const EVENT_1F9 + const EVENT_1FA + const EVENT_1FB + const EVENT_1FC + const EVENT_1FD + const EVENT_1FE + const EVENT_1FF + const EVENT_200 + const EVENT_201 + const EVENT_202 + const EVENT_203 + const EVENT_204 + const EVENT_205 + const EVENT_206 + const EVENT_207 + const EVENT_208 + const EVENT_209 + const EVENT_20A + const EVENT_20B + const EVENT_20C + const EVENT_20D + const EVENT_20E + const EVENT_20F + const EVENT_210 + const EVENT_211 + const EVENT_212 + const EVENT_213 + const EVENT_214 + const EVENT_215 + const EVENT_216 + const EVENT_217 + const EVENT_218 + const EVENT_219 + const EVENT_21A + const EVENT_21B + const EVENT_21C + const EVENT_21D + const EVENT_21E + const EVENT_21F + const EVENT_220 + const EVENT_221 + const EVENT_222 + const EVENT_223 + const EVENT_224 + const EVENT_225 + const EVENT_226 + const EVENT_227 + const EVENT_228 + const EVENT_229 + const EVENT_22A + const EVENT_22B + const EVENT_22C + const EVENT_22D + const EVENT_22E + const EVENT_22F + const EVENT_230 + const EVENT_231 + const EVENT_232 + const EVENT_233 + const EVENT_234 + const EVENT_235 + const EVENT_236 + const EVENT_237 + const EVENT_238 + const EVENT_239 + const EVENT_23A + const EVENT_23B + const EVENT_23C + const EVENT_23D + const EVENT_23E + const EVENT_23F + const EVENT_240 + const EVENT_241 + const EVENT_242 + const EVENT_243 + const EVENT_244 + const EVENT_245 + const EVENT_246 + const EVENT_247 + const EVENT_248 + const EVENT_249 + const EVENT_24A + const EVENT_24B + const EVENT_24C + const EVENT_24D + const EVENT_SAFARI_GAME_OVER + const EVENT_IN_SAFARI_ZONE + const EVENT_250 + const EVENT_251 + const EVENT_252 + const EVENT_253 + const EVENT_254 + const EVENT_255 + const EVENT_256 + const EVENT_257 + const EVENT_258 + const EVENT_259 + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_0 + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_2 + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_3 + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_4 + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_5 + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_6 + const EVENT_260 + const EVENT_261 + const EVENT_262 + const EVENT_263 + const EVENT_264 + const EVENT_265 + const EVENT_266 + const EVENT_267 + const EVENT_268 + const EVENT_269 + const EVENT_26A + const EVENT_26B + const EVENT_26C + const EVENT_26D + const EVENT_26E + const EVENT_26F + const EVENT_270 + const EVENT_271 + const EVENT_272 + const EVENT_273 + const EVENT_274 + const EVENT_275 + const EVENT_276 + const EVENT_277 + const EVENT_278 + const EVENT_279 + const EVENT_27A + const EVENT_27B + const EVENT_27C + const EVENT_27D + const EVENT_27E + const EVENT_27F + const EVENT_280 + const EVENT_281 + const EVENT_282 + const EVENT_283 + const EVENT_284 + const EVENT_285 + const EVENT_286 + const EVENT_287 + const EVENT_288 + const EVENT_BEAT_MANSION_1_TRAINER_0 + const EVENT_28A + const EVENT_28B + const EVENT_28C + const EVENT_28D + const EVENT_28E + const EVENT_28F + const EVENT_290 + const EVENT_291 + const EVENT_292 + const EVENT_293 + const EVENT_294 + const EVENT_295 + const EVENT_296 + const EVENT_297 + const EVENT_298 + const EVENT_299 + const EVENT_29A + const EVENT_29B + const EVENT_29C + const EVENT_29D + const EVENT_29E + const EVENT_29F + const EVENT_2A0 + const EVENT_2A1 + const EVENT_2A2 + const EVENT_2A3 + const EVENT_2A4 + const EVENT_2A5 + const EVENT_2A6 + const EVENT_2A7 + const EVENT_2A8 + const EVENT_2A9 + const EVENT_2AA + const EVENT_2AB + const EVENT_2AC + const EVENT_2AD + const EVENT_2AE + const EVENT_2AF + const EVENT_2B0 + const EVENT_2B1 + const EVENT_2B2 + const EVENT_2B3 + const EVENT_2B4 + const EVENT_2B5 + const EVENT_2B6 + const EVENT_2B7 + const EVENT_2B8 + const EVENT_2B9 + const EVENT_2BA + const EVENT_2BB + const EVENT_2BC + const EVENT_2BD + const EVENT_2BE + const EVENT_2BF + const EVENT_2C0 + const EVENT_2C1 + const EVENT_2C2 + const EVENT_2C3 + const EVENT_2C4 + const EVENT_2C5 + const EVENT_2C6 + const EVENT_2C7 + const EVENT_2C8 + const EVENT_2C9 + const EVENT_2CA + const EVENT_2CB + const EVENT_2CC + const EVENT_2CD + const EVENT_2CE + const EVENT_2CF + const EVENT_2D0 + const EVENT_2D1 + const EVENT_2D2 + const EVENT_2D3 + const EVENT_2D4 + const EVENT_2D5 + const EVENT_2D6 + const EVENT_2D7 + const EVENT_2D8 + const EVENT_2D9 + const EVENT_2DA + const EVENT_2DB + const EVENT_2DC + const EVENT_2DD + const EVENT_2DE + const EVENT_2DF + const EVENT_2E0 + const EVENT_2E1 + const EVENT_2E2 + const EVENT_2E3 + const EVENT_2E4 + const EVENT_2E5 + const EVENT_2E6 + const EVENT_2E7 + const EVENT_2E8 + const EVENT_2E9 + const EVENT_2EA + const EVENT_2EB + const EVENT_2EC + const EVENT_2ED + const EVENT_2EE + const EVENT_2EF + const EVENT_2F0 + const EVENT_2F1 + const EVENT_2F2 + const EVENT_2F3 + const EVENT_2F4 + const EVENT_2F5 + const EVENT_2F6 + const EVENT_2F7 + const EVENT_2F8 + const EVENT_2F9 + const EVENT_2FA + const EVENT_2FB + const EVENT_2FC + const EVENT_2FD + const EVENT_2FE + const EVENT_2FF + const EVENT_300 + const EVENT_301 + const EVENT_302 + const EVENT_303 + const EVENT_304 + const EVENT_305 + const EVENT_306 + const EVENT_307 + const EVENT_308 + const EVENT_309 + const EVENT_30A + const EVENT_30B + const EVENT_30C + const EVENT_30D + const EVENT_30E + const EVENT_30F + const EVENT_310 + const EVENT_311 + const EVENT_312 + const EVENT_313 + const EVENT_314 + const EVENT_315 + const EVENT_316 + const EVENT_317 + const EVENT_318 + const EVENT_319 + const EVENT_31A + const EVENT_31B + const EVENT_31C + const EVENT_31D + const EVENT_31E + const EVENT_31F + const EVENT_320 + const EVENT_321 + const EVENT_322 + const EVENT_323 + const EVENT_324 + const EVENT_325 + const EVENT_326 + const EVENT_327 + const EVENT_328 + const EVENT_329 + const EVENT_32A + const EVENT_32B + const EVENT_32C + const EVENT_32D + const EVENT_32E + const EVENT_32F + const EVENT_330 + const EVENT_331 + const EVENT_332 + const EVENT_333 + const EVENT_334 + const EVENT_335 + const EVENT_336 + const EVENT_337 + const EVENT_338 + const EVENT_339 + const EVENT_33A + const EVENT_33B + const EVENT_33C + const EVENT_33D + const EVENT_33E + const EVENT_33F + const EVENT_340 + const EVENT_341 + const EVENT_342 + const EVENT_343 + const EVENT_344 + const EVENT_345 + const EVENT_346 + const EVENT_347 + const EVENT_348 + const EVENT_349 + const EVENT_34A + const EVENT_34B + const EVENT_34C + const EVENT_34D + const EVENT_34E + const EVENT_34F + const EVENT_350 + const EVENT_351 + const EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 + const EVENT_BEAT_FIGHTING_DOJO_TRAINER_1 + const EVENT_BEAT_FIGHTING_DOJO_TRAINER_2 + const EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 + const EVENT_356 + const EVENT_357 + const EVENT_358 + const EVENT_359 + const EVENT_35A + const EVENT_35B + const EVENT_35C + const EVENT_35D + const EVENT_35E + const EVENT_35F + const EVENT_360 + const EVENT_361 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_0 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_1 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_2 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_3 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_4 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_5 + const EVENT_BEAT_SAFFRON_GYM_TRAINER_6 + const EVENT_369 + const EVENT_36A + const EVENT_36B + const EVENT_36C + const EVENT_36D + const EVENT_36E + const EVENT_36F + const EVENT_370 + const EVENT_371 + const EVENT_372 + const EVENT_373 + const EVENT_374 + const EVENT_375 + const EVENT_376 + const EVENT_377 + const EVENT_378 + const EVENT_379 + const EVENT_37A + const EVENT_37B + const EVENT_37C + const EVENT_37D + const EVENT_37E + const EVENT_37F + const EVENT_380 + const EVENT_381 + const EVENT_382 + const EVENT_383 + const EVENT_384 + const EVENT_385 + const EVENT_386 + const EVENT_387 + const EVENT_388 + const EVENT_389 + const EVENT_38A + const EVENT_38B + const EVENT_38C + const EVENT_38D + const EVENT_38E + const EVENT_38F + const EVENT_390 + const EVENT_391 + const EVENT_392 + const EVENT_393 + const EVENT_394 + const EVENT_395 + const EVENT_396 + const EVENT_397 + const EVENT_398 + const EVENT_399 + const EVENT_39A + const EVENT_39B + const EVENT_39C + const EVENT_39D + const EVENT_39E + const EVENT_39F + const EVENT_3A0 + const EVENT_3A1 + const EVENT_3A2 + const EVENT_3A3 + const EVENT_3A4 + const EVENT_3A5 + const EVENT_3A6 + const EVENT_3A7 + const EVENT_3A8 + const EVENT_3A9 + const EVENT_3AA + const EVENT_3AB + const EVENT_3AC + const EVENT_3AD + const EVENT_3AE + const EVENT_3AF + const EVENT_3B0 + const EVENT_3B1 + const EVENT_3B2 + const EVENT_3B3 + const EVENT_3B4 + const EVENT_3B5 + const EVENT_3B6 + const EVENT_3B7 + const EVENT_3B8 + const EVENT_3B9 + const EVENT_3BA + const EVENT_3BB + const EVENT_3BC + const EVENT_3BD + const EVENT_3BE + const EVENT_3BF + const EVENT_3C0 + const EVENT_3C1 + const EVENT_3C2 + const EVENT_3C3 + const EVENT_3C4 + const EVENT_3C5 + const EVENT_3C6 + const EVENT_3C7 + const EVENT_3C8 + const EVENT_3C9 + const EVENT_3CA + const EVENT_3CB + const EVENT_3CC + const EVENT_3CD + const EVENT_3CE + const EVENT_3CF + const EVENT_3D0 + const EVENT_3D1 + const EVENT_3D2 + const EVENT_3D3 + const EVENT_3D4 + const EVENT_3D5 + const EVENT_3D6 + const EVENT_3D7 + const EVENT_3D8 + const EVENT_3D9 + const EVENT_3DA + const EVENT_3DB + const EVENT_3DC + const EVENT_3DD + const EVENT_3DE + const EVENT_3DF + const EVENT_3E0 + const EVENT_3E1 + const EVENT_BEAT_ROUTE_3_TRAINER_0 + const EVENT_BEAT_ROUTE_3_TRAINER_2 + const EVENT_BEAT_ROUTE_3_TRAINER_3 + const EVENT_BEAT_ROUTE_3_TRAINER_4 + const EVENT_BEAT_ROUTE_3_TRAINER_5 + const EVENT_BEAT_ROUTE_3_TRAINER_6 + const EVENT_BEAT_ROUTE_3_TRAINER_7 + const EVENT_BEAT_ROUTE_3_TRAINER_8 + const EVENT_3EA + const EVENT_3EB + const EVENT_3EC + const EVENT_3ED + const EVENT_3EE + const EVENT_3EF + const EVENT_3F0 + const EVENT_3F1 + const EVENT_BEAT_ROUTE_4_TRAINER_0 + const EVENT_3F3 + const EVENT_3F4 + const EVENT_3F5 + const EVENT_3F6 + const EVENT_3F7 + const EVENT_3F8 + const EVENT_3F9 + const EVENT_3FA + const EVENT_3FB + const EVENT_3FC + const EVENT_3FD + const EVENT_3FE + const EVENT_BOUGHT_MAGIKARP + const EVENT_400 + const EVENT_401 + const EVENT_402 + const EVENT_403 + const EVENT_404 + const EVENT_405 + const EVENT_406 + const EVENT_407 + const EVENT_408 + const EVENT_409 + const EVENT_40A + const EVENT_40B + const EVENT_40C + const EVENT_40D + const EVENT_40E + const EVENT_40F + const EVENT_410 + const EVENT_BEAT_ROUTE_6_TRAINER_0 + const EVENT_BEAT_ROUTE_6_TRAINER_1 + const EVENT_BEAT_ROUTE_6_TRAINER_2 + const EVENT_BEAT_ROUTE_6_TRAINER_3 + const EVENT_BEAT_ROUTE_6_TRAINER_4 + const EVENT_BEAT_ROUTE_6_TRAINER_5 + const EVENT_417 + const EVENT_418 + const EVENT_419 + const EVENT_41A + const EVENT_41B + const EVENT_41C + const EVENT_41D + const EVENT_41E + const EVENT_41F + const EVENT_420 + const EVENT_421 + const EVENT_422 + const EVENT_423 + const EVENT_424 + const EVENT_425 + const EVENT_426 + const EVENT_427 + const EVENT_428 + const EVENT_429 + const EVENT_42A + const EVENT_42B + const EVENT_42C + const EVENT_42D + const EVENT_42E + const EVENT_42F + const EVENT_430 + const EVENT_BEAT_ROUTE_8_TRAINER_0 + const EVENT_BEAT_ROUTE_8_TRAINER_1 + const EVENT_BEAT_ROUTE_8_TRAINER_2 + const EVENT_BEAT_ROUTE_8_TRAINER_3 + const EVENT_BEAT_ROUTE_8_TRAINER_4 + const EVENT_BEAT_ROUTE_8_TRAINER_5 + const EVENT_BEAT_ROUTE_8_TRAINER_6 + const EVENT_BEAT_ROUTE_8_TRAINER_7 + const EVENT_BEAT_ROUTE_8_TRAINER_8 + const EVENT_43A + const EVENT_43B + const EVENT_43C + const EVENT_43D + const EVENT_43E + const EVENT_43F + const EVENT_440 + const EVENT_BEAT_ROUTE_9_TRAINER_0 + const EVENT_BEAT_ROUTE_9_TRAINER_2 + const EVENT_BEAT_ROUTE_9_TRAINER_3 + const EVENT_BEAT_ROUTE_9_TRAINER_4 + const EVENT_BEAT_ROUTE_9_TRAINER_5 + const EVENT_BEAT_ROUTE_9_TRAINER_6 + const EVENT_BEAT_ROUTE_9_TRAINER_7 + const EVENT_BEAT_ROUTE_9_TRAINER_8 + const EVENT_BEAT_ROUTE_9_TRAINER_9 + const EVENT_44A + const EVENT_44B + const EVENT_44C + const EVENT_44D + const EVENT_44E + const EVENT_44F + const EVENT_450 + const EVENT_BEAT_ROUTE_10_TRAINER_0 + const EVENT_BEAT_ROUTE_10_TRAINER_1 + const EVENT_BEAT_ROUTE_10_TRAINER_2 + const EVENT_BEAT_ROUTE_10_TRAINER_3 + const EVENT_BEAT_ROUTE_10_TRAINER_4 + const EVENT_BEAT_ROUTE_10_TRAINER_5 + const EVENT_457 + const EVENT_458 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6 + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_7 + const EVENT_460 + const EVENT_BEAT_POWER_PLANT_TRAINER_0 + const EVENT_BEAT_POWER_PLANT_TRAINER_1 + const EVENT_BEAT_POWER_PLANT_TRAINER_2 + const EVENT_BEAT_POWER_PLANT_TRAINER_3 + const EVENT_BEAT_POWER_PLANT_TRAINER_4 + const EVENT_BEAT_POWER_PLANT_TRAINER_5 + const EVENT_BEAT_POWER_PLANT_TRAINER_6 + const EVENT_BEAT_POWER_PLANT_TRAINER_7 + const EVENT_BEAT_POWER_PLANT_TRAINER_8 + const EVENT_46A + const EVENT_46B + const EVENT_46C + const EVENT_46D + const EVENT_46E + const EVENT_46F + const EVENT_470 + const EVENT_BEAT_ROUTE_11_TRAINER_0 + const EVENT_BEAT_ROUTE_11_TRAINER_1 + const EVENT_BEAT_ROUTE_11_TRAINER_2 + const EVENT_BEAT_ROUTE_11_TRAINER_3 + const EVENT_BEAT_ROUTE_11_TRAINER_4 + const EVENT_BEAT_ROUTE_11_TRAINER_5 + const EVENT_BEAT_ROUTE_11_TRAINER_6 + const EVENT_BEAT_ROUTE_11_TRAINER_7 + const EVENT_BEAT_ROUTE_11_TRAINER_8 + const EVENT_BEAT_ROUTE_11_TRAINER_9 + const EVENT_47B + const EVENT_47C + const EVENT_47D + const EVENT_47E + const EVENT_47F + const EVENT_480 + const EVENT_481 + const EVENT_BEAT_ROUTE_12_TRAINER_0 + const EVENT_BEAT_ROUTE_12_TRAINER_1 + const EVENT_BEAT_ROUTE_12_TRAINER_2 + const EVENT_BEAT_ROUTE_12_TRAINER_3 + const EVENT_BEAT_ROUTE_12_TRAINER_4 + const EVENT_BEAT_ROUTE_12_TRAINER_5 + const EVENT_BEAT_ROUTE_12_TRAINER_6 + const EVENT_489 + const EVENT_48A + const EVENT_48B + const EVENT_48C + const EVENT_48D + const EVENT_FIGHT_ROUTE12_SNORLAX + const EVENT_BEAT_ROUTE12_SNORLAX + const EVENT_490 + const EVENT_BEAT_ROUTE_13_TRAINER_0 + const EVENT_BEAT_ROUTE_13_TRAINER_2 + const EVENT_BEAT_ROUTE_13_TRAINER_3 + const EVENT_BEAT_ROUTE_13_TRAINER_4 + const EVENT_BEAT_ROUTE_13_TRAINER_5 + const EVENT_BEAT_ROUTE_13_TRAINER_6 + const EVENT_BEAT_ROUTE_13_TRAINER_7 + const EVENT_BEAT_ROUTE_13_TRAINER_8 + const EVENT_BEAT_ROUTE_13_TRAINER_9 + const EVENT_BEAT_ROUTE_13_TRAINER_10 + const EVENT_49B + const EVENT_49C + const EVENT_49D + const EVENT_49E + const EVENT_49F + const EVENT_4A0 + const EVENT_BEAT_ROUTE_14_TRAINER_0 + const EVENT_BEAT_ROUTE_14_TRAINER_1 + const EVENT_BEAT_ROUTE_14_TRAINER_2 + const EVENT_BEAT_ROUTE_14_TRAINER_3 + const EVENT_BEAT_ROUTE_14_TRAINER_4 + const EVENT_BEAT_ROUTE_14_TRAINER_5 + const EVENT_BEAT_ROUTE_14_TRAINER_6 + const EVENT_BEAT_ROUTE_14_TRAINER_7 + const EVENT_BEAT_ROUTE_14_TRAINER_8 + const EVENT_BEAT_ROUTE_14_TRAINER_9 + const EVENT_4AB + const EVENT_4AC + const EVENT_4AD + const EVENT_4AE + const EVENT_4AF + const EVENT_4B0 + const EVENT_BEAT_ROUTE_15_TRAINER_0 + const EVENT_BEAT_ROUTE_15_TRAINER_1 + const EVENT_BEAT_ROUTE_15_TRAINER_2 + const EVENT_BEAT_ROUTE_15_TRAINER_3 + const EVENT_BEAT_ROUTE_15_TRAINER_4 + const EVENT_BEAT_ROUTE_15_TRAINER_5 + const EVENT_BEAT_ROUTE_15_TRAINER_6 + const EVENT_BEAT_ROUTE_15_TRAINER_7 + const EVENT_BEAT_ROUTE_15_TRAINER_8 + const EVENT_BEAT_ROUTE_15_TRAINER_9 + const EVENT_4BB + const EVENT_4BC + const EVENT_4BD + const EVENT_4BE + const EVENT_4BF + const EVENT_4C0 + const EVENT_BEAT_ROUTE_16_TRAINER_0 + const EVENT_BEAT_ROUTE_16_TRAINER_1 + const EVENT_BEAT_ROUTE_16_TRAINER_2 + const EVENT_BEAT_ROUTE_16_TRAINER_3 + const EVENT_BEAT_ROUTE_16_TRAINER_4 + const EVENT_BEAT_ROUTE_16_TRAINER_5 + const EVENT_4C7 + const EVENT_FIGHT_ROUTE16_SNORLAX + const EVENT_BEAT_ROUTE16_SNORLAX + const EVENT_4CA + const EVENT_4CB + const EVENT_4CC + const EVENT_4CD + const EVENT_4CE + const EVENT_4CF + const EVENT_4D0 + const EVENT_BEAT_ROUTE_17_TRAINER_0 + const EVENT_BEAT_ROUTE_17_TRAINER_1 + const EVENT_BEAT_ROUTE_17_TRAINER_2 + const EVENT_BEAT_ROUTE_17_TRAINER_3 + const EVENT_BEAT_ROUTE_17_TRAINER_4 + const EVENT_BEAT_ROUTE_17_TRAINER_5 + const EVENT_BEAT_ROUTE_17_TRAINER_6 + const EVENT_BEAT_ROUTE_17_TRAINER_7 + const EVENT_BEAT_ROUTE_17_TRAINER_8 + const EVENT_BEAT_ROUTE_17_TRAINER_9 + const EVENT_4DB + const EVENT_4DC + const EVENT_4DD + const EVENT_4DE + const EVENT_4DF + const EVENT_4E0 + const EVENT_BEAT_ROUTE_18_TRAINER_0 + const EVENT_BEAT_ROUTE_18_TRAINER_1 + const EVENT_BEAT_ROUTE_18_TRAINER_2 + const EVENT_4E4 + const EVENT_4E5 + const EVENT_4E6 + const EVENT_4E7 + const EVENT_4E8 + const EVENT_4E9 + const EVENT_4EA + const EVENT_4EB + const EVENT_4EC + const EVENT_4ED + const EVENT_4EE + const EVENT_4EF + const EVENT_4F0 + const EVENT_BEAT_ROUTE_19_TRAINER_0 + const EVENT_BEAT_ROUTE_19_TRAINER_1 + const EVENT_BEAT_ROUTE_19_TRAINER_2 + const EVENT_BEAT_ROUTE_19_TRAINER_3 + const EVENT_BEAT_ROUTE_19_TRAINER_4 + const EVENT_BEAT_ROUTE_19_TRAINER_5 + const EVENT_BEAT_ROUTE_19_TRAINER_6 + const EVENT_BEAT_ROUTE_19_TRAINER_7 + const EVENT_BEAT_ROUTE_19_TRAINER_8 + const EVENT_BEAT_ROUTE_19_TRAINER_9 + const EVENT_4FB + const EVENT_4FC + const EVENT_4FD + const EVENT_4FE + const EVENT_4FF + const EVENT_500 + const EVENT_BEAT_ROUTE_20_TRAINER_0 + const EVENT_BEAT_ROUTE_20_TRAINER_2 + const EVENT_BEAT_ROUTE_20_TRAINER_3 + const EVENT_BEAT_ROUTE_20_TRAINER_4 + const EVENT_BEAT_ROUTE_20_TRAINER_5 + const EVENT_BEAT_ROUTE_20_TRAINER_6 + const EVENT_BEAT_ROUTE_20_TRAINER_7 + const EVENT_BEAT_ROUTE_20_TRAINER_8 + const EVENT_BEAT_ROUTE_20_TRAINER_9 + const EVENT_BEAT_ROUTE_20_TRAINER_10 + const EVENT_50B + const EVENT_50C + const EVENT_50D + const EVENT_50E + const EVENT_50F + const EVENT_510 + const EVENT_BEAT_ROUTE_21_TRAINER_0 + const EVENT_BEAT_ROUTE_21_TRAINER_1 + const EVENT_BEAT_ROUTE_21_TRAINER_2 + const EVENT_BEAT_ROUTE_21_TRAINER_3 + const EVENT_BEAT_ROUTE_21_TRAINER_4 + const EVENT_BEAT_ROUTE_21_TRAINER_5 + const EVENT_BEAT_ROUTE_21_TRAINER_6 + const EVENT_BEAT_ROUTE_21_TRAINER_7 + const EVENT_BEAT_ROUTE_21_TRAINER_8 + const EVENT_51A + const EVENT_51B + const EVENT_51C + const EVENT_51D + const EVENT_51E + const EVENT_51F + const EVENT_520 + const EVENT_521 + const EVENT_522 + const EVENT_523 + const EVENT_524 + const EVENT_525 + const EVENT_526 + const EVENT_527 + const EVENT_528 + const EVENT_529 + const EVENT_52A + const EVENT_52B + const EVENT_52C + const EVENT_52D + const EVENT_52E + const EVENT_52F + const EVENT_530 + const EVENT_531 + const EVENT_532 + const EVENT_533 + const EVENT_534 + const EVENT_535 + const EVENT_536 + const EVENT_537 + const EVENT_538 + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0 + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2 + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3 + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4 + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_5 + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_6 + const EVENT_53F + const EVENT_540 + const EVENT_541 + const EVENT_BEAT_ROUTE_24_TRAINER_0 + const EVENT_BEAT_ROUTE_24_TRAINER_2 + const EVENT_BEAT_ROUTE_24_TRAINER_3 + const EVENT_BEAT_ROUTE_24_TRAINER_4 + const EVENT_BEAT_ROUTE_24_TRAINER_5 + const EVENT_BEAT_ROUTE_24_TRAINER_6 + const EVENT_548 + const EVENT_549 + const EVENT_54A + const EVENT_54B + const EVENT_54C + const EVENT_54D + const EVENT_54E + const EVENT_54F + const EVENT_550 + const EVENT_BEAT_ROUTE_25_TRAINER_0 + const EVENT_BEAT_ROUTE_25_TRAINER_2 + const EVENT_BEAT_ROUTE_25_TRAINER_3 + const EVENT_BEAT_ROUTE_25_TRAINER_4 + const EVENT_BEAT_ROUTE_25_TRAINER_5 + const EVENT_BEAT_ROUTE_25_TRAINER_6 + const EVENT_BEAT_ROUTE_25_TRAINER_7 + const EVENT_BEAT_ROUTE_25_TRAINER_8 + const EVENT_BEAT_ROUTE_25_TRAINER_9 + const EVENT_55A + const EVENT_55B + const EVENT_55C + const EVENT_55D + const EVENT_55E + const EVENT_55F + const EVENT_560 + const EVENT_561 + const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 + const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1 + const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 + const EVENT_565 + const EVENT_566 + const EVENT_567 + const EVENT_568 + const EVENT_569 + const EVENT_56A + const EVENT_56B + const EVENT_56C + const EVENT_56D + const EVENT_56E + const EVENT_56F + const EVENT_570 + const EVENT_BEAT_MT_MOON_1_TRAINER_0 + const EVENT_BEAT_MT_MOON_1_TRAINER_2 + const EVENT_BEAT_MT_MOON_1_TRAINER_3 + const EVENT_BEAT_MT_MOON_1_TRAINER_4 + const EVENT_BEAT_MT_MOON_1_TRAINER_5 + const EVENT_BEAT_MT_MOON_1_TRAINER_6 + const EVENT_BEAT_MT_MOON_1_TRAINER_7 + const EVENT_578 + const EVENT_579 + const EVENT_BEAT_MT_MOON_3_TRAINER_0 + const EVENT_BEAT_MT_MOON_3_TRAINER_2 + const EVENT_BEAT_MT_MOON_3_TRAINER_3 + const EVENT_BEAT_MT_MOON_3_TRAINER_4 + const EVENT_57E + const EVENT_57F + const EVENT_580 + const EVENT_581 + const EVENT_582 + const EVENT_583 + const EVENT_584 + const EVENT_585 + const EVENT_586 + const EVENT_587 + const EVENT_588 + const EVENT_589 + const EVENT_58A + const EVENT_58B + const EVENT_58C + const EVENT_58D + const EVENT_58E + const EVENT_58F + const EVENT_590 + const EVENT_591 + const EVENT_592 + const EVENT_593 + const EVENT_594 + const EVENT_595 + const EVENT_596 + const EVENT_597 + const EVENT_598 + const EVENT_599 + const EVENT_59A + const EVENT_59B + const EVENT_59C + const EVENT_59D + const EVENT_59E + const EVENT_59F + const EVENT_5A0 + const EVENT_5A1 + const EVENT_5A2 + const EVENT_5A3 + const EVENT_5A4 + const EVENT_5A5 + const EVENT_5A6 + const EVENT_5A7 + const EVENT_5A8 + const EVENT_5A9 + const EVENT_5AA + const EVENT_5AB + const EVENT_5AC + const EVENT_5AD + const EVENT_5AE + const EVENT_5AF + const EVENT_5B0 + const EVENT_5B1 + const EVENT_5B2 + const EVENT_5B3 + const EVENT_5B4 + const EVENT_5B5 + const EVENT_5B6 + const EVENT_5B7 + const EVENT_5B8 + const EVENT_5B9 + const EVENT_5BA + const EVENT_5BB + const EVENT_5BC + const EVENT_5BD + const EVENT_5BE + const EVENT_5BF + const EVENT_5C0 + const EVENT_5C1 + const EVENT_5C2 + const EVENT_5C3 + const EVENT_BEAT_SS_ANNE_5_TRAINER_0 + const EVENT_BEAT_SS_ANNE_5_TRAINER_1 + const EVENT_5C6 + const EVENT_5C7 + const EVENT_5C8 + const EVENT_5C9 + const EVENT_5CA + const EVENT_5CB + const EVENT_5CC + const EVENT_5CD + const EVENT_5CE + const EVENT_5CF + const EVENT_5D0 + const EVENT_5D1 + const EVENT_5D2 + const EVENT_5D3 + const EVENT_5D4 + const EVENT_5D5 + const EVENT_5D6 + const EVENT_5D7 + const EVENT_5D8 + const EVENT_5D9 + const EVENT_5DA + const EVENT_5DB + const EVENT_5DC + const EVENT_5DD + const EVENT_5DE + const EVENT_5DF + const EVENT_5E0 + const EVENT_5E1 + const EVENT_SS_ANNE_LEFT + const EVENT_5E3 + const EVENT_5E4 + const EVENT_5E5 + const EVENT_5E6 + const EVENT_5E7 + const EVENT_5E8 + const EVENT_5E9 + const EVENT_5EA + const EVENT_5EB + const EVENT_5EC + const EVENT_5ED + const EVENT_5EE + const EVENT_5EF + const EVENT_5F0 + const EVENT_BEAT_SS_ANNE_8_TRAINER_0 + const EVENT_BEAT_SS_ANNE_8_TRAINER_1 + const EVENT_BEAT_SS_ANNE_8_TRAINER_2 + const EVENT_BEAT_SS_ANNE_8_TRAINER_3 + const EVENT_5F5 + const EVENT_5F6 + const EVENT_5F7 + const EVENT_5F8 + const EVENT_5F9 + const EVENT_5FA + const EVENT_5FB + const EVENT_5FC + const EVENT_5FD + const EVENT_5FE + const EVENT_5FF + const EVENT_600 + const EVENT_BEAT_SS_ANNE_9_TRAINER_0 + const EVENT_BEAT_SS_ANNE_9_TRAINER_1 + const EVENT_BEAT_SS_ANNE_9_TRAINER_2 + const EVENT_BEAT_SS_ANNE_9_TRAINER_3 + const EVENT_605 + const EVENT_606 + const EVENT_607 + const EVENT_608 + const EVENT_609 + const EVENT_60A + const EVENT_60B + const EVENT_60C + const EVENT_60D + const EVENT_60E + const EVENT_60F + const EVENT_610 + const EVENT_BEAT_SS_ANNE_10_TRAINER_0 + const EVENT_BEAT_SS_ANNE_10_TRAINER_1 + const EVENT_BEAT_SS_ANNE_10_TRAINER_2 + const EVENT_BEAT_SS_ANNE_10_TRAINER_3 + const EVENT_BEAT_SS_ANNE_10_TRAINER_4 + const EVENT_BEAT_SS_ANNE_10_TRAINER_5 + const EVENT_617 + const EVENT_618 + const EVENT_619 + const EVENT_61A + const EVENT_61B + const EVENT_61C + const EVENT_61D + const EVENT_61E + const EVENT_61F + const EVENT_620 + const EVENT_621 + const EVENT_622 + const EVENT_623 + const EVENT_624 + const EVENT_625 + const EVENT_626 + const EVENT_627 + const EVENT_628 + const EVENT_629 + const EVENT_62A + const EVENT_62B + const EVENT_62C + const EVENT_62D + const EVENT_62E + const EVENT_62F + const EVENT_630 + const EVENT_631 + const EVENT_632 + const EVENT_633 + const EVENT_634 + const EVENT_635 + const EVENT_636 + const EVENT_637 + const EVENT_638 + const EVENT_639 + const EVENT_63A + const EVENT_63B + const EVENT_63C + const EVENT_63D + const EVENT_63E + const EVENT_63F + const EVENT_640 + const EVENT_641 + const EVENT_642 + const EVENT_643 + const EVENT_644 + const EVENT_645 + const EVENT_646 + const EVENT_647 + const EVENT_648 + const EVENT_649 + const EVENT_64A + const EVENT_64B + const EVENT_64C + const EVENT_64D + const EVENT_64E + const EVENT_64F + const EVENT_650 + const EVENT_651 + const EVENT_652 + const EVENT_653 + const EVENT_654 + const EVENT_655 + const EVENT_656 + const EVENT_657 + const EVENT_658 + const EVENT_659 + const EVENT_65A + const EVENT_65B + const EVENT_65C + const EVENT_65D + const EVENT_65E + const EVENT_65F + const EVENT_660 + const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0 + const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2 + const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3 + const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_4 + const EVENT_665 + const EVENT_666 + const EVENT_667 + const EVENT_668 + const EVENT_669 + const EVENT_66A + const EVENT_66B + const EVENT_66C + const EVENT_66D + const EVENT_66E + const EVENT_66F + const EVENT_670 + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0 + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2 + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3 + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4 + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 + const EVENT_676 + const EVENT_677 + const EVENT_678 + const EVENT_679 + const EVENT_67A + const EVENT_67B + const EVENT_67C + const EVENT_67D + const EVENT_67E + const EVENT_67F + const EVENT_680 + const EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0 + const EVENT_682 + const EVENT_683 + const EVENT_684 + const EVENT_685 + const EVENT_686 + const EVENT_687 + const EVENT_688 + const EVENT_689 + const EVENT_68A + const EVENT_68B + const EVENT_68C + const EVENT_68D + const EVENT_68E + const EVENT_68F + const EVENT_690 + const EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0 + const EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_2 + const EVENT_693 + const EVENT_694 + const EVENT_695 + const EVENT_696 + const EVENT_697 + const EVENT_698 + const EVENT_699 + const EVENT_69A + const EVENT_69B + const EVENT_69C + const EVENT_69D + const EVENT_69E + const EVENT_69F + const EVENT_6A0 + const EVENT_6A1 + const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0 + const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2 + const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_3 + const EVENT_6A5 + const EVENT_6A6 + const EVENT_6A7 + const EVENT_6A8 + const EVENT_6A9 + const EVENT_6AA + const EVENT_6AB + const EVENT_6AC + const EVENT_6AD + const EVENT_6AE + const EVENT_6AF + const EVENT_6B0 + const EVENT_6B1 + const EVENT_6B2 + const EVENT_6B3 + const EVENT_6B4 + const EVENT_6B5 + const EVENT_6B6 + const EVENT_6B7 + const EVENT_6B8 + const EVENT_6B9 + const EVENT_6BA + const EVENT_6BB + const EVENT_6BC + const EVENT_6BD + const EVENT_6BE + const EVENT_6BF + const EVENT_6C0 + const EVENT_6C1 + const EVENT_6C2 + const EVENT_6C3 + const EVENT_6C4 + const EVENT_6C5 + const EVENT_6C6 + const EVENT_6C7 + const EVENT_6C8 + const EVENT_6C9 + const EVENT_6CA + const EVENT_6CB + const EVENT_6CC + const EVENT_6CD + const EVENT_6CE + const EVENT_6CF + const EVENT_6D0 + const EVENT_6D1 + const EVENT_6D2 + const EVENT_6D3 + const EVENT_6D4 + const EVENT_6D5 + const EVENT_6D6 + const EVENT_6D7 + const EVENT_6D8 + const EVENT_6D9 + const EVENT_6DA + const EVENT_6DB + const EVENT_6DC + const EVENT_6DD + const EVENT_6DE + const EVENT_6DF + const EVENT_6E0 + const EVENT_6E1 + const EVENT_6E2 + const EVENT_6E3 + const EVENT_6E4 + const EVENT_6E5 + const EVENT_6E6 + const EVENT_6E7 + const EVENT_6E8 + const EVENT_6E9 + const EVENT_6EA + const EVENT_6EB + const EVENT_6EC + const EVENT_6ED + const EVENT_6EE + const EVENT_6EF + const EVENT_6F0 + const EVENT_6F1 + const EVENT_BEAT_SILPH_CO_2F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_2F_TRAINER_1 + const EVENT_BEAT_SILPH_CO_2F_TRAINER_2 + const EVENT_BEAT_SILPH_CO_2F_TRAINER_3 + const EVENT_6F6 + const EVENT_6F7 + const EVENT_6F8 + const EVENT_6F9 + const EVENT_6FA + const EVENT_6FB + const EVENT_6FC + const EVENT_6FD + const EVENT_6FE + const EVENT_6FF + const EVENT_700 + const EVENT_701 + const EVENT_BEAT_SILPH_CO_3F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_3F_TRAINER_1 + const EVENT_704 + const EVENT_705 + const EVENT_706 + const EVENT_707 + const EVENT_708 + const EVENT_709 + const EVENT_70A + const EVENT_70B + const EVENT_70C + const EVENT_70D + const EVENT_70E + const EVENT_70F + const EVENT_710 + const EVENT_711 + const EVENT_BEAT_SILPH_CO_4F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_4F_TRAINER_2 + const EVENT_BEAT_SILPH_CO_4F_TRAINER_3 + const EVENT_715 + const EVENT_716 + const EVENT_717 + const EVENT_718 + const EVENT_719 + const EVENT_71A + const EVENT_71B + const EVENT_71C + const EVENT_71D + const EVENT_71E + const EVENT_71F + const EVENT_720 + const EVENT_721 + const EVENT_BEAT_SILPH_CO_5F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_5F_TRAINER_2 + const EVENT_BEAT_SILPH_CO_5F_TRAINER_3 + const EVENT_BEAT_SILPH_CO_5F_TRAINER_4 + const EVENT_726 + const EVENT_727 + const EVENT_728 + const EVENT_729 + const EVENT_72A + const EVENT_72B + const EVENT_72C + const EVENT_72D + const EVENT_72E + const EVENT_72F + const EVENT_730 + const EVENT_731 + const EVENT_732 + const EVENT_733 + const EVENT_734 + const EVENT_735 + const EVENT_BEAT_SILPH_CO_6F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_6F_TRAINER_2 + const EVENT_BEAT_SILPH_CO_6F_TRAINER_3 + const EVENT_739 + const EVENT_73A + const EVENT_73B + const EVENT_73C + const EVENT_73D + const EVENT_73E + const EVENT_73F + const EVENT_740 + const EVENT_741 + const EVENT_742 + const EVENT_743 + const EVENT_744 + const EVENT_BEAT_SILPH_CO_7F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_7F_TRAINER_2 + const EVENT_BEAT_SILPH_CO_7F_TRAINER_3 + const EVENT_BEAT_SILPH_CO_7F_TRAINER_4 + const EVENT_749 + const EVENT_74A + const EVENT_74B + const EVENT_74C + const EVENT_74D + const EVENT_74E + const EVENT_74F + const EVENT_750 + const EVENT_751 + const EVENT_BEAT_SILPH_CO_8F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_8F_TRAINER_1 + const EVENT_BEAT_SILPH_CO_8F_TRAINER_2 + const EVENT_755 + const EVENT_756 + const EVENT_757 + const EVENT_758 + const EVENT_759 + const EVENT_75A + const EVENT_75B + const EVENT_75C + const EVENT_75D + const EVENT_75E + const EVENT_75F + const EVENT_760 + const EVENT_761 + const EVENT_BEAT_SILPH_CO_9F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_9F_TRAINER_1 + const EVENT_BEAT_SILPH_CO_9F_TRAINER_2 + const EVENT_765 + const EVENT_766 + const EVENT_767 + const EVENT_768 + const EVENT_769 + const EVENT_76A + const EVENT_76B + const EVENT_76C + const EVENT_76D + const EVENT_76E + const EVENT_76F + const EVENT_770 + const EVENT_BEAT_SILPH_CO_10F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_10F_TRAINER_1 + const EVENT_773 + const EVENT_774 + const EVENT_775 + const EVENT_776 + const EVENT_777 + const EVENT_778 + const EVENT_779 + const EVENT_77A + const EVENT_77B + const EVENT_77C + const EVENT_77D + const EVENT_77E + const EVENT_77F + const EVENT_780 + const EVENT_781 + const EVENT_782 + const EVENT_783 + const EVENT_BEAT_SILPH_CO_11F_TRAINER_0 + const EVENT_BEAT_SILPH_CO_11F_TRAINER_1 + const EVENT_786 + const EVENT_787 + const EVENT_788 + const EVENT_789 + const EVENT_78A + const EVENT_78B + const EVENT_78C + const EVENT_78D + const EVENT_78E + const EVENT_78F + const EVENT_790 + const EVENT_791 + const EVENT_792 + const EVENT_793 + const EVENT_794 + const EVENT_795 + const EVENT_796 + const EVENT_797 + const EVENT_798 + const EVENT_799 + const EVENT_79A + const EVENT_79B + const EVENT_79C + const EVENT_79D + const EVENT_79E + const EVENT_79F + const EVENT_7A0 + const EVENT_7A1 + const EVENT_7A2 + const EVENT_7A3 + const EVENT_7A4 + const EVENT_7A5 + const EVENT_7A6 + const EVENT_7A7 + const EVENT_7A8 + const EVENT_7A9 + const EVENT_7AA + const EVENT_7AB + const EVENT_7AC + const EVENT_7AD + const EVENT_7AE + const EVENT_7AF + const EVENT_7B0 + const EVENT_7B1 + const EVENT_7B2 + const EVENT_7B3 + const EVENT_7B4 + const EVENT_7B5 + const EVENT_7B6 + const EVENT_7B7 + const EVENT_7B8 + const EVENT_7B9 + const EVENT_7BA + const EVENT_7BB + const EVENT_7BC + const EVENT_7BD + const EVENT_7BE + const EVENT_7BF + const EVENT_7C0 + const EVENT_7C1 + const EVENT_7C2 + const EVENT_7C3 + const EVENT_7C4 + const EVENT_7C5 + const EVENT_7C6 + const EVENT_7C7 + const EVENT_7C8 + const EVENT_7C9 + const EVENT_7CA + const EVENT_7CB + const EVENT_7CC + const EVENT_7CD + const EVENT_7CE + const EVENT_7CF + const EVENT_7D0 + const EVENT_7D1 + const EVENT_7D2 + const EVENT_7D3 + const EVENT_7D4 + const EVENT_7D5 + const EVENT_7D6 + const EVENT_7D7 + const EVENT_7D8 + const EVENT_7D9 + const EVENT_7DA + const EVENT_7DB + const EVENT_7DC + const EVENT_7DD + const EVENT_7DE + const EVENT_7DF + const EVENT_7E0 + const EVENT_7E1 + const EVENT_7E2 + const EVENT_7E3 + const EVENT_7E4 + const EVENT_7E5 + const EVENT_7E6 + const EVENT_7E7 + const EVENT_7E8 + const EVENT_7E9 + const EVENT_7EA + const EVENT_7EB + const EVENT_7EC + const EVENT_7ED + const EVENT_7EE + const EVENT_7EF + const EVENT_7F0 + const EVENT_7F1 + const EVENT_7F2 + const EVENT_7F3 + const EVENT_7F4 + const EVENT_7F5 + const EVENT_7F6 + const EVENT_7F7 + const EVENT_7F8 + const EVENT_7F9 + const EVENT_7FA + const EVENT_7FB + const EVENT_7FC + const EVENT_7FD + const EVENT_7FE + const EVENT_7FF + const EVENT_800 + const EVENT_BEAT_MANSION_2_TRAINER_0 + const EVENT_802 + const EVENT_803 + const EVENT_804 + const EVENT_805 + const EVENT_806 + const EVENT_807 + const EVENT_808 + const EVENT_809 + const EVENT_80A + const EVENT_80B + const EVENT_80C + const EVENT_80D + const EVENT_80E + const EVENT_80F + const EVENT_810 + const EVENT_BEAT_MANSION_3_TRAINER_0 + const EVENT_BEAT_MANSION_3_TRAINER_2 + const EVENT_813 + const EVENT_814 + const EVENT_815 + const EVENT_816 + const EVENT_817 + const EVENT_818 + const EVENT_819 + const EVENT_81A + const EVENT_81B + const EVENT_81C + const EVENT_81D + const EVENT_81E + const EVENT_81F + const EVENT_820 + const EVENT_BEAT_MANSION_4_TRAINER_0 + const EVENT_BEAT_MANSION_4_TRAINER_2 + const EVENT_823 + const EVENT_824 + const EVENT_825 + const EVENT_826 + const EVENT_827 + const EVENT_828 + const EVENT_829 + const EVENT_82A + const EVENT_82B + const EVENT_82C + const EVENT_82D + const EVENT_82E + const EVENT_82F + const EVENT_830 + const EVENT_831 + const EVENT_832 + const EVENT_833 + const EVENT_834 + const EVENT_835 + const EVENT_836 + const EVENT_837 + const EVENT_838 + const EVENT_839 + const EVENT_83A + const EVENT_83B + const EVENT_83C + const EVENT_83D + const EVENT_83E + const EVENT_83F + const EVENT_840 + const EVENT_841 + const EVENT_842 + const EVENT_843 + const EVENT_844 + const EVENT_845 + const EVENT_846 + const EVENT_847 + const EVENT_848 + const EVENT_849 + const EVENT_84A + const EVENT_84B + const EVENT_84C + const EVENT_84D + const EVENT_84E + const EVENT_84F + const EVENT_850 + const EVENT_851 + const EVENT_852 + const EVENT_853 + const EVENT_854 + const EVENT_855 + const EVENT_856 + const EVENT_857 + const EVENT_858 + const EVENT_859 + const EVENT_85A + const EVENT_85B + const EVENT_85C + const EVENT_85D + const EVENT_85E + const EVENT_85F + const EVENT_860 + const EVENT_861 + const EVENT_862 + const EVENT_863 + const EVENT_864 + const EVENT_865 + const EVENT_866 + const EVENT_867 + const EVENT_868 + const EVENT_869 + const EVENT_86A + const EVENT_86B + const EVENT_86C + const EVENT_86D + const EVENT_86E + const EVENT_86F + const EVENT_870 + const EVENT_871 + const EVENT_872 + const EVENT_873 + const EVENT_874 + const EVENT_875 + const EVENT_876 + const EVENT_877 + const EVENT_878 + const EVENT_879 + const EVENT_87A + const EVENT_87B + const EVENT_87C + const EVENT_87D + const EVENT_87E + const EVENT_87F + const EVENT_880 + const EVENT_881 + const EVENT_882 + const EVENT_883 + const EVENT_884 + const EVENT_885 + const EVENT_886 + const EVENT_887 + const EVENT_888 + const EVENT_889 + const EVENT_88A + const EVENT_88B + const EVENT_88C + const EVENT_88D + const EVENT_88E + const EVENT_88F + const EVENT_890 + const EVENT_891 + const EVENT_892 + const EVENT_893 + const EVENT_894 + const EVENT_895 + const EVENT_896 + const EVENT_897 + const EVENT_898 + const EVENT_899 + const EVENT_89A + const EVENT_89B + const EVENT_89C + const EVENT_89D + const EVENT_89E + const EVENT_89F + const EVENT_8A0 + const EVENT_8A1 + const EVENT_8A2 + const EVENT_8A3 + const EVENT_8A4 + const EVENT_8A5 + const EVENT_8A6 + const EVENT_8A7 + const EVENT_8A8 + const EVENT_8A9 + const EVENT_8AA + const EVENT_8AB + const EVENT_8AC + const EVENT_8AD + const EVENT_8AE + const EVENT_8AF + const EVENT_8B0 + const EVENT_8B1 + const EVENT_8B2 + const EVENT_8B3 + const EVENT_8B4 + const EVENT_8B5 + const EVENT_8B6 + const EVENT_8B7 + const EVENT_8B8 + const EVENT_8B9 + const EVENT_8BA + const EVENT_8BB + const EVENT_8BC + const EVENT_8BD + const EVENT_8BE + const EVENT_8BF + const EVENT_8C0 + const EVENT_BEAT_UNKNOWN_DUNGEON_3_TRAINER_0 + const EVENT_8C2 + const EVENT_8C3 + const EVENT_8C4 + const EVENT_8C5 + const EVENT_8C6 + const EVENT_8C7 + const EVENT_8C8 + const EVENT_8C9 + const EVENT_8CA + const EVENT_8CB + const EVENT_8CC + const EVENT_8CD + const EVENT_8CE + const EVENT_8CF + const EVENT_8D0 + const EVENT_8D1 + const EVENT_8D2 + const EVENT_8D3 + const EVENT_8D4 + const EVENT_8D5 + const EVENT_8D6 + const EVENT_8D7 + const EVENT_8D8 + const EVENT_8D9 + const EVENT_8DA + const EVENT_8DB + const EVENT_8DC + const EVENT_8DD + const EVENT_8DE + const EVENT_8DF + const EVENT_8E0 + const EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 + const EVENT_8E2 + const EVENT_8E3 + const EVENT_8E4 + const EVENT_8E5 + const EVENT_8E6 + const EVENT_8E7 + const EVENT_8E8 + const EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 + const EVENT_8EA + const EVENT_8EB + const EVENT_8EC + const EVENT_8ED + const EVENT_8EE + const EVENT_8EF + const EVENT_8F0 + const EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 + const EVENT_8F2 + const EVENT_8F3 + const EVENT_8F4 + const EVENT_8F5 + const EVENT_8F6 + const EVENT_8F7 + const EVENT_8F8 + const EVENT_BEAT_LANCES_ROOM_TRAINER_0 + const EVENT_8FA + const EVENT_8FB + const EVENT_8FC + const EVENT_8FD + const EVENT_8FE + const EVENT_8FF + const EVENT_900 + const EVENT_901 + const EVENT_902 + const EVENT_903 + const EVENT_904 + const EVENT_905 + const EVENT_906 + const EVENT_907 + const EVENT_908 + const EVENT_909 + const EVENT_90A + const EVENT_90B + const EVENT_90C + const EVENT_90D + const EVENT_90E + const EVENT_90F + const EVENT_910 + const EVENT_BEAT_VICTORY_ROAD_1_TRAINER_0 + const EVENT_BEAT_VICTORY_ROAD_1_TRAINER_1 + const EVENT_913 + const EVENT_914 + const EVENT_915 + const EVENT_916 + const EVENT_917 + const EVENT_918 + const EVENT_919 + const EVENT_91A + const EVENT_91B + const EVENT_91C + const EVENT_91D + const EVENT_91E + const EVENT_91F + const EVENT_920 + const EVENT_921 + const EVENT_922 + const EVENT_923 + const EVENT_924 + const EVENT_925 + const EVENT_926 + const EVENT_927 + const EVENT_928 + const EVENT_929 + const EVENT_92A + const EVENT_92B + const EVENT_92C + const EVENT_92D + const EVENT_92E + const EVENT_92F + const EVENT_930 + const EVENT_931 + const EVENT_932 + const EVENT_933 + const EVENT_934 + const EVENT_935 + const EVENT_936 + const EVENT_937 + const EVENT_938 + const EVENT_939 + const EVENT_93A + const EVENT_93B + const EVENT_93C + const EVENT_93D + const EVENT_93E + const EVENT_93F + const EVENT_940 + const EVENT_941 + const EVENT_942 + const EVENT_943 + const EVENT_944 + const EVENT_945 + const EVENT_946 + const EVENT_947 + const EVENT_948 + const EVENT_949 + const EVENT_94A + const EVENT_94B + const EVENT_94C + const EVENT_94D + const EVENT_94E + const EVENT_94F + const EVENT_950 + const EVENT_951 + const EVENT_952 + const EVENT_953 + const EVENT_954 + const EVENT_955 + const EVENT_956 + const EVENT_957 + const EVENT_958 + const EVENT_959 + const EVENT_95A + const EVENT_95B + const EVENT_95C + const EVENT_95D + const EVENT_95E + const EVENT_95F + const EVENT_960 + const EVENT_961 + const EVENT_962 + const EVENT_963 + const EVENT_964 + const EVENT_965 + const EVENT_966 + const EVENT_967 + const EVENT_968 + const EVENT_969 + const EVENT_96A + const EVENT_96B + const EVENT_96C + const EVENT_96D + const EVENT_96E + const EVENT_96F + const EVENT_970 + const EVENT_971 + const EVENT_972 + const EVENT_973 + const EVENT_974 + const EVENT_975 + const EVENT_976 + const EVENT_977 + const EVENT_978 + const EVENT_979 + const EVENT_97A + const EVENT_97B + const EVENT_97C + const EVENT_97D + const EVENT_97E + const EVENT_97F + const EVENT_980 + const EVENT_981 + const EVENT_982 + const EVENT_983 + const EVENT_984 + const EVENT_985 + const EVENT_986 + const EVENT_987 + const EVENT_988 + const EVENT_989 + const EVENT_98A + const EVENT_98B + const EVENT_98C + const EVENT_98D + const EVENT_98E + const EVENT_98F + const EVENT_990 + const EVENT_991 + const EVENT_992 + const EVENT_993 + const EVENT_994 + const EVENT_995 + const EVENT_996 + const EVENT_997 + const EVENT_998 + const EVENT_999 + const EVENT_99A + const EVENT_99B + const EVENT_99C + const EVENT_99D + const EVENT_99E + const EVENT_99F + const EVENT_9A0 + const EVENT_9A1 + const EVENT_9A2 + const EVENT_9A3 + const EVENT_9A4 + const EVENT_9A5 + const EVENT_9A6 + const EVENT_9A7 + const EVENT_9A8 + const EVENT_9A9 + const EVENT_9AA + const EVENT_9AB + const EVENT_9AC + const EVENT_9AD + const EVENT_9AE + const EVENT_9AF + const EVENT_9B0 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7 + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_8 + const EVENT_9B9 + const EVENT_9BA + const EVENT_9BB + const EVENT_9BC + const EVENT_9BD + const EVENT_9BE + const EVENT_9BF + const EVENT_9C0 + const EVENT_9C1 + const EVENT_9C2 + const EVENT_9C3 + const EVENT_9C4 + const EVENT_9C5 + const EVENT_9C6 + const EVENT_9C7 + const EVENT_9C8 + const EVENT_9C9 + const EVENT_9CA + const EVENT_9CB + const EVENT_9CC + const EVENT_9CD + const EVENT_9CE + const EVENT_9CF + const EVENT_9D0 + const EVENT_9D1 + const EVENT_9D2 + const EVENT_9D3 + const EVENT_9D4 + const EVENT_9D5 + const EVENT_9D6 + const EVENT_9D7 + const EVENT_9D8 + const EVENT_9D9 + const EVENT_BEAT_SEAFOAM_ISLANDS_5_TRAINER_0 + const EVENT_9DB + const EVENT_9DC + const EVENT_9DD + const EVENT_9DE + const EVENT_9DF + const EVENT_9E0 + const EVENT_9E1 + const EVENT_9E2 + const EVENT_9E3 + const EVENT_9E4 + const EVENT_9E5 + const EVENT_9E6 + const EVENT_9E7 + const EVENT_9E8 + const EVENT_9E9 + const EVENT_9EA + const EVENT_9EB + const EVENT_9EC + const EVENT_9ED + const EVENT_9EE + const EVENT_9EF + const EVENT_9F0 + const EVENT_9F1 + const EVENT_9F2 + const EVENT_9F3 + const EVENT_9F4 + const EVENT_9F5 + const EVENT_9F6 + const EVENT_9F7 + const EVENT_9F8 + const EVENT_9F9 + const EVENT_9FA + const EVENT_9FB + const EVENT_9FC + const EVENT_9FD + const EVENT_9FE + const EVENT_9FF diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm index 0d933571..7361fea2 100755 --- a/engine/hall_of_fame.asm +++ b/engine/hall_of_fame.asm @@ -207,8 +207,7 @@ HoFLoadMonPlayerPicTileIDs: ; 7036d (1c:436d) predef_jump CopyTileIDsFromList HoFDisplayPlayerStats: ; 70377 (1c:4377) - ld hl, wd747 - set 3, [hl] + SetEvent EVENT_003 predef DisplayDexRating coord hl, 0, 4 ld b, $6 diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 94b37193..01787e3e 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -314,8 +314,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) ld [wcd5b], a ; Don't do the trash can puzzle if it's already been done. - ld a, [wd773] - bit 0, a + CheckEvent EVENT_2ND_LOCK_OPENED jr z, .ok tx_pre_jump VermilionGymTrashText @@ -335,8 +334,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) .openFirstLock ; Next can is trying for the second switch. - ld hl, wd773 - set 1, [hl] + SetEvent EVENT_1ST_LOCK_OPENED ld hl, GymTrashCans ld a, [wcd5b] @@ -379,8 +377,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) jr z, .openSecondLock ; Reset the cans. - ld hl, wd773 - res 1, [hl] + ResetEvent EVENT_1ST_LOCK_OPENED call Random and $e @@ -391,8 +388,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) .openSecondLock ; Completed the trash can puzzle. - ld hl, wd773 - set 0, [hl] + SetEvent EVENT_2ND_LOCK_OPENED ld hl, wd126 set 6, [hl] diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index e293b0a0..cf18799d 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -152,8 +152,7 @@ CinnabarIslandPokecenterBenchGuyText: ; 624df (18:64df) SaffronCityPokecenterBenchGuyText: ; 624e4 (18:64e4) TX_ASM - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ld hl, SaffronCityPokecenterBenchGuyText2 jr nz, .asm_624f2 ld hl, SaffronCityPokecenterBenchGuyText1 diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 8893e496..d4a0ce88 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -36,8 +36,7 @@ StrengthsAndWeaknessesText: ; 1e983 (7:6983) db "@" SafariZoneCheck: ; 1e988 (7:6988) - ld hl, wd790 - bit 7, [hl]; if we are not in the Safari Zone, + CheckEventHL EVENT_IN_SAFARI_ZONE ; if we are not in the Safari Zone, jr z, SafariZoneGameStillGoing ; don't bother printing game over text ld a, [W_NUMSAFARIBALLS] and a @@ -85,8 +84,7 @@ SafariZoneGameOver: ; 1e9b0 (7:69b0) ld [wDestinationWarpID], a ld a, $5 ld [W_SAFARIZONEENTRANCECURSCRIPT], a - ld hl, wd790 - set 6, [hl] + SetEvent EVENT_SAFARI_GAME_OVER ld a, $1 ld [wSafariZoneGameOver], a ret @@ -191,7 +189,7 @@ CinnabarQuizQuestionsText6: ; 1ea85 (7:6a85) db "@" CinnabarGymQuiz_1ea8a: ; 1ea8a (7:6a8a) - ld hl, wd79c + EventFlagAddress hl, EVENT_2A8 predef_jump FlagActionPredef CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) @@ -208,6 +206,7 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) ld hl, CinnabarGymQuizCorrectText call PrintText ld a, [$ffe0] + AdjustEventBit EVENT_2A8, 0 ld c, a ld b, FLAG_SET call CinnabarGymQuiz_1ea8a @@ -221,9 +220,10 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) call PrintText ld a, [$ffdb] add $2 + AdjustEventBit EVENT_29A, 2 ld c, a ld b, FLAG_TEST - ld hl, wd79a + EventFlagAddress hl, EVENT_29A predef FlagActionPredef ld a, c and a @@ -240,6 +240,7 @@ CinnabarGymQuizCorrectText: ; 1eae3 (7:6ae3) TX_ASM ld a, [$ffe0] + AdjustEventBit EVENT_2A8, 0 ld c, a ld b, FLAG_TEST call CinnabarGymQuiz_1ea8a @@ -277,6 +278,7 @@ CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a) push bc ld a, [$ffdb] ld [$ffe0], a + AdjustEventBit EVENT_2A8, 0 ld c, a ld b, FLAG_TEST call CinnabarGymQuiz_1ea8a @@ -320,12 +322,11 @@ BillsHousePC: ; 1eb6e (7:6b6e) ld a, [wSpriteStateData1 + 9] cp SPRITE_FACING_UP ret nz - ld a, [wd7f2] - bit 7, a + CheckEvent EVENT_55F jr nz, .asm_1ebd2 - bit 3, a + CheckEventReuseA EVENT_55B jr nz, .asm_1eb86 - bit 6, a + CheckEventReuseA EVENT_55E jr nz, .asm_1eb8b .asm_1eb86 tx_pre_jump BillsHouseMonitorText @@ -354,8 +355,7 @@ BillsHousePC: ; 1eb6e (7:6b6e) call PlaySound call WaitForSoundToFinish call PlayDefaultMusic - ld hl, wd7f2 - set 3, [hl] + SetEvent EVENT_55B ret .asm_1ebd2 ld a, $1 diff --git a/engine/items/items.asm b/engine/items/items.asm index f2c41ef6..a7c731c2 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -432,8 +432,7 @@ ItemUseBall: ; d687 (3:5687) call ClearSprites call SendNewMonToBox ld hl,ItemUseBallText07 - ld a,[wd7f1] - bit 0,a ;already met Bill? + CheckEvent EVENT_550 jr nz,.sendToBox2 ld hl,ItemUseBallText08 .sendToBox2 @@ -1375,8 +1374,7 @@ ItemUseEscapeRope: ; dfaf (3:5faf) set 6,[hl] ld hl,wd72e res 4,[hl] - ld hl,wd790 - res 7,[hl] ; unset Safari Zone bit + ResetEvent EVENT_IN_SAFARI_ZONE xor a ld [W_NUMSAFARIBALLS],a ld [W_SAFARIZONEENTRANCECURSCRIPT],a @@ -1584,8 +1582,7 @@ ItemUsePokeflute: ; e140 (3:6140) ld a,[W_CURMAP] cp a,ROUTE_12 jr nz,.notRoute12 - ld a,[wd7d8] - bit 7,a ; has the player beaten Route 12 Snorlax yet? + CheckEvent EVENT_BEAT_ROUTE12_SNORLAX jr nz,.noSnorlaxToWakeUp ; if the player hasn't beaten Route 12 Snorlax ld hl,Route12SnorlaxFluteCoords @@ -1593,14 +1590,12 @@ ItemUsePokeflute: ; e140 (3:6140) jr nc,.noSnorlaxToWakeUp ld hl,PlayedFluteHadEffectText call PrintText - ld hl,wd7d8 - set 6,[hl] ; trigger Snorlax fight (handled by map script) + SetEvent EVENT_FIGHT_ROUTE12_SNORLAX ret .notRoute12 cp a,ROUTE_16 jr nz,.noSnorlaxToWakeUp - ld a,[wd7e0] - bit 1,a ; has the player beaten Route 16 Snorlax yet? + CheckEvent EVENT_BEAT_ROUTE16_SNORLAX jr nz,.noSnorlaxToWakeUp ; if the player hasn't beaten Route 16 Snorlax ld hl,Route16SnorlaxFluteCoords @@ -1608,8 +1603,7 @@ ItemUsePokeflute: ; e140 (3:6140) jr nc,.noSnorlaxToWakeUp ld hl,PlayedFluteHadEffectText call PrintText - ld hl,wd7e0 - set 0,[hl] ; trigger Snorlax fight (handled by map script) + SetEvent EVENT_FIGHT_ROUTE16_SNORLAX ret .noSnorlaxToWakeUp ld hl,PlayedFluteNoEffectText diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm index d491cd38..f9df345f 100644 --- a/engine/menu/bills_pc.asm +++ b/engine/menu/bills_pc.asm @@ -5,8 +5,7 @@ DisplayPCMainMenu:: ; 213c8 (8:53c8) ld a, [wNumHoFTeams] and a jr nz, .leaguePCAvailable - ld a, [wd74b] - bit 5, a ; received pokedex? + CheckEvent EVENT_GOT_POKEDEX jr z, .noOaksPC ld a, [wNumHoFTeams] and a @@ -29,8 +28,7 @@ DisplayPCMainMenu:: ; 213c8 (8:53c8) call UpdateSprites ld a, 3 ld [wMaxMenuItem], a - ld a, [wd7f1] - bit 0, a + CheckEvent EVENT_550 jr nz, .metBill coord hl, 2, 2 ld de, SomeonesPCText @@ -47,8 +45,7 @@ DisplayPCMainMenu:: ; 213c8 (8:53c8) ld h, b ld de, PlayersPCText call PlaceString - ld a, [wd74b] - bit 5, a ; received pokedex? + CheckEvent EVENT_GOT_POKEDEX jr z, .noOaksPC2 coord hl, 2, 6 ld de, OaksPCText diff --git a/engine/menu/pc.asm b/engine/menu/pc.asm index b5281964..43bd8452 100755 --- a/engine/menu/pc.asm +++ b/engine/menu/pc.asm @@ -74,8 +74,7 @@ BillsPC: ; 17ee4 (5:7ee4) ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish - ld a, [wd7f1] ;has to do with having met Bill - bit 0, a + CheckEvent EVENT_550 jr nz, .billsPC ;if you've met bill, use that bill's instead of someone's ld hl, AccessedSomeonesPCText jr .printText diff --git a/engine/menu/start_menu.asm b/engine/menu/start_menu.asm index bd876f5b..3c48e6ed 100755 --- a/engine/menu/start_menu.asm +++ b/engine/menu/start_menu.asm @@ -24,8 +24,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf) and a jr nz,.loop ; if the player pressed tried to go past the top item, wrap around to the bottom - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? + CheckEvent EVENT_GOT_POKEDEX ld a,6 ; there are 7 menu items with the pokedex, so the max index is 6 jr nz,.wrapMenuItemId dec a ; there are only 6 menu items without the pokedex @@ -37,8 +36,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf) bit 7,a jr z,.buttonPressed ; if the player pressed tried to go past the bottom item, wrap around to the top - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? + CheckEvent EVENT_GOT_POKEDEX ld a,[wCurrentMenuItem] ld c,7 ; there are 7 menu items with the pokedex jr nz,.checkIfPastBottom @@ -59,8 +57,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf) and a,%00001010 ; was the Start button or B button pressed? jp nz,CloseStartMenu call SaveScreenTilesToBuffer2 ; copy background from wTileMap to wTileMapBackup2 - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? + CheckEvent EVENT_GOT_POKEDEX ld a,[wCurrentMenuItem] jr nz,.displayMenuItem inc a ; adjust position to account for missing pokedex menu item diff --git a/engine/overworld/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm index 2a9b19fe..65837150 100755 --- a/engine/overworld/cable_club_npc.asm +++ b/engine/overworld/cable_club_npc.asm @@ -1,8 +1,7 @@ CableClubNPC: ; 71c5 (1:71c5) ld hl, CableClubNPCWelcomeText call PrintText - ld a, [wd74b] - bit 5, a ; received pokedex? + CheckEvent EVENT_GOT_POKEDEX jp nz, .receivedPokedex ; if the player hasn't received the pokedex ld c, 60 diff --git a/engine/overworld/cinnabar_lab.asm b/engine/overworld/cinnabar_lab.asm index 18ce23ed..5cc5536c 100755 --- a/engine/overworld/cinnabar_lab.asm +++ b/engine/overworld/cinnabar_lab.asm @@ -65,9 +65,7 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006) callba RemoveItemByID ld hl, LabFossil_610b8 call PrintText - ld hl, wd7a3 - set 0, [hl] - set 1, [hl] + SetEvents EVENT_2E0, EVENT_2E1 ret .asm_610a7 ld hl, LabFossil_610bd diff --git a/engine/pokedex_rating.asm b/engine/pokedex_rating.asm index 881c9716..2d7073df 100755 --- a/engine/pokedex_rating.asm +++ b/engine/pokedex_rating.asm @@ -23,10 +23,7 @@ DisplayDexRating: ; 44169 (11:4169) ld a, [hli] ld h, [hl] ld l, a ; load text pointer into hl - ld a, [wd747] - bit 3, a - res 3, a - ld [wd747], a + CheckAndResetEventA EVENT_003 jr nz, .label3 push hl ld hl, PokedexRatingText_441cc diff --git a/home/overworld.asm b/home/overworld.asm index cc5e9f5e..9b60d7e9 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -287,8 +287,7 @@ OverworldLoopLessDelay:: ld hl,wd72c res 0,[hl] ; indicate that the player has stepped thrice since the last battle .doneStepCounting - ld a,[wd790] - bit 7,a ; in the safari zone? + CheckEvent EVENT_IN_SAFARI_ZONE jr z,.notSafariZone callba SafariZoneCheckSteps ld a,[wSafariZoneGameOver] @@ -320,8 +319,7 @@ OverworldLoopLessDelay:: ld a,[W_CURMAP] cp a,CINNABAR_GYM jr nz,.notCinnabarGym - ld hl,wd79b - set 7,[hl] + SetEvent EVENT_2A7 .notCinnabarGym ld hl,wd72e set 5,[hl] diff --git a/macros.asm b/macros.asm index 659b0722..11f0f37b 100644 --- a/macros.asm +++ b/macros.asm @@ -79,6 +79,432 @@ bcd3: MACRO coins equs "bcd2" money equs "bcd3" +;\1 = event index +;\2 = return result in carry instead of zero flag +CheckEvent: MACRO +event_byte = ((\1) / 8) + ld a, [wEventFlags + event_byte] + + IF _NARG > 1 + IF ((\1) % 8) == 7 + add a + ELSE + REPT ((\1) % 8) + 1 + rrca + ENDR + ENDC + ELSE + bit (\1) % 8, a + ENDC + ENDM + +;\1 = event index +CheckEventReuseA: MACRO +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld a, [wEventFlags + event_byte] + ENDC + + bit (\1) % 8, a + ENDM + +;\1 = reg +;\2 = event index +;\3 = event index this event is relative to (optional, this is needed when there is a fixed flag address) +EventFlagBit: MACRO + IF _NARG > 2 + ld \1, ((\3) % 8) + ((\2) - (\3)) + ELSE + ld \1, (\2) % 8 + ENDC + ENDM + +;\1 = reg +;\2 = event index +EventFlagAddress: MACRO +event_byte = ((\2) / 8) + ld \1, wEventFlags + event_byte + ENDM + +;\1 = event index +CheckEventHL: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + bit (\1) % 8, [hl] + ENDM + +;\1 = event index +CheckEventReuseHL: MACRO +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + bit (\1) % 8, [hl] + ENDM + +; dangerous, only use when HL is guaranteed to be the desired value +;\1 = event index +CheckEventForceReuseHL: MACRO +event_byte = ((\1) / 8) + bit (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index of the last event used before the branch +CheckEventAfterBranchReuseHL: MACRO +event_byte = ((\2) / 8) +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + bit (\1) % 8, [hl] + ENDM + +;\1 = event index +CheckAndSetEvent: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + bit (\1) % 8, [hl] + set (\1) % 8, [hl] + ENDM + +;\1 = event index +CheckAndResetEvent: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + bit (\1) % 8, [hl] + res (\1) % 8, [hl] + ENDM + +;\1 = event index +CheckAndSetEventA: MACRO + ld a, [wEventFlags + ((\1) / 8)] + bit (\1) % 8, a + set (\1) % 8, a + ld [wEventFlags + ((\1) / 8)], a + ENDM + +;\1 = event index +CheckAndResetEventA: MACRO + ld a, [wEventFlags + ((\1) / 8)] + bit (\1) % 8, a + res (\1) % 8, a + ld [wEventFlags + ((\1) / 8)], a + ENDM + +;\1 = event index +SetEvent: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + set (\1) % 8, [hl] + ENDM + +;\1 = event index +SetEventReuseHL: MACRO + IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + set (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index of the last event used before the branch +SetEventAfterBranchReuseHL: MACRO +event_byte = ((\2) / 8) +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + set (\1) % 8, [hl] + ENDM + +; dangerous, only use when HL is guaranteed to be the desired value +;\1 = event index +SetEventForceReuseHL: MACRO +event_byte = ((\1) / 8) + set (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index +;\3 = event index (optional) +SetEvents: MACRO + SetEvent \1 + SetEventReuseHL \2 + + IF _NARG > 2 + SetEventReuseHL \3 + ENDC + ENDM + +;\1 = event index +ResetEvent: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + res (\1) % 8, [hl] + ENDM + +;\1 = event index +ResetEventReuseHL: MACRO + IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + res (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index of the last event used before the branch +ResetEventAfterBranchReuseHL: MACRO +event_byte = ((\2) / 8) +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + res (\1) % 8, [hl] + ENDM + +; dangerous, only use when HL is guaranteed to be the desired value +;\1 = event index +ResetEventForceReuseHL: MACRO +event_byte = ((\1) / 8) + res (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index +;\3 = event index (optional) +ResetEvents: MACRO + ResetEvent \1 + ResetEventReuseHL \2 + + IF _NARG > 2 + ResetEventReuseHL \3 + ENDC + ENDM + +;\1 = event index +;\2 = number of bytes away from the base address (optional, for matching the ROM) +dbEventFlagBit: MACRO + IF _NARG > 1 + db ((\1) % 8) + ((\2) * 8) + ELSE + db ((\1) % 8) + ENDC + ENDM + +;\1 = event index +;\2 = number of bytes away from the base address (optional, for matching the ROM) +dwEventFlagAddress: MACRO + IF _NARG > 1 + dw wEventFlags + ((\1) / 8) - (\2) + ELSE + dw wEventFlags + ((\1) / 8) + ENDC + ENDM + +;\1 = start +;\2 = end +SetEventRange: MACRO +event_start_byte = ((\1) / 8) +event_end_byte = ((\2) / 8) + + IF event_end_byte < event_start_byte + FAIL "Incorrect argument order in SetEventRange." + ENDC + + IF event_start_byte == event_end_byte + ld a, [wEventFlags + event_start_byte] + or (1 << (((\2) % 8) + 1)) - (1 << ((\1) % 8)) + ld [wEventFlags + event_start_byte], a + ELSE +event_fill_start = event_start_byte + 1 +event_fill_count = event_end_byte - event_start_byte - 1 + + IF ((\1) % 8) == 0 +event_fill_start = -1 + event_fill_start +event_fill_count = 1 + event_fill_count + ELSE + ld a, [wEventFlags + event_start_byte] + or $ff - ((1 << ((\1) % 8)) - 1) + ld [wEventFlags + event_start_byte], a + ENDC + + IF ((\2) % 8) == 7 +event_fill_count = 1 + event_fill_count + ENDC + + IF event_fill_count == 1 + ld hl, wEventFlags + event_fill_start + ld [hl], $ff + ENDC + + IF event_fill_count > 1 + ld a, $ff + ld hl, wEventFlags + event_fill_start + + REPT -1 + event_fill_count + ld [hli], a + ENDR + + ld [hl], a + ENDC + + IF ((\2) % 8) == 0 + ld hl, wEventFlags + event_end_byte + set 0, [hl] + ELSE + IF ((\2) % 8) != 7 + ld a, [wEventFlags + event_end_byte] + or (1 << (((\2) % 8) + 1)) - 1 + ld [wEventFlags + event_end_byte], a + ENDC + ENDC + ENDC + ENDM + +;\1 = start +;\2 = end +;\3 = assume a is 0 if present +ResetEventRange: MACRO +event_start_byte = ((\1) / 8) +event_end_byte = ((\2) / 8) + + IF event_end_byte < event_start_byte + FAIL "Incorrect argument order in ResetEventRange." + ENDC + + IF event_start_byte == event_end_byte + ld a, [wEventFlags + event_start_byte] + and ~((1 << (((\2) % 8) + 1)) - (1 << ((\1) % 8))) & $ff + ld [wEventFlags + event_start_byte], a + ELSE +event_fill_start = event_start_byte + 1 +event_fill_count = event_end_byte - event_start_byte - 1 + + IF ((\1) % 8) == 0 +event_fill_start = -1 + event_fill_start +event_fill_count = 1 + event_fill_count + ELSE + ld a, [wEventFlags + event_start_byte] + and ~($ff - ((1 << ((\1) % 8)) - 1)) & $ff + ld [wEventFlags + event_start_byte], a + ENDC + + IF ((\2) % 8) == 7 +event_fill_count = 1 + event_fill_count + ENDC + + IF event_fill_count == 1 + ld hl, wEventFlags + event_fill_start + ld [hl], 0 + ENDC + + IF event_fill_count > 1 + ld hl, wEventFlags + event_fill_start + + ; force xor a if we just to wrote to it above + IF (_NARG < 3) || (((\1) % 8) != 0) + xor a + ENDC + + REPT -1 + event_fill_count + ld [hli], a + ENDR + + ld [hl], a + ENDC + + IF ((\2) % 8) == 0 + ld hl, wEventFlags + event_end_byte + res 0, [hl] + ELSE + IF ((\2) % 8) != 7 + ld a, [wEventFlags + event_end_byte] + and ~((1 << (((\2) % 8) + 1)) - 1) $ ff + ld [wEventFlags + event_end_byte], a + ENDC + ENDC + ENDC + ENDM + +; returns whether both events are set in Z flag +;\1 = event index 1 +;\2 = event index 2 +CheckBothEventsSet: MACRO + IF ((\1) / 8) == ((\2) / 8) + ld a, [wEventFlags + ((\1) / 8)] + and (1 << ((\1) % 8)) | (1 << ((\2) % 8)) + cp (1 << ((\1) % 8)) | (1 << ((\2) % 8)) + ELSE + ; This case doesn't happen in the original ROM. + IF ((\1) % 8) == ((\2) % 8) + push hl + ld a, [wEventFlags + ((\1) / 8)] + ld hl, wEventFlags + ((\2) / 8) + and [hl] + cpl + bit ((\1) % 8), a + pop hl + ELSE + push bc + ld a, [wEventFlags + ((\1) / 8)] + and (1 << ((\1) % 8)) + ld b, a + ld a, [wEventFlags + ((\2) / 8)] + and (1 << ((\2) % 8)) + or b + cp (1 << ((\1) % 8)) | (1 << ((\2) % 8)) + pop bc + ENDC + ENDC + ENDM + +; returns the complement of whether either event is set in Z flag +;\1 = event index 1 +;\2 = event index 2 +CheckEitherEventSet: MACRO + IF ((\1) / 8) == ((\2) / 8) + ld a, [wEventFlags + ((\1) / 8)] + and (1 << ((\1) % 8)) | (1 << ((\2) % 8)) + ELSE + ; This case doesn't happen in the original ROM. + IF ((\1) % 8) == ((\2) % 8) + push hl + ld a, [wEventFlags + ((\1) / 8)] + ld hl, wEventFlags + ((\2) / 8) + or [hl] + bit ((\1) % 8), a + pop hl + ELSE + push bc + ld a, [wEventFlags + ((\1) / 8)] + and (1 << ((\1) % 8)) + ld b, a + ld a, [wEventFlags + ((\2) / 8)] + and (1 << ((\2) % 8)) + or b + pop bc + ENDC + ENDC + ENDM + +; for handling fixed event bits when events are inserted/removed +;\1 = event index +;\2 = fixed flag bit +AdjustEventBit: MACRO + IF ((\1) % 8) != (\2) + add ((\1) % 8) - (\2) + ENDC + ENDM + ;\1 = r ;\2 = X ;\3 = Y diff --git a/main.asm b/main.asm index 2261acb8..ea13bd64 100755 --- a/main.asm +++ b/main.asm @@ -1002,8 +1002,7 @@ DisplayTextIDInit: ; 7096 (1:7096) ; if text ID is 0 (i.e. the start menu) ; Note that the start menu text border is also drawn in the function directly ; below this, so this seems unnecessary. - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? + CheckEvent EVENT_GOT_POKEDEX ; start menu with pokedex coord hl, 10, 0 ld b,$0e @@ -1071,8 +1070,7 @@ DisplayTextIDInit: ; 7096 (1:7096) ; function that displays the start menu DrawStartMenu: ; 710b (1:710b) - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? + CheckEvent EVENT_GOT_POKEDEX ; menu with pokedex coord hl, 10, 0 ld b,$0e @@ -1098,8 +1096,7 @@ DrawStartMenu: ; 710b (1:710b) ld hl,wd730 set 6,[hl] ; no pauses between printing each letter coord hl, 12, 2 - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? + CheckEvent EVENT_GOT_POKEDEX ; case for not having pokdex ld a,$06 jr z,.storeMenuItemCount @@ -2763,9 +2760,7 @@ CheckForForcedBikeSurf: ; cdc0 (3:4dc0) ld a, [W_CURMAP] cp SEAFOAM_ISLANDS_5 ret nz - ld a, [wd881] - and $3 - cp $3 + CheckBothEventsSet EVENT_9D0, EVENT_9D1 ret z ld hl, CoordsData_cdf7 call ArePlayerCoordsInArray diff --git a/scripts/agatha.asm b/scripts/agatha.asm index 850cc0bb..c9df27d2 100755 --- a/scripts/agatha.asm +++ b/scripts/agatha.asm @@ -13,8 +13,7 @@ AgathaScript_76443: ; 76443 (1d:6443) bit 5, [hl] res 5, [hl] ret z - ld a, [wd865] - bit 1, a + CheckEvent EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 jr z, .asm_76457 ld a, $e jp AgathaScript_76459 @@ -70,9 +69,7 @@ AgathaScript0: ; 76490 (1d:6490) ld a, [wCoordIndex] cp $3 jr c, .asm_764b4 - ld hl, wd865 - bit 6, [hl] - set 6, [hl] + CheckAndSetEvent EVENT_8F6 jr z, AgathaScript_76474 .asm_764b4 ld a, $2 @@ -124,9 +121,9 @@ AgathaTextPointers: ; 76505 (1d:6505) AgathaTrainerHeaders: ; 76509 (1d:6509) AgathaTrainerHeader0: ; 76509 (1d:6509) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd865 ; flag's byte + dwEventFlagAddress EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 dw AgathaBeforeBattleText ; TextBeforeBattle dw AgathaAfterBattleText ; TextAfterBattle dw AgathaEndBattleText ; TextEndBattle diff --git a/scripts/bikeshop.asm b/scripts/bikeshop.asm index 6779d9f6..bdae3536 100755 --- a/scripts/bikeshop.asm +++ b/scripts/bikeshop.asm @@ -8,8 +8,7 @@ BikeShopTextPointers: ; 1d73f (7:573f) BikeShopText1: ; 1d745 (7:5745) TX_ASM - ld a, [wd75f] - bit 0, a + CheckEvent EVENT_0C0 jr z, .asm_260d4 ld hl, BikeShopText_1d82f call PrintText @@ -26,8 +25,7 @@ BikeShopText1: ; 1d745 (7:5745) ld a, BIKE_VOUCHER ld [$ffdb], a callba RemoveItemByID - ld hl, wd75f - set 0, [hl] + SetEvent EVENT_0C0 ld hl, BikeShopText_1d824 call PrintText jr .Done @@ -131,8 +129,7 @@ BikeShopText_1d843: ; 1d843 (7:5843) BikeShopText3: ; 1d848 (7:5848) TX_ASM - ld a, [wd75f] - bit 0, a + CheckEvent EVENT_0C0 ld hl, BikeShopText_1d861 jr nz, .asm_34d2d ld hl, BikeShopText_1d85c diff --git a/scripts/billshouse.asm b/scripts/billshouse.asm index 115b3b19..b7e85f9a 100755 --- a/scripts/billshouse.asm +++ b/scripts/billshouse.asm @@ -51,8 +51,7 @@ BillsHouseScript2: ; 1e7a6 (7:67a6) ld a, HS_BILL_POKEMON ld [wcc4d], a predef HideObject - ld hl, wd7f2 - set 6, [hl] + SetEvent EVENT_55E xor a ld [wJoyIgnore], a ld a, $3 @@ -60,8 +59,7 @@ BillsHouseScript2: ; 1e7a6 (7:67a6) ret BillsHouseScript3: ; 1e7c5 (7:67c5) - ld a, [wd7f2] - bit 3, a + CheckEvent EVENT_55B ret z ld a, $f0 ld [wJoyIgnore], a @@ -103,10 +101,8 @@ BillsHouseScript4: ; 1e80d (7:680d) ret nz xor a ld [wJoyIgnore], a - ld hl, wd7f2 - set 5, [hl] - ld hl, wd7f1 - set 0, [hl] + SetEvent EVENT_55D + SetEvent EVENT_550 ld a, $0 ld [W_BILLSHOUSECURSCRIPT], a ret @@ -163,8 +159,7 @@ BillsHouseText_1e86f: ; 1e86f (7:686f) BillsHouseText2: ; 1e874 (7:6874) TX_ASM - ld a, [wd7f2] - bit 4, a + CheckEvent EVENT_55C jr nz, .asm_1e8a9 ld hl, BillThankYouText call PrintText @@ -173,8 +168,7 @@ BillsHouseText2: ; 1e874 (7:6874) jr nc, .BagFull ld hl, SSTicketReceivedText call PrintText - ld hl, wd7f2 - set 4, [hl] + SetEvent EVENT_55C ld a, HS_CERULEAN_GUARD_1 ld [wcc4d], a predef ShowObject diff --git a/scripts/blueshouse.asm b/scripts/blueshouse.asm index 5d6f1f83..17b182f5 100755 --- a/scripts/blueshouse.asm +++ b/scripts/blueshouse.asm @@ -9,8 +9,7 @@ BluesHouseScriptPointers: ; 19b47 (6:5b47) dw BluesHouseScript1 BluesHouseScript0: ; 19b4b (6:5b4b) - ld hl,wd74a - set 1,[hl] + SetEvent EVENT_019 ; trigger the next script ld a,1 @@ -27,11 +26,9 @@ BluesHouseTextPointers: ; 19b57 (6:5b57) BluesHouseText1: ; 19b5d (6:5b5d) TX_ASM - ld a,[wd74a] - bit 0,a + CheckEvent EVENT_018 jr nz,.GotMap - ld a,[wd74b] - bit 5,a + CheckEvent EVENT_GOT_POKEDEX jr nz,.GiveMap ld hl,DaisyInitialText call PrintText @@ -47,8 +44,7 @@ BluesHouseText1: ; 19b5d (6:5b5d) predef HideObject ; hide table map object ld hl,GotMapText call PrintText - ld hl,wd74a - set 0,[hl] + SetEvent EVENT_018 jr .done .GotMap ld hl,DaisyUseMapText diff --git a/scripts/bruno.asm b/scripts/bruno.asm index 76a5919a..9cd55193 100755 --- a/scripts/bruno.asm +++ b/scripts/bruno.asm @@ -13,8 +13,7 @@ BrunoScript_762ec: ; 762ec (1d:62ec) bit 5, [hl] res 5, [hl] ret z - ld a, [wd864] - bit 1, a + CheckEvent EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 jr z, .asm_76300 ld a, $5 jp BrunoScript_76302 @@ -70,9 +69,7 @@ BrunoScript0: ; 76339 (1d:6339) ld a, [wCoordIndex] cp $3 jr c, .asm_7635d - ld hl, wd864 - bit 6, [hl] - set 6, [hl] + CheckAndSetEvent EVENT_8EE jr z, BrunoScript_7631d .asm_7635d ld a, $2 @@ -121,9 +118,9 @@ BrunoTextPointers: ; 763a8 (1d:63a8) BrunoTrainerHeaders: ; 763ac (1d:63ac) BrunoTrainerHeader0: ; 763ac (1d:63ac) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd864 ; flag's byte + dwEventFlagAddress EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 dw BrunoBeforeBattleText ; TextBeforeBattle dw BrunoAfterBattleText ; TextAfterBattle dw BrunoEndBattleText ; TextEndBattle diff --git a/scripts/celadoncity.asm b/scripts/celadoncity.asm index 9107d254..65e71cca 100755 --- a/scripts/celadoncity.asm +++ b/scripts/celadoncity.asm @@ -1,10 +1,7 @@ CeladonCityScript: ; 19956 (6:5956) call EnableAutoTextBoxDrawing - ld hl, wd77e - res 0, [hl] - res 7, [hl] - ld hl, wd816 - res 7, [hl] + ResetEvents EVENT_1B8, EVENT_1BF + ResetEvent EVENT_67F ret CeladonCityTextPointers: ; 19966 (6:5966) @@ -45,8 +42,7 @@ CeladonCityText4: ; 19999 (6:5999) CeladonCityText5: ; 1999e (6:599e) TX_ASM - ld a, [wd777] - bit 0, a + CheckEvent EVENT_180 jr nz, .asm_7053f ld hl, TM41PreText call PrintText @@ -59,8 +55,7 @@ CeladonCityText5: ; 1999e (6:599e) .Success ld hl, ReceivedTM41Text call PrintText - ld hl, wd777 - set 0, [hl] + SetEvent EVENT_180 jr .Done .asm_7053f ld hl, TM41ExplanationText diff --git a/scripts/celadondiner.asm b/scripts/celadondiner.asm index f6db1606..d4d4b84b 100755 --- a/scripts/celadondiner.asm +++ b/scripts/celadondiner.asm @@ -27,16 +27,14 @@ CeladonDinerText4: ; 4916e (12:516e) CeladonDinerText5: ; 49173 (12:5173) TX_ASM - ld a, [wd783] - bit 0, a + CheckEvent EVENT_1E0 jr nz, .asm_eb14d ld hl, CeladonDinerText_491a7 call PrintText ld bc, (COIN_CASE << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, wd783 - set 0, [hl] + SetEvent EVENT_1E0 ld hl, ReceivedCoinCaseText call PrintText jr .asm_68b61 diff --git a/scripts/celadongamecorner.asm b/scripts/celadongamecorner.asm index c8d07058..51ffef89 100755 --- a/scripts/celadongamecorner.asm +++ b/scripts/celadongamecorner.asm @@ -28,8 +28,7 @@ CeladonGameCornerScript_48bec: ; 48bec (12:4bec) bit 5, [hl] res 5, [hl] ret z - ld a, [wd77e] - bit 1, a + CheckEvent EVENT_1B9 ret nz ld a, $2a ld [wd09f], a @@ -227,8 +226,7 @@ CeladonGameCornerText4: ; 48d45 (12:4d45) CeladonGameCornerText5: ; 48d4a (12:4d4a) TX_ASM - ld a, [wd77e] - bit 2, a + CheckEvent EVENT_1BA jr nz, .asm_48d89 ld hl, CeladonGameCornerText_48d9c call PrintText @@ -246,8 +244,7 @@ CeladonGameCornerText5: ; 48d4a (12:4d4a) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - ld hl, wd77e - set 2, [hl] + SetEvent EVENT_1BA ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, Received10CoinsText @@ -286,8 +283,7 @@ CeladonGameCornerText6: ; 48db1 (12:4db1) CeladonGameCornerText7: ; 48db6 (12:4db6) TX_ASM - ld a, [wd77c] - bit 1, a + CheckEvent EVENT_1A9 ld hl, CeladonGameCornerText_48dca jr z, .asm_48dc4 ld hl, CeladonGameCornerText_48dcf @@ -309,8 +305,7 @@ CeladonGameCornerText8: ; 48dd4 (12:4dd4) CeladonGameCornerText9: ; 48dd9 (12:4dd9) TX_ASM - ld a, [wd77e] - bit 4, a + CheckEvent EVENT_1BC jr nz, .asm_48e13 ld hl, CeladonGameCornerText_48e26 call PrintText @@ -328,8 +323,7 @@ CeladonGameCornerText9: ; 48dd9 (12:4dd9) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - ld hl, wd77e - set 4, [hl] + SetEvent EVENT_1BC ld hl, Received20CoinsText jr .asm_48e20 .asm_48e13 @@ -362,8 +356,7 @@ CeladonGameCornerText_48e36: ; 48e36 (12:4e36) CeladonGameCornerText10: ; 48e3b (12:4e3b) TX_ASM - ld a, [wd77e] - bit 3, a + CheckEvent EVENT_1BB jr nz, .asm_48e75 ld hl, CeladonGameCornerText_48e88 call PrintText @@ -381,8 +374,7 @@ CeladonGameCornerText10: ; 48e3b (12:4e3b) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - ld hl, wd77e - set 3, [hl] + SetEvent EVENT_1BB ld hl, CeladonGameCornerText_48e8d jr .asm_48e82 .asm_48e75 @@ -457,8 +449,7 @@ CeladonGameCornerText12: ; 48edd (12:4edd) ld a, SFX_GO_INSIDE call PlaySound call WaitForSoundToFinish - ld hl, wd77e - set 1, [hl] + SetEvent EVENT_1B9 ld a, $43 ld [wd09f], a ld bc, $0208 diff --git a/scripts/celadongym.asm b/scripts/celadongym.asm index b978b272..1e2959dd 100755 --- a/scripts/celadongym.asm +++ b/scripts/celadongym.asm @@ -46,16 +46,14 @@ CeladonGymText_48963: ; 48963 (12:4963) ld a, $9 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd77c - set 1, [hl] + SetEvent EVENT_1A9 ld bc, (TM_21 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd77c - set 0, [hl] + SetEvent EVENT_1A8 jr .asm_4898c .BagFull ld a, $b @@ -68,11 +66,7 @@ CeladonGymText_48963: ; 48963 (12:4963) set 3, [hl] ; deactivate gym trainers - ld a, [wd77c] - or %11111100 - ld [wd77c], a - ld hl, wd77d - set 0, [hl] + SetEventRange EVENT_BEAT_CELADON_GYM_TRAINER_0, EVENT_BEAT_CELADON_GYM_TRAINER_7 jp CeladonGymText_48943 @@ -91,63 +85,63 @@ CeladonGymTextPointers: ; 489a6 (12:49a6) CeladonGymTrainerHeaders: ; 489bc (12:49bc) CeladonGymTrainerHeader0: ; 489bc (12:49bc) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_0 dw CeladonGymBattleText2 ; TextBeforeBattle dw CeladonGymAfterBattleText2 ; TextAfterBattle dw CeladonGymEndBattleText2 ; TextEndBattle dw CeladonGymEndBattleText2 ; TextEndBattle CeladonGymTrainerHeader2: ; 489c8 (12:49c8) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_2 dw CeladonGymBattleText3 ; TextBeforeBattle dw CeladonGymAfterBattleText3 ; TextAfterBattle dw CeladonGymEndBattleText3 ; TextEndBattle dw CeladonGymEndBattleText3 ; TextEndBattle CeladonGymTrainerHeader3: ; 489d4 (12:49d4) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_3 dw CeladonGymBattleText4 ; TextBeforeBattle dw CeladonGymAfterBattleText4 ; TextAfterBattle dw CeladonGymEndBattleText4 ; TextEndBattle dw CeladonGymEndBattleText4 ; TextEndBattle CeladonGymTrainerHeader4: ; 489e0 (12:49e0) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_4 dw CeladonGymBattleText5 ; TextBeforeBattle dw CeladonGymAfterBattleText5 ; TextAfterBattle dw CeladonGymEndBattleText5 ; TextEndBattle dw CeladonGymEndBattleText5 ; TextEndBattle CeladonGymTrainerHeader5: ; 489ec (12:49ec) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_5 db ($2 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_5 dw CeladonGymBattleText6 ; TextBeforeBattle dw CeladonGymAfterBattleText6 ; TextAfterBattle dw CeladonGymEndBattleText6 ; TextEndBattle dw CeladonGymEndBattleText6 ; TextEndBattle CeladonGymTrainerHeader6: ; 489f8 (12:49f8) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_6 db ($2 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_6 dw CeladonGymBattleText7 ; TextBeforeBattle dw CeladonGymAfterBattleText7 ; TextAfterBattle dw CeladonGymEndBattleText7 ; TextEndBattle dw CeladonGymEndBattleText7 ; TextEndBattle CeladonGymTrainerHeader7: ; 48a04 (12:4a04) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_7, 1 db ($3 << 4) ; trainer's view range - dw wd77c ; flag's byte + dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_7, 1 dw CeladonGymBattleText8 ; TextBeforeBattle dw CeladonGymAfterBattleText8 ; TextAfterBattle dw CeladonGymEndBattleText8 ; TextEndBattle @@ -157,10 +151,9 @@ CeladonGymTrainerHeader7: ; 48a04 (12:4a04) CeladonGymText1: ; 48a11 (12:4a11) TX_ASM - ld a, [wd77c] - bit 1, a + CheckEvent EVENT_1A9 jr z, .asm_48a2d - bit 0, a + CheckEventReuseA EVENT_1A8 jr nz, .asm_48a25 call z, CeladonGymText_48963 call DisableWaitingAfterTextDisplay diff --git a/scripts/celadonmart3.asm b/scripts/celadonmart3.asm index 46e58d8c..6e17ac77 100755 --- a/scripts/celadonmart3.asm +++ b/scripts/celadonmart3.asm @@ -22,16 +22,14 @@ CeladonMart3TextPointers: ; 48228 (12:4228) CeladonMart3Text1: ; 4824a (12:424a) TX_ASM - ld a, [wd778] - bit 7, a + CheckEvent EVENT_18F jr nz, .asm_a5463 ld hl, TM18PreReceiveText call PrintText ld bc, (TM_18 << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, wd778 - set 7, [hl] + SetEvent EVENT_18F ld hl, ReceivedTM18Text jr .asm_81359 .BagFull diff --git a/scripts/celadonmartroof.asm b/scripts/celadonmartroof.asm index f83e466d..e509ffeb 100755 --- a/scripts/celadonmartroof.asm +++ b/scripts/celadonmartroof.asm @@ -83,8 +83,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr z, .asm_484b6 cp SODA_POP jr z, .asm_48492 - ld a, [wd778] - bit 6, a + CheckEvent EVENT_18E jr nz, .asm_484e0 ld hl, CeladonMartRoofText_48515 call PrintText @@ -94,12 +93,10 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, ReceivedTM49Text call PrintText - ld hl, wd778 - set 6, [hl] + SetEvent EVENT_18E ret .asm_48492 - ld a, [wd778] - bit 5, a + CheckEvent EVENT_18D jr nz, .asm_484e0 ld hl, CeladonMartRoofText_48504 call PrintText @@ -109,12 +106,10 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, CeladonMartRoofText_4850a call PrintText - ld hl, wd778 - set 5, [hl] + SetEvent EVENT_18D ret .asm_484b6 - ld a, [wd778] - bit 4, a + CheckEvent EVENT_18C jr nz, .asm_484e0 ld hl, CeladonMartRoofText_484f3 call PrintText @@ -124,8 +119,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, CeladonMartRoofText_484f9 call PrintText - ld hl, wd778 - set 4, [hl] + SetEvent EVENT_18C ret .BagFull ld hl, CeladonMartRoofText_48526 diff --git a/scripts/ceruleancity.asm b/scripts/ceruleancity.asm index 48480167..b009ca95 100755 --- a/scripts/ceruleancity.asm +++ b/scripts/ceruleancity.asm @@ -25,8 +25,7 @@ CeruleanCityScript4: ; 194a7 (6:54a7) jp z, CeruleanCityScript_1948c ld a, $f0 ld [wJoyIgnore], a - ld hl, wd75b - set 7, [hl] + SetEvent EVENT_0A7 ld a, $2 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -36,8 +35,7 @@ CeruleanCityScript4: ; 194a7 (6:54a7) ret CeruleanCityScript0: ; 194c8 (6:54c8) - ld a, [wd75b] - bit 7, a + CheckEvent EVENT_0A7 jr nz, .asm_194f7 ld hl, CeruleanCityCoords1 call ArePlayerCoordsInArray @@ -58,8 +56,7 @@ CeruleanCityScript0: ; 194c8 (6:54c8) ld [hSpriteIndexOrTextID], a jp DisplayTextID .asm_194f7 - ld a, [wd75a] - bit 0, a + CheckEvent EVENT_098 ret nz ld hl, CeruleanCityCoords2 call ArePlayerCoordsInArray @@ -170,8 +167,7 @@ CeruleanCityScript2: ; 195b1 (6:55b1) call CeruleanCityScript_1955d ld a, $f0 ld [wJoyIgnore], a - ld hl, wd75a - set 0, [hl] + SetEvent EVENT_098 ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -252,8 +248,7 @@ CeruleanCityTextPointers: ; 1962d (6:562d) CeruleanCityText1: ; 1964f (6:564f) TX_ASM - ld a, [wd75a] ; rival battle flag - bit 0, a + CheckEvent EVENT_098 ; do pre-battle text jr z, .PreBattleText ; or talk about bill @@ -284,8 +279,7 @@ CeruleanCityText_19677: ; 19677 (6:5677) CeruleanCityText2: ; 1967c (6:567c) TX_ASM - ld a, [wd75b] - bit 7, a + CheckEvent EVENT_0A7 jr nz, .asm_4ca20 ld hl, CeruleanCityText_196d9 call PrintText diff --git a/scripts/ceruleangym.asm b/scripts/ceruleangym.asm index 2343af03..e4c614d6 100755 --- a/scripts/ceruleangym.asm +++ b/scripts/ceruleangym.asm @@ -46,16 +46,14 @@ CeruleanGymScript_5c70d: ; 5c70d (17:470d) ld a, $5 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd75e - set 7, [hl] + SetEvent EVENT_0BF ld bc, (TM_11 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $6 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd75e - set 6, [hl] + SetEvent EVENT_0BE jr .asm_5c736 .BagFull ld a, $7 @@ -68,9 +66,7 @@ CeruleanGymScript_5c70d: ; 5c70d (17:470d) set 1, [hl] ; deactivate gym trainers - ld hl, wd75e - set 2, [hl] - set 3, [hl] + SetEvents EVENT_BEAT_CERULEAN_GYM_TRAINER_0, EVENT_BEAT_CERULEAN_GYM_TRAINER_1 jp CeruleanGymScript_5c6ed @@ -85,18 +81,18 @@ CeruleanGymTextPointers: ; 5c74a (17:474a) CeruleanGymTrainerHeaders: ; 5c758 (17:4758) CeruleanGymTrainerHeader0: ; 5c758 (17:4758) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_CERULEAN_GYM_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd75e ; flag's byte + dwEventFlagAddress EVENT_BEAT_CERULEAN_GYM_TRAINER_0 dw CeruleanGymBattleText1 ; TextBeforeBattle dw CeruleanGymAfterBattleText1 ; TextAfterBattle dw CeruleanGymEndBattleText1 ; TextEndBattle dw CeruleanGymEndBattleText1 ; TextEndBattle CeruleanGymTrainerHeader1: ; 5c764 (17:4764) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_CERULEAN_GYM_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd75e ; flag's byte + dwEventFlagAddress EVENT_BEAT_CERULEAN_GYM_TRAINER_1 dw CeruleanGymBattleText2 ; TextBeforeBattle dw CeruleanGymAfterBattleText2 ; TextAfterBattle dw CeruleanGymEndBattleText2 ; TextEndBattle @@ -106,10 +102,9 @@ CeruleanGymTrainerHeader1: ; 5c764 (17:4764) CeruleanGymText1: ; 5c771 (17:4771) TX_ASM - ld a, [wd75e] - bit 7, a + CheckEvent EVENT_0BF jr z, .asm_5c78d - bit 6, a + CheckEventReuseA EVENT_0BE jr nz, .asm_5c785 call z, CeruleanGymScript_5c70d call DisableWaitingAfterTextDisplay @@ -203,8 +198,7 @@ CeruleanGymAfterBattleText2: ; 5c80c (17:480c) CeruleanGymText4: ; 5c811 (17:4811) TX_ASM - ld a, [wd75e] - bit 7, a + CheckEvent EVENT_0BF jr nz, .asm_5c821 ld hl, CeruleanGymText_5c82a call PrintText diff --git a/scripts/cinnabargym.asm b/scripts/cinnabargym.asm index 213568d5..fe7f1c13 100755 --- a/scripts/cinnabargym.asm +++ b/scripts/cinnabargym.asm @@ -15,8 +15,7 @@ CinnabarGymScript_75759: ; 75759 (1d:5759) bit 5, [hl] res 5, [hl] call nz, Func_3ead - ld hl, wd79b - res 7, [hl] + ResetEvent EVENT_2A7 ret CinnabarGymScript_75772: ; 75772 (1d:5772) ld hl, Gym7CityName @@ -98,9 +97,10 @@ CinnabarGymScript2: ; 757f6 (1d:57f6) jp z, CinnabarGymScript_75792 ld a, [wTrainerHeaderFlagBit] ld [$ffdb], a + AdjustEventBit EVENT_29A, 2 ld c, a ld b, FLAG_TEST - ld hl, wd79a + EventFlagAddress hl, EVENT_29A call CinnabarGymScript_757f1 ld a, c and a @@ -112,15 +112,17 @@ CinnabarGymScript2: ; 757f6 (1d:57f6) .asm_7581b ld a, [wTrainerHeaderFlagBit] ld [$ffdb], a + AdjustEventBit EVENT_29A, 2 ld c, a ld b, FLAG_SET - ld hl, wd79a + EventFlagAddress hl, EVENT_29A call CinnabarGymScript_757f1 ld a, [wTrainerHeaderFlagBit] sub $2 + AdjustEventBit EVENT_2A8, 0 ld c, a ld b, FLAG_SET - ld hl, wd79c + EventFlagAddress hl, EVENT_2A8 call CinnabarGymScript_757f1 call Func_3ead xor a @@ -141,16 +143,14 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd79a - set 1, [hl] + SetEvent EVENT_299 ld bc, (TM_38 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $b ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd79a - set 0, [hl] + SetEvent EVENT_298 jr .asm_75880 .BagFull ld a, $c @@ -163,11 +163,7 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) set 6, [hl] ; deactivate gym trainers - ld a, [wd79a] - or %11111100 - ld [wd79a], a - ld hl, wd79b - set 0, [hl] + SetEventRange EVENT_29A, EVENT_2A0 ld hl, wd126 set 5, [hl] @@ -210,10 +206,9 @@ CinnabarGymScript_758b7: ; 758b7 (1d:58b7) CinnabarGymText1: ; 758df (1d:58df) TX_ASM - ld a, [wd79a] - bit 1, a + CheckEvent EVENT_299 jr z, .asm_d9332 - bit 0, a + CheckEventReuseA EVENT_298 jr nz, .asm_3012f call z, CinnabarGymScript3_75857 call DisableWaitingAfterTextDisplay @@ -263,8 +258,7 @@ TM38NoRoomText: ; 75934 (1d:5934) CinnabarGymText2: ; 75939 (1d:5939) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79a] - bit 2, a + CheckEvent EVENT_29A jr nz, .asm_46bb4 ld hl, CinnabarGymText_7595f call PrintText @@ -292,8 +286,7 @@ CinnabarGymText_75969: ; 75969 (1d:5969) CinnabarGymText3: ; 7596e (1d:596e) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79a] - bit 3, a + CheckEvent EVENT_29B jr nz, .asm_4b406 ld hl, CinnabarGymText_75994 call PrintText @@ -321,8 +314,7 @@ CinnabarGymText_7599e: ; 7599e (1d:599e) CinnabarGymText4: ; 759a3 (1d:59a3) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79a] - bit 4, a + CheckEvent EVENT_29C jr nz, .asm_c0673 ld hl, CinnabarGymText_759c9 call PrintText @@ -350,8 +342,7 @@ CinnabarGymText_759d3: ; 759d3 (1d:59d3) CinnabarGymText5: ; 759d8 (1d:59d8) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79a] - bit 5, a + CheckEvent EVENT_29D jr nz, .asm_5cfd7 ld hl, CinnabarGymText_759fe call PrintText @@ -379,8 +370,7 @@ CinnabarGymText_75a08: ; 75a08 (1d:5a08) CinnabarGymText6: ; 75a0d (1d:5a0d) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79a] - bit 6, a + CheckEvent EVENT_29E jr nz, .asm_776b4 ld hl, CinnabarGymText_75a33 call PrintText @@ -408,8 +398,7 @@ CinnabarGymText_75a3d: ; 75a3d (1d:5a3d) CinnabarGymText7: ; 75a42 (1d:5a42) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79a] - bit 7, a + CheckEvent EVENT_29F jr nz, .asm_2f755 ld hl, CinnabarGymText_75a68 call PrintText @@ -437,8 +426,7 @@ CinnabarGymText_75a72: ; 75a72 (1d:5a72) CinnabarGymText8: ; 75a77 (1d:5a77) TX_ASM call CinnabarGymScript_757a0 - ld a, [wd79b] - bit 0, a + CheckEvent EVENT_2A0 jr nz, .asm_d87be ld hl, CinnabarGymText_75a9d call PrintText @@ -465,8 +453,7 @@ CinnabarGymText_75aa7: ; 75aa7 (1d:5aa7) CinnabarGymText9: ; 75aac (1d:5aac) TX_ASM - ld a, [wd79a] - bit 1, a + CheckEvent EVENT_299 jr nz, .asm_627d9 ld hl, CinnabarGymText_75ac2 jr .asm_0b11d diff --git a/scripts/cinnabarisland.asm b/scripts/cinnabarisland.asm index 92c0fc6b..2fc0503f 100755 --- a/scripts/cinnabarisland.asm +++ b/scripts/cinnabarisland.asm @@ -2,10 +2,8 @@ CinnabarIslandScript: ; 1ca19 (7:4a19) call EnableAutoTextBoxDrawing ld hl, wd126 set 5, [hl] - ld hl, wd796 - res 0, [hl] - ld hl, wd7a3 - res 1, [hl] + ResetEvent EVENT_278 + ResetEvent EVENT_2E1 ld hl, CinnabarIslandScriptPointers ld a, [W_CINNABARISLANDCURSCRIPT] jp CallFunctionInTable diff --git a/scripts/copycatshouse2f.asm b/scripts/copycatshouse2f.asm index 51a633b1..d6a330f3 100755 --- a/scripts/copycatshouse2f.asm +++ b/scripts/copycatshouse2f.asm @@ -12,8 +12,7 @@ CopycatsHouse2FTextPointers: ; 5cc74 (17:4c74) CopycatsHouse2FText1: ; 5cc82 (17:4c82) TX_ASM - ld a, [wd7af] - bit 0, a + CheckEvent EVENT_340 jr nz, .asm_7ccf3 ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -32,8 +31,7 @@ CopycatsHouse2FText1: ; 5cc82 (17:4c82) ld a, POKE_DOLL ld [$ffdb], a callba RemoveItemByID - ld hl, wd7af - set 0, [hl] + SetEvent EVENT_340 jr .asm_62ecd .BagFull ld hl, TM31NoRoomText diff --git a/scripts/fanclub.asm b/scripts/fanclub.asm index 79621fce..45298c0b 100755 --- a/scripts/fanclub.asm +++ b/scripts/fanclub.asm @@ -3,8 +3,7 @@ FanClubScript: ; 59b70 (16:5b70) FanClubBikeInBag: ; check if any bike paraphernalia in bag - ld a, [wd771] - bit 1, a ; got bike voucher? + CheckEvent EVENT_GOT_BIKE_VOUCHER ret nz ld b, BICYCLE call IsItemInBag @@ -25,19 +24,16 @@ FanClubTextPointers: ; 59b84 (16:5b84) FanClubText1: ; pikachu fan TX_ASM - ld a, [wd771] - bit 7, a + CheckEvent EVENT_157 jr nz, .mineisbetter ld hl, .normaltext call PrintText - ld hl, wd771 - set 6, [hl] + SetEvent EVENT_156 jr .done .mineisbetter ld hl, .bettertext call PrintText - ld hl, wd771 - res 7, [hl] + ResetEvent EVENT_157 .done jp TextScriptEnd @@ -52,19 +48,16 @@ FanClubText1: FanClubText2: ; seel fan TX_ASM - ld a, [wd771] - bit 6, a + CheckEvent EVENT_156 jr nz, .mineisbetter ld hl, .normaltext call PrintText - ld hl, wd771 - set 7, [hl] + SetEvent EVENT_157 jr .done .mineisbetter ld hl, .bettertext call PrintText - ld hl, wd771 - res 6, [hl] + ResetEvent EVENT_156 .done jp TextScriptEnd @@ -125,8 +118,7 @@ FanClubText5: jr nc, .BagFull ld hl, .receivedvouchertext call PrintText - ld hl, wd771 - set 1, [hl] + SetEvent EVENT_GOT_BIKE_VOUCHER jr .done .BagFull ld hl, .bagfulltext diff --git a/scripts/fightingdojo.asm b/scripts/fightingdojo.asm index c21dde00..e27baf57 100755 --- a/scripts/fightingdojo.asm +++ b/scripts/fightingdojo.asm @@ -21,15 +21,13 @@ FightingDojoScriptPointers: ; 5cd7b (17:4d7b) dw FightingDojoScript3 FightingDojoScript1: ; 5cd83 (17:4d83) - ld a, [wd7b1] - bit 0, a + CheckEvent EVENT_350 ret nz call CheckFightingMapTrainers ld a, [wTrainerHeaderFlagBit] and a ret nz - ld a, [wd7b1] - bit 1, a + CheckEvent EVENT_351 ret nz xor a ld [hJoyHeld], a @@ -72,9 +70,7 @@ FightingDojoScript3: ; 5cdc6 (17:4dc6) .asm_5cde4 ld a, $f0 ld [wJoyIgnore], a - ld a, [wd7b1] - or $3e - ld [wd7b1], a + SetEventRange EVENT_351, EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 ld a, $8 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -96,36 +92,36 @@ FightingDojoTextPointers: ; 5ce03 (17:4e03) FightingDojoTrainerHeaders: ; 5ce13 (17:4e13) FightingDojoTrainerHeader0: ; 5ce13 (17:4e13) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7b1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 dw FightingDojoBattleText1 ; TextBeforeBattle dw FightingDojoAfterBattleText1 ; TextAfterBattle dw FightingDojoEndBattleText1 ; TextEndBattle dw FightingDojoEndBattleText1 ; TextEndBattle FightingDojoTrainerHeader1: ; 5ce1f (17:4e1f) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd7b1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_1 dw FightingDojoBattleText2 ; TextBeforeBattle dw FightingDojoAfterBattleText2 ; TextAfterBattle dw FightingDojoEndBattleText2 ; TextEndBattle dw FightingDojoEndBattleText2 ; TextEndBattle FightingDojoTrainerHeader2: ; 5ce2b (17:4e2b) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7b1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_2 dw FightingDojoBattleText3 ; TextBeforeBattle dw FightingDojoAfterBattleText3 ; TextAfterBattle dw FightingDojoEndBattleText3 ; TextEndBattle dw FightingDojoEndBattleText3 ; TextEndBattle FightingDojoTrainerHeader3: ; 5ce37 (17:4e37) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7b1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 dw FightingDojoBattleText4 ; TextBeforeBattle dw FightingDojoAfterBattleText4 ; TextAfterBattle dw FightingDojoEndBattleText4 ; TextEndBattle @@ -135,10 +131,9 @@ FightingDojoTrainerHeader3: ; 5ce37 (17:4e37) FightingDojoText1: ; 5ce44 (17:4e44) TX_ASM - ld a, [wd7b1] - bit 0, a + CheckEvent EVENT_350 jp nz, .continue1 - bit 1, a + CheckEventReuseA EVENT_351 jp nz, .continue2 ld hl, FightingDojoText_5ce8e call PrintText @@ -257,8 +252,7 @@ FightingDojoAfterBattleText4: ; 5cf01 (17:4f01) FightingDojoText6: ; 5cf06 (17:4f06) ; Hitmonlee Poké Ball TX_ASM - ld a, [wd7b1] - and %11000000 + CheckEitherEventSet EVENT_356, EVENT_357 jr z, .GetMon ld hl, OtherHitmonText call PrintText @@ -282,9 +276,7 @@ FightingDojoText6: ; 5cf06 (17:4f06) ld a, HS_FIGHTING_DOJO_GIFT_1 ld [wcc4d], a predef HideObject - ld hl, wd7b1 - set 6, [hl] - set 0, [hl] + SetEvents EVENT_356, EVENT_350 .done jp TextScriptEnd @@ -295,8 +287,7 @@ WantHitmonleeText: ; 5cf49 (17:4f49) FightingDojoText7: ; 5cf4e (17:4f4e) ; Hitmonchan Poké Ball TX_ASM - ld a, [wd7b1] - and %11000000 + CheckEitherEventSet EVENT_356, EVENT_357 jr z, .GetMon ld hl, OtherHitmonText call PrintText @@ -315,9 +306,7 @@ FightingDojoText7: ; 5cf4e (17:4f4e) ld c,30 call GivePokemon jr nc, .done - ld hl, wd7b1 - set 7, [hl] - set 0, [hl] + SetEvents EVENT_357, EVENT_350 ; once Poké Ball is taken, hide sprite ld a, HS_FIGHTING_DOJO_GIFT_2 diff --git a/scripts/fuchsiacity.asm b/scripts/fuchsiacity.asm index 462e6084..b314b983 100755 --- a/scripts/fuchsiacity.asm +++ b/scripts/fuchsiacity.asm @@ -135,10 +135,9 @@ FuchsiaCityLaprasText: ; 19aef (6:5aef) FuchsiaCityText24: ; 19af4 (6:5af4) TX_ASM - ld a, [wd7f6] - bit 6, a + CheckEvent EVENT_57E jr nz, .asm_3b4e8 - bit 7, a + CheckEventReuseA EVENT_57F jr nz, .asm_667d5 ld hl, FuchsiaCityText_19b2a call PrintText diff --git a/scripts/fuchsiagym.asm b/scripts/fuchsiagym.asm index 843e7293..f13af011 100755 --- a/scripts/fuchsiagym.asm +++ b/scripts/fuchsiagym.asm @@ -46,16 +46,14 @@ FuchsiaGymScript3_75497: ; 75497 (1d:5497) ld a, $9 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd792 - set 1, [hl] + SetEvent EVENT_259 ld bc, (TM_06 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd792 - set 0, [hl] + SetEvent EVENT_258 jr .asm_754c0 .BagFull ld a, $b @@ -68,9 +66,7 @@ FuchsiaGymScript3_75497: ; 75497 (1d:5497) set 4, [hl] ; deactivate gym trainers - ld a, [wd792] - or %11111100 - ld [wd792], a + SetEventRange EVENT_BEAT_FUCHSIA_GYM_TRAINER_0, EVENT_BEAT_FUCHSIA_GYM_TRAINER_6 jp FuchsiaGymScript_75477 @@ -89,54 +85,54 @@ FuchsiaGymTextPointers: ; 754d5 (1d:54d5) FuchsiaGymTrainerHeaders: ; 754eb (1d:54eb) FuchsiaGymTrainerHeader0: ; 754eb (1d:54eb) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd792 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_0 dw FuchsiaGymBattleText1 ; TextBeforeBattle dw FuchsiaGymAfterBattleText1 ; TextAfterBattle dw FuchsiaGymEndBattleText1 ; TextEndBattle dw FuchsiaGymEndBattleText1 ; TextEndBattle FuchsiaGymTrainerHeader2: ; 754f7 (1d:54f7) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd792 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_2 dw FuchsiaGymBattleText2 ; TextBeforeBattle dw FuchsiaGymAfterBattleText2 ; TextAfterBattle dw FuchsiaGymEndBattleText2 ; TextEndBattle dw FuchsiaGymEndBattleText2 ; TextEndBattle FuchsiaGymTrainerHeader3: ; 75503 (1d:5503) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd792 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_3 dw FuchsiaGymBattleText3 ; TextBeforeBattle dw FuchsiaGymAfterBattleText3 ; TextAfterBattle dw FuchsiaGymEndBattleText3 ; TextEndBattle dw FuchsiaGymEndBattleText3 ; TextEndBattle FuchsiaGymTrainerHeader4: ; 7550f (1d:550f) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd792 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_4 dw FuchsiaGymBattleText4 ; TextBeforeBattle dw FuchsiaGymAfterBattleText4 ; TextAfterBattle dw FuchsiaGymEndBattleText4 ; TextEndBattle dw FuchsiaGymEndBattleText4 ; TextEndBattle FuchsiaGymTrainerHeader5: ; 7551b (1d:551b) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_5 db ($2 << 4) ; trainer's view range - dw wd792 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_5 dw FuchsiaGymBattleText5 ; TextBeforeBattle dw FuchsiaGymAfterBattleText5 ; TextAfterBattle dw FuchsiaGymEndBattleText5 ; TextEndBattle dw FuchsiaGymEndBattleText5 ; TextEndBattle FuchsiaGymTrainerHeader6: ; 75527 (1d:5527) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_6 db ($2 << 4) ; trainer's view range - dw wd792 ; flag's byte + dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_6 dw FuchsiaGymBattleText6 ; TextBeforeBattle dw FuchsiaGymAfterBattleText6 ; TextAfterBattle dw FuchsiaGymEndBattleText6 ; TextEndBattle @@ -146,10 +142,9 @@ FuchsiaGymTrainerHeader6: ; 75527 (1d:5527) FuchsiaGymText1: ; 75534 (1d:5534) TX_ASM - ld a, [wd792] - bit 1, a + CheckEvent EVENT_259 jr z, .asm_181b6 - bit 0, a + CheckEventReuseA EVENT_258 jr nz, .asm_adc3b call z, FuchsiaGymScript3_75497 call DisableWaitingAfterTextDisplay @@ -318,8 +313,7 @@ FuchsiaGymAfterBattleText6: ; 75635 (1d:5635) FuchsiaGymText8: ; 7563a (1d:563a) TX_ASM - ld a, [wd792] - bit 1, a + CheckEvent EVENT_259 ld hl, FuchsiaGymText_75653 jr nz, .asm_50671 ld hl, FuchsiaGymText_7564e diff --git a/scripts/fuchsiahouse2.asm b/scripts/fuchsiahouse2.asm index f758b49e..b755b3bc 100755 --- a/scripts/fuchsiahouse2.asm +++ b/scripts/fuchsiahouse2.asm @@ -10,14 +10,12 @@ FuchsiaHouse2TextPointers: ; 750b8 (1d:50b8) FuchsiaHouse2Text1: ; 750c2 (1d:50c2) TX_ASM - ld a, [wd78e] - bit 0, a + CheckEvent EVENT_238 jr nz, .subtract ld b,GOLD_TEETH call IsItemInBag jr nz, .asm_3f30f - ld a, [wd78e] - bit 1, a + CheckEvent EVENT_239 jr nz, .asm_60cba ld hl, WardenGibberishText1 call PrintText @@ -36,8 +34,7 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) ld a, GOLD_TEETH ld [$ffdb], a callba RemoveItemByID - ld hl, wd78e - set 1, [hl] + SetEvent EVENT_239 .asm_60cba ld hl, WardenThankYouText call PrintText @@ -46,8 +43,7 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) jr nc, .BagFull ld hl, ReceivedHM04Text call PrintText - ld hl, wd78e - set 0, [hl] + SetEvent EVENT_238 jr .asm_52039 .subtract ld hl, HM04ExplanationText diff --git a/scripts/gary.asm b/scripts/gary.asm index d01161da..ab991942 100755 --- a/scripts/gary.asm +++ b/scripts/gary.asm @@ -94,8 +94,7 @@ GaryScript3: ; 75fbb (1d:5fbb) cp $ff jp z, GaryScript_75f29 call UpdateSprites - ld hl, wd867 - set 1, [hl] + SetEvent EVENT_901 ld a, $f0 ld [wJoyIgnore], a ld a, $1 @@ -249,8 +248,7 @@ GaryTextPointers: ; 760d6 (1d:60d6) GaryText1: ; 760e0 (1d:60e0) TX_ASM - ld a, [wd867] - bit 1, a + CheckEvent EVENT_901 ld hl, GaryText_760f4 jr z, .asm_17e9f ld hl, GaryText_76103 diff --git a/scripts/halloffameroom.asm b/scripts/halloffameroom.asm index bc0d19e1..136061d8 100755 --- a/scripts/halloffameroom.asm +++ b/scripts/halloffameroom.asm @@ -39,12 +39,8 @@ HallofFameRoomScript2: ; 5a4bb (16:64bb) ld [hl], a ld [W_LANCECURSCRIPT], a ld [W_HALLOFFAMEROOMCURSCRIPT], a - ld hl, wd863 - ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a - ld [hl], a + ; Elite 4 events + ResetEventRange EVENT_8E0, EVENT_907, 1 xor a ld [W_HALLOFFAMEROOMCURSCRIPT], a ld a, PALLET_TOWN diff --git a/scripts/indigoplateaulobby.asm b/scripts/indigoplateaulobby.asm index 1b09a61d..8cde0854 100755 --- a/scripts/indigoplateaulobby.asm +++ b/scripts/indigoplateaulobby.asm @@ -5,18 +5,13 @@ IndigoPlateauLobbyScript: ; 19c5b (6:5c5b) bit 6, [hl] res 6, [hl] ret z - ld hl, wd869 - res 7, [hl] + ResetEvent EVENT_917 ld hl, wd734 bit 1, [hl] res 1, [hl] ret z - ld hl, wd863 - xor a - ld [hli], a - ld [hli], a - ld [hli], a - ld [hl], a + ; Elite 4 events + ResetEventRange EVENT_8E0, EVENT_8FF ret IndigoPlateauLobbyTextPointers: ; 19c7f (6:5c7f) diff --git a/scripts/lab3.asm b/scripts/lab3.asm index e91d36f3..0351038d 100755 --- a/scripts/lab3.asm +++ b/scripts/lab3.asm @@ -10,8 +10,7 @@ Lab3TextPointers: ; 75c8a (1d:5c8a) Lab3Text1: ; 75c94 (1d:5c94) TX_ASM - ld a, [wd7a1] - bit 7, a + CheckEvent EVENT_2D7 jr nz, .asm_e551a ld hl, TM35PreReceiveText call PrintText @@ -20,8 +19,7 @@ Lab3Text1: ; 75c94 (1d:5c94) jr nc, .BagFull ld hl, ReceivedTM35Text call PrintText - ld hl, wd7a1 - set 7, [hl] + SetEvent EVENT_2D7 jr .asm_eb896 .BagFull ld hl, TM35NoRoomText diff --git a/scripts/lab4.asm b/scripts/lab4.asm index 21fee0c6..44dcb2c3 100755 --- a/scripts/lab4.asm +++ b/scripts/lab4.asm @@ -49,8 +49,7 @@ FossilsList: ; 75d68 (1d:5d68) Lab4Text1: ; 75d6c (1d:5d6c) TX_ASM - ld a, [wd7a3] - bit 0, a + CheckEvent EVENT_2E0 jr nz, .asm_75d96 ld hl, Lab4Text_75dc6 call PrintText @@ -75,17 +74,13 @@ Lab4Text1: ; 75d6c (1d:5d6c) call LoadFossilItemAndMonNameBank1D ld hl, Lab4Text_75dd5 call PrintText - ld hl, wd7a3 - set 2, [hl] + SetEvent EVENT_2E2 ld a, [W_FOSSILMON] ld b, a ld c, 30 call GivePokemon jr nc, .asm_75d93 - ld hl, wd7a3 - res 0, [hl] - res 1, [hl] - res 2, [hl] + ResetEvents EVENT_2E0, EVENT_2E1, EVENT_2E2 jr .asm_75d93 Lab4Text_75dc6: ; 75dc6 (1d:5dc6) diff --git a/scripts/lance.asm b/scripts/lance.asm index 80780cd1..9d3a2f99 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -13,8 +13,7 @@ LanceScript_5a2c4: ; 5a2c4 (16:62c4) bit 5, [hl] res 5, [hl] ret z - ld a, [wd866] - bit 7, a + CheckEvent EVENT_8FF jr nz, .asm_5a2da ld a, $31 ld b, $32 @@ -52,8 +51,7 @@ LanceScript4: ; 5a304 (16:6304) ret LanceScript0: ; 5a305 (16:6305) - ld a, [wd866] - bit 6, a + CheckEvent EVENT_8FE ret nz ld hl, CoordsData_5a33e call ArePlayerCoordsInArray @@ -69,9 +67,7 @@ LanceScript0: ; 5a305 (16:6305) .asm_5a325 cp $5 jr z, LanceScript_5a35b - ld hl, wd866 - bit 7, [hl] - set 7, [hl] + CheckAndSetEvent EVENT_8FF ret nz ld hl, wd126 set 5, [hl] @@ -133,9 +129,9 @@ LanceTextPointers: ; 5a395 (16:6395) LanceTrainerHeaders: ; 5a397 (16:6397) LanceTrainerHeader0: ; 5a397 (16:6397) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_LANCES_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd866 ; flag's byte + dwEventFlagAddress EVENT_BEAT_LANCES_ROOM_TRAINER_0 dw LanceBeforeBattleText ; TextBeforeBattle dw LanceAfterBattleText ; TextAfterBattle dw LanceEndBattleText ; TextEndBattle @@ -160,6 +156,5 @@ LanceEndBattleText: ; 5a3b3 (16:63b3) LanceAfterBattleText: ; 5a3b8 (16:63b8) TX_FAR _LanceAfterBattleText TX_ASM - ld hl, wd866 - set 6, [hl] + SetEvent EVENT_8FE jp TextScriptEnd diff --git a/scripts/lavenderhouse1.asm b/scripts/lavenderhouse1.asm index 9c812c71..21e67013 100755 --- a/scripts/lavenderhouse1.asm +++ b/scripts/lavenderhouse1.asm @@ -12,8 +12,7 @@ LavenderHouse1TextPointers: ; 1d8ac (7:58ac) LavenderHouse1Text1: ; 1d8b8 (7:58b8) TX_ASM - ld a, [wd7e0] - bit 7, a + CheckEvent EVENT_4CF jr nz, .asm_72e5d ld hl, LavenderHouse1Text_1d8d1 call PrintText @@ -34,8 +33,7 @@ LavenderHouse1Text_1d8d6: ; 1d8d6 (7:58d6) LavenderHouse1Text2: ; 1d8db (7:58db) TX_ASM - ld a, [wd7e0] - bit 7, a + CheckEvent EVENT_4CF jr nz, .asm_06470 ld hl, LavenderHouse1Text_1d8f4 call PrintText @@ -70,8 +68,7 @@ LavenderHouse1Text4: ; 1d90b (7:590b) LavenderHouse1Text5: ; 1d918 (7:5918) TX_ASM - ld a, [wd76c] - bit 0, a + CheckEvent EVENT_128 jr nz, .asm_15ac2 ld hl, LavenderHouse1Text_1d94c call PrintText @@ -80,8 +77,7 @@ LavenderHouse1Text5: ; 1d918 (7:5918) jr nc, .BagFull ld hl, ReceivedFluteText call PrintText - ld hl, wd76c - set 0, [hl] + SetEvent EVENT_128 jr .asm_da749 .BagFull ld hl, FluteNoRoomText diff --git a/scripts/lavenderhouse2.asm b/scripts/lavenderhouse2.asm index 4dc5c7b7..4c3ad333 100755 --- a/scripts/lavenderhouse2.asm +++ b/scripts/lavenderhouse2.asm @@ -15,8 +15,7 @@ LavenderHouse2Text1: ; 1d9b6 (7:59b6) LavenderHouse2Text2: ; 1d9c3 (7:59c3) TX_ASM - ld a, [wd7e0] - bit 7, a + CheckEvent EVENT_4CF jr nz, .asm_65711 ld hl, LavenderHouse2Text_1d9dc call PrintText diff --git a/scripts/lavendermart.asm b/scripts/lavendermart.asm index 53967cf2..ababf70d 100755 --- a/scripts/lavendermart.asm +++ b/scripts/lavendermart.asm @@ -12,8 +12,7 @@ LavenderMartText2: ; 5c935 (17:4935) LavenderMartText3: ; 5c93a (17:493a) TX_ASM - ld a, [wd7e0] - bit 7, a + CheckEvent EVENT_4CF jr nz, .asm_c88d4 ld hl, LavenderMart_5c953 call PrintText diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index eb6c3e7d..a8e0cb5b 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -15,8 +15,7 @@ LoreleiScript_76191: ; 76191 (1d:6191) ret z ld hl, wd734 set 1, [hl] - ld a, [wd863] - bit 1, a + CheckEvent EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 jr z, .asm_761a9 ld a, $5 jr .asm_761ab @@ -71,9 +70,7 @@ LoreleiScript0: ; 761e2 (1d:61e2) ld a, [wCoordIndex] cp $3 jr c, .asm_76206 - ld hl, wd863 - bit 6, [hl] - set 6, [hl] + CheckAndSetEvent EVENT_8E6 jr z, LoreleiScript_761c6 .asm_76206 ld a, $2 @@ -121,9 +118,9 @@ LoreleiTextPointers: ; 76251 (1d:6251) LoreleiTrainerHeaders: ; 76255 (1d:6255) LoreleiTrainerHeader0: ; 76255 (1d:6255) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd863 ; flag's byte + dwEventFlagAddress EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 dw LoreleiBeforeBattleText ; TextBeforeBattle dw LoreleiAfterBattleText ; TextAfterBattle dw LoreleiEndBattleText ; TextEndBattle diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm index a9e2616a..ff8707e0 100755 --- a/scripts/mansion1.asm +++ b/scripts/mansion1.asm @@ -13,8 +13,7 @@ Mansion1Subscript1: ; 442c5 (11:42c5) bit 5, [hl] res 5, [hl] ret z - ld a, [wd796] - bit 0, a + CheckEvent EVENT_278 jr nz, .asm_442ec ld bc, $060c call Mansion1Script_4430b @@ -69,9 +68,9 @@ Mansion1TextPointers: ; 4432c (11:432c) Mansion1TrainerHeaders: ; 44334 (11:4334) Mansion1TrainerHeader0: ; 44334 (11:4334) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_MANSION_1_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd798 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MANSION_1_TRAINER_0 dw Mansion1BattleText2 ; TextBeforeBattle dw Mansion1AfterBattleText2 ; TextAfterBattle dw Mansion1EndBattleText2 ; TextEndBattle @@ -113,11 +112,9 @@ Mansion1Text4: ; 4435a (11:435a) call PrintText ld a, SFX_GO_INSIDE call PlaySound - ld hl, wd796 - bit 0, [hl] - set 0, [hl] + CheckAndSetEvent EVENT_278 jr z, .asm_44392 - res 0, [hl] + ResetEventReuseHL EVENT_278 jr .asm_44392 .asm_4438c ld hl, MansionSwitchNotPressedText diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm index 1cacae02..6e1a26c0 100755 --- a/scripts/mansion2.asm +++ b/scripts/mansion2.asm @@ -13,8 +13,7 @@ Mansion2Script_51fee: ; 51fee (14:5fee) bit 5, [hl] res 5, [hl] ret z - ld a, [wd796] - bit 0, a + CheckEvent EVENT_278 jr nz, .asm_52016 ld a, $e ld bc, $204 @@ -66,9 +65,9 @@ Mansion2TextPointers: ; 5204d (14:604d) Mansion2TrainerHeaders: ; 52057 (14:6057) Mansion2TrainerHeader0: ; 52057 (14:6057) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_MANSION_2_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd847 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MANSION_2_TRAINER_0 dw Mansion2BattleText1 ; TextBeforeBattle dw Mansion2AfterBattleText1 ; TextAfterBattle dw Mansion2EndBattleText1 ; TextEndBattle @@ -119,11 +118,9 @@ Mansion2Text5: ; 52087 (14:6087) call PrintText ld a, SFX_GO_INSIDE call PlaySound - ld hl, wd796 - bit 0, [hl] - set 0, [hl] + CheckAndSetEvent EVENT_278 jr z, .asm_520bf - res 0, [hl] + ResetEventReuseHL EVENT_278 jr .asm_520bf .asm_520b9 ld hl, Mansion2Text_520cc diff --git a/scripts/mansion3.asm b/scripts/mansion3.asm index c22bf761..0aec82b3 100755 --- a/scripts/mansion3.asm +++ b/scripts/mansion3.asm @@ -13,8 +13,7 @@ Mansion3Script_52204: ; 52204 (14:6204) bit 5, [hl] res 5, [hl] ret z - ld a, [wd796] - bit 0, a + CheckEvent EVENT_278 jr nz, .asm_52224 ld a, $e ld bc, $207 @@ -93,18 +92,18 @@ Mansion3TextPointers: ; 5228a (14:628a) Mansion3TrainerHeaders: ; 52296 (14:6296) Mansion3TrainerHeader0: ; 52296 (14:6296) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_MANSION_3_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd849 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MANSION_3_TRAINER_0 dw Mansion3BattleText1 ; TextBeforeBattle dw Mansion3AfterBattleText1 ; TextAfterBattle dw Mansion3EndBattleText1 ; TextEndBattle dw Mansion3EndBattleText1 ; TextEndBattle Mansion3TrainerHeader2: ; 522a2 (14:62a2) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_MANSION_3_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd849 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MANSION_3_TRAINER_2 dw Mansion3BattleText2 ; TextBeforeBattle dw Mansion3AfterBattleText2 ; TextAfterBattle dw Mansion3EndBattleText2 ; TextEndBattle diff --git a/scripts/mansion4.asm b/scripts/mansion4.asm index 68e74fd5..98c55a76 100755 --- a/scripts/mansion4.asm +++ b/scripts/mansion4.asm @@ -13,8 +13,7 @@ Mansion4Script_523cf: ; 523cf (14:63cf) bit 5, [hl] res 5, [hl] ret z - ld a, [wd796] - bit 0, a + CheckEvent EVENT_278 jr nz, .asm_523ff ld a, $e ld bc, $80d @@ -72,18 +71,18 @@ Mansion4TextPointers: ; 52436 (14:6436) Mansion4TrainerHeaders: ; 52448 (14:6448) Mansion4TrainerHeader0: ; 52448 (14:6448) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_MANSION_4_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd84b ; flag's byte + dwEventFlagAddress EVENT_BEAT_MANSION_4_TRAINER_0 dw Mansion4BattleText1 ; TextBeforeBattle dw Mansion4AfterBattleText1 ; TextAfterBattle dw Mansion4EndBattleText1 ; TextEndBattle dw Mansion4EndBattleText1 ; TextEndBattle Mansion4TrainerHeader2: ; 52454 (14:6454) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_MANSION_4_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd84b ; flag's byte + dwEventFlagAddress EVENT_BEAT_MANSION_4_TRAINER_2 dw Mansion4BattleText2 ; TextBeforeBattle dw Mansion4AfterBattleText2 ; TextAfterBattle dw Mansion4EndBattleText2 ; TextEndBattle diff --git a/scripts/mtmoon1.asm b/scripts/mtmoon1.asm index 868b70d1..4a5eeae3 100755 --- a/scripts/mtmoon1.asm +++ b/scripts/mtmoon1.asm @@ -30,63 +30,63 @@ MtMoon1TextPointers: ; 499e1 (12:59e1) MtMoon1TrainerHeaders: ; 499fd (12:59fd) MtMoon1TrainerHeader0: ; 499fd (12:59fd) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_0 dw MtMoon1BattleText2 ; TextBeforeBattle dw MtMoon1AfterBattleText2 ; TextAfterBattle dw MtMoon1EndBattleText2 ; TextEndBattle dw MtMoon1EndBattleText2 ; TextEndBattle MtMoon1TrainerHeader2: ; 49a09 (12:5a09) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_2 dw MtMoon1BattleText3 ; TextBeforeBattle dw MtMoon1AfterBattleText3 ; TextAfterBattle dw MtMoon1EndBattleText3 ; TextEndBattle dw MtMoon1EndBattleText3 ; TextEndBattle MtMoon1TrainerHeader3: ; 49a15 (12:5a15) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_3 dw MtMoon1BattleText4 ; TextBeforeBattle dw MtMoon1AfterBattleText4 ; TextAfterBattle dw MtMoon1EndBattleText4 ; TextEndBattle dw MtMoon1EndBattleText4 ; TextEndBattle MtMoon1TrainerHeader4: ; 49a21 (12:5a21) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_4 dw MtMoon1BattleText5 ; TextBeforeBattle dw MtMoon1AfterBattleText5 ; TextAfterBattle dw MtMoon1EndBattleText5 ; TextEndBattle dw MtMoon1EndBattleText5 ; TextEndBattle MtMoon1TrainerHeader5: ; 49a2d (12:5a2d) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_5 dw MtMoon1BattleText6 ; TextBeforeBattle dw MtMoon1AfterBattleText6 ; TextAfterBattle dw MtMoon1EndBattleText6 ; TextEndBattle dw MtMoon1EndBattleText6 ; TextEndBattle MtMoon1TrainerHeader6: ; 49a39 (12:5a39) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_6 dw MtMoon1BattleText7 ; TextBeforeBattle dw MtMoon1AfterBattleText7 ; TextAfterBattle dw MtMoon1EndBattleText7 ; TextEndBattle dw MtMoon1EndBattleText7 ; TextEndBattle MtMoon1TrainerHeader7: ; 49a45 (12:5a45) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_7 db ($3 << 4) ; trainer's view range - dw wd7f5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_7 dw MtMoon1BattleText8 ; TextBeforeBattle dw MtMoon1AfterBattleText8 ; TextAfterBattle dw MtMoon1EndBattleText8 ; TextEndBattle diff --git a/scripts/mtmoon3.asm b/scripts/mtmoon3.asm index ee163738..dfa92260 100755 --- a/scripts/mtmoon3.asm +++ b/scripts/mtmoon3.asm @@ -5,8 +5,7 @@ MtMoon3Script: ; 49d0b (12:5d0b) ld a, [W_MTMOON3CURSCRIPT] call ExecuteCurMapScriptInTable ld [W_MTMOON3CURSCRIPT], a - ld a, [wd7f6] - bit 1, a + CheckEvent EVENT_579 ret z ld hl, CoordsData_49d37 call ArePlayerCoordsInArray @@ -54,8 +53,7 @@ MtMoon3ScriptPointers: ; 49d63 (12:5d63) dw MtMoon3Script5 MtMoon3Script0: ; 49d6f (12:5d6f) - ld a, [wd7f6] - bit 1, a + CheckEvent EVENT_579 jp nz, MtMoon3Script_49d91 ld a, [W_YCOORD] cp $8 @@ -70,8 +68,7 @@ MtMoon3Script0: ; 49d6f (12:5d6f) jp DisplayTextID MtMoon3Script_49d91: ; 49d91 (12:5d91) - ld a, [wd7f6] - and $c0 + CheckEitherEventSet EVENT_57E, EVENT_57F jp z, CheckFightingMapTrainers ret @@ -81,8 +78,7 @@ MtMoon3Script3: ; 49d9a (12:5d9a) jp z, MtMoon3Script_49d58 call UpdateSprites call Delay3 - ld hl, wd7f6 - set 1, [hl] + SetEvent EVENT_579 xor a ld [wJoyIgnore], a ld a, $0 @@ -142,8 +138,7 @@ MtMoon3Script5: ; 49dfb (12:5dfb) ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - ld a, [wd7f6] - bit 6, a + CheckEvent EVENT_57E jr z, .asm_49e1d ld a, HS_MT_MOON_3_FOSSIL_2 jr .asm_49e1f @@ -173,36 +168,36 @@ MtMoon3TextPointers: ; 49e34 (12:5e34) MtMoon3TrainerHeaders: ; 49e48 (12:5e48) MtMoon3TrainerHeader0: ; 49e48 (12:5e48) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7f6 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_0 dw MtMoon3BattleText2 ; TextBeforeBattle dw MtMoon3AfterBattleText2 ; TextAfterBattle dw MtMoon3EndBattleText2 ; TextEndBattle dw MtMoon3EndBattleText2 ; TextEndBattle MtMoon3TrainerHeader2: ; 49e54 (12:5e54) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7f6 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_2 dw MtMoon3BattleText3 ; TextBeforeBattle dw MtMoon3AfterBattleText3 ; TextAfterBattle dw MtMoon3EndBattleText3 ; TextEndBattle dw MtMoon3EndBattleText3 ; TextEndBattle MtMoon3TrainerHeader3: ; 49e60 (12:5e60) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd7f6 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_3 dw MtMoon3BattleText4 ; TextBeforeBattle dw MtMoon3AfterBattleText4 ; TextAfterBattle dw MtMoon3EndBattleText4 ; TextEndBattle dw MtMoon3EndBattleText4 ; TextEndBattle MtMoon3TrainerHeader4: ; 49e6c (12:5e6c) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd7f6 ; flag's byte + dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_4 dw MtMoon3BattleText5 ; TextBeforeBattle dw MtMoon3AfterBattleText5 ; TextAfterBattle dw MtMoon3EndBattleText5 ; TextEndBattle @@ -212,8 +207,7 @@ MtMoon3TrainerHeader4: ; 49e6c (12:5e6c) MtMoon3Text1: ; 49e79 (12:5e79) TX_ASM - ld a, [wd7f6] - bit 1, a + CheckEvent EVENT_579 jr z, .asm_49e8d and $c0 jr nz, .asm_49eb8 @@ -284,8 +278,7 @@ MtMoon3Text6: ; 49ee9 (12:5ee9) ld a, HS_MT_MOON_3_FOSSIL_1 ld [wcc4d], a predef HideObject - ld hl, wd7f6 - set 6, [hl] + SetEvent EVENT_57E ld a, $4 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a @@ -313,8 +306,7 @@ MtMoon3Text7: ; 49f29 (12:5f29) ld a, HS_MT_MOON_3_FOSSIL_2 ld [wcc4d], a predef HideObject - ld hl, wd7f6 - set 7, [hl] + SetEvent EVENT_57F ld a, $4 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a diff --git a/scripts/mtmoonpokecenter.asm b/scripts/mtmoonpokecenter.asm index d4996b4b..63cc06e4 100755 --- a/scripts/mtmoonpokecenter.asm +++ b/scripts/mtmoonpokecenter.asm @@ -23,8 +23,7 @@ MtMoonPokecenterText3: ; 492e7 (12:52e7) MtMoonPokecenterText4: ; 492ec (12:52ec) TX_ASM - ld a, [wd7c6] - add a + CheckEvent EVENT_BOUGHT_MAGIKARP, 1 jp c, .alreadyBoughtMagikarp ld hl, MtMoonPokecenterText_4935c call PrintText @@ -59,8 +58,7 @@ MtMoonPokecenterText4: ; 492ec (12:52ec) ld a, MONEY_BOX ld [wTextBoxID], a call DisplayTextBoxID - ld hl, wd7c6 - set 7, [hl] + SetEvent EVENT_BOUGHT_MAGIKARP jr .done .choseNo ld hl, MtMoonPokecenterText_49361 diff --git a/scripts/museum1f.asm b/scripts/museum1f.asm index 32e489ca..2acf1af5 100755 --- a/scripts/museum1f.asm +++ b/scripts/museum1f.asm @@ -54,15 +54,13 @@ Museum1FText1: ; 5c135 (17:4135) cp $c jp z, Museum1FScript_5c1f9 .asm_d49e7 - ld a, [wd754] - bit 0, a + CheckEvent EVENT_068 jr nz, .asm_31a16 ld hl, Museum1FText_5c23d call PrintText jp Museum1FScriptEnd .asm_b8709 - ld a, [wd754] - bit 0, a + CheckEvent EVENT_068 jr z, .asm_3ded4 .asm_31a16 ld hl, Museum1FText_5c242 @@ -93,8 +91,7 @@ Museum1FText1: ; 5c135 (17:4135) .asm_0f3e3 ld hl, Museum1FText_5c224 call PrintText - ld hl, wd754 - set 0, [hl] + SetEvent EVENT_068 xor a ld [wPriceTemp], a ld [wPriceTemp + 1], a @@ -190,16 +187,14 @@ Museum1FText_5c251: ; 5c251 (17:4251) Museum1FText3: ; 5c256 (17:4256) TX_ASM - ld a, [wd754] - bit 1, a + CheckEvent EVENT_069 jr nz, .asm_5c285 ld hl, Museum1FText_5c28e call PrintText ld bc, (OLD_AMBER << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, wd754 - set 1, [hl] + SetEvent EVENT_069 ld a, HS_OLD_AMBER ld [wcc4d], a predef HideObject diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index ae6da40d..6f51aca0 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -1,6 +1,5 @@ OaksLabScript: ; 1cb0e (7:4b0e) - ld a, [wd74b] - bit 6, a + CheckEvent EVENT_026 call nz, OaksLabScript_1d076 ld a, $1 ld [wAutoTextBoxDrawingControl], a @@ -32,8 +31,7 @@ OaksLabScriptPointers: ; 1cb28 (7:4b28) dw OaksLabScript18 OaksLabScript0: ; 1cb4e (7:4b4e) - ld a, [wd74b] - bit 7, a + CheckEvent EVENT_027 ret z ld a, [wNPCMovementScriptFunctionNum] and a @@ -110,10 +108,8 @@ OaksLabScript4: ; 1cbd2 (7:4bd2) ld a, [wSimulatedJoypadStatesIndex] and a ret nz - ld hl, wd747 - set 0, [hl] - ld hl, wd74b - set 0, [hl] + SetEvent EVENT_STOPPED_FROM_LEAVING_PALLET + SetEvent EVENT_FOLLOWED_OAK_INSIDE_LAB ld a, $1 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_UP @@ -146,8 +142,7 @@ OaksLabScript5: ; 1cbfd (7:4bfd) ld a, $14 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd74b - set 1, [hl] + SetEvent EVENT_OAK_ASKED_TO_CHOOSE_MON xor a ld [wJoyIgnore], a @@ -336,8 +331,7 @@ OaksLabScript9: ; 1cd00 (7:4d00) ld a, $e ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd74b - set 2, [hl] + SetEvent EVENT_GOT_STARTER xor a ld [wJoyIgnore], a @@ -435,8 +429,7 @@ OaksLabScript12: ; 1ce03 (7:4e03) ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay predef HealParty - ld hl, wd74b - set 3, [hl] + SetEvent EVENT_BATTLED_RIVAL_IN_OAKS_LAB ld a, $d ld [W_OAKSLABCURSCRIPT], a @@ -603,10 +596,8 @@ OaksLabScript16: ; 1cf12 (7:4f12) ld a, $1b ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd74b - set 5, [hl] - ld hl, wd74e - set 0, [hl] + SetEvent EVENT_GOT_POKEDEX + SetEvent EVENT_038 ld a, HS_LYING_OLD_MAN ld [wcc4d], a predef HideObject @@ -641,10 +632,9 @@ OaksLabScript17: ; 1cfd4 (7:4fd4) ld a, HS_OAKS_LAB_RIVAL ld [wcc4d], a predef HideObject - ld hl, wd7eb - set 0, [hl] - res 1, [hl] - set 7, [hl] + SetEvent EVENT_520 + ResetEventReuseHL EVENT_521 + SetEventReuseHL EVENT_527 ld a, HS_ROUTE_22_RIVAL_1 ld [wcc4d], a predef ShowObject @@ -772,8 +762,7 @@ OaksLabTextPointers: ; 1d082 (7:5082) OaksLabText28: ; 1d0ce (7:50ce) OaksLabText1: ; 1d0ce (7:50ce) TX_ASM - ld a, [wd74b] - bit 0, a + CheckEvent EVENT_FOLLOWED_OAK_INSIDE_LAB jr nz, .asm_1d0de ld hl, OaksLabGaryText1 call PrintText @@ -839,10 +828,9 @@ OaksLabScript_1d133: ; 1d133 (7:5133) ld [wd11e], a ld a, b ld [wSpriteIndex], a - ld a, [wd74b] - bit 2, a + CheckEvent EVENT_GOT_STARTER jp nz, OaksLabScript_1d22d - bit 1, a + CheckEventReuseA EVENT_OAK_ASKED_TO_CHOOSE_MON jr nz, OaksLabScript_1d157 ld hl, OaksLabText39 call PrintText @@ -976,8 +964,7 @@ OaksLabLastMonText: ; 1d243 (7:5243) OaksLabText32: ; 1d248 (7:5248) OaksLabText5: ; 1d248 (7:5248) TX_ASM - ld a, [wd747] - bit 6, a + CheckEvent EVENT_006 jr nz, .asm_1d266 ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned @@ -985,8 +972,7 @@ OaksLabText5: ; 1d248 (7:5248) ld a, [wd11e] cp $2 jr c, .asm_1d279 - ld a, [wd74b] - bit 5, a + CheckEvent EVENT_GOT_POKEDEX jr z, .asm_1d279 .asm_1d266 ld hl, OaksLabText_1d31d @@ -999,13 +985,11 @@ OaksLabText5: ; 1d248 (7:5248) ld b,POKE_BALL call IsItemInBag jr nz, .asm_1d2e7 - ld a, [wd7eb] - bit 5, a + CheckEvent EVENT_525 jr nz, .asm_1d2d0 - ld a, [wd74b] - bit 5, a + CheckEvent EVENT_GOT_POKEDEX jr nz, .asm_1d2c8 - bit 3, a + CheckEventReuseA EVENT_BATTLED_RIVAL_IN_OAKS_LAB jr nz, .asm_1d2a9 ld a, [wd72e] bit 3, a @@ -1036,9 +1020,7 @@ OaksLabText5: ; 1d248 (7:5248) call PrintText jr .asm_1d2ed .asm_1d2d0 - ld hl, wd74b - bit 4, [hl] - set 4, [hl] + CheckAndSetEvent EVENT_GOT_POKEBALLS_FROM_OAK jr nz, .asm_1d2e7 ld bc, (POKE_BALL << 8) | 5 call GiveItem diff --git a/scripts/pallettown.asm b/scripts/pallettown.asm index b463c4d6..15956e7b 100755 --- a/scripts/pallettown.asm +++ b/scripts/pallettown.asm @@ -1,9 +1,7 @@ PalletTownScript: ; 18e5b (6:4e5b) - ld a,[wd74b] - bit 4,a + CheckEvent EVENT_GOT_POKEBALLS_FROM_OAK jr z,.next - ld hl,wd747 - set 6,[hl] + SetEvent EVENT_006 .next call EnableAutoTextBoxDrawing ld hl,PalletTownScriptPointers @@ -20,8 +18,7 @@ PalletTownScriptPointers: ; 18e73 (6:4e73) dw PalletTownScript6 PalletTownScript0: ; 18e81 (6:4e81) - ld a,[wd747] - bit 0,a + CheckEvent EVENT_STOPPED_FROM_LEAVING_PALLET ret nz ld a,[W_YCOORD] cp 1 ; is player near north exit? @@ -38,8 +35,7 @@ PalletTownScript0: ; 18e81 (6:4e81) call PlayMusic ld a,$FC ld [wJoyIgnore],a - ld hl,wd74b - set 7,[hl] + SetEvent EVENT_027 ; trigger the next script ld a,1 @@ -134,14 +130,12 @@ PalletTownScript4: ; 18f4b (6:4f4b) ret PalletTownScript5: ; 18f56 (6:4f56) - ld a,[wd74a] - bit 2,a + CheckEvent EVENT_01A jr nz,.next and 3 cp 3 jr nz,.next - ld hl,wd74a - set 2,[hl] + SetEvent EVENT_01A ld a,HS_DAISY_SITTING ld [wcc4d],a predef HideObject @@ -149,11 +143,9 @@ PalletTownScript5: ; 18f56 (6:4f56) ld [wcc4d],a predef_jump ShowObject .next - ld a,[wd74b] - bit 4,a + CheckEvent EVENT_GOT_POKEBALLS_FROM_OAK ret z - ld hl,wd74b - set 6,[hl] + SetEvent EVENT_026 PalletTownScript6: ; 18f87 (6:4f87) ret diff --git a/scripts/pewtercity.asm b/scripts/pewtercity.asm index 94d23caa..2fce86df 100755 --- a/scripts/pewtercity.asm +++ b/scripts/pewtercity.asm @@ -16,14 +16,12 @@ PewterCityScriptPointers: ; 19243 (6:5243) PewterCityScript0: ; 19251 (6:5251) xor a ld [W_MUSEUM1FCURSCRIPT], a - ld hl, wd754 - res 0, [hl] + ResetEvent EVENT_068 call PewterCityScript_1925e ret PewterCityScript_1925e: ; 1925e (6:525e) - ld a, [wd755] - bit 7, a + CheckEvent EVENT_077 ret nz ld hl, CoordsData_19277 call ArePlayerCoordsInArray diff --git a/scripts/pewtergym.asm b/scripts/pewtergym.asm index 9f1493d4..e2798b24 100755 --- a/scripts/pewtergym.asm +++ b/scripts/pewtergym.asm @@ -46,16 +46,14 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) ld a, $4 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd755 - set 7, [hl] + SetEvent EVENT_077 ld bc, (TM_34 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $5 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd755 - set 6, [hl] + SetEvent EVENT_076 jr .asm_5c408 .BagFull ld a, $6 @@ -74,13 +72,10 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) ld [wcc4d], a predef HideObject - ld hl, wd7eb - res 0, [hl] - res 7, [hl] + ResetEvents EVENT_520, EVENT_527 ; deactivate gym trainers - ld hl, wd755 - set 2, [hl] + SetEvent EVENT_BEAT_PEWTER_GYM_TRAINER_0 jp PewterGymScript_5c3bf @@ -94,9 +89,9 @@ PewterGymTextPointers: ; 5c435 (17:4435) PewterGymTrainerHeaders: ; 5c441 (17:4441) PewterGymTrainerHeader0: ; 5c441 (17:4441) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_PEWTER_GYM_TRAINER_0 db ($5 << 4) ; trainer's view range - dw wd755 ; flag's byte + dwEventFlagAddress EVENT_BEAT_PEWTER_GYM_TRAINER_0 dw PewterGymBattleText1 ; TextBeforeBattle dw PewterGymAfterBattleText1 ; TextAfterBattle dw PewterGymEndBattleText1 ; TextEndBattle @@ -106,10 +101,9 @@ PewterGymTrainerHeader0: ; 5c441 (17:4441) PewterGymText1: ; 5c44e (17:444e) TX_ASM - ld a, [wd755] - bit 7, a + CheckEvent EVENT_077 jr z, .asm_5c46a - bit 6, a + CheckEventReuseA EVENT_076 jr nz, .asm_5c462 call z, PewterGymScript_5c3df call DisableWaitingAfterTextDisplay diff --git a/scripts/pokemontower2.asm b/scripts/pokemontower2.asm index 6a54d549..a9619170 100755 --- a/scripts/pokemontower2.asm +++ b/scripts/pokemontower2.asm @@ -17,8 +17,7 @@ PokemonTower2ScriptPointers: ; 60509 (18:4509) dw PokemonTower2Script2 PokemonTower2Script0: ; 6050f (18:450f) - ld a, [wd764] - bit 7, a + CheckEvent EVENT_0EF ret nz ld hl, CoordsData_6055e call ArePlayerCoordsInArray @@ -29,15 +28,13 @@ PokemonTower2Script0: ; 6050f (18:450f) ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL call PlayMusic - ld hl, wd764 - res 6, [hl] + ResetEvent EVENT_0EE ld a, [wCoordIndex] cp $1 ld a, PLAYER_DIR_UP ld b, SPRITE_FACING_DOWN jr nz, .asm_60544 - ld hl, wd764 - set 6, [hl] + SetEvent EVENT_0EE ld a, PLAYER_DIR_LEFT ld b, SPRITE_FACING_RIGHT .asm_60544 @@ -66,14 +63,12 @@ PokemonTower2Script1: ; 60563 (18:4563) jp z, PokemonTower2Script_604fe ld a, $f0 ld [wJoyIgnore], a - ld hl, wd764 - set 7, [hl] + SetEvent EVENT_0EF ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID ld de, MovementData_605b2 - ld a, [wd764] - bit 6, a + CheckEvent EVENT_0EE jr nz, .asm_60589 ld de, MovementData_605a9 .asm_60589 @@ -132,8 +127,7 @@ PokemonTower2TextPointers: ; 605db (18:45db) PokemonTower2Text1: ; 605df (18:45df) TX_ASM - ld a, [wd764] - bit 7, a + CheckEvent EVENT_0EF jr z, .asm_16f24 ld hl, PokemonTower2Text_6063c call PrintText diff --git a/scripts/pokemontower3.asm b/scripts/pokemontower3.asm index 9d08aec4..a4fbbf18 100755 --- a/scripts/pokemontower3.asm +++ b/scripts/pokemontower3.asm @@ -20,27 +20,27 @@ PokemonTower3TextPointers: ; 606e5 (18:46e5) PokemonTower3TrainerHeaders: ; 606ed (18:46ed) PokemonTower3TrainerHeader0: ; 606ed (18:46ed) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_3_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd765 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_3_TRAINER_0 dw PokemonTower3BattleText1 ; TextBeforeBattle dw PokemonTower3AfterBattleText1 ; TextAfterBattle dw PokemonTower3EndBattleText1 ; TextEndBattle dw PokemonTower3EndBattleText1 ; TextEndBattle PokemonTower3TrainerHeader1: ; 606f9 (18:46f9) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_3_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd765 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_3_TRAINER_1 dw PokemonTower3BattleText2 ; TextBeforeBattle dw PokemonTower3AfterBattleText2 ; TextAfterBattle dw PokemonTower3EndBattleText2 ; TextEndBattle dw PokemonTower3EndBattleText2 ; TextEndBattle PokemonTower3TrainerHeader2: ; 60705 (18:4705) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_3_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd765 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_3_TRAINER_2 dw PokemonTower3BattleText3 ; TextBeforeBattle dw PokemonTower3AfterBattleText3 ; TextAfterBattle dw PokemonTower3EndBattleText3 ; TextEndBattle diff --git a/scripts/pokemontower4.asm b/scripts/pokemontower4.asm index c4732397..2638bdc2 100755 --- a/scripts/pokemontower4.asm +++ b/scripts/pokemontower4.asm @@ -22,27 +22,27 @@ PokemonTower4TextPointers: ; 6080f (18:480f) PokemonTower4TrainerHeaders: ; 6081b (18:481b) PokemonTower4TrainerHeader0: ; 6081b (18:481b) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_4_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd766 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_4_TRAINER_0 dw PokemonTower4BattleText1 ; TextBeforeBattle dw PokemonTower4AfterBattleText1 ; TextAfterBattle dw PokemonTower4EndBattleText1 ; TextEndBattle dw PokemonTower4EndBattleText1 ; TextEndBattle PokemonTower4TrainerHeader1: ; 60827 (18:4827) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_4_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd766 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_4_TRAINER_1 dw PokemonTower4BattleText2 ; TextBeforeBattle dw PokemonTower4AfterBattleText2 ; TextAfterBattle dw PokemonTower4EndBattleText2 ; TextEndBattle dw PokemonTower4EndBattleText2 ; TextEndBattle PokemonTower4TrainerHeader2: ; 60833 (18:4833) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_4_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd766 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_4_TRAINER_2 dw PokemonTower4BattleText3 ; TextBeforeBattle dw PokemonTower4AfterBattleText3 ; TextAfterBattle dw PokemonTower4EndBattleText3 ; TextEndBattle diff --git a/scripts/pokemontower5.asm b/scripts/pokemontower5.asm index 9ef5d419..b418b361 100755 --- a/scripts/pokemontower5.asm +++ b/scripts/pokemontower5.asm @@ -18,13 +18,10 @@ PokemonTower5Script0: ; 6094b (18:494b) jr c, .asm_60960 ld hl, wd72e res 4, [hl] - ld hl, wd767 - res 7, [hl] + ResetEvent EVENT_107 jp CheckFightingMapTrainers .asm_60960 - ld hl, wd767 - bit 7, [hl] - set 7, [hl] + CheckAndSetEvent EVENT_107 ret nz xor a ld [hJoyHeld], a @@ -62,36 +59,36 @@ PokemonTower5TextPointers: ; 6099b (18:499b) PokemonTower5TrainerHeaders: ; 609a9 (18:49a9) PokemonTower5TrainerHeader0: ; 609a9 (18:49a9) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd767 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_0 dw PokemonTower5BattleText1 ; TextBeforeBattle dw PokemonTower5AfterBattleText1 ; TextAfterBattle dw PokemonTower5EndBattleText1 ; TextEndBattle dw PokemonTower5EndBattleText1 ; TextEndBattle PokemonTower5TrainerHeader1: ; 609b5 (18:49b5) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd767 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_1 dw PokemonTower5BattleText2 ; TextBeforeBattle dw PokemonTower5AfterBattleText2 ; TextAfterBattle dw PokemonTower5EndBattleText2 ; TextEndBattle dw PokemonTower5EndBattleText2 ; TextEndBattle PokemonTower5TrainerHeader2: ; 609c1 (18:49c1) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd767 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_2 dw PokemonTower5BattleText3 ; TextBeforeBattle dw PokemonTower5AfterBattleText3 ; TextAfterBattle dw PokemonTower5EndBattleText3 ; TextEndBattle dw PokemonTower5EndBattleText3 ; TextEndBattle PokemonTower5TrainerHeader3: ; 609cd (18:49cd) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd767 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_3 dw PokemonTower5BattleText4 ; TextBeforeBattle dw PokemonTower5AfterBattleText4 ; TextAfterBattle dw PokemonTower5EndBattleText4 ; TextEndBattle diff --git a/scripts/pokemontower6.asm b/scripts/pokemontower6.asm index e9412fb0..68260484 100755 --- a/scripts/pokemontower6.asm +++ b/scripts/pokemontower6.asm @@ -22,8 +22,7 @@ PokemonTower6ScriptPointers: ; 60b0d (18:4b0d) dw PokemonTower6Script4 PokemonTower6Script0: ; 60b17 (18:4b17) - ld a, [wd768] - bit 7, a + CheckEvent EVENT_10F jp nz, CheckFightingMapTrainers ld hl, CoordsData_60b45 call ArePlayerCoordsInArray @@ -60,8 +59,7 @@ PokemonTower6Script4: ; 60b48 (18:4b48) ld a, [wBattleResult] and a jr nz, .asm_60b82 - ld hl, wd768 - set 7, [hl] + SetEvent EVENT_10F ld a, $7 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -107,27 +105,27 @@ PokemonTower6TextPointers: ; 60bb1 (18:4bb1) PokemonTower6TrainerHeaders: ; 60bbf (18:4bbf) PokemonTower6TrainerHeader0: ; 60bbf (18:4bbf) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd768 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_0 dw PokemonTower6BattleText1 ; TextBeforeBattle dw PokemonTower6AfterBattleText1 ; TextAfterBattle dw PokemonTower6EndBattleText1 ; TextEndBattle dw PokemonTower6EndBattleText1 ; TextEndBattle PokemonTower6TrainerHeader1: ; 60bcb (18:4bcb) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd768 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_1 dw PokemonTower6BattleText2 ; TextBeforeBattle dw PokemonTower6AfterBattleText2 ; TextAfterBattle dw PokemonTower6EndBattleText2 ; TextEndBattle dw PokemonTower6EndBattleText2 ; TextEndBattle PokemonTower6TrainerHeader2: ; 60bd7 (18:4bd7) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd768 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_2 dw PokemonTower6BattleText3 ; TextBeforeBattle dw PokemonTower6AfterBattleText3 ; TextAfterBattle dw PokemonTower6EndBattleText3 ; TextEndBattle diff --git a/scripts/pokemontower7.asm b/scripts/pokemontower7.asm index 60635f20..c2fe1508 100755 --- a/scripts/pokemontower7.asm +++ b/scripts/pokemontower7.asm @@ -206,27 +206,27 @@ PokemonTower7TextPointers: ; 60e3f (18:4e3f) PokemonTower7TrainerHeaders: ; 60e47 (18:4e47) PokemonTower7TrainerHeader0: ; 60e47 (18:4e47) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_7_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd769 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_7_TRAINER_0 dw PokemonTower7BattleText1 ; TextBeforeBattle dw PokemonTower7AfterBattleText1 ; TextAfterBattle dw PokemonTower7EndBattleText1 ; TextEndBattle dw PokemonTower7EndBattleText1 ; TextEndBattle PokemonTower7TrainerHeader1: ; 60e53 (18:4e53) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_7_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd769 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_7_TRAINER_1 dw PokemonTower7BattleText2 ; TextBeforeBattle dw PokemonTower7AfterBattleText2 ; TextAfterBattle dw PokemonTower7EndBattleText2 ; TextEndBattle dw PokemonTower7EndBattleText2 ; TextEndBattle PokemonTower7TrainerHeader2: ; 60e5f (18:4e5f) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_POKEMONTOWER_7_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd769 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_7_TRAINER_2 dw PokemonTower7BattleText3 ; TextBeforeBattle dw PokemonTower7AfterBattleText3 ; TextAfterBattle dw PokemonTower7EndBattleText3 ; TextEndBattle @@ -256,10 +256,8 @@ PokemonTower7FujiText: TX_ASM ld hl, TowerRescueFujiText call PrintText - ld hl, wd7e0 - set 7, [hl] - ld hl, wd769 - set 7, [hl] + SetEvent EVENT_4CF + SetEvent EVENT_117 ld a, HS_LAVENDER_HOUSE_1_MR_FUJI ld [wcc4d], a predef ShowObject diff --git a/scripts/powerplant.asm b/scripts/powerplant.asm index 0026d525..48f291e1 100755 --- a/scripts/powerplant.asm +++ b/scripts/powerplant.asm @@ -30,81 +30,81 @@ PowerPlantTextPointers: ; 1e2df (7:62df) PowerPlantTrainerHeaders: ; 1e2fb (7:62fb) PowerPlantTrainerHeader0: ; 1e2fb (7:62fb) - db 1 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_0 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_0 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader1: ; 1e307 (7:6307) - db 2 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_1 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_1 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader2: ; 1e313 (7:6313) - db 3 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_2 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_2 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader3: ; 1e31f (7:631f) - db 4 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_3 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_3 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader4: ; 1e32b (7:632b) - db 5 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_4 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_4 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader5: ; 1e337 (7:6337) - db 6 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_5 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_5 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader6: ; 1e343 (7:6343) - db 7 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_6 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_6 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader7: ; 1e34f (7:634f) - db 8 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_7, 1 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_7, 1 dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle dw VoltorbBattleText ; TextEndBattle PowerPlantTrainerHeader8: ; 1e35b (7:635b) - db 9 ; flag's bit + dbEventFlagBit EVENT_BEAT_POWER_PLANT_TRAINER_8, 1 db 0 ; view range - dw wd7d3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_POWER_PLANT_TRAINER_8, 1 dw ZapdosBattleText ; TextBeforeBattle dw ZapdosBattleText ; TextAfterBattle dw ZapdosBattleText ; TextEndBattle diff --git a/scripts/rockethideout1.asm b/scripts/rockethideout1.asm index b798744d..ccf40cb4 100755 --- a/scripts/rockethideout1.asm +++ b/scripts/rockethideout1.asm @@ -13,18 +13,16 @@ RocketHideout1Script_44be0: ; 44be0 (11:4be0) bit 5, [hl] res 5, [hl] ret z - ld a, [wd815] - bit 7, a + CheckEvent EVENT_677 jr nz, .asm_44c01 - bit 5, a + CheckEventReuseA EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 jr nz, .asm_44bf7 ld a, $54 jr .asm_44c03 .asm_44bf7 ld a, SFX_GO_INSIDE call PlaySound - ld hl, wd815 - bit 7, [hl] + CheckEventHL EVENT_677 .asm_44c01 ld a, $e .asm_44c03 @@ -48,45 +46,45 @@ RocketHideout1TextPointers: ; 44c14 (11:4c14) RocketHideout1TrainerHeaders: ; 44c22 (11:4c22) RocketHideout1TrainerHeader0: ; 44c22 (11:4c22) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd815 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0 dw RocketHideout1BattleText2 ; TextBeforeBattle dw RocketHideout1AfterBattleTxt2 ; TextAfterBattle dw RocketHideout1EndBattleText2 ; TextEndBattle dw RocketHideout1EndBattleText2 ; TextEndBattle RocketHideout1TrainerHeader2: ; 44c2e (11:4c2e) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd815 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2 dw RocketHideout1BattleText3 ; TextBeforeBattle dw RocketHideout1AfterBattleTxt3 ; TextAfterBattle dw RocketHideout1EndBattleText3 ; TextEndBattle dw RocketHideout1EndBattleText3 ; TextEndBattle RocketHideout1TrainerHeader3: ; 44c3a (11:4c3a) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd815 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3 dw RocketHideout1BattleText4 ; TextBeforeBattle dw RocketHideout1AfterBattleTxt4 ; TextAfterBattle dw RocketHideout1EndBattleText4 ; TextEndBattle dw RocketHideout1EndBattleText4 ; TextEndBattle RocketHideout1TrainerHeader4: ; 44c46 (11:4c46) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd815 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4 dw RocketHideout1BattleText5 ; TextBeforeBattle dw RocketHideout1AfterBattleTxt5 ; TextAfterBattle dw RocketHideout1EndBattleText5 ; TextEndBattle dw RocketHideout1EndBattleText5 ; TextEndBattle RocketHideout1TrainerHeader5: ; 44c52 (11:4c52) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd815 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 dw RocketHideout1BattleText6 ; TextBeforeBattle dw RocketHideout1AfterBattleTxt6 ; TextAfterBattle dw RocketHideout1EndBattleText6 ; TextEndBattle @@ -127,8 +125,7 @@ RocketHideout1Text5: ; 44c87 (11:4c87) RocketHideout1EndBattleText6: ; 44c91 (11:4c91) TX_FAR _RocketHideout1EndBattleText6 TX_ASM - ld hl, wd815 - set 5, [hl] + SetEvent EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 ld hl, RocketHideout1Text_44c9f ret diff --git a/scripts/rockethideout2.asm b/scripts/rockethideout2.asm index ead69458..f269faef 100755 --- a/scripts/rockethideout2.asm +++ b/scripts/rockethideout2.asm @@ -422,9 +422,9 @@ RocketHideout2TextPointers: ; 450c7 (11:50c7) RocketHideout2TrainerHeaders: ; 450d1 (11:50d1) RocketHideout2TrainerHeader0: ; 450d1 (11:50d1) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd817 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0 dw RocketHideout2BattleText2 ; TextBeforeBattle dw RocketHideout2AfterBattleTxt2 ; TextAfterBattle dw RocketHideout2EndBattleText2 ; TextEndBattle diff --git a/scripts/rockethideout3.asm b/scripts/rockethideout3.asm index 2060c26c..1f6d5b41 100755 --- a/scripts/rockethideout3.asm +++ b/scripts/rockethideout3.asm @@ -151,18 +151,18 @@ RocketHideout3TextPointers: ; 452fa (11:52fa) RocketHideout3TrainerHeaders: ; 45302 (11:5302) RocketHideout3TrainerHeader0: ; 45302 (11:5302) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd819 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0 dw RocketHideout3BattleText2 ; TextBeforeBattle dw RocketHideout3AfterBattleTxt2 ; TextAfterBattle dw RocketHideout3EndBattleText2 ; TextEndBattle dw RocketHideout3EndBattleText2 ; TextEndBattle RocketHideout3TrainerHeader2: ; 4530e (11:530e) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd819 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_2 dw RocketHideout3BattleTxt ; TextBeforeBattle dw RocketHideout3AfterBattleText3 ; TextAfterBattle dw RocketHideout3EndBattleText3 ; TextEndBattle diff --git a/scripts/rockethideout4.asm b/scripts/rockethideout4.asm index 44536279..e6ba430b 100755 --- a/scripts/rockethideout4.asm +++ b/scripts/rockethideout4.asm @@ -13,8 +13,7 @@ RocketHideout4Script_45473: ; 45473 (11:5473) bit 5, [hl] res 5, [hl] ret z - ld a, [wd81b] - bit 5, a + CheckEvent EVENT_6A5 jr nz, .asm_45496 and $c cp $c @@ -24,8 +23,7 @@ RocketHideout4Script_45473: ; 45473 (11:5473) .asm_4548c ld a, SFX_GO_INSIDE call PlaySound - ld hl, wd81b - set 5, [hl] + SetEvent EVENT_6A5 .asm_45496 ld a, $e .asm_45498 @@ -53,8 +51,7 @@ RocketHideout4Script3: ; 454b6 (11:54b6) call UpdateSprites ld a, $f0 ld [wJoyIgnore], a - ld hl, wd81b - set 7, [hl] + SetEvent EVENT_6A7 ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -90,27 +87,27 @@ RocketHideout4TextPointers: ; 45501 (11:5501) RocketHideout4TrainerHeaders: ; 45515 (11:5515) RocketHideout4TrainerHeader0: ; 45515 (11:5515) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd81b ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0 dw RocketHideout4BattleText2 ; TextBeforeBattle dw RocketHideout4AfterBattleText2 ; TextAfterBattle dw RocketHideout4EndBattleText2 ; TextEndBattle dw RocketHideout4EndBattleText2 ; TextEndBattle RocketHideout4TrainerHeader2: ; 45521 (11:5521) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2 db ($0 << 4) ; trainer's view range - dw wd81b ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2 dw RocketHideout4BattleText3 ; TextBeforeBattle dw RocketHideout4AfterBattleText3 ; TextAfterBattle dw RocketHideout4EndBattleText3 ; TextEndBattle dw RocketHideout4EndBattleText3 ; TextEndBattle RocketHideout4TrainerHeader3: ; 4552d (11:552d) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_3 db ($1 << 4) ; trainer's view range - dw wd81b ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_3 dw RocketHideout4BattleText4 ; TextBeforeBattle dw RocketHideout4AfterBattleText4 ; TextAfterBattle dw RocketHideout4EndBattleText4 ; TextEndBattle @@ -120,8 +117,7 @@ RocketHideout4TrainerHeader3: ; 4552d (11:552d) RocketHideout4Text1: ; 4553a (11:553a) TX_ASM - ld a, [wd81b] - bit 7, a + CheckEvent EVENT_6A7 jp nz, .asm_545571 ld hl, RocketHideout4Text_4557a call PrintText @@ -213,9 +209,7 @@ RocketHideout4AfterBattleText4: ; 455cf (11:55cf) TX_ASM ld hl, RocketHideout4Text_455ec call PrintText - ld hl, wd81b - bit 6, [hl] - set 6, [hl] + CheckAndSetEvent EVENT_6A6 jr nz, .asm_455e9 ld a, HS_ROCKET_HIDEOUT_4_ITEM_5 ld [wcc4d], a diff --git a/scripts/rocktunnel1.asm b/scripts/rocktunnel1.asm index 72881e65..d03a5ba1 100755 --- a/scripts/rocktunnel1.asm +++ b/scripts/rocktunnel1.asm @@ -24,63 +24,63 @@ RockTunnel1TextPointers: ; 444f5 (11:44f5) RockTunnel1TrainerHeaders: ; 44505 (11:4505) RockTunnel1TrainerHeader1: ; 44505 (11:4505) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1 dw RockTunnel1BattleText1 ; TextBeforeBattle dw RockTunnel1AfterBattleText1 ; TextAfterBattle dw RockTunnel1EndBattleText1 ; TextEndBattle dw RockTunnel1EndBattleText1 ; TextEndBattle RockTunnel1TrainerHeader2: ; 44511 (11:4511) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2 dw RockTunnel1BattleText2 ; TextBeforeBattle dw RockTunnel1AfterBattleText2 ; TextAfterBattle dw RockTunnel1EndBattleText2 ; TextEndBattle dw RockTunnel1EndBattleText2 ; TextEndBattle RockTunnel1TrainerHeader3: ; 4451d (11:451d) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3 dw RockTunnel1BattleText3 ; TextBeforeBattle dw RockTunnel1AfterBattleText3 ; TextAfterBattle dw RockTunnel1EndBattleText3 ; TextEndBattle dw RockTunnel1EndBattleText3 ; TextEndBattle RockTunnel1TrainerHeader4: ; 44529 (11:4529) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4 dw RockTunnel1BattleText4 ; TextBeforeBattle dw RockTunnel1AfterBattleText4 ; TextAfterBattle dw RockTunnel1EndBattleText4 ; TextEndBattle dw RockTunnel1EndBattleText4 ; TextEndBattle RockTunnel1TrainerHeader5: ; 44535 (11:4535) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5 dw RockTunnel1BattleText5 ; TextBeforeBattle dw RockTunnel1AfterBattleText5 ; TextAfterBattle dw RockTunnel1EndBattleText5 ; TextEndBattle dw RockTunnel1EndBattleText5 ; TextEndBattle RockTunnel1TrainerHeader6: ; 44541 (11:4541) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6 db ($4 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6 dw RockTunnel1BattleText6 ; TextBeforeBattle dw RockTunnel1AfterBattleText6 ; TextAfterBattle dw RockTunnel1EndBattleText6 ; TextEndBattle dw RockTunnel1EndBattleText6 ; TextEndBattle RockTunnel1TrainerHeader7: ; 4454d (11:454d) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_7 db ($4 << 4) ; trainer's view range - dw wd7d2 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_7 dw RockTunnel1BattleText7 ; TextBeforeBattle dw RockTunnel1AfterBattleText7 ; TextAfterBattle dw RockTunnel1EndBattleText7 ; TextEndBattle diff --git a/scripts/rocktunnel2.asm b/scripts/rocktunnel2.asm index 832a244f..2082394a 100755 --- a/scripts/rocktunnel2.asm +++ b/scripts/rocktunnel2.asm @@ -24,72 +24,72 @@ RockTunnel2TextPointers: ; 46004 (11:6004) RockTunnel2TrainerHeaders: ; 46014 (11:6014) RockTunnel2TrainerHeader0: ; 46014 (11:6014) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0 dw RockTunnel2BattleText2 ; TextBeforeBattle dw RockTunnel2AfterBattleText2 ; TextAfterBattle dw RockTunnel2EndBattleText2 ; TextEndBattle dw RockTunnel2EndBattleText2 ; TextEndBattle RockTunnel2TrainerHeader2: ; 46020 (11:6020) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2 dw RockTunnel2BattleText3 ; TextBeforeBattle dw RockTunnel2AfterBattleText3 ; TextAfterBattle dw RockTunnel2EndBattleText3 ; TextEndBattle dw RockTunnel2EndBattleText3 ; TextEndBattle RockTunnel2TrainerHeader3: ; 4602c (11:602c) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3 dw RockTunnel2BattleText4 ; TextBeforeBattle dw RockTunnel2AfterBattleText4 ; TextAfterBattle dw RockTunnel2EndBattleText4 ; TextEndBattle dw RockTunnel2EndBattleText4 ; TextEndBattle RockTunnel2TrainerHeader4: ; 46038 (11:6038) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4 dw RockTunnel2BattleText5 ; TextBeforeBattle dw RockTunnel2AfterBattleText5 ; TextAfterBattle dw RockTunnel2EndBattleText5 ; TextEndBattle dw RockTunnel2EndBattleText5 ; TextEndBattle RockTunnel2TrainerHeader5: ; 46044 (11:6044) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5 dw RockTunnel2BattleText6 ; TextBeforeBattle dw RockTunnel2AfterBattleText6 ; TextAfterBattle dw RockTunnel2EndBattleText6 ; TextEndBattle dw RockTunnel2EndBattleText6 ; TextEndBattle RockTunnel2TrainerHeader6: ; 46050 (11:6050) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6 db ($4 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6 dw RockTunnel2BattleText7 ; TextBeforeBattle dw RockTunnel2AfterBattleText7 ; TextAfterBattle dw RockTunnel2EndBattleText7 ; TextEndBattle dw RockTunnel2EndBattleText7 ; TextEndBattle RockTunnel2TrainerHeader7: ; 4605c (11:605c) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7 db ($3 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7 dw RockTunnel2BattleText8 ; TextBeforeBattle dw RockTunnel2AfterBattleText8 ; TextAfterBattle dw RockTunnel2EndBattleText8 ; TextEndBattle dw RockTunnel2EndBattleText8 ; TextEndBattle RockTunnel2TrainerHeader8: ; 46068 (11:6068) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_8, 1 db ($3 << 4) ; trainer's view range - dw wd87d ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_8, 1 dw RockTunnel2BattleText9 ; TextBeforeBattle dw RockTunnel2AfterBattleText9 ; TextAfterBattle dw RockTunnel2EndBattleText9 ; TextEndBattle diff --git a/scripts/route1.asm b/scripts/route1.asm index 74ac9605..d1e39c06 100755 --- a/scripts/route1.asm +++ b/scripts/route1.asm @@ -8,9 +8,7 @@ Route1TextPointers: ; 1cab2 (7:4ab2) Route1Text1: ; 1cab8 (7:4ab8) TX_ASM - ld hl, wd7bf - bit 0, [hl] - set 0, [hl] + CheckAndSetEvent EVENT_3C0 jr nz, .asm_1cada ld hl, Route1ViridianMartSampleText call PrintText diff --git a/scripts/route10.asm b/scripts/route10.asm index fbc3b01a..2d5d2ae4 100755 --- a/scripts/route10.asm +++ b/scripts/route10.asm @@ -26,54 +26,54 @@ Route10TextPointers: ; 5934f (16:534f) Route10TrainerHeaders: ; 59363 (16:5363) Route10TrainerHeader0: ; 59363 (16:5363) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7d1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_0 dw Route10BattleText1 ; TextBeforeBattle dw Route10AfterBattleText1 ; TextAfterBattle dw Route10EndBattleText1 ; TextEndBattle dw Route10EndBattleText1 ; TextEndBattle Route10TrainerHeader1: ; 5936f (16:536f) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd7d1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_1 dw Route10BattleText2 ; TextBeforeBattle dw Route10AfterBattleText2 ; TextAfterBattle dw Route10EndBattleText2 ; TextEndBattle dw Route10EndBattleText2 ; TextEndBattle Route10TrainerHeader2: ; 5937b (16:537b) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7d1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_2 dw Route10BattleText3 ; TextBeforeBattle dw Route10AfterBattleText3 ; TextAfterBattle dw Route10EndBattleText3 ; TextEndBattle dw Route10EndBattleText3 ; TextEndBattle Route10TrainerHeader3: ; 59387 (16:5387) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7d1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_3 dw Route10BattleText4 ; TextBeforeBattle dw Route10AfterBattleText4 ; TextAfterBattle dw Route10EndBattleText4 ; TextEndBattle dw Route10EndBattleText4 ; TextEndBattle Route10TrainerHeader4: ; 59393 (16:5393) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd7d1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_4 dw Route10BattleText5 ; TextBeforeBattle dw Route10AfterBattleText5 ; TextAfterBattle dw Route10EndBattleText5 ; TextEndBattle dw Route10EndBattleText5 ; TextEndBattle Route10TrainerHeader5: ; 5939f (16:539f) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_5 db ($2 << 4) ; trainer's view range - dw wd7d1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_5 dw Route10BattleText6 ; TextBeforeBattle dw Route10AfterBattleText6 ; TextAfterBattle dw Route10EndBattleText6 ; TextEndBattle diff --git a/scripts/route11.asm b/scripts/route11.asm index 7a31232b..3a9f1e0d 100755 --- a/scripts/route11.asm +++ b/scripts/route11.asm @@ -27,90 +27,90 @@ Route11TextPointers: ; 59465 (16:5465) Route11TrainerHeaders: ; 5947b (16:547b) Route11TrainerHeader0: ; 5947b (16:547b) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_0 dw Route11BattleText1 ; TextBeforeBattle dw Route11AfterBattleText1 ; TextAfterBattle dw Route11EndBattleText1 ; TextEndBattle dw Route11EndBattleText1 ; TextEndBattle Route11TrainerHeader1: ; 59487 (16:5487) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_1 dw Route11BattleText2 ; TextBeforeBattle dw Route11AfterBattleText2 ; TextAfterBattle dw Route11EndBattleText2 ; TextEndBattle dw Route11EndBattleText2 ; TextEndBattle Route11TrainerHeader2: ; 59493 (16:5493) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_2 dw Route11BattleText3 ; TextBeforeBattle dw Route11AfterBattleText3 ; TextAfterBattle dw Route11EndBattleText3 ; TextEndBattle dw Route11EndBattleText3 ; TextEndBattle Route11TrainerHeader3: ; 5949f (16:549f) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_3 dw Route11BattleText4 ; TextBeforeBattle dw Route11AfterBattleText4 ; TextAfterBattle dw Route11EndBattleText4 ; TextEndBattle dw Route11EndBattleText4 ; TextEndBattle Route11TrainerHeader4: ; 594ab (16:54ab) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_4 dw Route11BattleText5 ; TextBeforeBattle dw Route11AfterBattleText5 ; TextAfterBattle dw Route11EndBattleText5 ; TextEndBattle dw Route11EndBattleText5 ; TextEndBattle Route11TrainerHeader5: ; 594b7 (16:54b7) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_5 dw Route11BattleText6 ; TextBeforeBattle dw Route11AfterBattleText6 ; TextAfterBattle dw Route11EndBattleText6 ; TextEndBattle dw Route11EndBattleText6 ; TextEndBattle Route11TrainerHeader6: ; 594c3 (16:54c3) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_6 dw Route11BattleText7 ; TextBeforeBattle dw Route11AfterBattleText7 ; TextAfterBattle dw Route11EndBattleText7 ; TextEndBattle dw Route11EndBattleText7 ; TextEndBattle Route11TrainerHeader7: ; 594cf (16:54cf) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_7, 1 db ($4 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_7, 1 dw Route11BattleText8 ; TextBeforeBattle dw Route11AfterBattleText8 ; TextAfterBattle dw Route11EndBattleText8 ; TextEndBattle dw Route11EndBattleText8 ; TextEndBattle Route11TrainerHeader8: ; 594db (16:54db) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_8, 1 db ($3 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_8, 1 dw Route11BattleText9 ; TextBeforeBattle dw Route11AfterBattleText9 ; TextAfterBattle dw Route11EndBattleText9 ; TextEndBattle dw Route11EndBattleText9 ; TextEndBattle Route11TrainerHeader9: ; 594e7 (16:54e7) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_9, 1 db ($4 << 4) ; trainer's view range - dw wd7d5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_9, 1 dw Route11BattleText10 ; TextBeforeBattle dw Route11AfterBattleText10 ; TextAfterBattle dw Route11EndBattleText10 ; TextEndBattle diff --git a/scripts/route11gateupstairs.asm b/scripts/route11gateupstairs.asm index eded4165..7720b176 100755 --- a/scripts/route11gateupstairs.asm +++ b/scripts/route11gateupstairs.asm @@ -17,8 +17,7 @@ Route11GateUpstairsScriptEnd: ; 49469 (12:5469) Route11GateUpstairsText2: ; 4946c (12:546c) TX_ASM - ld a, [wd7d6] - add a + CheckEvent EVENT_47F, 1 jr c, .asm_4949b ld a, 30 ; pokemon needed ld [$ffdb], a @@ -35,8 +34,7 @@ Route11GateUpstairsText2: ; 4946c (12:546c) ld a, [$ffdb] dec a jr nz, .asm_494a1 - ld hl, wd7d6 - set 7, [hl] + SetEvent EVENT_47F .asm_4949b ld hl, Route11GateUpstairsText_494a3 call PrintText @@ -52,8 +50,7 @@ Route11GateUpstairsText3: ; 494a8 (12:54a8) ld a, [wSpriteStateData1 + 9] cp SPRITE_FACING_UP jp nz, GateUpstairsScript_PrintIfFacingUp - ld a, [wd7d8] - bit 7, a ; fought snorlax? + CheckEvent EVENT_BEAT_ROUTE12_SNORLAX ld hl, BinocularsSnorlaxText jr z, .print ld hl, BinocularsNoSnorlaxText diff --git a/scripts/route12.asm b/scripts/route12.asm index 8fe9d8f7..be20958e 100755 --- a/scripts/route12.asm +++ b/scripts/route12.asm @@ -21,11 +21,10 @@ Route12ScriptPointers: ; 59611 (16:5611) dw Route12Script3 Route12Script0: ; 59619 (16:5619) - ld hl, wd7d8 - bit 7, [hl] + CheckEventHL EVENT_BEAT_ROUTE12_SNORLAX jp nz, CheckFightingMapTrainers - bit 6, [hl] - res 6, [hl] + CheckEventReuseHL EVENT_FIGHT_ROUTE12_SNORLAX + ResetEventReuseHL EVENT_FIGHT_ROUTE12_SNORLAX jp z, CheckFightingMapTrainers ld a, $d ld [hSpriteIndexOrTextID], a @@ -54,8 +53,7 @@ Route12Script3: ; 5964c (16:564c) ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_59664 - ld hl, wd7d8 - set 7, [hl] + SetEvent EVENT_BEAT_ROUTE12_SNORLAX call Delay3 ld a, $0 ld [W_ROUTE12CURSCRIPT], a @@ -80,63 +78,63 @@ Route12TextPointers: ; 59675 (16:5675) Route12TrainerHeaders: ; 59691 (16:5691) Route12TrainerHeader0: ; 59691 (16:5691) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_0 dw Route12BattleText1 ; TextBeforeBattle dw Route12AfterBattleText1 ; TextAfterBattle dw Route12EndBattleText1 ; TextEndBattle dw Route12EndBattleText1 ; TextEndBattle Route12TrainerHeader1: ; 5969d (16:569d) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_1 dw Route12BattleText2 ; TextBeforeBattle dw Route12AfterBattleText2 ; TextAfterBattle dw Route12EndBattleText2 ; TextEndBattle dw Route12EndBattleText2 ; TextEndBattle Route12TrainerHeader2: ; 596a9 (16:56a9) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_2 dw Route12BattleText3 ; TextBeforeBattle dw Route12AfterBattleText3 ; TextAfterBattle dw Route12EndBattleText3 ; TextEndBattle dw Route12EndBattleText3 ; TextEndBattle Route12TrainerHeader3: ; 596b5 (16:56b5) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_3 dw Route12BattleText4 ; TextBeforeBattle dw Route12AfterBattleText4 ; TextAfterBattle dw Route12EndBattleText4 ; TextEndBattle dw Route12EndBattleText4 ; TextEndBattle Route12TrainerHeader4: ; 596c1 (16:56c1) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_4 dw Route12BattleText5 ; TextBeforeBattle dw Route12AfterBattleText5 ; TextAfterBattle dw Route12EndBattleText5 ; TextEndBattle dw Route12EndBattleText5 ; TextEndBattle Route12TrainerHeader5: ; 596cd (16:56cd) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_5 dw Route12BattleText6 ; TextBeforeBattle dw Route12AfterBattleText6 ; TextAfterBattle dw Route12EndBattleText6 ; TextEndBattle dw Route12EndBattleText6 ; TextEndBattle Route12TrainerHeader6: ; 596d9 (16:56d9) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_6, 1 db ($1 << 4) ; trainer's view range - dw wd7d7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_6, 1 dw Route12BattleText7 ; TextBeforeBattle dw Route12AfterBattleText7 ; TextAfterBattle dw Route12EndBattleText7 ; TextEndBattle diff --git a/scripts/route12gateupstairs.asm b/scripts/route12gateupstairs.asm index d4e8e983..e1f8901f 100755 --- a/scripts/route12gateupstairs.asm +++ b/scripts/route12gateupstairs.asm @@ -8,8 +8,7 @@ Route12GateUpstairsTextPointers: ; 49563 (12:5563) Route12GateUpstairsText1: ; 49569 (12:5569) TX_ASM - ld a, [wd7d7] - rrca + CheckEvent EVENT_480, 1 jr c, .asm_0ad3c ld hl, TM39PreReceiveText call PrintText @@ -18,8 +17,7 @@ Route12GateUpstairsText1: ; 49569 (12:5569) jr nc, .BagFull ld hl, ReceivedTM39Text call PrintText - ld hl, wd7d7 - set 0, [hl] + SetEvent EVENT_480 jr .asm_4ba56 .BagFull ld hl, TM39NoRoomText diff --git a/scripts/route13.asm b/scripts/route13.asm index aed4745c..ab061071 100755 --- a/scripts/route13.asm +++ b/scripts/route13.asm @@ -29,90 +29,90 @@ Route13TextPointers: ; 55837 (15:5837) Route13TrainerHeaders: ; 55851 (15:5851) Route13TrainerHeader0: ; 55851 (15:5851) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_0 dw Route13BattleText2 ; TextBeforeBattle dw Route13AfterBattleText2 ; TextAfterBattle dw Route13EndBattleText2 ; TextEndBattle dw Route13EndBattleText2 ; TextEndBattle Route13TrainerHeader2: ; 5585d (15:585d) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_2 dw Route13BattleText3 ; TextBeforeBattle dw Route13AfterBattleText3 ; TextAfterBattle dw Route13EndBattleText3 ; TextEndBattle dw Route13EndBattleText3 ; TextEndBattle Route13TrainerHeader3: ; 55869 (15:5869) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_3 dw Route13BattleText4 ; TextBeforeBattle dw Route13AfterBattleText4 ; TextAfterBattle dw Route13EndBattleText4 ; TextEndBattle dw Route13EndBattleText4 ; TextEndBattle Route13TrainerHeader4: ; 55875 (15:5875) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_4 dw Route13BattleText5 ; TextBeforeBattle dw Route13AfterBattleText5 ; TextAfterBattle dw Route13EndBattleText5 ; TextEndBattle dw Route13EndBattleText5 ; TextEndBattle Route13TrainerHeader5: ; 55881 (15:5881) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_5 dw Route13BattleText6 ; TextBeforeBattle dw Route13AfterBattleText6 ; TextAfterBattle dw Route13EndBattleText6 ; TextEndBattle dw Route13EndBattleText6 ; TextEndBattle Route13TrainerHeader6: ; 5588d (15:588d) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_6 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_6 dw Route13BattleText7 ; TextBeforeBattle dw Route13AfterBattleText7 ; TextAfterBattle dw Route13EndBattleText7 ; TextEndBattle dw Route13EndBattleText7 ; TextEndBattle Route13TrainerHeader7: ; 55899 (15:5899) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_7 db ($4 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_7 dw Route13BattleText8 ; TextBeforeBattle dw Route13AfterBattleText8 ; TextAfterBattle dw Route13EndBattleText8 ; TextEndBattle dw Route13EndBattleText8 ; TextEndBattle Route13TrainerHeader8: ; 558a5 (15:58a5) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_8, 1 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_8, 1 dw Route13BattleText9 ; TextBeforeBattle dw Route13AfterBattleText9 ; TextAfterBattle dw Route13EndBattleText9 ; TextEndBattle dw Route13EndBattleText9 ; TextEndBattle Route13TrainerHeader9: ; 558b1 (15:58b1) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_9, 1 db ($2 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_9, 1 dw Route13BattleText10 ; TextBeforeBattle dw Route13AfterBattleText10 ; TextAfterBattle dw Route13EndBattleText10 ; TextEndBattle dw Route13EndBattleText10 ; TextEndBattle Route13TrainerHeader10: ; 558bd (15:58bd) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_10, 1 db ($4 << 4) ; trainer's view range - dw wd7d9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_10, 1 dw Route13BattleText11 ; TextBeforeBattle dw Route13AfterBattleText11 ; TextAfterBattle dw Route13EndBattleText11 ; TextEndBattle diff --git a/scripts/route14.asm b/scripts/route14.asm index 25a2cd85..d65e257f 100755 --- a/scripts/route14.asm +++ b/scripts/route14.asm @@ -27,90 +27,90 @@ Route14TextPointers: ; 559ec (15:59ec) Route14TrainerHeaders: ; 55a02 (15:5a02) Route14TrainerHeader0: ; 55a02 (15:5a02) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_0 dw Route14BattleText1 ; TextBeforeBattle dw Route14AfterBattleText1 ; TextAfterBattle dw Route14EndBattleText1 ; TextEndBattle dw Route14EndBattleText1 ; TextEndBattle Route14TrainerHeader1: ; 55a0e (15:5a0e) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_1 dw Route14BattleText2 ; TextBeforeBattle dw Route14AfterBattleText2 ; TextAfterBattle dw Route14EndBattleText2 ; TextEndBattle dw Route14EndBattleText2 ; TextEndBattle Route14TrainerHeader2: ; 55a1a (15:5a1a) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_2 dw Route14BattleText3 ; TextBeforeBattle dw Route14AfterBattleText3 ; TextAfterBattle dw Route14EndBattleText3 ; TextEndBattle dw Route14EndBattleText3 ; TextEndBattle Route14TrainerHeader3: ; 55a26 (15:5a26) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_3 dw Route14BattleText4 ; TextBeforeBattle dw Route14AfterBattleText4 ; TextAfterBattle dw Route14EndBattleText4 ; TextEndBattle dw Route14EndBattleText4 ; TextEndBattle Route14TrainerHeader4: ; 55a32 (15:5a32) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_4 dw Route14BattleText5 ; TextBeforeBattle dw Route14AfterBattleText5 ; TextAfterBattle dw Route14EndBattleText5 ; TextEndBattle dw Route14EndBattleText5 ; TextEndBattle Route14TrainerHeader5: ; 55a3e (15:5a3e) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_5 dw Route14BattleText6 ; TextBeforeBattle dw Route14AfterBattleText6 ; TextAfterBattle dw Route14EndBattleText6 ; TextEndBattle dw Route14EndBattleText6 ; TextEndBattle Route14TrainerHeader6: ; 55a4a (15:5a4a) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_6 db ($4 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_6 dw Route14BattleText7 ; TextBeforeBattle dw Route14AfterBattleText7 ; TextAfterBattle dw Route14EndBattleText7 ; TextEndBattle dw Route14EndBattleText7 ; TextEndBattle Route14TrainerHeader7: ; 55a56 (15:5a56) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_7, 1 db ($4 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_7, 1 dw Route14BattleText8 ; TextBeforeBattle dw Route14AfterBattleText8 ; TextAfterBattle dw Route14EndBattleText8 ; TextEndBattle dw Route14EndBattleText8 ; TextEndBattle Route14TrainerHeader8: ; 55a62 (15:5a62) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_8, 1 db ($3 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_8, 1 dw Route14BattleText9 ; TextBeforeBattle dw Route14AfterBattleText9 ; TextAfterBattle dw Route14EndBattleText9 ; TextEndBattle dw Route14EndBattleText9 ; TextEndBattle Route14TrainerHeader9: ; 55a6e (15:5a6e) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_9, 1 db ($4 << 4) ; trainer's view range - dw wd7db ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_9, 1 dw Route14BattleText10 ; TextBeforeBattle dw Route14AfterBattleText10 ; TextAfterBattle dw Route14EndBattleText10 ; TextEndBattle diff --git a/scripts/route15.asm b/scripts/route15.asm index fe70d2b4..023f859c 100755 --- a/scripts/route15.asm +++ b/scripts/route15.asm @@ -28,90 +28,90 @@ Route15TextPointers: ; 597c7 (16:57c7) Route15TrainerHeaders: ; 597df (16:57df) Route15TrainerHeader0: ; 597df (16:57df) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_0 dw Route15BattleText1 ; TextBeforeBattle dw Route15AfterBattleText1 ; TextAfterBattle dw Route15EndBattleText1 ; TextEndBattle dw Route15EndBattleText1 ; TextEndBattle Route15TrainerHeader1: ; 597eb (16:57eb) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_1 dw Route15BattleText2 ; TextBeforeBattle dw Route15AfterBattleText2 ; TextAfterBattle dw Route15EndBattleText2 ; TextEndBattle dw Route15EndBattleText2 ; TextEndBattle Route15TrainerHeader2: ; 597f7 (16:57f7) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_2 dw Route15BattleText3 ; TextBeforeBattle dw Route15AfterBattleText3 ; TextAfterBattle dw Route15EndBattleText3 ; TextEndBattle dw Route15EndBattleText3 ; TextEndBattle Route15TrainerHeader3: ; 59803 (16:5803) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_3 dw Route15BattleText4 ; TextBeforeBattle dw Route15AfterBattleText4 ; TextAfterBattle dw Route15EndBattleText4 ; TextEndBattle dw Route15EndBattleText4 ; TextEndBattle Route15TrainerHeader4: ; 5980f (16:580f) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_4 dw Route15BattleText5 ; TextBeforeBattle dw Route15AfterBattleText5 ; TextAfterBattle dw Route15EndBattleText5 ; TextEndBattle dw Route15EndBattleText5 ; TextEndBattle Route15TrainerHeader5: ; 5981b (16:581b) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_5 dw Route15BattleText6 ; TextBeforeBattle dw Route15AfterBattleText6 ; TextAfterBattle dw Route15EndBattleText6 ; TextEndBattle dw Route15EndBattleText6 ; TextEndBattle Route15TrainerHeader6: ; 59827 (16:5827) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_6 dw Route15BattleText7 ; TextBeforeBattle dw Route15AfterBattleText7 ; TextAfterBattle dw Route15EndBattleText7 ; TextEndBattle dw Route15EndBattleText7 ; TextEndBattle Route15TrainerHeader7: ; 59833 (16:5833) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_7, 1 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_7, 1 dw Route15BattleText8 ; TextBeforeBattle dw Route15AfterBattleText8 ; TextAfterBattle dw Route15EndBattleText8 ; TextEndBattle dw Route15EndBattleText8 ; TextEndBattle Route15TrainerHeader8: ; 5983f (16:583f) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_8, 1 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_8, 1 dw Route15BattleText9 ; TextBeforeBattle dw Route15AfterBattleText9 ; TextAfterBattle dw Route15EndBattleText9 ; TextEndBattle dw Route15EndBattleText9 ; TextEndBattle Route15TrainerHeader9: ; 5984b (16:584b) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_9, 1 db ($3 << 4) ; trainer's view range - dw wd7dd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_9, 1 dw Route15BattleText10 ; TextBeforeBattle dw Route15AfterBattleText10 ; TextAfterBattle dw Route15EndBattleText10 ; TextEndBattle diff --git a/scripts/route15gateupstairs.asm b/scripts/route15gateupstairs.asm index 8969fd74..e3a3cf3b 100755 --- a/scripts/route15gateupstairs.asm +++ b/scripts/route15gateupstairs.asm @@ -7,8 +7,7 @@ Route15GateUpstairsTextPointers: ; 4964d (12:564d) Route15GateUpstairsText1: ; 49651 (12:5651) TX_ASM - ld a, [wd7dd] - bit 0, a + CheckEvent EVENT_4B0 jr nz, .asm_49683 ld a, 50 ; pokemon needed ld [$ffdb], a @@ -24,8 +23,7 @@ Route15GateUpstairsText1: ; 49651 (12:5651) ld a, [$ffdb] cp $1 jr nz, .asm_49689 - ld hl, wd7dd - set 0, [hl] + SetEvent EVENT_4B0 .asm_49683 ld hl, Route15GateUpstairsText_4968c call PrintText diff --git a/scripts/route16.asm b/scripts/route16.asm index cdf436a5..286b5289 100755 --- a/scripts/route16.asm +++ b/scripts/route16.asm @@ -21,11 +21,10 @@ Route16ScriptPointers: ; 59951 (16:5951) dw Route16Script3 Route16Script0: ; 59959 (16:5959) - ld hl, wd7e0 - bit 1, [hl] + CheckEventHL EVENT_BEAT_ROUTE16_SNORLAX jp nz, CheckFightingMapTrainers - bit 0, [hl] - res 0, [hl] + CheckEventReuseHL EVENT_FIGHT_ROUTE16_SNORLAX + ResetEventReuseHL EVENT_FIGHT_ROUTE16_SNORLAX jp z, CheckFightingMapTrainers ld a, $a ld [hSpriteIndexOrTextID], a @@ -55,8 +54,7 @@ Route16Script3: ; 5998f (16:598f) ld [hSpriteIndexOrTextID], a call DisplayTextID .asm_599a8 - ld hl, wd7e0 - set 1, [hl] + SetEvent EVENT_BEAT_ROUTE16_SNORLAX call Delay3 ld a, $0 ld [W_ROUTE16CURSCRIPT], a @@ -78,54 +76,54 @@ Route16TextPointers: ; 599b9 (16:59b9) Route16TrainerHeaders: ; 599cf (16:59cf) Route16TrainerHeader0: ; 599cf (16:59cf) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7df ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_0 dw Route16BattleText1 ; TextBeforeBattle dw Route16AfterBattleText1 ; TextAfterBattle dw Route16EndBattleText1 ; TextEndBattle dw Route16EndBattleText1 ; TextEndBattle Route16TrainerHeader1: ; 599db (16:59db) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd7df ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_1 dw Route16BattleText2 ; TextBeforeBattle dw Route16AfterBattleText2 ; TextAfterBattle dw Route16EndBattleText2 ; TextEndBattle dw Route16EndBattleText2 ; TextEndBattle Route16TrainerHeader2: ; 599e7 (16:59e7) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd7df ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_2 dw Route16BattleText3 ; TextBeforeBattle dw Route16AfterBattleText3 ; TextAfterBattle dw Route16EndBattleText3 ; TextEndBattle dw Route16EndBattleText3 ; TextEndBattle Route16TrainerHeader3: ; 599f3 (16:59f3) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd7df ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_3 dw Route16BattleText4 ; TextBeforeBattle dw Route16AfterBattleText4 ; TextAfterBattle dw Route16EndBattleText4 ; TextEndBattle dw Route16EndBattleText4 ; TextEndBattle Route16TrainerHeader4: ; 599ff (16:59ff) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd7df ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_4 dw Route16BattleText5 ; TextBeforeBattle dw Route16AfterBattleText5 ; TextAfterBattle dw Route16EndBattleText5 ; TextEndBattle dw Route16EndBattleText5 ; TextEndBattle Route16TrainerHeader5: ; 59a0b (16:5a0b) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7df ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_5 dw Route16BattleText6 ; TextBeforeBattle dw Route16AfterBattleText6 ; TextAfterBattle dw Route16EndBattleText6 ; TextEndBattle diff --git a/scripts/route16house.asm b/scripts/route16house.asm index 5035b190..d01465cb 100755 --- a/scripts/route16house.asm +++ b/scripts/route16house.asm @@ -7,8 +7,7 @@ Route16HouseTextPointers: ; 1e5fb (7:65fb) Route16HouseText1: ; 1e5ff (7:65ff) TX_ASM - ld a, [wd7e0] - bit 6, a + CheckEvent EVENT_4CE ld hl, HM02ExplanationText jr nz, .asm_13616 ld hl, Route16HouseText3 @@ -16,8 +15,7 @@ Route16HouseText1: ; 1e5ff (7:65ff) ld bc, (HM_02 << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, wd7e0 - set 6, [hl] + SetEvent EVENT_4CE ld hl, ReceivedHM02Text jr .asm_13616 .BagFull diff --git a/scripts/route17.asm b/scripts/route17.asm index 8de70c3b..28c43627 100755 --- a/scripts/route17.asm +++ b/scripts/route17.asm @@ -32,90 +32,90 @@ Route17TextPointers: ; 55b93 (15:5b93) Route17TrainerHeaders: ; 55bb3 (15:5bb3) Route17TrainerHeader0: ; 55bb3 (15:5bb3) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_0 dw Route17BattleText1 ; TextBeforeBattle dw Route17AfterBattleText1 ; TextAfterBattle dw Route17EndBattleText1 ; TextEndBattle dw Route17EndBattleText1 ; TextEndBattle Route17TrainerHeader1: ; 55bbf (15:5bbf) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_1 dw Route17BattleText2 ; TextBeforeBattle dw Route17AfterBattleText2 ; TextAfterBattle dw Route17EndBattleText2 ; TextEndBattle dw Route17EndBattleText2 ; TextEndBattle Route17TrainerHeader2: ; 55bcb (15:5bcb) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_2 dw Route17BattleText3 ; TextBeforeBattle dw Route17AfterBattleText3 ; TextAfterBattle dw Route17EndBattleText3 ; TextEndBattle dw Route17EndBattleText3 ; TextEndBattle Route17TrainerHeader3: ; 55bd7 (15:5bd7) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_3 dw Route17BattleText4 ; TextBeforeBattle dw Route17AfterBattleText4 ; TextAfterBattle dw Route17EndBattleText4 ; TextEndBattle dw Route17EndBattleText4 ; TextEndBattle Route17TrainerHeader4: ; 55be3 (15:5be3) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_4 dw Route17BattleText5 ; TextBeforeBattle dw Route17AfterBattleText5 ; TextAfterBattle dw Route17EndBattleText5 ; TextEndBattle dw Route17EndBattleText5 ; TextEndBattle Route17TrainerHeader5: ; 55bef (15:5bef) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_5 db ($2 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_5 dw Route17BattleText6 ; TextBeforeBattle dw Route17AfterBattleText6 ; TextAfterBattle dw Route17EndBattleText6 ; TextEndBattle dw Route17EndBattleText6 ; TextEndBattle Route17TrainerHeader6: ; 55bfb (15:5bfb) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_6 db ($4 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_6 dw Route17BattleText7 ; TextBeforeBattle dw Route17AfterBattleText7 ; TextAfterBattle dw Route17EndBattleText7 ; TextEndBattle dw Route17EndBattleText7 ; TextEndBattle Route17TrainerHeader7: ; 55c07 (15:5c07) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_7, 1 db ($2 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_7, 1 dw Route17BattleText8 ; TextBeforeBattle dw Route17AfterBattleText8 ; TextAfterBattle dw Route17EndBattleText8 ; TextEndBattle dw Route17EndBattleText8 ; TextEndBattle Route17TrainerHeader8: ; 55c13 (15:5c13) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_8, 1 db ($3 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_8, 1 dw Route17BattleText9 ; TextBeforeBattle dw Route17AfterBattleText9 ; TextAfterBattle dw Route17EndBattleText9 ; TextEndBattle dw Route17EndBattleText9 ; TextEndBattle Route17TrainerHeader9: ; 55c1f (15:5c1f) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_9, 1 db ($4 << 4) ; trainer's view range - dw wd7e1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_9, 1 dw Route17BattleText10 ; TextBeforeBattle dw Route17AfterBattleText10 ; TextAfterBattle dw Route17EndBattleText10 ; TextEndBattle diff --git a/scripts/route18.asm b/scripts/route18.asm index 80242169..9a077faf 100755 --- a/scripts/route18.asm +++ b/scripts/route18.asm @@ -21,27 +21,27 @@ Route18TextPointers: ; 59ae0 (16:5ae0) Route18TrainerHeaders: ; 59aea (16:5aea) Route18TrainerHeader0: ; 59aea (16:5aea) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_18_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7e3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_18_TRAINER_0 dw Route18BattleText1 ; TextBeforeBattle dw Route18AfterBattleText1 ; TextAfterBattle dw Route18EndBattleText1 ; TextEndBattle dw Route18EndBattleText1 ; TextEndBattle Route18TrainerHeader1: ; 59af6 (16:5af6) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_18_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd7e3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_18_TRAINER_1 dw Route18BattleText2 ; TextBeforeBattle dw Route18AfterBattleText2 ; TextAfterBattle dw Route18EndBattleText2 ; TextEndBattle dw Route18EndBattleText2 ; TextEndBattle Route18TrainerHeader2: ; 59b02 (16:5b02) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_18_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7e3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_18_TRAINER_2 dw Route18BattleText3 ; TextBeforeBattle dw Route18AfterBattleText3 ; TextAfterBattle dw Route18EndBattleText3 ; TextEndBattle diff --git a/scripts/route19.asm b/scripts/route19.asm index 0265d2a3..4a60e40f 100755 --- a/scripts/route19.asm +++ b/scripts/route19.asm @@ -27,90 +27,90 @@ Route19TextPointers: ; 55d5d (15:5d5d) Route19TrainerHeaders: ; 55d73 (15:5d73) Route19TrainerHeader0: ; 55d73 (15:5d73) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_0 dw Route19BattleText1 ; TextBeforeBattle dw Route19AfterBattleText1 ; TextAfterBattle dw Route19EndBattleText1 ; TextEndBattle dw Route19EndBattleText1 ; TextEndBattle Route19TrainerHeader1: ; 55d7f (15:5d7f) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_1 dw Route19BattleText2 ; TextBeforeBattle dw Route19AfterBattleText2 ; TextAfterBattle dw Route19EndBattleText2 ; TextEndBattle dw Route19EndBattleText2 ; TextEndBattle Route19TrainerHeader2: ; 55d8b (15:5d8b) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_2 dw Route19BattleText3 ; TextBeforeBattle dw Route19AfterBattleText3 ; TextAfterBattle dw Route19EndBattleText3 ; TextEndBattle dw Route19EndBattleText3 ; TextEndBattle Route19TrainerHeader3: ; 55d97 (15:5d97) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_3 dw Route19BattleText4 ; TextBeforeBattle dw Route19AfterBattleText4 ; TextAfterBattle dw Route19EndBattleText4 ; TextEndBattle dw Route19EndBattleText4 ; TextEndBattle Route19TrainerHeader4: ; 55da3 (15:5da3) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_4 dw Route19BattleText5 ; TextBeforeBattle dw Route19AfterBattleText5 ; TextAfterBattle dw Route19EndBattleText5 ; TextEndBattle dw Route19EndBattleText5 ; TextEndBattle Route19TrainerHeader5: ; 55daf (15:5daf) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_5 dw Route19BattleText6 ; TextBeforeBattle dw Route19AfterBattleText6 ; TextAfterBattle dw Route19EndBattleText6 ; TextEndBattle dw Route19EndBattleText6 ; TextEndBattle Route19TrainerHeader6: ; 55dbb (15:5dbb) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_6 dw Route19BattleText7 ; TextBeforeBattle dw Route19AfterBattleText7 ; TextAfterBattle dw Route19EndBattleText7 ; TextEndBattle dw Route19EndBattleText7 ; TextEndBattle Route19TrainerHeader7: ; 55dc7 (15:5dc7) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_7, 1 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_7, 1 dw Route19BattleText8 ; TextBeforeBattle dw Route19AfterBattleText8 ; TextAfterBattle dw Route19EndBattleText8 ; TextEndBattle dw Route19EndBattleText8 ; TextEndBattle Route19TrainerHeader8: ; 55dd3 (15:5dd3) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_8, 1 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_8, 1 dw Route19BattleText9 ; TextBeforeBattle dw Route19AfterBattleText9 ; TextAfterBattle dw Route19EndBattleText9 ; TextEndBattle dw Route19EndBattleText9 ; TextEndBattle Route19TrainerHeader9: ; 55ddf (15:5ddf) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_9, 1 db ($4 << 4) ; trainer's view range - dw wd7e5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_9, 1 dw Route19BattleText10 ; TextBeforeBattle dw Route19AfterBattleText10 ; TextAfterBattle dw Route19EndBattleText10 ; TextEndBattle diff --git a/scripts/route20.asm b/scripts/route20.asm index 085a6c18..f4690732 100755 --- a/scripts/route20.asm +++ b/scripts/route20.asm @@ -1,7 +1,5 @@ Route20Script: ; 50ca9 (14:4ca9) - ld hl, wd7e7 - bit 0, [hl] - res 0, [hl] + CheckAndResetEvent EVENT_500 call nz, Route20Script_50cc6 call EnableAutoTextBoxDrawing ld hl, Route20TrainerHeader0 @@ -12,9 +10,7 @@ Route20Script: ; 50ca9 (14:4ca9) ret Route20Script_50cc6: ; 50cc6 (14:4cc6) - ld a, [wd880] - and $3 - cp $3 + CheckBothEventsSet EVENT_9C8, EVENT_9C9 jr z, .asm_50cef ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_1 call Route20Script_50d0c @@ -40,9 +36,7 @@ Route20Script_50cc6: ; 50cc6 (14:4cc6) db $FF .asm_50cef - ld a, [wd881] - and $3 - cp $3 + CheckBothEventsSet EVENT_9D0, EVENT_9D1 ret z ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_1 call Route20Script_50d0c @@ -83,90 +77,90 @@ Route20TextPointers: ; 50d22 (14:4d22) Route20TrainerHeaders: ; 50d3a (14:4d3a) Route20TrainerHeader0: ; 50d3a (14:4d3a) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_0 dw Route20BattleText1 ; TextBeforeBattle dw Route20AfterBattleText1 ; TextAfterBattle dw Route20EndBattleText1 ; TextEndBattle dw Route20EndBattleText1 ; TextEndBattle Route20TrainerHeader2: ; 50d46 (14:4d46) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_2 dw Route20BattleText2 ; TextBeforeBattle dw Route20AfterBattleText2 ; TextAfterBattle dw Route20EndBattleText2 ; TextEndBattle dw Route20EndBattleText2 ; TextEndBattle Route20TrainerHeader3: ; 50d52 (14:4d52) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_3 dw Route20BattleText3 ; TextBeforeBattle dw Route20AfterBattleText3 ; TextAfterBattle dw Route20EndBattleText3 ; TextEndBattle dw Route20EndBattleText3 ; TextEndBattle Route20TrainerHeader4: ; 50d5e (14:4d5e) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_4 dw Route20BattleText4 ; TextBeforeBattle dw Route20AfterBattleText4 ; TextAfterBattle dw Route20EndBattleText4 ; TextEndBattle dw Route20EndBattleText4 ; TextEndBattle Route20TrainerHeader5: ; 50d6a (14:4d6a) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_5 dw Route20BattleText5 ; TextBeforeBattle dw Route20AfterBattleText5 ; TextAfterBattle dw Route20EndBattleText5 ; TextEndBattle dw Route20EndBattleText5 ; TextEndBattle Route20TrainerHeader6: ; 50d76 (14:4d76) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_6 db ($4 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_6 dw Route20BattleText6 ; TextBeforeBattle dw Route20AfterBattleText6 ; TextAfterBattle dw Route20EndBattleText6 ; TextEndBattle dw Route20EndBattleText6 ; TextEndBattle Route20TrainerHeader7: ; 50d82 (14:4d82) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_7 db ($2 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_7 dw Route20BattleText7 ; TextBeforeBattle dw Route20AfterBattleText7 ; TextAfterBattle dw Route20EndBattleText7 ; TextEndBattle dw Route20EndBattleText7 ; TextEndBattle Route20TrainerHeader8: ; 50d8e (14:4d8e) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_8, 1 db ($4 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_8, 1 dw Route20BattleText8 ; TextBeforeBattle dw Route20AfterBattleText8 ; TextAfterBattle dw Route20EndBattleText8 ; TextEndBattle dw Route20EndBattleText8 ; TextEndBattle Route20TrainerHeader9: ; 50d9a (14:4d9a) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_9, 1 db ($3 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_9, 1 dw Route20BattleText9 ; TextBeforeBattle dw Route20AfterBattleText9 ; TextAfterBattle dw Route20EndBattleText9 ; TextEndBattle dw Route20EndBattleText9 ; TextEndBattle Route20TrainerHeader10: ; 50da6 (14:4da6) - db $a ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_10, 1 db ($4 << 4) ; trainer's view range - dw wd7e7 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_10, 1 dw Route20BattleText10 ; TextBeforeBattle dw Route20AfterBattleText10 ; TextAfterBattle dw Route20EndBattleText10 ; TextEndBattle diff --git a/scripts/route21.asm b/scripts/route21.asm index cbb5ea7b..4c8087fd 100755 --- a/scripts/route21.asm +++ b/scripts/route21.asm @@ -25,81 +25,81 @@ Route21TextPointers: ; 55f04 (15:5f04) Route21TrainerHeaders: ; 55f16 (15:5f16) Route21TrainerHeader0: ; 55f16 (15:5f16) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_0 dw Route21BattleText1 ; TextBeforeBattle dw Route21AfterBattleText1 ; TextAfterBattle dw Route21EndBattleText1 ; TextEndBattle dw Route21EndBattleText1 ; TextEndBattle Route21TrainerHeader1: ; 55f22 (15:5f22) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_1 db ($0 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_1 dw Route21BattleText2 ; TextBeforeBattle dw Route21AfterBattleText2 ; TextAfterBattle dw Route21EndBattleText2 ; TextEndBattle dw Route21EndBattleText2 ; TextEndBattle Route21TrainerHeader2: ; 55f2e (15:5f2e) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_2 dw Route21BattleText3 ; TextBeforeBattle dw Route21AfterBattleText3 ; TextAfterBattle dw Route21EndBattleText3 ; TextEndBattle dw Route21EndBattleText3 ; TextEndBattle Route21TrainerHeader3: ; 55f3a (15:5f3a) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_3 dw Route21BattleText4 ; TextBeforeBattle dw Route21AfterBattleText4 ; TextAfterBattle dw Route21EndBattleText4 ; TextEndBattle dw Route21EndBattleText4 ; TextEndBattle Route21TrainerHeader4: ; 55f46 (15:5f46) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_4 dw Route21BattleText5 ; TextBeforeBattle dw Route21AfterBattleText5 ; TextAfterBattle dw Route21EndBattleText5 ; TextEndBattle dw Route21EndBattleText5 ; TextEndBattle Route21TrainerHeader5: ; 55f52 (15:5f52) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_5 dw Route21BattleText6 ; TextBeforeBattle dw Route21AfterBattleText6 ; TextAfterBattle dw Route21EndBattleText6 ; TextEndBattle dw Route21EndBattleText6 ; TextEndBattle Route21TrainerHeader6: ; 55f5e (15:5f5e) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_6 dw Route21BattleText7 ; TextBeforeBattle dw Route21AfterBattleText7 ; TextAfterBattle dw Route21EndBattleText7 ; TextEndBattle dw Route21EndBattleText7 ; TextEndBattle Route21TrainerHeader7: ; 55f6a (15:5f6a) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_7, 1 db ($0 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_7, 1 dw Route21BattleText8 ; TextBeforeBattle dw Route21AfterBattleText8 ; TextAfterBattle dw Route21EndBattleText8 ; TextEndBattle dw Route21EndBattleText8 ; TextEndBattle Route21TrainerHeader8: ; 55f76 (15:5f76) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_8, 1 db ($0 << 4) ; trainer's view range - dw wd7e9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_8, 1 dw Route21BattleText9 ; TextBeforeBattle dw Route21AfterBattleText9 ; TextAfterBattle dw Route21EndBattleText9 ; TextEndBattle diff --git a/scripts/route22.asm b/scripts/route22.asm index 01f8bee8..dec8afd6 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -55,8 +55,7 @@ Route22RivalMovementData: ; 50efb (14:4efb) db $FF Route22Script0: ; 50f00 (14:4f00) - ld a, [wd7eb] - bit 7, a + CheckEvent EVENT_527 ret z ld hl, .Route22RivalBattleCoords call ArePlayerCoordsInArray @@ -69,10 +68,9 @@ Route22Script0: ; 50f00 (14:4f00) ld [wJoyIgnore], a ld a, PLAYER_DIR_LEFT ld [wPlayerMovingDirection], a - ld a, [wd7eb] - bit 0, a ; is this the rival battle at the beginning of the game? + CheckEvent EVENT_520 jr nz, .firstRivalBattle - bit 1, a ; is this the rival at the end of the game? + CheckEventReuseA EVENT_521 ; is this the rival at the end of the game? jp nz, Route22Script_5104e ret @@ -165,8 +163,7 @@ Route22Script2: ; 50fb5 (14:4fb5) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - ld hl, wd7eb - set 5, [hl] + SetEvent EVENT_525 ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -230,9 +227,7 @@ Route22Script3: ; 5102a (14:502a) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ld hl, wd7eb - res 0, [hl] - res 7, [hl] + ResetEvents EVENT_520, EVENT_527 ld a, $0 ld [W_ROUTE22CURSCRIPT], a ret @@ -327,8 +322,7 @@ Route22Script5: ; 510df (14:50df) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - ld hl, wd7eb - set 6, [hl] + SetEvent EVENT_526 ld a, $2 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -378,9 +372,7 @@ Route22Script6: ; 51151 (14:5151) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ld hl, wd7eb - res 1, [hl] - res 7, [hl] + ResetEvents EVENT_521, EVENT_527 ld a, $7 ld [W_ROUTE22CURSCRIPT], a ret @@ -392,8 +384,7 @@ Route22TextPointers: ; 51175 (14:5175) Route22Text1: ; 5117b (14:517b) TX_ASM - ld a, [wd7eb] - bit 5, a + CheckEvent EVENT_525 jr z, .asm_5118b ld hl, Route22RivalAfterBattleText1 call PrintText @@ -406,8 +397,7 @@ Route22Text1: ; 5117b (14:517b) Route22Text2: ; 51194 (14:5194) TX_ASM - ld a, [wd7eb] - bit 6, a + CheckEvent EVENT_526 jr z, .asm_511a4 ld hl, Route22RivalAfterBattleText2 call PrintText diff --git a/scripts/route23.asm b/scripts/route23.asm index cfcf41f5..e17b7d23 100755 --- a/scripts/route23.asm +++ b/scripts/route23.asm @@ -10,12 +10,8 @@ Route23Script_511e9: ; 511e9 (14:51e9) bit 6, [hl] res 6, [hl] ret z - ld hl, wd7ee - res 0, [hl] - res 7, [hl] - ld hl, wd813 - res 0, [hl] - res 6, [hl] + ResetEvents EVENT_538, EVENT_53F + ResetEvents EVENT_660, EVENT_666 ld a, HS_VICTORY_ROAD_3_BOULDER ld [wcc4d], a predef ShowObject @@ -33,7 +29,7 @@ Route23Script0: ; 51219 (14:5219) ld a, [W_YCOORD] ld b, a ld e, $0 - ld c, $7 + EventFlagBit c, EVENT_536 + 1, EVENT_530 .asm_51224 ld a, [hli] cp $ff @@ -53,7 +49,7 @@ Route23Script0: ; 51219 (14:5219) ld a, c ld [wWhichBadge], a ld b, FLAG_TEST - ld hl, wd7ed + EventFlagAddress hl, EVENT_530 predef FlagActionPredef ld a, c and a @@ -147,43 +143,43 @@ Route23TextPointers: ; 512f7 (14:52f7) Route23Text1: ; 51307 (14:5307) TX_ASM - ld a, $6 + EventFlagBit a, EVENT_536, EVENT_530 call Route23Script_51346 jp TextScriptEnd Route23Text2: ; 51310 (14:5310) TX_ASM - ld a, $5 + EventFlagBit a, EVENT_535, EVENT_530 call Route23Script_51346 jp TextScriptEnd Route23Text3: ; 51319 (14:5319) TX_ASM - ld a, $4 + EventFlagBit a, EVENT_534, EVENT_530 call Route23Script_51346 jp TextScriptEnd Route23Text4: ; 51322 (14:5322) TX_ASM - ld a, $3 + EventFlagBit a, EVENT_533, EVENT_530 call Route23Script_51346 jp TextScriptEnd Route23Text5: ; 5132b (14:532b) TX_ASM - ld a, $2 + EventFlagBit a, EVENT_532, EVENT_530 call Route23Script_51346 jp TextScriptEnd Route23Text6: ; 51334 (14:5334) TX_ASM - ld a, $1 + EventFlagBit a, EVENT_531, EVENT_530 call Route23Script_51346 jp TextScriptEnd Route23Text7: ; 5133d (14:533d) TX_ASM - ld a, $0 + EventFlagBit a, EVENT_530 call Route23Script_51346 jp TextScriptEnd @@ -211,7 +207,7 @@ Route23Script_51346: ; 51346 (14:5346) ld a, [wWhichBadge] ld c, a ld b, FLAG_SET - ld hl, wd7ed + EventFlagAddress hl, EVENT_530 predef FlagActionPredef ld a, $2 ld [W_ROUTE23CURSCRIPT], a diff --git a/scripts/route24.asm b/scripts/route24.asm index f6822a35..c946159c 100755 --- a/scripts/route24.asm +++ b/scripts/route24.asm @@ -22,8 +22,7 @@ Route24ScriptPointers: ; 513cb (14:53cb) dw Route24Script4 Route24Script0: ; 513d5 (14:53d5) - ld a, [wd7ef] - bit 0, a + CheckEvent EVENT_540 jp nz, CheckFightingMapTrainers ld hl, CoordsData_5140e call ArePlayerCoordsInArray @@ -33,9 +32,7 @@ Route24Script0: ; 513d5 (14:53d5) ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd7f0 - bit 1, [hl] - res 1, [hl] + CheckAndResetEvent EVENT_549 ret z ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a @@ -67,8 +64,7 @@ Route24Script3: ; 51422 (14:5422) call UpdateSprites ld a, $f0 ld [wJoyIgnore], a - ld hl, wd7ef - set 1, [hl] + SetEvent EVENT_541 ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -91,54 +87,54 @@ Route24TextPointers: ; 5144b (14:544b) Route24TrainerHeaders: ; 5145b (14:545b) Route24TrainerHeader0: ; 5145b (14:545b) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_0 dw Route24BattleText1 ; TextBeforeBattle dw Route24AfterBattleText1 ; TextAfterBattle dw Route24EndBattleText1 ; TextEndBattle dw Route24EndBattleText1 ; TextEndBattle Route24TrainerHeader2: ; 51467 (14:5467) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_2 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_2 dw Route24BattleText2 ; TextBeforeBattle dw Route24AfterBattleText2 ; TextAfterBattle dw Route24EndBattleText2 ; TextEndBattle dw Route24EndBattleText2 ; TextEndBattle Route24TrainerHeader3: ; 51473 (14:5473) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_3 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_3 dw Route24BattleText3 ; TextBeforeBattle dw Route24AfterBattleText3 ; TextAfterBattle dw Route24EndBattleText3 ; TextEndBattle dw Route24EndBattleText3 ; TextEndBattle Route24TrainerHeader4: ; 5147f (14:547f) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_4 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_4 dw Route24BattleText4 ; TextBeforeBattle dw Route24AfterBattleText4 ; TextAfterBattle dw Route24EndBattleText4 ; TextEndBattle dw Route24EndBattleText4 ; TextEndBattle Route24TrainerHeader5: ; 5148b (14:548b) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_5 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_5 dw Route24BattleText5 ; TextBeforeBattle dw Route24AfterBattleText5 ; TextAfterBattle dw Route24EndBattleText5 ; TextEndBattle dw Route24EndBattleText5 ; TextEndBattle Route24TrainerHeader6: ; 51497 (14:5497) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_6 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_6 dw Route24BattleText6 ; TextBeforeBattle dw Route24AfterBattleText6 ; TextAfterBattle dw Route24EndBattleText6 ; TextEndBattle @@ -148,18 +144,15 @@ Route24TrainerHeader6: ; 51497 (14:5497) Route24Text1: ; 514a4 (14:54a4) TX_ASM - ld hl, wd7f0 - res 1, [hl] - ld a, [wd7ef] - bit 0, a + ResetEvent EVENT_549 + CheckEvent EVENT_540 jr nz, .asm_514f9 ld hl, Route24Text_51510 call PrintText ld bc, (NUGGET << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, wd7ef - set 0, [hl] + SetEvent EVENT_540 ld hl, Route24Text_5151a call PrintText ld hl, Route24Text_51526 @@ -187,8 +180,7 @@ Route24Text1: ; 514a4 (14:54a4) .BagFull ld hl, Route24Text_51521 call PrintText - ld hl, wd7f0 - set 1, [hl] + SetEvent EVENT_549 jp TextScriptEnd Route24Text_51510: ; 51510 (14:5510) diff --git a/scripts/route25.asm b/scripts/route25.asm index 5f544365..6bbb5e26 100755 --- a/scripts/route25.asm +++ b/scripts/route25.asm @@ -13,19 +13,18 @@ Route25Script_515e1: ; 515e1 (14:55e1) bit 6, [hl] res 6, [hl] ret z - ld hl, wd7f2 - bit 7, [hl] + CheckEventHL EVENT_55F ret nz - bit 5, [hl] + CheckEventReuseHL EVENT_55D jr nz, .asm_515ff - res 6, [hl] + ResetEventReuseHL EVENT_55E ld a, HS_BILL_POKEMON ld [wcc4d], a predef_jump ShowObject .asm_515ff - bit 4, [hl] + CheckEventAfterBranchReuseHL EVENT_55C, EVENT_55D ret z - set 7, [hl] + SetEventReuseHL EVENT_55F ld a, HS_NUGGET_BRIDGE_GUY ld [wcc4d], a predef HideObject @@ -56,81 +55,81 @@ Route25TextPointers: ; 51628 (14:5628) Route25TrainerHeaders: ; 5163e (14:563e) Route25TrainerHeader0: ; 5163e (14:563e) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_0 dw Route25BattleText1 ; TextBeforeBattle dw Route25AfterBattleText1 ; TextAfterBattle dw Route25EndBattleText1 ; TextEndBattle dw Route25EndBattleText1 ; TextEndBattle Route25TrainerHeader2: ; 5164a (14:564a) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_2 dw Route25BattleText2 ; TextBeforeBattle dw Route25AfterBattleText2 ; TextAfterBattle dw Route25EndBattleText2 ; TextEndBattle dw Route25EndBattleText2 ; TextEndBattle Route25TrainerHeader3: ; 51656 (14:5656) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_3 dw Route25BattleText3 ; TextBeforeBattle dw Route25AfterBattleText3 ; TextAfterBattle dw Route25EndBattleText3 ; TextEndBattle dw Route25EndBattleText3 ; TextEndBattle Route25TrainerHeader4: ; 51662 (14:5662) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_4 dw Route25BattleText4 ; TextBeforeBattle dw Route25AfterBattleText4 ; TextAfterBattle dw Route25EndBattleText4 ; TextEndBattle dw Route25EndBattleText4 ; TextEndBattle Route25TrainerHeader5: ; 5166e (14:566e) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_5 dw Route25BattleText5 ; TextBeforeBattle dw Route25AfterBattleText5 ; TextAfterBattle dw Route25EndBattleText5 ; TextEndBattle dw Route25EndBattleText5 ; TextEndBattle Route25TrainerHeader6: ; 5167a (14:567a) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_6 db ($4 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_6 dw Route25BattleText6 ; TextBeforeBattle dw Route25AfterBattleText6 ; TextAfterBattle dw Route25EndBattleText6 ; TextEndBattle dw Route25EndBattleText6 ; TextEndBattle Route25TrainerHeader7: ; 51686 (14:5686) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_7 db ($3 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_7 dw Route25BattleText7 ; TextBeforeBattle dw Route25AfterBattleText7 ; TextAfterBattle dw Route25EndBattleText7 ; TextEndBattle dw Route25EndBattleText7 ; TextEndBattle Route25TrainerHeader8: ; 51692 (14:5692) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_8, 1 db ($2 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_8, 1 dw Route25BattleText8 ; TextBeforeBattle dw Route25AfterBattleText8 ; TextAfterBattle dw Route25EndBattleText8 ; TextEndBattle dw Route25EndBattleText8 ; TextEndBattle Route25TrainerHeader9: ; 5169e (14:569e) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_9, 1 db ($2 << 4) ; trainer's view range - dw wd7f1 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_9, 1 dw Route25BattleText9 ; TextBeforeBattle dw Route25AfterBattleText9 ; TextAfterBattle dw Route25EndBattleText9 ; TextEndBattle diff --git a/scripts/route2gate.asm b/scripts/route2gate.asm index e8d02321..49c28e02 100755 --- a/scripts/route2gate.asm +++ b/scripts/route2gate.asm @@ -7,8 +7,7 @@ Route2GateTextPointers: ; 5d5d7 (17:55d7) Route2GateText1: ; 5d5db (17:55db) TX_ASM - ld a, [wd7c2] - bit 0, a + CheckEvent EVENT_3D8 jr nz, .asm_5d60d ld a, 10 ; pokemon needed ld [$ffdb], a @@ -24,8 +23,7 @@ Route2GateText1: ; 5d5db (17:55db) ld a, [$ffdb] cp $1 jr nz, .asm_5d613 - ld hl, wd7c2 - set 0, [hl] + SetEvent EVENT_3D8 .asm_5d60d ld hl, Route2GateText_5d616 call PrintText diff --git a/scripts/route3.asm b/scripts/route3.asm index c39a5435..50c4e00d 100755 --- a/scripts/route3.asm +++ b/scripts/route3.asm @@ -26,72 +26,72 @@ Route3TextPointers: ; 55511 (15:5511) Route3TrainerHeaders: ; 55525 (15:5525) Route3TrainerHeader0: ; 55525 (15:5525) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_0 dw Route3BattleText1 ; TextBeforeBattle dw Route3AfterBattleText1 ; TextAfterBattle dw Route3EndBattleText1 ; TextEndBattle dw Route3EndBattleText1 ; TextEndBattle Route3TrainerHeader2: ; 55531 (15:5531) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_2 dw Route3BattleText2 ; TextBeforeBattle dw Route3AfterBattleText2 ; TextAfterBattle dw Route3EndBattleText2 ; TextEndBattle dw Route3EndBattleText2 ; TextEndBattle Route3TrainerHeader3: ; 5553d (15:553d) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_3 dw Route3BattleText3 ; TextBeforeBattle dw Route3AfterBattleText3 ; TextAfterBattle dw Route3EndBattleText3 ; TextEndBattle dw Route3EndBattleText3 ; TextEndBattle Route3TrainerHeader4: ; 55549 (15:5549) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_4 db ($1 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_4 dw Route3BattleText4 ; TextBeforeBattle dw Route3AfterBattleText4 ; TextAfterBattle dw Route3EndBattleText4 ; TextEndBattle dw Route3EndBattleText4 ; TextEndBattle Route3TrainerHeader5: ; 55555 (15:5555) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_5 dw Route3BattleText5 ; TextBeforeBattle dw Route3AfterBattleText5 ; TextAfterBattle dw Route3EndBattleText5 ; TextEndBattle dw Route3EndBattleText5 ; TextEndBattle Route3TrainerHeader6: ; 55561 (15:5561) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_6 dw Route3BattleText6 ; TextBeforeBattle dw Route3AfterBattleText6 ; TextAfterBattle dw Route3EndBattleText6 ; TextEndBattle dw Route3EndBattleText6 ; TextEndBattle Route3TrainerHeader7: ; 5556d (15:556d) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_7, 1 db ($3 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_7, 1 dw Route3BattleText7 ; TextBeforeBattle dw Route3AfterBattleText7 ; TextAfterBattle dw Route3EndBattleText7 ; TextEndBattle dw Route3EndBattleText7 ; TextEndBattle Route3TrainerHeader8: ; 55579 (15:5579) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_8, 1 db ($2 << 4) ; trainer's view range - dw wd7c3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_8, 1 dw Route3BattleText8 ; TextBeforeBattle dw Route3AfterBattleText8 ; TextAfterBattle dw Route3EndBattleText8 ; TextEndBattle diff --git a/scripts/route4.asm b/scripts/route4.asm index 10d3882d..f5bdd9e8 100755 --- a/scripts/route4.asm +++ b/scripts/route4.asm @@ -22,9 +22,9 @@ Route4TextPointers: ; 55671 (15:5671) Route4TrainerHeaders: ; 5567d (15:567d) Route4TrainerHeader0: ; 5567d (15:567d) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_4_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7c5 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_4_TRAINER_0 dw Route4BattleText1 ; TextBeforeBattle dw Route4AfterBattleText1 ; TextAfterBattle dw Route4EndBattleText1 ; TextEndBattle diff --git a/scripts/route6.asm b/scripts/route6.asm index 51116390..e748fed1 100755 --- a/scripts/route6.asm +++ b/scripts/route6.asm @@ -23,54 +23,54 @@ Route6TextPointers: ; 590c9 (16:50c9) Route6TrainerHeaders: ; 590d7 (16:50d7) Route6TrainerHeader0: ; 590d7 (16:50d7) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd7c9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_0 dw Route6BattleText1 ; TextBeforeBattle dw Route6AfterBattleText1 ; TextAfterBattle dw Route6EndBattleText1 ; TextEndBattle dw Route6EndBattleText1 ; TextEndBattle Route6TrainerHeader1: ; 590e3 (16:50e3) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_1 db ($0 << 4) ; trainer's view range - dw wd7c9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_1 dw Route6BattleText2 ; TextBeforeBattle dw Route6AfterBattleText1 ; TextAfterBattle dw Route6EndBattleText2 ; TextEndBattle dw Route6EndBattleText2 ; TextEndBattle Route6TrainerHeader2: ; 590ef (16:50ef) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7c9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_2 dw Route6BattleText3 ; TextBeforeBattle dw Route6AfterBattleText3 ; TextAfterBattle dw Route6EndBattleText3 ; TextEndBattle dw Route6EndBattleText3 ; TextEndBattle Route6TrainerHeader3: ; 590fb (16:50fb) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7c9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_3 dw Route6BattleText4 ; TextBeforeBattle dw Route6AfterBattleText4 ; TextAfterBattle dw Route6EndBattleText4 ; TextEndBattle dw Route6EndBattleText4 ; TextEndBattle Route6TrainerHeader4: ; 59107 (16:5107) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7c9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_4 dw Route6BattleText5 ; TextBeforeBattle dw Route6AfterBattleText5 ; TextAfterBattle dw Route6EndBattleText5 ; TextEndBattle dw Route6EndBattleText5 ; TextEndBattle Route6TrainerHeader5: ; 59113 (16:5113) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7c9 ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_5 dw Route6BattleText6 ; TextBeforeBattle dw Route6AfterBattleText6 ; TextAfterBattle dw Route6EndBattleText6 ; TextEndBattle diff --git a/scripts/route8.asm b/scripts/route8.asm index 8d589c90..c734c62d 100755 --- a/scripts/route8.asm +++ b/scripts/route8.asm @@ -26,81 +26,81 @@ Route8TextPointers: ; 591cf (16:51cf) Route8TrainerHeaders: ; 591e3 (16:51e3) Route8TrainerHeader0: ; 591e3 (16:51e3) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_0 dw Route8BattleText1 ; TextBeforeBattle dw Route8AfterBattleText1 ; TextAfterBattle dw Route8EndBattleText1 ; TextEndBattle dw Route8EndBattleText1 ; TextEndBattle Route8TrainerHeader1: ; 591ef (16:51ef) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_1 dw Route8BattleText2 ; TextBeforeBattle dw Route8AfterBattleText2 ; TextAfterBattle dw Route8EndBattleText2 ; TextEndBattle dw Route8EndBattleText2 ; TextEndBattle Route8TrainerHeader2: ; 591fb (16:51fb) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_2 dw Route8BattleText3 ; TextBeforeBattle dw Route8AfterBattleText3 ; TextAfterBattle dw Route8EndBattleText3 ; TextEndBattle dw Route8EndBattleText3 ; TextEndBattle Route8TrainerHeader3: ; 59207 (16:5207) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_3 dw Route8BattleText4 ; TextBeforeBattle dw Route8AfterBattleText4 ; TextAfterBattle dw Route8EndBattleText4 ; TextEndBattle dw Route8EndBattleText4 ; TextEndBattle Route8TrainerHeader4: ; 59213 (16:5213) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_4 dw Route8BattleText5 ; TextBeforeBattle dw Route8AfterBattleText5 ; TextAfterBattle dw Route8EndBattleText5 ; TextEndBattle dw Route8EndBattleText5 ; TextEndBattle Route8TrainerHeader5: ; 5921f (16:521f) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_5 dw Route8BattleText6 ; TextBeforeBattle dw Route8AfterBattleText6 ; TextAfterBattle dw Route8EndBattleText6 ; TextEndBattle dw Route8EndBattleText6 ; TextEndBattle Route8TrainerHeader6: ; 5922b (16:522b) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_6 db ($2 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_6 dw Route8BattleText7 ; TextBeforeBattle dw Route8AfterBattleText7 ; TextAfterBattle dw Route8EndBattleText7 ; TextEndBattle dw Route8EndBattleText7 ; TextEndBattle Route8TrainerHeader7: ; 59237 (16:5237) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_7, 1 db ($2 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_7, 1 dw Route8BattleText8 ; TextBeforeBattle dw Route8AfterBattleText8 ; TextAfterBattle dw Route8EndBattleText8 ; TextEndBattle dw Route8EndBattleText8 ; TextEndBattle Route8TrainerHeader8: ; 59243 (16:5243) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_8, 1 db ($4 << 4) ; trainer's view range - dw wd7cd ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_8, 1 dw Route8BattleText9 ; TextBeforeBattle dw Route8AfterBattleText9 ; TextAfterBattle dw Route8EndBattleText9 ; TextEndBattle diff --git a/scripts/route9.asm b/scripts/route9.asm index d6050970..9d26ee96 100755 --- a/scripts/route9.asm +++ b/scripts/route9.asm @@ -27,81 +27,81 @@ Route9TextPointers: ; 556d5 (15:56d5) Route9TrainerHeaders: ; 556eb (15:56eb) Route9TrainerHeader0: ; 556eb (15:56eb) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_0 dw Route9BattleText1 ; TextBeforeBattle dw Route9AfterBattleText1 ; TextAfterBattle dw Route9EndBattleText1 ; TextEndBattle dw Route9EndBattleText1 ; TextEndBattle Route9TrainerHeader2: ; 556f7 (15:56f7) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_2 dw Route9BattleText2 ; TextBeforeBattle dw Route9AfterBattleText2 ; TextAfterBattle dw Route9EndBattleText2 ; TextEndBattle dw Route9EndBattleText2 ; TextEndBattle Route9TrainerHeader3: ; 55703 (15:5703) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_3 dw Route9BattleText3 ; TextBeforeBattle dw Route9AfterBattleText3 ; TextAfterBattle dw Route9EndBattleText3 ; TextEndBattle dw Route9EndBattleText3 ; TextEndBattle Route9TrainerHeader4: ; 5570f (15:570f) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_4 dw Route9BattleText4 ; TextBeforeBattle dw Route9AfterBattleText4 ; TextAfterBattle dw Route9EndBattleText4 ; TextEndBattle dw Route9EndBattleText4 ; TextEndBattle Route9TrainerHeader5: ; 5571b (15:571b) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_5 db ($2 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_5 dw Route9BattleText5 ; TextBeforeBattle dw Route9AfterBattleText5 ; TextAfterBattle dw Route9EndBattleText5 ; TextEndBattle dw Route9EndBattleText5 ; TextEndBattle Route9TrainerHeader6: ; 55727 (15:5727) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_6 db ($3 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_6 dw Route9BattleText6 ; TextBeforeBattle dw Route9AfterBattleText6 ; TextAfterBattle dw Route9EndBattleText6 ; TextEndBattle dw Route9EndBattleText6 ; TextEndBattle Route9TrainerHeader7: ; 55733 (15:5733) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_7 db ($4 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_7 dw Route9BattleText7 ; TextBeforeBattle dw Route9AfterBattleText7 ; TextAfterBattle dw Route9EndBattleText7 ; TextEndBattle dw Route9EndBattleText7 ; TextEndBattle Route9TrainerHeader8: ; 5573f (15:573f) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_8, 1 db ($2 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_8, 1 dw Route9BattleText8 ; TextBeforeBattle dw Route9AfterBattleText8 ; TextAfterBattle dw Route9EndBattleText8 ; TextEndBattle dw Route9EndBattleText8 ; TextEndBattle Route9TrainerHeader9: ; 5574b (15:574b) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_9, 1 db ($2 << 4) ; trainer's view range - dw wd7cf ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_9, 1 dw Route9BattleText9 ; TextBeforeBattle dw Route9AfterBattleText9 ; TextAfterBattle dw Route9EndBattleText9 ; TextEndBattle diff --git a/scripts/safarizoneentrance-yellow.asm b/scripts/safarizoneentrance-yellow.asm index 74ecaa54..6ff0e298 100644 --- a/scripts/safarizoneentrance-yellow.asm +++ b/scripts/safarizoneentrance-yellow.asm @@ -64,9 +64,8 @@ ld a,D_UP ld c,3 call SafariZoneEntranceAutoWalk - ld hl,wd790 - set 7,[hl] - res 6,[hl] + SetEvent EVENT_IN_SAFARI_ZONE + ResetEventReuseHL EVENT_SAFARI_GAME_OVER ld a,3 ld [W_SAFARIZONEENTRANCECURSCRIPT],a jr .done diff --git a/scripts/safarizoneentrance.asm b/scripts/safarizoneentrance.asm index ab54dd8a..6ed62fd1 100755 --- a/scripts/safarizoneentrance.asm +++ b/scripts/safarizoneentrance.asm @@ -74,11 +74,9 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) .SafariZoneEntranceScript5 ld a, PLAYER_DIR_DOWN ld [wPlayerMovingDirection], a - ld hl, wd790 - bit 6, [hl] - res 6, [hl] + CheckAndResetEvent EVENT_SAFARI_GAME_OVER jr z, .asm_7527f - res 7, [hl] + ResetEventReuseHL EVENT_IN_SAFARI_ZONE call UpdateSprites ld a, $f0 ld [wJoyIgnore], a @@ -191,9 +189,8 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) ld a,D_UP ld c,3 call SafariZoneEntranceAutoWalk - ld hl,wd790 - set 7,[hl] - res 6,[hl] + SetEvent EVENT_IN_SAFARI_ZONE + ResetEventReuseHL EVENT_SAFARI_GAME_OVER ld a,3 ld [W_SAFARIZONEENTRANCECURSCRIPT],a jr .done @@ -238,9 +235,7 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) ld a, D_DOWN ld c, $3 call SafariZoneEntranceAutoWalk - ld hl, wd790 - res 6, [hl] - res 7, [hl] + ResetEvents EVENT_SAFARI_GAME_OVER, EVENT_IN_SAFARI_ZONE ld a, $0 ld [wcf0d], a jr .asm_753b3 diff --git a/scripts/safarizonesecrethouse.asm b/scripts/safarizonesecrethouse.asm index b1dd95d3..48992d94 100755 --- a/scripts/safarizonesecrethouse.asm +++ b/scripts/safarizonesecrethouse.asm @@ -6,8 +6,7 @@ SafariZoneSecretHouseTextPointers: ; 4a31a (12:631a) SafariZoneSecretHouseText1: ; 4a31c (12:631c) TX_ASM - ld a, [wd857] - bit 0, a + CheckEvent EVENT_880 jr nz, .asm_20a9b ld hl, SafariZoneSecretHouseText_4a350 call PrintText @@ -16,8 +15,7 @@ SafariZoneSecretHouseText1: ; 4a31c (12:631c) jr nc, .BagFull ld hl, ReceivedHM03Text call PrintText - ld hl, wd857 - set 0, [hl] + SetEvent EVENT_880 jr .asm_8f1fc .BagFull ld hl, HM03NoRoomText diff --git a/scripts/saffrongym.asm b/scripts/saffrongym.asm index 349eda5e..4e2115c3 100755 --- a/scripts/saffrongym.asm +++ b/scripts/saffrongym.asm @@ -46,16 +46,14 @@ SaffronGymText_5d068: ; 5d068 (17:5068) ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd7b3 - set 1, [hl] + SetEvent EVENT_361 ld bc, (TM_46 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $b ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd7b3 - set 0, [hl] + SetEvent EVENT_360 jr .asm_5d091 .BagFull ld a, $c @@ -68,11 +66,7 @@ SaffronGymText_5d068: ; 5d068 (17:5068) set 5, [hl] ; deactivate gym trainers - ld a, [wd7b3] - or %11111100 - ld [wd7b3], a - ld hl, wd7b4 - set 0, [hl] + SetEventRange EVENT_BEAT_SAFFRON_GYM_TRAINER_0, EVENT_BEAT_SAFFRON_GYM_TRAINER_6 jp SaffronGymText_5d048 @@ -92,63 +86,63 @@ SaffronGymTextPointers: ; 5d0ab (17:50ab) SaffronGymTrainerHeaders: ; 5d0c3 (17:50c3) SaffronGymTrainerHeader0: ; 5d0c3 (17:50c3) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_0 dw SaffronGymBattleText1 ; TextBeforeBattle dw SaffronGymAfterBattleText1 ; TextAfterBattle dw SaffronGymEndBattleText1 ; TextEndBattle dw SaffronGymEndBattleText1 ; TextEndBattle SaffronGymTrainerHeader1: ; 5d0cf (17:50cf) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_1 dw SaffronGymBattleText2 ; TextBeforeBattle dw SaffronGymAfterBattleText2 ; TextAfterBattle dw SaffronGymEndBattleText2 ; TextEndBattle dw SaffronGymEndBattleText2 ; TextEndBattle SaffronGymTrainerHeader2: ; 5d0db (17:50db) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_2 dw SaffronGymBattleText3 ; TextBeforeBattle dw SaffronGymAfterBattleText3 ; TextAfterBattle dw SaffronGymEndBattleText3 ; TextEndBattle dw SaffronGymEndBattleText3 ; TextEndBattle SaffronGymTrainerHeader3: ; 5d0e7 (17:50e7) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_3 dw SaffronGymBattleText4 ; TextBeforeBattle dw SaffronGymAfterBattleText4 ; TextAfterBattle dw SaffronGymEndBattleText4 ; TextEndBattle dw SaffronGymEndBattleText4 ; TextEndBattle SaffronGymTrainerHeader4: ; 5d0f3 (17:50f3) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_4 dw SaffronGymBattleText5 ; TextBeforeBattle dw SaffronGymAfterBattleText5 ; TextAfterBattle dw SaffronGymEndBattleText5 ; TextEndBattle dw SaffronGymEndBattleText5 ; TextEndBattle SaffronGymTrainerHeader5: ; 5d0ff (17:50ff) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_5 dw SaffronGymBattleText6 ; TextBeforeBattle dw SaffronGymAfterBattleText6 ; TextAfterBattle dw SaffronGymEndBattleText6 ; TextEndBattle dw SaffronGymEndBattleText6 ; TextEndBattle SaffronGymTrainerHeader6: ; 5d10b (17:510b) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_6, 1 db ($3 << 4) ; trainer's view range - dw wd7b3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_6, 1 dw SaffronGymBattleText7 ; TextBeforeBattle dw SaffronGymAfterBattleText7 ; TextAfterBattle dw SaffronGymEndBattleText7 ; TextEndBattle @@ -158,10 +152,9 @@ SaffronGymTrainerHeader6: ; 5d10b (17:510b) SaffronGymText1: ; 5d118 (17:5118) TX_ASM - ld a, [wd7b3] - bit 1, a + CheckEvent EVENT_361 jr z, .asm_5d134 - bit 0, a + CheckEventReuseA EVENT_360 jr nz, .asm_5d12c call z, SaffronGymText_5d068 call DisableWaitingAfterTextDisplay @@ -262,8 +255,7 @@ SaffronGymText8: ; 5d1c3 (17:51c3) SaffronGymText9: ; 5d1cd (17:51cd) TX_ASM - ld a, [wd7b3] - bit 1, a + CheckEvent EVENT_361 jr nz, .asm_5d1dd ld hl, SaffronGymText_5d1e6 call PrintText diff --git a/scripts/saffronhouse2.asm b/scripts/saffronhouse2.asm index b7d8ed26..68300183 100755 --- a/scripts/saffronhouse2.asm +++ b/scripts/saffronhouse2.asm @@ -6,8 +6,7 @@ SaffronHouse2TextPointers: ; 1de3f (7:5e3f) SaffronHouse2Text1: ; 1de41 (7:5e41) TX_ASM - ld a, [wd7bd] - bit 0, a + CheckEvent EVENT_3B0 jr nz, .asm_9e72b ld hl, TM29PreReceiveText call PrintText @@ -16,8 +15,7 @@ SaffronHouse2Text1: ; 1de41 (7:5e41) jr nc, .BagFull ld hl, ReceivedTM29Text call PrintText - ld hl, wd7bd - set 0, [hl] + SetEvent EVENT_3B0 jr .asm_fe4e1 .BagFull ld hl, TM29NoRoomText diff --git a/scripts/seafoamislands1.asm b/scripts/seafoamislands1.asm index f71fc648..89972aca 100755 --- a/scripts/seafoamislands1.asm +++ b/scripts/seafoamislands1.asm @@ -1,7 +1,6 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) call EnableAutoTextBoxDrawing - ld hl, wd7e7 - set 0, [hl] + SetEvent EVENT_500 ld hl, wFlags_0xcd60 bit 7, [hl] res 7, [hl] @@ -9,18 +8,18 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) ld hl, Seafoam1HolesCoords call CheckBoulderCoords ret nc - ld hl, wd7e8 + EventFlagAddress hl, EVENT_50E ld a, [wCoordIndex] cp $1 jr nz, .asm_44819 - set 6, [hl] + SetEventReuseHL EVENT_50E ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_1 ld [wd07a], a jr .asm_44825 .asm_44819 - set 7, [hl] + SetEventAfterBranchReuseHL EVENT_50F, EVENT_50E ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_2 diff --git a/scripts/seafoamislands2.asm b/scripts/seafoamislands2.asm index a62d6bda..c24ba601 100755 --- a/scripts/seafoamislands2.asm +++ b/scripts/seafoamislands2.asm @@ -7,18 +7,18 @@ SeafoamIslands2Script: ; 46315 (11:6315) ld hl, Seafoam2HolesCoords call CheckBoulderCoords ret nc - ld hl, wd87f + EventFlagAddress hl, EVENT_9C0 ld a, [wCoordIndex] cp $1 jr nz, .asm_46340 - set 0, [hl] + SetEventReuseHL EVENT_9C0 ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_1 ld [wd07a], a jr .asm_4634c .asm_46340 - set 1, [hl] + SetEventAfterBranchReuseHL EVENT_9C1, EVENT_9C0 ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_2 diff --git a/scripts/seafoamislands3.asm b/scripts/seafoamislands3.asm index 0b650135..f117c2a7 100755 --- a/scripts/seafoamislands3.asm +++ b/scripts/seafoamislands3.asm @@ -7,18 +7,18 @@ SeafoamIslands3Script: ; 46451 (11:6451) ld hl, Seafoam3HolesCoords call CheckBoulderCoords ret nc - ld hl, wd880 + EventFlagAddress hl, EVENT_9C8 ld a, [wCoordIndex] cp $1 jr nz, .asm_4647c - set 0, [hl] + SetEventReuseHL EVENT_9C8 ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_3 ld [wd07a], a jr .asm_46488 .asm_4647c - set 1, [hl] + SetEventAfterBranchReuseHL EVENT_9C9, EVENT_9C8 ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_4 diff --git a/scripts/seafoamislands4.asm b/scripts/seafoamislands4.asm index f16ab2c6..031f9d13 100755 --- a/scripts/seafoamislands4.asm +++ b/scripts/seafoamislands4.asm @@ -7,18 +7,18 @@ SeafoamIslands4Script: ; 4658d (11:658d) ld hl, Seafoam4HolesCoords call CheckBoulderCoords ret nc - ld hl, wd881 + EventFlagAddress hl, EVENT_9D0 ld a, [wCoordIndex] cp $1 jr nz, .asm_465b8 - set 0, [hl] + SetEventReuseHL EVENT_9D0 ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_5_BOULDER_1 ld [wd07a], a jr .asm_465c4 .asm_465b8 - set 1, [hl] + SetEventAfterBranchReuseHL EVENT_9D1, EVENT_9D0 ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_5_BOULDER_2 @@ -56,9 +56,7 @@ SeafoamIslands4ScriptPointers: ; 465fb (11:65fb) dw SeafoamIslands4Script3 SeafoamIslands4Script0: ; 46603 (11:6603) - ld a, [wd880] - and $3 - cp $3 + CheckBothEventsSet EVENT_9C8, EVENT_9C9 ret z ld a, [W_YCOORD] cp $8 @@ -93,9 +91,7 @@ SeafoamIslands4Script1: ; 46639 (11:6639) ret SeafoamIslands4Script2: ; 46644 (11:6644) - ld a, [wd880] - and $3 - cp $3 + CheckBothEventsSet EVENT_9C8, EVENT_9C9 ret z ld a, [W_XCOORD] cp $12 diff --git a/scripts/seafoamislands5.asm b/scripts/seafoamislands5.asm index ab303728..9324a187 100755 --- a/scripts/seafoamislands5.asm +++ b/scripts/seafoamislands5.asm @@ -27,9 +27,7 @@ SeafoamIslands5Script4: ; 467b7 (11:67b7) ret SeafoamIslands5Script0: ; 467c7 (11:67c7) - ld a, [wd880] - and $3 - cp $3 + CheckBothEventsSet EVENT_9C8, EVENT_9C9 ret z ld hl, CoordsData_467fe call ArePlayerCoordsInArray @@ -72,9 +70,7 @@ SeafoamIslands5Script1: ; 46807 (11:6807) ret SeafoamIslands5Script2: ; 46816 (11:6816) - ld a, [wd881] - and $3 - cp $3 + CheckBothEventsSet EVENT_9D0, EVENT_9D1 ld a, $0 jr z, .asm_46849 ld hl, CoordsData_4684d @@ -143,9 +139,9 @@ SeafoamIslands5TextPointers: ; 4687c (11:687c) SeafoamIslands5TrainerHeaders: ; 46886 (11:6886) SeafoamIslands5TrainerHeader0: ; 46886 (11:6886) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SEAFOAM_ISLANDS_5_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd882 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SEAFOAM_ISLANDS_5_TRAINER_0 dw SeafoamIslands5BattleText2 ; TextBeforeBattle dw SeafoamIslands5BattleText2 ; TextAfterBattle dw SeafoamIslands5BattleText2 ; TextEndBattle diff --git a/scripts/silphco1.asm b/scripts/silphco1.asm index 8a399a4c..26c8c888 100755 --- a/scripts/silphco1.asm +++ b/scripts/silphco1.asm @@ -1,11 +1,8 @@ SilphCo1Script: ; 5d44e (17:544e) call EnableAutoTextBoxDrawing - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ret z - ld hl, wd7b9 - bit 7, [hl] - set 7, [hl] + CheckAndSetEvent EVENT_397 ret nz ld a, HS_SILPH_CO_1F_1 ld [wcc4d], a diff --git a/scripts/silphco10.asm b/scripts/silphco10.asm index 47700664..7c7bf785 100755 --- a/scripts/silphco10.asm +++ b/scripts/silphco10.asm @@ -16,8 +16,7 @@ SilphCo10Script_5a14f: ; 5a14f (16:614f) ld hl, DataTable_5a173 call SilphCo2Script_59d43 call SilphCo10Text_5a176 - ld a, [wd836] - bit 0, a + CheckEvent EVENT_778 ret nz ld a, $54 ld [wd09f], a @@ -31,8 +30,7 @@ SilphCo10Text_5a176: ; 5a176 (16:6176) ld a, [$ffe0] and a ret z - ld hl, wd836 - set 0, [hl] + SetEvent EVENT_778 ret SilphCo10ScriptPointers: ; 5a180 (16:6180) @@ -50,18 +48,18 @@ SilphCo10TextPointers: ; 5a186 (16:6186) SilphCo10TrainerHeaders: ; 5a192 (16:6192) SilphCo10TrainerHeader0: ; 5a192 (16:6192) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_10F_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd835 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_10F_TRAINER_0 dw SilphCo10BattleText1 ; TextBeforeBattle dw SilphCo10AfterBattleText1 ; TextAfterBattle dw SilphCo10EndBattleText1 ; TextEndBattle dw SilphCo10EndBattleText1 ; TextEndBattle SilphCo10TrainerHeader1: ; 5a19e (16:619e) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_10F_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd835 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_10F_TRAINER_1 dw SilphCo10BattleText2 ; TextBeforeBattle dw SilphCo10AfterBattleText2 ; TextAfterBattle dw SilphCo10EndBattleText2 ; TextEndBattle @@ -83,8 +81,7 @@ SilphCo10Text2: ; 5a1b5 (16:61b5) SilphCo10Text3: ; 5a1bf (16:61bf) TX_ASM - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ld hl, SilphCo10Text_5a1d8 jr nz, .asm_cf85f ld hl, SilphCo10Text_5a1d3 diff --git a/scripts/silphco11.asm b/scripts/silphco11.asm index 62591476..b855e6d0 100755 --- a/scripts/silphco11.asm +++ b/scripts/silphco11.asm @@ -16,8 +16,7 @@ SilphCo11Script_62110: ; 62110 (18:6110) ld hl, DataTable_62134 call SilphCo11Script_62137 call SilphCo11Script_62163 - ld a, [wd838] - bit 0, a + CheckEvent EVENT_788 ret nz ld a, $20 ld [wd09f], a @@ -67,8 +66,7 @@ SilphCo11Script_62163: ; 62163 (18:6163) ld a, [$ffe0] and a ret z - ld hl, wd838 - set 0, [hl] + SetEvent EVENT_788 ret SilphCo11Script_6216d: ; 6216d (18:616d) @@ -164,8 +162,7 @@ SilphCo11ScriptPointers: ; 621cf (18:61cf) dw SilphCo11Script5 SilphCo11Script0: ; 621db (18:61db) - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ret nz ld hl, CoordsData_62211 call ArePlayerCoordsInArray @@ -231,8 +228,7 @@ SilphCo11Script5: ; 62227 (18:6227) call UpdateSprites call Delay3 call GBFadeInFromBlack - ld hl, wd838 - set 7, [hl] + SetEvent EVENT_78F xor a ld [wJoyIgnore], a jp SilphCo11Script_621c8 @@ -285,18 +281,18 @@ SilphCo11TextPointers: ; 622b7 (18:62b7) SilphCo11TrainerHeaders: ; 622c3 (18:62c3) SilphCo11TrainerHeader0: ; 622c3 (18:62c3) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_11F_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd837 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_11F_TRAINER_0 dw SilphCo11BattleText1 ; TextBeforeBattle dw SilphCo11AfterBattleText1 ; TextAfterBattle dw SilphCo11EndBattleText1 ; TextEndBattle dw SilphCo11EndBattleText1 ; TextEndBattle SilphCo11TrainerHeader1: ; 622cf (18:62cf) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_11F_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd837 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_11F_TRAINER_1 dw SilphCo11BattleText2 ; TextBeforeBattle dw SilphCo11AfterBattleText2 ; TextAfterBattle dw SilphCo11EndBattleText2 ; TextEndBattle @@ -306,8 +302,7 @@ SilphCo11TrainerHeader1: ; 622cf (18:62cf) SilphCo11Text1: ; 622dc (18:62dc) TX_ASM - ld a, [wd838] - bit 5, a + CheckEvent EVENT_78D jp nz, .asm_62308 ld hl, SilphCoPresidentText call PrintText @@ -316,8 +311,7 @@ SilphCo11Text1: ; 622dc (18:62dc) jr nc, .BagFull ld hl, ReceivedSilphCoMasterBallText call PrintText - ld hl, wd838 - set 5, [hl] + SetEvent EVENT_78D jr .asm_6230e .BagFull ld hl, SilphCoMasterBallNoRoomText diff --git a/scripts/silphco2.asm b/scripts/silphco2.asm index ee0bd150..eb6b1b8e 100755 --- a/scripts/silphco2.asm +++ b/scripts/silphco2.asm @@ -16,8 +16,7 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07) ld hl, DataTable_59d3e call SilphCo2Script_59d43 call SilphCo2Script_59d6f - ld a, [wd826] - bit 5, a + CheckEvent EVENT_6FD jr nz, .asm_59d2e push af ld a, $54 @@ -73,16 +72,16 @@ SilphCo2Script_59d43: ; 59d43 (16:5d43) ret SilphCo2Script_59d6f: ; 59d6f (16:5d6f) - ld hl, wd826 + EventFlagAddress hl, EVENT_6FD ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_59d7d - set 5, [hl] + jr nz, .next + SetEventReuseHL EVENT_6FD ret -.asm_59d7d - set 6, [hl] +.next + SetEventAfterBranchReuseHL EVENT_6FE, EVENT_6FD ret SilphCo2ScriptPointers: ; 59d80 (16:5d80) @@ -99,36 +98,36 @@ SilphCo2TextPointers: ; 59d86 (16:5d86) SilphCo2TrainerHeaders: ; 59d90 (16:5d90) SilphCo2TrainerHeader0: ; 59d90 (16:5d90) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd825 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_0 dw SilphCo2BattleText1 ; TextBeforeBattle dw SilphCo2AfterBattleText1 ; TextAfterBattle dw SilphCo2EndBattleText1 ; TextEndBattle dw SilphCo2EndBattleText1 ; TextEndBattle SilphCo2TrainerHeader1: ; 59d9c (16:5d9c) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd825 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_1 dw SilphCo2BattleText2 ; TextBeforeBattle dw SilphCo2AfterBattleText2 ; TextAfterBattle dw SilphCo2EndBattleText2 ; TextEndBattle dw SilphCo2EndBattleText2 ; TextEndBattle SilphCo2TrainerHeader2: ; 59da8 (16:5da8) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd825 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_2 dw SilphCo2BattleText3 ; TextBeforeBattle dw SilphCo2AfterBattleText3 ; TextAfterBattle dw SilphCo2EndBattleText3 ; TextEndBattle dw SilphCo2EndBattleText3 ; TextEndBattle SilphCo2TrainerHeader3: ; 59db4 (16:5db4) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd825 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_3 dw SilphCo2BattleText4 ; TextBeforeBattle dw SilphCo2AfterBattleText4 ; TextAfterBattle dw SilphCo2EndBattleText4 ; TextEndBattle @@ -138,8 +137,7 @@ SilphCo2TrainerHeader3: ; 59db4 (16:5db4) SilphCo2Text1: ; 59dc1 (16:5dc1) TX_ASM - ld a, [wd826] - bit 7, a + CheckEvent EVENT_6FF jr nz, .asm_59de4 ld hl, SilphCo2Text_59ded call PrintText @@ -147,8 +145,7 @@ SilphCo2Text1: ; 59dc1 (16:5dc1) call GiveItem ld hl, TM36NoRoomText jr nc, .asm_59de7 - ld hl, wd826 - set 7, [hl] + SetEvent EVENT_6FF ld hl, ReceivedTM36Text jr .asm_59de7 .asm_59de4 diff --git a/scripts/silphco3.asm b/scripts/silphco3.asm index 4bd1edd1..0cb54726 100755 --- a/scripts/silphco3.asm +++ b/scripts/silphco3.asm @@ -16,8 +16,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) ld hl, DataTable_59fa8 call SilphCo2Script_59d43 call SilphCo3Script_59fad - ld a, [wd828] - bit 0, a + CheckEvent EVENT_708 jr nz, .asm_59f98 push af ld a, $5f @@ -37,16 +36,16 @@ DataTable_59fa8: ; 59fa8 (16:5fa8) db $04,$04,$04,$08,$FF SilphCo3Script_59fad: ; 59fad (16:5fad) - ld hl, wd828 + EventFlagAddress hl, EVENT_708 ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_59fbb - set 0, [hl] + jr nz, .next + SetEventReuseHL EVENT_708 ret -.asm_59fbb - set 1, [hl] +.next + SetEventAfterBranchReuseHL EVENT_709, EVENT_708 ret SilphCo3ScriptPointers: ; 59fbe (16:5fbe) @@ -62,18 +61,18 @@ SilphCo3TextPointers: ; 59fc4 (16:5fc4) SilphCo3TrainerHeaders: ; 59fcc (16:5fcc) SilphCo3TrainerHeader0: ; 59fcc (16:5fcc) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_3F_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd827 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_3F_TRAINER_0 dw SilphCo3BattleText1 ; TextBeforeBattle dw SilphCo3AfterBattleText1 ; TextAfterBattle dw SilphCo3EndBattleText1 ; TextEndBattle dw SilphCo3EndBattleText1 ; TextEndBattle SilphCo3TrainerHeader1: ; 59fd8 (16:5fd8) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_3F_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd827 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_3F_TRAINER_1 dw SilphCo3BattleText2 ; TextBeforeBattle dw SilphCo3AfterBattleText2 ; TextAfterBattle dw SilphCo3EndBattleText2 ; TextEndBattle @@ -83,8 +82,7 @@ SilphCo3TrainerHeader1: ; 59fd8 (16:5fd8) SilphCo3Text1: ; 59fe5 (16:5fe5) TX_ASM - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ld hl, SilphCo3Text_59ffe jr nz, .asm_59fee ld hl, SilphCo3Text_59ff9 diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index a3953e27..aff77e4a 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -16,8 +16,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) ld hl, SilphCo4Data19d58 call SilphCo4Script_19d5d call SilphCo4Script_19d89 - ld a, [wd82a] - bit 0, a + CheckEvent EVENT_718 jr nz, .asm_19d48 push af ld a, $54 @@ -73,16 +72,16 @@ SilphCo4Script_19d5d: ; 19d5d (6:5d5d) ret SilphCo4Script_19d89: ; 19d89 (6:5d89) - ld hl, wd82a + EventFlagAddress hl, EVENT_718 ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_19d97 - set 0, [hl] + jr nz, .next + SetEventReuseHL EVENT_718 ret -.asm_19d97 - set 1, [hl] +.next + SetEventAfterBranchReuseHL EVENT_719, EVENT_718 ret SilphCo4ScriptPointers: ; 19d9a (6:5d9a) @@ -101,27 +100,27 @@ SilphCo4TextPointers: ; 19da0 (6:5da0) SilphCo4TrainerHeaders: ; 19dae (6:5dae) SilphCo4TrainerHeader0: ; 19dae (6:5dae) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd829 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_0 dw SilphCo4BattleText2 ; TextBeforeBattle dw SilphCo4AfterBattleText2 ; TextAfterBattle dw SilphCo4EndBattleText2 ; TextEndBattle dw SilphCo4EndBattleText2 ; TextEndBattle SilphCo4TrainerHeader2: ; 19dba (6:5dba) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd829 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_2 dw SilphCo4BattleText3 ; TextBeforeBattle dw SilphCo4AfterBattleText3 ; TextAfterBattle dw SilphCo4EndBattleText3 ; TextEndBattle dw SilphCo4EndBattleText3 ; TextEndBattle SilphCo4TrainerHeader3: ; 19dc6 (6:5dc6) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd829 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_3 dw SilphCo4BattleText4 ; TextBeforeBattle dw SilphCo4AfterBattleText4 ; TextAfterBattle dw SilphCo4EndBattleText4 ; TextEndBattle diff --git a/scripts/silphco5.asm b/scripts/silphco5.asm index 1ed6006f..cd220b3e 100755 --- a/scripts/silphco5.asm +++ b/scripts/silphco5.asm @@ -16,8 +16,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) ld hl, SilphCo5Coords call SilphCo4Script_19d5d call SilphCo5Script_19f9e - ld a, [wd82c] - bit 0, a + CheckEvent EVENT_728 jr nz, .asm_19f74 push af ld a, $5f @@ -46,21 +45,21 @@ SilphCo5Coords: ; 19f97 (6:5f97) db $02, $03, $06, $03, $05, $07, $ff SilphCo5Script_19f9e: ; 19f9e (6:5f9e) - ld hl, wd82c + EventFlagAddress hl, EVENT_728 ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_19fac - set 0, [hl] + jr nz, .next1 + SetEventReuseHL EVENT_728 ret -.asm_19fac +.next1 cp $2 - jr nz, .asm_19fb3 - set 1, [hl] + jr nz, .next2 + SetEventAfterBranchReuseHL EVENT_729, EVENT_728 ret -.asm_19fb3 - set 2, [hl] +.next2 + SetEventAfterBranchReuseHL EVENT_72A, EVENT_728 ret SilphCo5ScriptPointers: ; 19fb6 (6:5fb6) @@ -83,36 +82,36 @@ SilphCo5TextPointers: ; 19fbc (6:5fbc) SilphCo5TrainerHeaders: ; 19fd2 (6:5fd2) Silphco5TrainerHeader0: ; 19fd2 (6:5fd2) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_0 db ($1 << 4) ; trainer's view range - dw wd82b ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_0 dw SilphCo5BattleText2 ; TextBeforeBattle dw SilphCo5AfterBattleText2 ; TextAfterBattle dw SilphCo5EndBattleText2 ; TextEndBattle dw SilphCo5EndBattleText2 ; TextEndBattle Silphco5TrainerHeader2: ; 19fde (6:5fde) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd82b ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_2 dw SilphCo5BattleText3 ; TextBeforeBattle dw SilphCo5AfterBattleText3 ; TextAfterBattle dw SilphCo5EndBattleText3 ; TextEndBattle dw SilphCo5EndBattleText3 ; TextEndBattle Silphco5TrainerHeader3: ; 19fea (6:5fea) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd82b ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_3 dw SilphCo5BattleText4 ; TextBeforeBattle dw SilphCo5AfterBattleText4 ; TextAfterBattle dw SilphCo5EndBattleText4 ; TextEndBattle dw SilphCo5EndBattleText4 ; TextEndBattle Silphco5TrainerHeader4: ; 19ff6 (6:5ff6) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd82b ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_4 dw SilphCo5BattleText5 ; TextBeforeBattle dw SilphCo5AfterBattleText5 ; TextAfterBattle dw SilphCo5EndBattleText5 ; TextEndBattle diff --git a/scripts/silphco6.asm b/scripts/silphco6.asm index fe1e6224..ca52d05c 100755 --- a/scripts/silphco6.asm +++ b/scripts/silphco6.asm @@ -16,8 +16,7 @@ SilphCo6Script_1a1bf: ; 1a1bf (6:61bf) ld hl, SilphCo6Coords1 call SilphCo4Script_19d5d call SilphCo6Script_1a1e6 - ld a, [wd82e] - bit 7, a + CheckEvent EVENT_73F ret nz ld a, $5f ld [wd09f], a @@ -32,8 +31,7 @@ SilphCo6Script_1a1e6: ; 1a1e6 (6:61e6) ld a, [$ffe0] and a ret z - ld hl, wd82e - set 7, [hl] + SetEvent EVENT_73F ret SilphCo6ScriptPointers: ; 1a1f0 (6:61f0) @@ -55,27 +53,27 @@ SilphCo6TextPointers: ; 1a1f6 (6:61f6) SilphCo6TrainerHeaders: ; 1a20a (6:620a) SilphCo6TrainerHeader0: ; 1a20a (6:620a) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_6F_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd82d ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_6F_TRAINER_0 dw SilphCo6BattleText2 ; TextBeforeBattle dw SilphCo6AfterBattleText2 ; TextAfterBattle dw SilphCo6EndBattleText2 ; TextEndBattle dw SilphCo6EndBattleText2 ; TextEndBattle SilphCo6TrainerHeader2: ; 1a216 (6:6216) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_6F_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd82d ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_6F_TRAINER_2 dw SilphCo6BattleText3 ; TextBeforeBattle dw SilphCo6AfterBattleText3 ; TextAfterBattle dw SilphCo6EndBattleText3 ; TextEndBattle dw SilphCo6EndBattleText3 ; TextEndBattle SilphCo6TrainerHeader3: ; 1a222 (6:6222) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_6F_TRAINER_3, 1 db ($2 << 4) ; trainer's view range - dw wd82d ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_6F_TRAINER_3, 1 dw SilphCo6BattleText4 ; TextBeforeBattle dw SilphCo6AfterBattleText4 ; TextAfterBattle dw SilphCo6EndBattleText4 ; TextEndBattle @@ -84,8 +82,7 @@ SilphCo6TrainerHeader3: ; 1a222 (6:6222) db $ff SilphCo6Script_1a22f: ; 1a22f (6:622f) - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F jr nz, .asm_1a238 jr .asm_1a23a .asm_1a238 diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm index 78d6e0d7..64c79c3a 100755 --- a/scripts/silphco7.asm +++ b/scripts/silphco7.asm @@ -16,8 +16,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) ld hl, DataTable_51bc1 call SilphCo7Text_51bc8 call SilphCo7Text_51bf4 - ld a, [wd830] - bit 4, a + CheckEvent EVENT_74C jr nz, .asm_51b9e push af ld a, $54 @@ -82,21 +81,21 @@ SilphCo7Text_51bc8: ; 51bc8 (14:5bc8) ret SilphCo7Text_51bf4: ; 51bf4 (14:5bf4) - ld hl, wd830 + EventFlagAddress hl, EVENT_74C ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_51c02 - set 4, [hl] + jr nz, .next1 + SetEventReuseHL EVENT_74C ret -.asm_51c02 +.next1 cp $2 - jr nz, .asm_51c09 - set 5, [hl] + jr nz, .next2 + SetEventAfterBranchReuseHL EVENT_74D, EVENT_74C ret -.asm_51c09 - set 6, [hl] +.next2 + SetEventAfterBranchReuseHL EVENT_74E, EVENT_74C ret SilphCo7Text_51c0c: ; 51c0c (14:5c0c) @@ -117,8 +116,7 @@ SilphCo7ScriptPointers: ; 51c17 (14:5c17) dw SilphCo7Script5 SilphCo7Script0: ; 51c23 (14:5c23) - ld a, [wd82f] - bit 0, a + CheckEvent EVENT_740 jp nz, CheckFightingMapTrainers ld hl, CoordsData_51c78 call ArePlayerCoordsInArray @@ -207,8 +205,7 @@ SilphCo7Script4: ; 51cc8 (14:5cc8) jp z, SilphCo7Text_51c0c ld a, $f0 ld [wJoyIgnore], a - ld hl, wd82f - set 0, [hl] + SetEvent EVENT_740 ld a, PLAYER_DIR_DOWN ld [wPlayerMovingDirection], a ld a, $9 @@ -281,36 +278,36 @@ SilphCo7TextPointers: ; 51d3f (14:5d3f) SilphCo7TrainerHeaders: ; 51d5d (14:5d5d) SilphCo7TrainerHeader0: ; 51d5d (14:5d5d) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd82f ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_0 dw SilphCo7BattleText1 ; TextBeforeBattle dw SilphCo7AfterBattleText1 ; TextAfterBattle dw SilphCo7EndBattleText1 ; TextEndBattle dw SilphCo7EndBattleText1 ; TextEndBattle SilphCo7TrainerHeader2: ; 51d69 (14:5d69) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd82f ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_2 dw SilphCo7BattleText2 ; TextBeforeBattle dw SilphCo7AfterBattleText2 ; TextAfterBattle dw SilphCo7EndBattleText2 ; TextEndBattle dw SilphCo7EndBattleText2 ; TextEndBattle SilphCo7TrainerHeader3: ; 51d75 (14:5d75) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd82f ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_3 dw SilphCo7BattleText3 ; TextBeforeBattle dw SilphCo7AfterBattleText3 ; TextAfterBattle dw SilphCo7EndBattleText3 ; TextEndBattle dw SilphCo7EndBattleText3 ; TextEndBattle SilphCo7TrainerHeader4: ; 51d81 (14:5d81) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_4, 1 db ($4 << 4) ; trainer's view range - dw wd82f ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_4, 1 dw SilphCo7BattleText4 ; TextBeforeBattle dw SilphCo7AfterBattleText4 ; TextAfterBattle dw SilphCo7EndBattleText4 ; TextEndBattle @@ -324,8 +321,7 @@ SilphCo7Text1: ld a, [wd72e] bit 0, a ; got lapras? jr z, .givelapras - ld a, [wd838] - bit 7, a ; saved silph? + CheckEvent EVENT_78F jr nz, .savedsilph ld hl, .LaprasGuyText call PrintText @@ -369,8 +365,7 @@ SilphCo7Text1: SilphCo7Text2: TX_ASM - ld a, [wd838] - bit 7, a ; saved silph? + CheckEvent EVENT_78F jr nz, .savedsilph ld hl, .rockettext call PrintText @@ -391,8 +386,7 @@ SilphCo7Text2: SilphCo7Text3: TX_ASM - ld a, [wd838] - bit 7, a ; saved silph? + CheckEvent EVENT_78F jr nz, .savedsilph ld hl, .rockettext call PrintText @@ -413,8 +407,7 @@ SilphCo7Text3: SilphCo7Text4: TX_ASM - ld a, [wd838] - bit 7, a ; saved silph? + CheckEvent EVENT_78F jr nz, .savedsilph ld hl, .rockettext call PrintText diff --git a/scripts/silphco8.asm b/scripts/silphco8.asm index 95a1096d..ec54ea8e 100755 --- a/scripts/silphco8.asm +++ b/scripts/silphco8.asm @@ -16,8 +16,7 @@ SilphCo8Script_5651a: ; 5651a (15:651a) ld hl, DataTable_5653e call SilphCo8Script_56541 call SilphCo8Script_5656d - ld a, [wd832] - bit 0, a + CheckEvent EVENT_758 ret nz ld a, $5f ld [wd09f], a @@ -67,8 +66,7 @@ SilphCo8Script_5656d: ; 5656d (15:656d) ld a, [$ffe0] and a ret z - ld hl, wd832 - set 0, [hl] + SetEvent EVENT_758 ret SilphCo8ScriptPointers: ; 56577 (15:6577) @@ -84,27 +82,27 @@ SilphCo8TextPointers: ; 5657d (15:657d) SilphCo8TrainerHeaders: ; 56585 (15:6585) SilphCo8TrainerHeader0: ; 56585 (15:6585) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_8F_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd831 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_8F_TRAINER_0 dw SilphCo8BattleText1 ; TextBeforeBattle dw SilphCo8AfterBattleText1 ; TextAfterBattle dw SilphCo8EndBattleText1 ; TextEndBattle dw SilphCo8EndBattleText1 ; TextEndBattle SilphCo8TrainerHeader1: ; 56591 (15:6591) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_8F_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd831 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_8F_TRAINER_1 dw SilphCo8BattleText2 ; TextBeforeBattle dw SilphCo8AfterBattleText2 ; TextAfterBattle dw SilphCo8EndBattleText2 ; TextEndBattle dw SilphCo8EndBattleText2 ; TextEndBattle SilphCo8TrainerHeader2: ; 5659d (15:659d) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_8F_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd831 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_8F_TRAINER_2 dw SilphCo8BattleText3 ; TextBeforeBattle dw SilphCo8AfterBattleText3 ; TextAfterBattle dw SilphCo8EndBattleText3 ; TextEndBattle @@ -114,8 +112,7 @@ SilphCo8TrainerHeader2: ; 5659d (15:659d) SilphCo8Text1: ; 565aa (15:65aa) TX_ASM - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ld hl, SilphCo8Text_565c3 jr nz, .asm_565b8 ld hl, SilphCo8Text_565be diff --git a/scripts/silphco9.asm b/scripts/silphco9.asm index b19dbde4..2c41e019 100755 --- a/scripts/silphco9.asm +++ b/scripts/silphco9.asm @@ -16,8 +16,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) ld hl, DataTable_5d82e call SilphCo9Script_5d837 call SilphCo9Script_5d863 - ld a, [wd834] - bit 0, a + CheckEvent EVENT_768 jr nz, .asm_5d7f8 push af ld a, $5f @@ -91,28 +90,28 @@ SilphCo9Script_5d837: ; 5d837 (17:5837) ret SilphCo9Script_5d863: ; 5d863 (17:5863) - ld hl, wd834 + EventFlagAddress hl, EVENT_768 ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_5d871 - set 0, [hl] + jr nz, .next1 + SetEventReuseHL EVENT_768 ret -.asm_5d871 +.next1 cp $2 - jr nz, .asm_5d878 - set 1, [hl] + jr nz, .next2 + SetEventAfterBranchReuseHL EVENT_769, EVENT_768 ret -.asm_5d878 +.next2 cp $3 - jr nz, .asm_5d87f - set 2, [hl] + jr nz, .next3 + SetEventAfterBranchReuseHL EVENT_76A, EVENT_768 ret -.asm_5d87f +.next3 cp $4 ret nz - set 3, [hl] + SetEventAfterBranchReuseHL EVENT_76B, EVENT_768 ret SilphCo9ScriptPointers: ; 5d885 (17:5885) @@ -128,27 +127,27 @@ SilphCo9TextPointers: ; 5d88b (17:588b) SilphCo9TrainerHeaders: ; 5d893 (17:5893) SilphCo9TrainerHeader0: ; 5d893 (17:5893) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd833 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_0 dw SilphCo9BattleText1 ; TextBeforeBattle dw SilphCo9AfterBattleText1 ; TextAfterBattle dw SilphCo9EndBattleText1 ; TextEndBattle dw SilphCo9EndBattleText1 ; TextEndBattle SilphCo9TrainerHeader1: ; 5d89f (17:589f) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd833 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_1 dw SilphCo9BattleText2 ; TextBeforeBattle dw SilphCo9AfterBattleText2 ; TextAfterBattle dw SilphCo9EndBattleText2 ; TextEndBattle dw SilphCo9EndBattleText2 ; TextEndBattle SilphCo9TrainerHeader2: ; 5d8ab (17:58ab) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd833 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_2 dw SilphCo9BattleText3 ; TextBeforeBattle dw SilphCo9AfterBattleText3 ; TextAfterBattle dw SilphCo9EndBattleText3 ; TextEndBattle @@ -158,8 +157,7 @@ SilphCo9TrainerHeader2: ; 5d8ab (17:58ab) SilphCo9Text1: ; 5d8b8 (17:58b8) TX_ASM - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F jr nz, .asm_5d8dc ld hl, SilphCo9Text_5d8e5 call PrintText diff --git a/scripts/ssanne10.asm b/scripts/ssanne10.asm index 031315c3..3b53b961 100755 --- a/scripts/ssanne10.asm +++ b/scripts/ssanne10.asm @@ -27,54 +27,54 @@ SSAnne10TextPointers: ; 61d6e (18:5d6e) SSAnne10TrainerHeaders: ; 61d84 (18:5d84) SSAnne10TrainerHeader0: ; 61d84 (18:5d84) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd809 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_0 dw SSAnne10BattleText1 ; TextBeforeBattle dw SSAnne10AfterBattleText1 ; TextAfterBattle dw SSAnne10EndBattleText1 ; TextEndBattle dw SSAnne10EndBattleText1 ; TextEndBattle SSAnne10TrainerHeader1: ; 61d90 (18:5d90) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd809 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_1 dw SSAnne10BattleText2 ; TextBeforeBattle dw SSAnne10AfterBattleText2 ; TextAfterBattle dw SSAnne10EndBattleText2 ; TextEndBattle dw SSAnne10EndBattleText2 ; TextEndBattle SSAnne10TrainerHeader2: ; 61d9c (18:5d9c) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd809 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_2 dw SSAnne10BattleText3 ; TextBeforeBattle dw SSAnne10AfterBattleText3 ; TextAfterBattle dw SSAnne10EndBattleText3 ; TextEndBattle dw SSAnne10EndBattleText3 ; TextEndBattle SSAnne10TrainerHeader3: ; 61da8 (18:5da8) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd809 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_3 dw SSAnne10BattleText4 ; TextBeforeBattle dw SSAnne10AfterBattleText4 ; TextAfterBattle dw SSAnne10EndBattleText4 ; TextEndBattle dw SSAnne10EndBattleText4 ; TextEndBattle SSAnne10TrainerHeader4: ; 61db4 (18:5db4) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_4 db ($2 << 4) ; trainer's view range - dw wd809 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_4 dw SSAnne10BattleText5 ; TextBeforeBattle dw SSAnne10AfterBattleText5 ; TextAfterBattle dw SSAnne10EndBattleText5 ; TextEndBattle dw SSAnne10EndBattleText5 ; TextEndBattle SSAnne10TrainerHeader5: ; 61dc0 (18:5dc0) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd809 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_5 dw SSAnne10BattleText6 ; TextBeforeBattle dw SSAnne10AfterBattleText6 ; TextAfterBattle dw SSAnne10EndBattleText6 ; TextEndBattle diff --git a/scripts/ssanne5.asm b/scripts/ssanne5.asm index 063ccbb8..76553563 100755 --- a/scripts/ssanne5.asm +++ b/scripts/ssanne5.asm @@ -21,18 +21,18 @@ SSAnne5TextPointers: ; 616c7 (18:56c7) SSAnne5TrainerHeaders: ; 616d1 (18:56d1) SSAnne5TrainerHeader0: ; 616d1 (18:56d1) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_5_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd7ff ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_5_TRAINER_0 dw SSAnne5BattleText1 ; TextBeforeBattle dw SSAnne5AfterBattleText1 ; TextAfterBattle dw SSAnne5EndBattleText1 ; TextEndBattle dw SSAnne5EndBattleText1 ; TextEndBattle SSAnne5TrainerHeader1: ; 616dd (18:56dd) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_5_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd7ff ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_5_TRAINER_1 dw SSAnne5BattleText2 ; TextBeforeBattle dw SSAnne5AfterBattleText2 ; TextAfterBattle dw SSAnne5EndBattleText2 ; TextEndBattle diff --git a/scripts/ssanne7.asm b/scripts/ssanne7.asm index a1fd791a..a47cc069 100755 --- a/scripts/ssanne7.asm +++ b/scripts/ssanne7.asm @@ -3,8 +3,7 @@ SSAnne7Script: ; 61895 (18:5895) jp EnableAutoTextBoxDrawing SSAnne7Script_6189b: ; 6189b (18:589b) - ld a, [wd803] - bit 1, a + CheckEvent EVENT_5E1 ret nz ld hl, wd72d set 5, [hl] @@ -17,8 +16,7 @@ SSAnne7TextPointers: ; 618a7 (18:58a7) SSAnne7Text1: ; 618ad (18:58ad) TX_ASM - ld a, [wd803] - bit 0, a + CheckEvent EVENT_5E0 jr nz, .asm_797c4 ld hl, SSAnne7RubText call PrintText @@ -29,8 +27,7 @@ SSAnne7Text1: ; 618ad (18:58ad) jr nc, .BagFull ld hl, ReceivedHM01Text call PrintText - ld hl, wd803 - set 0, [hl] + SetEvent EVENT_5E0 jr .asm_0faf5 .BagFull ld hl, HM01NoRoomText @@ -65,8 +62,7 @@ SSAnne7RubText: ; 618ec (18:58ec) cp MUSIC_PKMN_HEALED jr z, .asm_61910 call PlayDefaultMusic - ld hl, wd803 - set 1, [hl] + SetEvent EVENT_5E1 ld hl, wd72d res 5, [hl] jp TextScriptEnd diff --git a/scripts/ssanne8.asm b/scripts/ssanne8.asm index 7885135b..195c9a81 100755 --- a/scripts/ssanne8.asm +++ b/scripts/ssanne8.asm @@ -27,36 +27,36 @@ SSAnne8TextPointers: ; 6198f (18:598f) SSAnne8TrainerHeaders: ; 619a5 (18:59a5) SSAnne8TrainerHeader0: ; 619a5 (18:59a5) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd805 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_0 dw SSAnne8BattleText1 ; TextBeforeBattle dw SSAnne8AfterBattleText1 ; TextAfterBattle dw SSAnne8EndBattleText1 ; TextEndBattle dw SSAnne8EndBattleText1 ; TextEndBattle SSAnne8TrainerHeader1: ; 619b1 (18:59b1) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd805 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_1 dw SSAnne8BattleText2 ; TextBeforeBattle dw SSAnne8AfterBattleText2 ; TextAfterBattle dw SSAnne8EndBattleText2 ; TextEndBattle dw SSAnne8EndBattleText2 ; TextEndBattle SSAnne8TrainerHeader2: ; 619bd (18:59bd) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_2 db ($2 << 4) ; trainer's view range - dw wd805 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_2 dw SSAnne8BattleText3 ; TextBeforeBattle dw SSAnne8AfterBattleText3 ; TextAfterBattle dw SSAnne8EndBattleText3 ; TextEndBattle dw SSAnne8EndBattleText3 ; TextEndBattle SSAnne8TrainerHeader3: ; 619c9 (18:59c9) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd805 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_3 dw SSAnne8BattleText4 ; TextBeforeBattle dw SSAnne8AfterBattleText4 ; TextAfterBattle dw SSAnne8EndBattleText4 ; TextEndBattle diff --git a/scripts/ssanne9.asm b/scripts/ssanne9.asm index 0cee1e08..525a2964 100755 --- a/scripts/ssanne9.asm +++ b/scripts/ssanne9.asm @@ -32,36 +32,36 @@ SSAnne9TextPointers: ; 61b6a (18:5b6a) SSAnne9TrainerHeaders: ; 61b84 (18:5b84) SSAnne9TrainerHeader0: ; 61b84 (18:5b84) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd807 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_0 dw SSAnne9BattleText1 ; TextBeforeBattle dw SSAnne9AfterBattleText1 ; TextAfterBattle dw SSAnne9EndBattleText1 ; TextEndBattle dw SSAnne9EndBattleText1 ; TextEndBattle SSAnne9TrainerHeader1: ; 61b90 (18:5b90) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_1 db ($3 << 4) ; trainer's view range - dw wd807 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_1 dw SSAnne9BattleText2 ; TextBeforeBattle dw SSAnne9AfterBattleText2 ; TextAfterBattle dw SSAnne9EndBattleText2 ; TextEndBattle dw SSAnne9EndBattleText2 ; TextEndBattle SSAnne9TrainerHeader2: ; 61b9c (18:5b9c) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd807 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_2 dw SSAnne9BattleText3 ; TextBeforeBattle dw SSAnne9AfterBattleText3 ; TextAfterBattle dw SSAnne9EndBattleText3 ; TextEndBattle dw SSAnne9EndBattleText3 ; TextEndBattle SSAnne9TrainerHeader3: ; 61ba8 (18:5ba8) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd807 ; flag's byte + dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_3 dw SSAnne9BattleText4 ; TextBeforeBattle dw SSAnne9AfterBattleText4 ; TextAfterBattle dw SSAnne9EndBattleText4 ; TextEndBattle diff --git a/scripts/unknowndungeon3.asm b/scripts/unknowndungeon3.asm index 1c87aa39..42459766 100755 --- a/scripts/unknowndungeon3.asm +++ b/scripts/unknowndungeon3.asm @@ -19,9 +19,9 @@ UnknownDungeon3TextPointers: ; 45f09 (11:5f09) UnknownDungeon3TrainerHeaders: ; 45f0f (11:5f0f) UnknownDungeon3TrainerHeader0: ; 45f0f (11:5f0f) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_UNKNOWN_DUNGEON_3_TRAINER_0 db ($0 << 4) ; trainer's view range - dw wd85f ; flag's byte + dwEventFlagAddress EVENT_BEAT_UNKNOWN_DUNGEON_3_TRAINER_0 dw UnknownDungeon3MewtwoText ; TextBeforeBattle dw UnknownDungeon3MewtwoText ; TextAfterBattle dw UnknownDungeon3MewtwoText ; TextEndBattle diff --git a/scripts/vermilioncity.asm b/scripts/vermilioncity.asm index 6b9f94f7..0d6ccbee 100755 --- a/scripts/vermilioncity.asm +++ b/scripts/vermilioncity.asm @@ -21,11 +21,10 @@ VermilionCityScript_197c0: ; 197c0 (6:57c0) ret VermilionCityScript_197cb: ; 197cb (6:57cb) - ld hl, wd803 - bit 2, [hl] + CheckEventHL EVENT_SS_ANNE_LEFT ret z - bit 3, [hl] - set 3, [hl] + CheckEventReuseHL EVENT_5E3 + SetEventReuseHL EVENT_5E3 ret nz ld a, $2 ld [W_VERMILIONCITYCURSCRIPT], a @@ -51,8 +50,7 @@ VermilionCityScript0: ; 197e6 (6:57e6) ld a, $3 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld a, [wd803] - bit 2, a + CheckEvent EVENT_SS_ANNE_LEFT jr nz, .asm_19810 ld b, S_S__TICKET predef IsItemInBag_ @@ -136,8 +134,7 @@ VermilionCityText1: ; 19889 (6:5889) VermilionCityText2: ; 1988e (6:588e) TX_ASM - ld a, [wd803] - bit 2, a + CheckEvent EVENT_SS_ANNE_LEFT jr nz, .asm_1989e ld hl, VermilionCityText_198a7 call PrintText @@ -158,8 +155,7 @@ VermilionCityText_198ac: ; 198ac (6:58ac) VermilionCityText3: ; 198b1 (6:58b1) TX_ASM - ld a, [wd803] - bit 2, a + CheckEvent EVENT_SS_ANNE_LEFT jr nz, .asm_198f6 ld a, [wSpriteStateData1 + 9] cp SPRITE_FACING_RIGHT diff --git a/scripts/vermiliondock.asm b/scripts/vermiliondock.asm index 7c2fb656..20288102 100755 --- a/scripts/vermiliondock.asm +++ b/scripts/vermiliondock.asm @@ -1,16 +1,15 @@ VermilionDockScript: ; 1db52 (7:5b52) call EnableAutoTextBoxDrawing - ld hl, wd803 - bit 4, [hl] + CheckEventHL EVENT_5E4 jr nz, .asm_1db8d - bit 0, [hl] + CheckEventReuseHL EVENT_5E0 ret z ld a, [wDestinationWarpID] cp $1 ret nz - bit 2, [hl] + CheckEventReuseHL EVENT_SS_ANNE_LEFT jp z, VermilionDock_1db9b - set 4, [hl] + SetEventReuseHL EVENT_5E4 call Delay3 ld hl, wd730 set 7, [hl] @@ -28,17 +27,17 @@ VermilionDockScript: ; 1db52 (7:5b52) ld [wJoyIgnore], a ret .asm_1db8d - bit 5, [hl] + CheckEventAfterBranchReuseHL EVENT_5E5, EVENT_5E4 ret nz ld a, [wSimulatedJoypadStatesIndex] and a ret nz ld [wJoyIgnore], a - set 5, [hl] + SetEventReuseHL EVENT_5E5 ret VermilionDock_1db9b: ; 1db9b (7:5b9b) - set 2, [hl] + SetEventForceReuseHL EVENT_SS_ANNE_LEFT ld a, $ff ld [wJoyIgnore], a ld [wc0ee], a diff --git a/scripts/vermiliongym.asm b/scripts/vermiliongym.asm index 614e0b4d..31f736cd 100755 --- a/scripts/vermiliongym.asm +++ b/scripts/vermiliongym.asm @@ -28,8 +28,7 @@ Gym3LeaderName: ; 5ca64 (17:4a64) db "LT.SURGE@" VermilionGymScript_5ca6d: ; 5ca6d (17:4a6d) - ld a, [wd773] - bit 0, a + CheckEvent EVENT_2ND_LOCK_OPENED jr nz, .asm_5ca78 ld a, $24 jr .asm_5ca7f @@ -66,16 +65,14 @@ VermilionGymScript_5caaa: ; 5caaa (17:4aaa) ld a, $6 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd773 - set 7, [hl] + SetEvent EVENT_167 ld bc, (TM_24 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $7 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd773 - set 6, [hl] + SetEvent EVENT_166 jr .asm_5cad3 .BagFull ld a, $8 @@ -88,9 +85,7 @@ VermilionGymScript_5caaa: ; 5caaa (17:4aaa) set 2, [hl] ; deactivate gym trainers - ld a, [wd773] - or %00011100 - ld [wd773], a + SetEventRange EVENT_BEAT_VERMILION_GYM_TRAINER_0, EVENT_BEAT_VERMILION_GYM_TRAINER_2 jp VermilionGymScript_5ca8a @@ -106,27 +101,27 @@ VermilionGymTextPointers: ; 5cae8 (17:4ae8) VermilionGymTrainerHeaders: ; 5caf8 (17:4af8) VermilionGymTrainerHeader0: ; 5caf8 (17:4af8) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_0 db ($3 << 4) ; trainer's view range - dw wd773 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_0 dw VermilionGymBattleText1 ; TextBeforeBattle dw VermilionGymAfterBattleText1 ; TextAfterBattle dw VermilionGymEndBattleText1 ; TextEndBattle dw VermilionGymEndBattleText1 ; TextEndBattle VermilionGymTrainerHeader1: ; 5cb04 (17:4b04) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd773 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_1 dw VermilionGymBattleText2 ; TextBeforeBattle dw VermilionGymAfterBattleText2 ; TextAfterBattle dw VermilionGymEndBattleText2 ; TextEndBattle dw VermilionGymEndBattleText2 ; TextEndBattle VermilionGymTrainerHeader2: ; 5cb10 (17:4b10) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd773 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_2 dw VermilionGymBattleText3 ; TextBeforeBattle dw VermilionGymAfterBattleText3 ; TextAfterBattle dw VermilionGymEndBattleText3 ; TextEndBattle @@ -136,10 +131,9 @@ VermilionGymTrainerHeader2: ; 5cb10 (17:4b10) VermilionGymText1: ; 5cb1d (17:4b1d) TX_ASM - ld a, [wd773] - bit 7, a + CheckEvent EVENT_167 jr z, .asm_5cb39 - bit 6, a + CheckEventReuseA EVENT_166 jr nz, .asm_5cb31 call z, VermilionGymScript_5caaa call DisableWaitingAfterTextDisplay diff --git a/scripts/victoryroad1.asm b/scripts/victoryroad1.asm index 4f1df52f..e8b90e05 100755 --- a/scripts/victoryroad1.asm +++ b/scripts/victoryroad1.asm @@ -11,8 +11,7 @@ VictoryRoad1Script: ; 5da0a (17:5a0a) ld [W_VICTORYROAD1CURSCRIPT], a ret .next - ld a, [wd869] - bit 7, a + CheckEvent EVENT_917 ret z ld a, $1d ld [wd09f], a @@ -25,16 +24,14 @@ VictoryRoad1ScriptPointers: ; 5da3a (17:5a3a) dw EndTrainerBattle VictoryRoad1Script0: ; 5da40 (17:5a40) - ld a, [wd869] - bit 7, a + CheckEvent EVENT_917 jp nz, CheckFightingMapTrainers ld hl, CoordsData_5da5c call CheckBoulderCoords jp nc, CheckFightingMapTrainers ld hl, wd126 set 5, [hl] - ld hl, wd869 - set 7, [hl] + SetEvent EVENT_917 ret CoordsData_5da5c: ; 5da5c (17:5a5c) @@ -51,18 +48,18 @@ VictoryRoad1TextPointers: ; 5da5f (17:5a5f) VictoryRoad1TrainerHeaders: ; 5da6d (17:5a6d) VictoryRoad1TrainerHeader0: ; 5da6d (17:5a6d) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_1_TRAINER_0 db ($2 << 4) ; trainer's view range - dw wd869 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_1_TRAINER_0 dw VictoryRoad1BattleText1 ; TextBeforeBattle dw VictoryRoad1AfterBattleText1 ; TextAfterBattle dw VictoryRoad1EndBattleText1 ; TextEndBattle dw VictoryRoad1EndBattleText1 ; TextEndBattle VictoryRoad1TrainerHeader1: ; 5da79 (17:5a79) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_1_TRAINER_1 db ($2 << 4) ; trainer's view range - dw wd869 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_1_TRAINER_1 dw VictoryRoad1BattleText2 ; TextBeforeBattle dw VictoryRoad1AfterBattleText2 ; TextAfterBattle dw VictoryRoad1EndBattleText2 ; TextEndBattle diff --git a/scripts/victoryroad2.asm b/scripts/victoryroad2.asm index fd095638..46755c46 100755 --- a/scripts/victoryroad2.asm +++ b/scripts/victoryroad2.asm @@ -16,12 +16,10 @@ VictoryRoad2Script: ; 5179d (14:579d) ret VictoryRoad2Script_517c4: ; 517c4 (14:57c4) - ld hl, wd869 - res 7, [hl] + ResetEvent EVENT_917 VictoryRoad2Script_517c9: ; 517c9 (14:57c9) - ld a, [wd7ee] - bit 0, a + CheckEvent EVENT_538 jr z, .asm_517da push af ld a, $15 @@ -48,17 +46,17 @@ VictoryRoad2Script0: ; 517f1 (14:57f1) ld hl, CoordsData_51816 call CheckBoulderCoords jp nc, CheckFightingMapTrainers - ld hl, wd7ee + EventFlagAddress hl, EVENT_538 ld a, [wCoordIndex] cp $2 jr z, .asm_5180b - bit 0, [hl] - set 0, [hl] + CheckEventReuseHL EVENT_538 + SetEventReuseHL EVENT_538 ret nz jr .asm_51810 .asm_5180b - bit 7, [hl] - set 7, [hl] + CheckEventAfterBranchReuseHL EVENT_53F, EVENT_538 + SetEventReuseHL EVENT_53F ret nz .asm_51810 ld hl, wd126 @@ -87,54 +85,54 @@ VictoryRoad2TextPointers: ; 5181b (14:581b) VictoryRoad2TrainerHeaders: ; 51835 (14:5835) VictoryRoad2TrainerHeader0: ; 51835 (14:5835) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7ee ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0 dw VictoryRoad2BattleText1 ; TextBeforeBattle dw VictoryRoad2AfterBattleText1 ; TextAfterBattle dw VictoryRoad2EndBattleText1 ; TextEndBattle dw VictoryRoad2EndBattleText1 ; TextEndBattle VictoryRoad2TrainerHeader2: ; 51841 (14:5841) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2 db ($3 << 4) ; trainer's view range - dw wd7ee ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2 dw VictoryRoad2BattleText2 ; TextBeforeBattle dw VictoryRoad2AfterBattleText2 ; TextAfterBattle dw VictoryRoad2EndBattleText2 ; TextEndBattle dw VictoryRoad2EndBattleText2 ; TextEndBattle VictoryRoad2TrainerHeader3: ; 5184d (14:584d) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3 db ($3 << 4) ; trainer's view range - dw wd7ee ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3 dw VictoryRoad2BattleText3 ; TextBeforeBattle dw VictoryRoad2AfterBattleText3 ; TextAfterBattle dw VictoryRoad2EndBattleText3 ; TextEndBattle dw VictoryRoad2EndBattleText3 ; TextEndBattle VictoryRoad2TrainerHeader4: ; 51859 (14:5859) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4 db ($1 << 4) ; trainer's view range - dw wd7ee ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4 dw VictoryRoad2BattleText4 ; TextBeforeBattle dw VictoryRoad2AfterBattleText4 ; TextAfterBattle dw VictoryRoad2EndBattleText4 ; TextEndBattle dw VictoryRoad2EndBattleText4 ; TextEndBattle VictoryRoad2TrainerHeader5: ; 51865 (14:5865) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_5 db ($3 << 4) ; trainer's view range - dw wd7ee ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_5 dw VictoryRoad2BattleText5 ; TextBeforeBattle dw VictoryRoad2AfterBattleText5 ; TextAfterBattle dw VictoryRoad2EndBattleText5 ; TextEndBattle dw VictoryRoad2EndBattleText5 ; TextEndBattle VictoryRoad2TrainerHeader6: ; 51871 (14:5871) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_6 db ($0 << 4) ; trainer's view range - dw wd7ee ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_6 dw VictoryRoad2BattleText6 ; TextBeforeBattle dw VictoryRoad2BattleText6 ; TextAfterBattle dw VictoryRoad2BattleText6 ; TextEndBattle diff --git a/scripts/victoryroad3.asm b/scripts/victoryroad3.asm index 14b6895d..bbb64272 100755 --- a/scripts/victoryroad3.asm +++ b/scripts/victoryroad3.asm @@ -13,8 +13,7 @@ VictoryRoad3Script_44996: ; 44996 (11:4996) bit 5, [hl] res 5, [hl] ret z - ld hl, wd813 - bit 0, [hl] + CheckEventHL EVENT_660 ret z ld a, $1d ld [wd09f], a @@ -39,13 +38,10 @@ VictoryRoad3Script0: ; 449b7 (11:49b7) jr nz, .asm_449dc ld hl, wd126 set 5, [hl] - ld hl, wd813 - set 0, [hl] + SetEvent EVENT_660 ret .asm_449dc - ld hl, wd813 - bit 6, [hl] - set 6, [hl] + CheckAndSetEvent EVENT_666 jr nz, .asm_449fe ld a, HS_VICTORY_ROAD_3_BOULDER ld [wcc4d], a @@ -92,36 +88,36 @@ VictoryRoad3TextPointers: ; 44a24 (11:4a24) VictoryRoad3TrainerHeaders: ; 44a38 (11:4a38) VictoryRoad3TrainerHeader0: ; 44a38 (11:4a38) - db $1 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0 db ($1 << 4) ; trainer's view range - dw wd813 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0 dw VictoryRoad3BattleText2 ; TextBeforeBattle dw VictoryRoad3AfterBattleText2 ; TextAfterBattle dw VictoryRoad3EndBattleText2 ; TextEndBattle dw VictoryRoad3EndBattleText2 ; TextEndBattle VictoryRoad3TrainerHeader2: ; 44a44 (11:4a44) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd813 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2 dw VictoryRoad3BattleText3 ; TextBeforeBattle dw VictoryRoad3AfterBattleText3 ; TextAfterBattle dw VictoryRoad3EndBattleText3 ; TextEndBattle dw VictoryRoad3EndBattleText3 ; TextEndBattle VictoryRoad3TrainerHeader3: ; 44a50 (11:4a50) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3 db ($4 << 4) ; trainer's view range - dw wd813 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3 dw VictoryRoad3BattleText4 ; TextBeforeBattle dw VictoryRoad3AfterBattleText4 ; TextAfterBattle dw VictoryRoad3EndBattleText4 ; TextEndBattle dw VictoryRoad3EndBattleText4 ; TextEndBattle VictoryRoad3TrainerHeader4: ; 44a5c (11:4a5c) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_4 db ($4 << 4) ; trainer's view range - dw wd813 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_4 dw VictoryRoad3BattleText5 ; TextBeforeBattle dw VictoryRoad3AfterBattleText5 ; TextAfterBattle dw VictoryRoad3EndBattleText5 ; TextEndBattle diff --git a/scripts/viridiancity.asm b/scripts/viridiancity.asm index c358e961..f7884c9b 100755 --- a/scripts/viridiancity.asm +++ b/scripts/viridiancity.asm @@ -15,14 +15,12 @@ ViridianCityScript0: ; 19005 (6:5005) jp ViridianCityScript_1903d ViridianCityScript_1900b: ; 1900b (6:500b) - ld a, [wd74c] - bit 0, a + CheckEvent EVENT_028 ret nz ld a, [W_OBTAINEDBADGES] cp %01111111 jr nz, .asm_1901e - ld hl, wd74c - set 0, [hl] + SetEvent EVENT_028 ret .asm_1901e ld a, [W_YCOORD] @@ -42,8 +40,7 @@ ViridianCityScript_1900b: ; 1900b (6:500b) ret ViridianCityScript_1903d: ; 1903d (6:503d) - ld a, [wd74b] - bit 5, a + CheckEvent EVENT_GOT_POKEDEX ret nz ld a, [W_YCOORD] cp $9 @@ -154,8 +151,7 @@ ViridianCityText2: ; 19107 (6:5107) cp %01111111 ld hl, ViridianCityText_19127 jr z, .asm_ae9fe - ld a, [wd751] - bit 1, a + CheckEvent EVENT_051 jr nz, .asm_ae9fe ld hl, ViridianCityText_19122 .asm_ae9fe @@ -201,8 +197,7 @@ ViridianCityText_19157: ; 19157 (6:5157) ViridianCityText4: ; 1915c (6:515c) TX_ASM - ld a, [wd74b] - bit 5, a + CheckEvent EVENT_GOT_POKEDEX jr nz, .asm_83894 ld hl, ViridianCityText_19175 call PrintText @@ -236,8 +231,7 @@ ViridianCityText_19191: ; 19191 (6:5191) ViridianCityText6: ; 19196 (6:5196) TX_ASM - ld a, [wd74c] - bit 1, a + CheckEvent EVENT_029 jr nz, .asm_4e5a0 ld hl, ViridianCityText_191ca call PrintText @@ -246,8 +240,7 @@ ViridianCityText6: ; 19196 (6:5196) jr nc, .BagFull ld hl, ReceivedTM42Text call PrintText - ld hl, wd74c - set 1, [hl] + SetEvent EVENT_029 jr .asm_3c73c .BagFull ld hl, TM42NoRoomText diff --git a/scripts/viridianforest.asm b/scripts/viridianforest.asm index 554c2125..892eeef2 100755 --- a/scripts/viridianforest.asm +++ b/scripts/viridianforest.asm @@ -30,27 +30,27 @@ ViridianForestTextPointers: ; 61126 (18:5126) ViridianForestTrainerHeaders: ; 61142 (18:5142) ViridianForestTrainerHeader0: ; 61142 (18:5142) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7f3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 dw ViridianForestBattleText1 ; TextBeforeBattle dw ViridianForestAfterBattleText1 ; TextAfterBattle dw ViridianForestEndBattleText1 ; TextEndBattle dw ViridianForestEndBattleText1 ; TextEndBattle ViridianForestTrainerHeader1: ; 6114e (18:514e) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd7f3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1 dw ViridianForestBattleText2 ; TextBeforeBattle dw ViridianForestAfterBattleText2 ; TextAfterBattle dw ViridianForestEndBattleText2 ; TextEndBattle dw ViridianForestEndBattleText2 ; TextEndBattle ViridianForestTrainerHeader2: ; 6115a (18:515a) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 db ($1 << 4) ; trainer's view range - dw wd7f3 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 dw ViridianForestBattleText3 ; TextBeforeBattle dw ViridianForestAfterBattleText3 ; TextAfterBattle dw ViridianForestEndBattleText3 ; TextEndBattle diff --git a/scripts/viridiangym.asm b/scripts/viridiangym.asm index 40484d21..9047b80a 100755 --- a/scripts/viridiangym.asm +++ b/scripts/viridiangym.asm @@ -140,16 +140,14 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) ld a, $c ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd751 - set 1, [hl] + SetEvent EVENT_051 ld bc, (TM_27 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $d ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd751 - set 0, [hl] + SetEvent EVENT_050 jr .asm_749be .BagFull ld a, $e @@ -162,19 +160,12 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) set 7, [hl] ; deactivate gym trainers - ld a, [wd751] - or %11111100 - ld [wd751], a - ld a, [wd752] - or %00000011 - ld [wd752], a + SetEventRange EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0, EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7 ld a, HS_ROUTE_22_RIVAL_2 ld [wcc4d], a predef ShowObject - ld hl, wd7eb - set 1, [hl] - set 7, [hl] + SetEvents EVENT_521, EVENT_527 jp ViridianGymScript_748d6 ViridianGymTextPointers: ; 749ec (1d:49ec) @@ -195,72 +186,72 @@ ViridianGymTextPointers: ; 749ec (1d:49ec) ViridianGymTrainerHeaders: ; 74a08 (1d:4a08) ViridianGymTrainerHeader0: ; 74a08 (1d:4a08) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0 dw ViridianGymBattleText1 ; TextBeforeBattle dw ViridianGymAfterBattleText1 ; TextAfterBattle dw ViridianGymEndBattleText1 ; TextEndBattle dw ViridianGymEndBattleText1 ; TextEndBattle ViridianGymTrainerHeader1: ; 74a14 (1d:4a14) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1 db ($4 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1 dw ViridianGymBattleText2 ; TextBeforeBattle dw ViridianGymAfterBattleText2 ; TextAfterBattle dw ViridianGymEndBattleText2 ; TextEndBattle dw ViridianGymEndBattleText2 ; TextEndBattle ViridianGymTrainerHeader2: ; 74a20 (1d:4a20) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2 db ($4 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2 dw ViridianGymBattleText3 ; TextBeforeBattle dw ViridianGymAfterBattleText3 ; TextAfterBattle dw ViridianGymEndBattleText3 ; TextEndBattle dw ViridianGymEndBattleText3 ; TextEndBattle ViridianGymTrainerHeader3: ; 74a2c (1d:4a2c) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3 db ($2 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3 dw ViridianGymBattleText4 ; TextBeforeBattle dw ViridianGymAfterBattleText4 ; TextAfterBattle dw ViridianGymEndBattleText4 ; TextEndBattle dw ViridianGymEndBattleText4 ; TextEndBattle ViridianGymTrainerHeader4: ; 74a38 (1d:4a38) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4 db ($3 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4 dw ViridianGymBattleText5 ; TextBeforeBattle dw ViridianGymAfterBattleText5 ; TextAfterBattle dw ViridianGymEndBattleText5 ; TextEndBattle dw ViridianGymEndBattleText5 ; TextEndBattle ViridianGymTrainerHeader5: ; 74a44 (1d:4a44) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5 db ($4 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5 dw ViridianGymBattleText6 ; TextBeforeBattle dw ViridianGymAfterBattleText6 ; TextAfterBattle dw ViridianGymEndBattleText6 ; TextEndBattle dw ViridianGymEndBattleText6 ; TextEndBattle ViridianGymTrainerHeader6: ; 74a50 (1d:4a50) - db $8 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6, 1 db ($3 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6, 1 dw ViridianGymBattleText7 ; TextBeforeBattle dw ViridianGymAfterBattleText7 ; TextAfterBattle dw ViridianGymEndBattleText7 ; TextEndBattle dw ViridianGymEndBattleText7 ; TextEndBattle ViridianGymTrainerHeader7: ; 74a5c (1d:4a5c) - db $9 ; flag's bit + dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7, 1 db ($4 << 4) ; trainer's view range - dw wd751 ; flag's byte + dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7, 1 dw ViridianGymBattleText8 ; TextBeforeBattle dw ViridianGymAfterBattleText8 ; TextAfterBattle dw ViridianGymEndBattleText8 ; TextEndBattle @@ -270,10 +261,9 @@ ViridianGymTrainerHeader7: ; 74a5c (1d:4a5c) ViridianGymText1: ; 74a69 (1d:4a69) TX_ASM - ld a, [wd751] - bit 1, a + CheckEvent EVENT_051 jr z, .asm_6de66 - bit 0, a + CheckEventReuseA EVENT_050 jr nz, .asm_9fc95 call z, ViridianGymScript3_74995 call DisableWaitingAfterTextDisplay @@ -485,8 +475,7 @@ ViridianGymAfterBattleText8: ; 74bb6 (1d:4bb6) ViridianGymText10: ; 74bbb (1d:4bbb) TX_ASM - ld a, [wd751] - bit 1, a + CheckEvent EVENT_051 jr nz, .asm_1abd1 ld hl, ViridianGymText_74bd4 call PrintText diff --git a/scripts/viridianmart.asm b/scripts/viridianmart.asm index b6621684..7008ba5b 100755 --- a/scripts/viridianmart.asm +++ b/scripts/viridianmart.asm @@ -6,8 +6,7 @@ ViridianMartScript: ; 1d46e (7:546e) jp CallFunctionInTable ViridianMartScript_1d47d: ; 1d47d (7:547d) - ld a, [wd74e] - bit 0, a + CheckEvent EVENT_038 jr nz, .asm_1d489 ld hl, ViridianMartTextPointers jr .asm_1d48c @@ -55,8 +54,7 @@ ViridianMartScript1: ; 1d4c0 (7:54c0) call DisplayTextID ld bc, (OAKS_PARCEL << 8) + 1 call GiveItem - ld hl, wd74e - set 1, [hl] + SetEvent EVENT_039 ld a, $2 ld [W_VIRIDIANMARKETCURSCRIPT], a ; fallthrough diff --git a/wram.asm b/wram.asm index b43f3845..767cc0d4 100755 --- a/wram.asm +++ b/wram.asm @@ -2575,142 +2575,9 @@ wCardKeyDoorX:: ; d740 wd743:: ds 1 ; used with surge gym trash cans wd744:: ds 3 ; also used with surge gym trash cans -wd747:: ds 3 ; and we're getting to flags, which I'm not going to bother commenting -wd74a:: ds 1 - -wd74b:: ; d74b -; bit 0: Prof. Oak has lead the player to the north end of his lab -; bit 1: Prof. Oak has asked the player to choose a pokemon -; bit 2: the player and the rival have received their pokemon -; bit 3: the player has battled the rival in Oak's lab -; bit 4: Prof. Oak has given the player 5 pokeballs -; bit 5: received pokedex - ds 1 - -wd74c:: ds 2 -wd74e:: ds 3 -wd751:: ds 1 -wd752:: ds 2 -wd754:: ds 1 -wd755:: ds 5 -wd75a:: ds 1 -wd75b:: ds 3 -wd75e:: ds 1 -wd75f:: ds 5 -wd764:: ds 1 -wd765:: ds 1 -wd766:: ds 1 -wd767:: ds 1 -wd768:: ds 1 -wd769:: ds 3 -wd76c:: ds 5 -wd771:: ds 2 -wd773:: ds 4 -wd777:: ds 1 -wd778:: ds 4 -wd77c:: ds 1 -wd77d:: ds 1 -wd77e:: ds 5 -wd783:: ds 11 -wd78e:: ds 2 -wd790:: ds 2 -wd792:: ds 4 -wd796:: ds 2 -wd798:: ds 2 -wd79a:: ds 1 -wd79b:: ds 1 -wd79c:: ds 5 -wd7a1:: ds 2 -wd7a3:: ds 12 -wd7af:: ds 2 -wd7b1:: ds 2 -wd7b3:: ds 1 -wd7b4:: ds 5 -wd7b9:: ds 4 -wd7bd:: ds 2 -wd7bf:: ds 3 -wd7c2:: ds 1 -wd7c3:: ds 2 -wd7c5:: ds 1 -wd7c6:: ds 3 -wd7c9:: ds 4 -wd7cd:: ds 2 -wd7cf:: ds 2 -wd7d1:: ds 1 -wd7d2:: ds 1 -wd7d3:: ds 2 -wd7d5:: ds 1 -wd7d6:: ds 1 -wd7d7:: ds 1 -wd7d8:: ds 1 -wd7d9:: ds 2 -wd7db:: ds 2 -wd7dd:: ds 2 -wd7df:: ds 1 -wd7e0:: ds 1 -wd7e1:: ds 2 -wd7e3:: ds 2 -wd7e5:: ds 2 -wd7e7:: ds 1 -wd7e8:: ds 1 -wd7e9:: ds 2 -wd7eb:: ds 2 -wd7ed:: ds 1 -wd7ee:: ds 1 -wd7ef:: ds 1 -wd7f0:: ds 1 -wd7f1:: ds 1 -wd7f2:: ds 1 -wd7f3:: ds 2 -wd7f5:: ds 1 -wd7f6:: ds 9 -wd7ff:: ds 4 -wd803:: ds 2 -wd805:: ds 2 -wd807:: ds 2 -wd809:: ds 10 -wd813:: ds 2 -wd815:: ds 1 -wd816:: ds 1 -wd817:: ds 2 -wd819:: ds 2 -wd81b:: ds 10 -wd825:: ds 1 -wd826:: ds 1 -wd827:: ds 1 -wd828:: ds 1 -wd829:: ds 1 -wd82a:: ds 1 -wd82b:: ds 1 -wd82c:: ds 1 -wd82d:: ds 1 -wd82e:: ds 1 -wd82f:: ds 1 -wd830:: ds 1 -wd831:: ds 1 -wd832:: ds 1 -wd833:: ds 1 -wd834:: ds 1 -wd835:: ds 1 -wd836:: ds 1 -wd837:: ds 1 -wd838:: ds 15 -wd847:: ds 2 -wd849:: ds 2 -wd84b:: ds 12 -wd857:: ds 8 -wd85f:: ds 4 -wd863:: ds 1 -wd864:: ds 1 -wd865:: ds 1 -wd866:: ds 1 -wd867:: ds 2 -wd869:: ds 20 -wd87d:: ds 2 -wd87f:: ds 1 -wd880:: ds 1 -wd881:: ds 1 -wd882:: ds 5 + +wEventFlags:: ; d747 + ds 320 wLinkEnemyTrainerName:: ; d887 ; linked game's trainer name -- cgit v1.2.3 From fd2b4b6c74e324f423cd3a5aac0428eae12b7620 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Mon, 20 Jul 2015 19:41:23 -0700 Subject: gym leader events --- constants/event_constants.asm | 32 ++++++++++++++++---------------- macros.asm | 2 +- scripts/celadongamecorner.asm | 2 +- scripts/celadongym.asm | 8 ++++---- scripts/ceruleangym.asm | 10 +++++----- scripts/cinnabargym.asm | 10 +++++----- scripts/fuchsiagym.asm | 10 +++++----- scripts/pewtercity.asm | 2 +- scripts/pewtergym.asm | 8 ++++---- scripts/saffrongym.asm | 10 +++++----- scripts/vermiliongym.asm | 8 ++++---- scripts/viridiancity.asm | 2 +- scripts/viridiangym.asm | 10 +++++----- 13 files changed, 57 insertions(+), 57 deletions(-) diff --git a/constants/event_constants.asm b/constants/event_constants.asm index 64241ae6..072a90b8 100755 --- a/constants/event_constants.asm +++ b/constants/event_constants.asm @@ -80,8 +80,8 @@ const_value = 0 const EVENT_04D const EVENT_04E const EVENT_04F - const EVENT_050 - const EVENT_051 + const EVENT_GOT_TM27 + const EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0 const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1 const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2 @@ -118,8 +118,8 @@ const_value = 0 const EVENT_073 const EVENT_074 const EVENT_075 - const EVENT_076 - const EVENT_077 + const EVENT_GOT_TM34 + const EVENT_BEAT_BROCK const EVENT_078 const EVENT_079 const EVENT_07A @@ -190,8 +190,8 @@ const_value = 0 const EVENT_BEAT_CERULEAN_GYM_TRAINER_1 const EVENT_0BC const EVENT_0BD - const EVENT_0BE - const EVENT_0BF + const EVENT_GOT_TM11 + const EVENT_BEAT_MISTY const EVENT_0C0 const EVENT_0C1 const EVENT_0C2 @@ -358,8 +358,8 @@ const_value = 0 const EVENT_BEAT_VERMILION_GYM_TRAINER_1 const EVENT_BEAT_VERMILION_GYM_TRAINER_2 const EVENT_165 - const EVENT_166 - const EVENT_167 + const EVENT_GOT_TM24 + const EVENT_BEAT_LT_SURGE const EVENT_168 const EVENT_169 const EVENT_16A @@ -424,8 +424,8 @@ const_value = 0 const EVENT_1A5 const EVENT_1A6 const EVENT_1A7 - const EVENT_1A8 - const EVENT_1A9 + const EVENT_GOT_TM21 + const EVENT_BEAT_ERIKA const EVENT_BEAT_CELADON_GYM_TRAINER_0 const EVENT_BEAT_CELADON_GYM_TRAINER_2 const EVENT_BEAT_CELADON_GYM_TRAINER_3 @@ -600,8 +600,8 @@ const_value = 0 const EVENT_255 const EVENT_256 const EVENT_257 - const EVENT_258 - const EVENT_259 + const EVENT_GOT_TM06 + const EVENT_BEAT_KOGA const EVENT_BEAT_FUCHSIA_GYM_TRAINER_0 const EVENT_BEAT_FUCHSIA_GYM_TRAINER_2 const EVENT_BEAT_FUCHSIA_GYM_TRAINER_3 @@ -664,8 +664,8 @@ const_value = 0 const EVENT_295 const EVENT_296 const EVENT_297 - const EVENT_298 - const EVENT_299 + const EVENT_GOT_TM38 + const EVENT_BEAT_BLAINE const EVENT_29A const EVENT_29B const EVENT_29C @@ -864,8 +864,8 @@ const_value = 0 const EVENT_35D const EVENT_35E const EVENT_35F - const EVENT_360 - const EVENT_361 + const EVENT_GOT_TM46 + const EVENT_BEAT_SABRINA const EVENT_BEAT_SAFFRON_GYM_TRAINER_0 const EVENT_BEAT_SAFFRON_GYM_TRAINER_1 const EVENT_BEAT_SAFFRON_GYM_TRAINER_2 diff --git a/macros.asm b/macros.asm index 11f0f37b..62fd4b53 100644 --- a/macros.asm +++ b/macros.asm @@ -428,7 +428,7 @@ event_fill_count = 1 + event_fill_count ELSE IF ((\2) % 8) != 7 ld a, [wEventFlags + event_end_byte] - and ~((1 << (((\2) % 8) + 1)) - 1) $ ff + and ~((1 << (((\2) % 8) + 1)) - 1) & $ff ld [wEventFlags + event_end_byte], a ENDC ENDC diff --git a/scripts/celadongamecorner.asm b/scripts/celadongamecorner.asm index 51ffef89..ef4b4760 100755 --- a/scripts/celadongamecorner.asm +++ b/scripts/celadongamecorner.asm @@ -283,7 +283,7 @@ CeladonGameCornerText6: ; 48db1 (12:4db1) CeladonGameCornerText7: ; 48db6 (12:4db6) TX_ASM - CheckEvent EVENT_1A9 + CheckEvent EVENT_BEAT_ERIKA ld hl, CeladonGameCornerText_48dca jr z, .asm_48dc4 ld hl, CeladonGameCornerText_48dcf diff --git a/scripts/celadongym.asm b/scripts/celadongym.asm index 1e2959dd..9d761a31 100755 --- a/scripts/celadongym.asm +++ b/scripts/celadongym.asm @@ -46,14 +46,14 @@ CeladonGymText_48963: ; 48963 (12:4963) ld a, $9 ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_1A9 + SetEvent EVENT_BEAT_ERIKA ld bc, (TM_21 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_1A8 + SetEvent EVENT_GOT_TM21 jr .asm_4898c .BagFull ld a, $b @@ -151,9 +151,9 @@ CeladonGymTrainerHeader7: ; 48a04 (12:4a04) CeladonGymText1: ; 48a11 (12:4a11) TX_ASM - CheckEvent EVENT_1A9 + CheckEvent EVENT_BEAT_ERIKA jr z, .asm_48a2d - CheckEventReuseA EVENT_1A8 + CheckEventReuseA EVENT_GOT_TM21 jr nz, .asm_48a25 call z, CeladonGymText_48963 call DisableWaitingAfterTextDisplay diff --git a/scripts/ceruleangym.asm b/scripts/ceruleangym.asm index e4c614d6..c8ce12b9 100755 --- a/scripts/ceruleangym.asm +++ b/scripts/ceruleangym.asm @@ -46,14 +46,14 @@ CeruleanGymScript_5c70d: ; 5c70d (17:470d) ld a, $5 ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_0BF + SetEvent EVENT_BEAT_MISTY ld bc, (TM_11 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $6 ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_0BE + SetEvent EVENT_GOT_TM11 jr .asm_5c736 .BagFull ld a, $7 @@ -102,9 +102,9 @@ CeruleanGymTrainerHeader1: ; 5c764 (17:4764) CeruleanGymText1: ; 5c771 (17:4771) TX_ASM - CheckEvent EVENT_0BF + CheckEvent EVENT_BEAT_MISTY jr z, .asm_5c78d - CheckEventReuseA EVENT_0BE + CheckEventReuseA EVENT_GOT_TM11 jr nz, .asm_5c785 call z, CeruleanGymScript_5c70d call DisableWaitingAfterTextDisplay @@ -198,7 +198,7 @@ CeruleanGymAfterBattleText2: ; 5c80c (17:480c) CeruleanGymText4: ; 5c811 (17:4811) TX_ASM - CheckEvent EVENT_0BF + CheckEvent EVENT_BEAT_MISTY jr nz, .asm_5c821 ld hl, CeruleanGymText_5c82a call PrintText diff --git a/scripts/cinnabargym.asm b/scripts/cinnabargym.asm index fe7f1c13..f5c07317 100755 --- a/scripts/cinnabargym.asm +++ b/scripts/cinnabargym.asm @@ -143,14 +143,14 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_299 + SetEvent EVENT_BEAT_BLAINE ld bc, (TM_38 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $b ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_298 + SetEvent EVENT_GOT_TM38 jr .asm_75880 .BagFull ld a, $c @@ -206,9 +206,9 @@ CinnabarGymScript_758b7: ; 758b7 (1d:58b7) CinnabarGymText1: ; 758df (1d:58df) TX_ASM - CheckEvent EVENT_299 + CheckEvent EVENT_BEAT_BLAINE jr z, .asm_d9332 - CheckEventReuseA EVENT_298 + CheckEventReuseA EVENT_GOT_TM38 jr nz, .asm_3012f call z, CinnabarGymScript3_75857 call DisableWaitingAfterTextDisplay @@ -453,7 +453,7 @@ CinnabarGymText_75aa7: ; 75aa7 (1d:5aa7) CinnabarGymText9: ; 75aac (1d:5aac) TX_ASM - CheckEvent EVENT_299 + CheckEvent EVENT_BEAT_BLAINE jr nz, .asm_627d9 ld hl, CinnabarGymText_75ac2 jr .asm_0b11d diff --git a/scripts/fuchsiagym.asm b/scripts/fuchsiagym.asm index f13af011..0855d506 100755 --- a/scripts/fuchsiagym.asm +++ b/scripts/fuchsiagym.asm @@ -46,14 +46,14 @@ FuchsiaGymScript3_75497: ; 75497 (1d:5497) ld a, $9 ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_259 + SetEvent EVENT_BEAT_KOGA ld bc, (TM_06 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_258 + SetEvent EVENT_GOT_TM06 jr .asm_754c0 .BagFull ld a, $b @@ -142,9 +142,9 @@ FuchsiaGymTrainerHeader6: ; 75527 (1d:5527) FuchsiaGymText1: ; 75534 (1d:5534) TX_ASM - CheckEvent EVENT_259 + CheckEvent EVENT_BEAT_KOGA jr z, .asm_181b6 - CheckEventReuseA EVENT_258 + CheckEventReuseA EVENT_GOT_TM06 jr nz, .asm_adc3b call z, FuchsiaGymScript3_75497 call DisableWaitingAfterTextDisplay @@ -313,7 +313,7 @@ FuchsiaGymAfterBattleText6: ; 75635 (1d:5635) FuchsiaGymText8: ; 7563a (1d:563a) TX_ASM - CheckEvent EVENT_259 + CheckEvent EVENT_BEAT_KOGA ld hl, FuchsiaGymText_75653 jr nz, .asm_50671 ld hl, FuchsiaGymText_7564e diff --git a/scripts/pewtercity.asm b/scripts/pewtercity.asm index 2fce86df..8e72ee4b 100755 --- a/scripts/pewtercity.asm +++ b/scripts/pewtercity.asm @@ -21,7 +21,7 @@ PewterCityScript0: ; 19251 (6:5251) ret PewterCityScript_1925e: ; 1925e (6:525e) - CheckEvent EVENT_077 + CheckEvent EVENT_BEAT_BROCK ret nz ld hl, CoordsData_19277 call ArePlayerCoordsInArray diff --git a/scripts/pewtergym.asm b/scripts/pewtergym.asm index e2798b24..03a1c218 100755 --- a/scripts/pewtergym.asm +++ b/scripts/pewtergym.asm @@ -46,14 +46,14 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) ld a, $4 ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_077 + SetEvent EVENT_BEAT_BROCK ld bc, (TM_34 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $5 ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_076 + SetEvent EVENT_GOT_TM34 jr .asm_5c408 .BagFull ld a, $6 @@ -101,9 +101,9 @@ PewterGymTrainerHeader0: ; 5c441 (17:4441) PewterGymText1: ; 5c44e (17:444e) TX_ASM - CheckEvent EVENT_077 + CheckEvent EVENT_BEAT_BROCK jr z, .asm_5c46a - CheckEventReuseA EVENT_076 + CheckEventReuseA EVENT_GOT_TM34 jr nz, .asm_5c462 call z, PewterGymScript_5c3df call DisableWaitingAfterTextDisplay diff --git a/scripts/saffrongym.asm b/scripts/saffrongym.asm index 4e2115c3..e712689f 100755 --- a/scripts/saffrongym.asm +++ b/scripts/saffrongym.asm @@ -46,14 +46,14 @@ SaffronGymText_5d068: ; 5d068 (17:5068) ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_361 + SetEvent EVENT_BEAT_SABRINA ld bc, (TM_46 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $b ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_360 + SetEvent EVENT_GOT_TM46 jr .asm_5d091 .BagFull ld a, $c @@ -152,9 +152,9 @@ SaffronGymTrainerHeader6: ; 5d10b (17:510b) SaffronGymText1: ; 5d118 (17:5118) TX_ASM - CheckEvent EVENT_361 + CheckEvent EVENT_BEAT_SABRINA jr z, .asm_5d134 - CheckEventReuseA EVENT_360 + CheckEventReuseA EVENT_GOT_TM46 jr nz, .asm_5d12c call z, SaffronGymText_5d068 call DisableWaitingAfterTextDisplay @@ -255,7 +255,7 @@ SaffronGymText8: ; 5d1c3 (17:51c3) SaffronGymText9: ; 5d1cd (17:51cd) TX_ASM - CheckEvent EVENT_361 + CheckEvent EVENT_BEAT_SABRINA jr nz, .asm_5d1dd ld hl, SaffronGymText_5d1e6 call PrintText diff --git a/scripts/vermiliongym.asm b/scripts/vermiliongym.asm index 31f736cd..8c400b5f 100755 --- a/scripts/vermiliongym.asm +++ b/scripts/vermiliongym.asm @@ -65,14 +65,14 @@ VermilionGymScript_5caaa: ; 5caaa (17:4aaa) ld a, $6 ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_167 + SetEvent EVENT_BEAT_LT_SURGE ld bc, (TM_24 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $7 ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_166 + SetEvent EVENT_GOT_TM24 jr .asm_5cad3 .BagFull ld a, $8 @@ -131,9 +131,9 @@ VermilionGymTrainerHeader2: ; 5cb10 (17:4b10) VermilionGymText1: ; 5cb1d (17:4b1d) TX_ASM - CheckEvent EVENT_167 + CheckEvent EVENT_BEAT_LT_SURGE jr z, .asm_5cb39 - CheckEventReuseA EVENT_166 + CheckEventReuseA EVENT_GOT_TM24 jr nz, .asm_5cb31 call z, VermilionGymScript_5caaa call DisableWaitingAfterTextDisplay diff --git a/scripts/viridiancity.asm b/scripts/viridiancity.asm index f7884c9b..2d55cc44 100755 --- a/scripts/viridiancity.asm +++ b/scripts/viridiancity.asm @@ -151,7 +151,7 @@ ViridianCityText2: ; 19107 (6:5107) cp %01111111 ld hl, ViridianCityText_19127 jr z, .asm_ae9fe - CheckEvent EVENT_051 + CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI jr nz, .asm_ae9fe ld hl, ViridianCityText_19122 .asm_ae9fe diff --git a/scripts/viridiangym.asm b/scripts/viridiangym.asm index 9047b80a..1dd736cf 100755 --- a/scripts/viridiangym.asm +++ b/scripts/viridiangym.asm @@ -140,14 +140,14 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) ld a, $c ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_051 + SetEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI ld bc, (TM_27 << 8) | 1 call GiveItem jr nc, .BagFull ld a, $d ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_050 + SetEvent EVENT_GOT_TM27 jr .asm_749be .BagFull ld a, $e @@ -261,9 +261,9 @@ ViridianGymTrainerHeader7: ; 74a5c (1d:4a5c) ViridianGymText1: ; 74a69 (1d:4a69) TX_ASM - CheckEvent EVENT_051 + CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI jr z, .asm_6de66 - CheckEventReuseA EVENT_050 + CheckEventReuseA EVENT_GOT_TM27 jr nz, .asm_9fc95 call z, ViridianGymScript3_74995 call DisableWaitingAfterTextDisplay @@ -475,7 +475,7 @@ ViridianGymAfterBattleText8: ; 74bb6 (1d:4bb6) ViridianGymText10: ; 74bbb (1d:4bbb) TX_ASM - CheckEvent EVENT_051 + CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI jr nz, .asm_1abd1 ld hl, ViridianGymText_74bd4 call PrintText -- cgit v1.2.3 From cbcdb2ec2a013beba4f321988e393419a8eed10e Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Mon, 20 Jul 2015 22:11:59 -0700 Subject: move event macros to separate file --- constants.asm | 1 + constants/event_macros.asm | 425 ++++++++++++++++++++++++++++++++++++++++++++ macros.asm | 426 --------------------------------------------- 3 files changed, 426 insertions(+), 426 deletions(-) create mode 100755 constants/event_macros.asm diff --git a/constants.asm b/constants.asm index e121b6b3..3b2d8437 100644 --- a/constants.asm +++ b/constants.asm @@ -31,3 +31,4 @@ INCLUDE "constants/music_constants.asm" INCLUDE "constants/tilesets.asm" INCLUDE "constants/starter_mons.asm" INCLUDE "constants/event_constants.asm" +INCLUDE "constants/event_macros.asm" diff --git a/constants/event_macros.asm b/constants/event_macros.asm new file mode 100755 index 00000000..8daaea28 --- /dev/null +++ b/constants/event_macros.asm @@ -0,0 +1,425 @@ +;\1 = event index +;\2 = return result in carry instead of zero flag +CheckEvent: MACRO +event_byte = ((\1) / 8) + ld a, [wEventFlags + event_byte] + + IF _NARG > 1 + IF ((\1) % 8) == 7 + add a + ELSE + REPT ((\1) % 8) + 1 + rrca + ENDR + ENDC + ELSE + bit (\1) % 8, a + ENDC + ENDM + +;\1 = event index +CheckEventReuseA: MACRO +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld a, [wEventFlags + event_byte] + ENDC + + bit (\1) % 8, a + ENDM + +;\1 = reg +;\2 = event index +;\3 = event index this event is relative to (optional, this is needed when there is a fixed flag address) +EventFlagBit: MACRO + IF _NARG > 2 + ld \1, ((\3) % 8) + ((\2) - (\3)) + ELSE + ld \1, (\2) % 8 + ENDC + ENDM + +;\1 = reg +;\2 = event index +EventFlagAddress: MACRO +event_byte = ((\2) / 8) + ld \1, wEventFlags + event_byte + ENDM + +;\1 = event index +CheckEventHL: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + bit (\1) % 8, [hl] + ENDM + +;\1 = event index +CheckEventReuseHL: MACRO +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + bit (\1) % 8, [hl] + ENDM + +; dangerous, only use when HL is guaranteed to be the desired value +;\1 = event index +CheckEventForceReuseHL: MACRO +event_byte = ((\1) / 8) + bit (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index of the last event used before the branch +CheckEventAfterBranchReuseHL: MACRO +event_byte = ((\2) / 8) +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + bit (\1) % 8, [hl] + ENDM + +;\1 = event index +CheckAndSetEvent: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + bit (\1) % 8, [hl] + set (\1) % 8, [hl] + ENDM + +;\1 = event index +CheckAndResetEvent: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + bit (\1) % 8, [hl] + res (\1) % 8, [hl] + ENDM + +;\1 = event index +CheckAndSetEventA: MACRO + ld a, [wEventFlags + ((\1) / 8)] + bit (\1) % 8, a + set (\1) % 8, a + ld [wEventFlags + ((\1) / 8)], a + ENDM + +;\1 = event index +CheckAndResetEventA: MACRO + ld a, [wEventFlags + ((\1) / 8)] + bit (\1) % 8, a + res (\1) % 8, a + ld [wEventFlags + ((\1) / 8)], a + ENDM + +;\1 = event index +SetEvent: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + set (\1) % 8, [hl] + ENDM + +;\1 = event index +SetEventReuseHL: MACRO + IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + set (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index of the last event used before the branch +SetEventAfterBranchReuseHL: MACRO +event_byte = ((\2) / 8) +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + set (\1) % 8, [hl] + ENDM + +; dangerous, only use when HL is guaranteed to be the desired value +;\1 = event index +SetEventForceReuseHL: MACRO +event_byte = ((\1) / 8) + set (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index +;\3 = event index (optional) +SetEvents: MACRO + SetEvent \1 + SetEventReuseHL \2 + + IF _NARG > 2 + SetEventReuseHL \3 + ENDC + ENDM + +;\1 = event index +ResetEvent: MACRO +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + res (\1) % 8, [hl] + ENDM + +;\1 = event index +ResetEventReuseHL: MACRO + IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + res (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index of the last event used before the branch +ResetEventAfterBranchReuseHL: MACRO +event_byte = ((\2) / 8) +IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld hl, wEventFlags + event_byte + ENDC + + res (\1) % 8, [hl] + ENDM + +; dangerous, only use when HL is guaranteed to be the desired value +;\1 = event index +ResetEventForceReuseHL: MACRO +event_byte = ((\1) / 8) + res (\1) % 8, [hl] + ENDM + +;\1 = event index +;\2 = event index +;\3 = event index (optional) +ResetEvents: MACRO + ResetEvent \1 + ResetEventReuseHL \2 + + IF _NARG > 2 + ResetEventReuseHL \3 + ENDC + ENDM + +;\1 = event index +;\2 = number of bytes away from the base address (optional, for matching the ROM) +dbEventFlagBit: MACRO + IF _NARG > 1 + db ((\1) % 8) + ((\2) * 8) + ELSE + db ((\1) % 8) + ENDC + ENDM + +;\1 = event index +;\2 = number of bytes away from the base address (optional, for matching the ROM) +dwEventFlagAddress: MACRO + IF _NARG > 1 + dw wEventFlags + ((\1) / 8) - (\2) + ELSE + dw wEventFlags + ((\1) / 8) + ENDC + ENDM + +;\1 = start +;\2 = end +SetEventRange: MACRO +event_start_byte = ((\1) / 8) +event_end_byte = ((\2) / 8) + + IF event_end_byte < event_start_byte + FAIL "Incorrect argument order in SetEventRange." + ENDC + + IF event_start_byte == event_end_byte + ld a, [wEventFlags + event_start_byte] + or (1 << (((\2) % 8) + 1)) - (1 << ((\1) % 8)) + ld [wEventFlags + event_start_byte], a + ELSE +event_fill_start = event_start_byte + 1 +event_fill_count = event_end_byte - event_start_byte - 1 + + IF ((\1) % 8) == 0 +event_fill_start = event_fill_start + -1 +event_fill_count = event_fill_count + 1 + ELSE + ld a, [wEventFlags + event_start_byte] + or $ff - ((1 << ((\1) % 8)) - 1) + ld [wEventFlags + event_start_byte], a + ENDC + + IF ((\2) % 8) == 7 +event_fill_count = event_fill_count + 1 + ENDC + + IF event_fill_count == 1 + ld hl, wEventFlags + event_fill_start + ld [hl], $ff + ENDC + + IF event_fill_count > 1 + ld a, $ff + ld hl, wEventFlags + event_fill_start + + REPT event_fill_count + -1 + ld [hli], a + ENDR + + ld [hl], a + ENDC + + IF ((\2) % 8) == 0 + ld hl, wEventFlags + event_end_byte + set 0, [hl] + ELSE + IF ((\2) % 8) != 7 + ld a, [wEventFlags + event_end_byte] + or (1 << (((\2) % 8) + 1)) - 1 + ld [wEventFlags + event_end_byte], a + ENDC + ENDC + ENDC + ENDM + +;\1 = start +;\2 = end +;\3 = assume a is 0 if present +ResetEventRange: MACRO +event_start_byte = ((\1) / 8) +event_end_byte = ((\2) / 8) + + IF event_end_byte < event_start_byte + FAIL "Incorrect argument order in ResetEventRange." + ENDC + + IF event_start_byte == event_end_byte + ld a, [wEventFlags + event_start_byte] + and ~((1 << (((\2) % 8) + 1)) - (1 << ((\1) % 8))) & $ff + ld [wEventFlags + event_start_byte], a + ELSE +event_fill_start = event_start_byte + 1 +event_fill_count = event_end_byte - event_start_byte - 1 + + IF ((\1) % 8) == 0 +event_fill_start = event_fill_start + -1 +event_fill_count = event_fill_count + 1 + ELSE + ld a, [wEventFlags + event_start_byte] + and ~($ff - ((1 << ((\1) % 8)) - 1)) & $ff + ld [wEventFlags + event_start_byte], a + ENDC + + IF ((\2) % 8) == 7 +event_fill_count = event_fill_count + 1 + ENDC + + IF event_fill_count == 1 + ld hl, wEventFlags + event_fill_start + ld [hl], 0 + ENDC + + IF event_fill_count > 1 + ld hl, wEventFlags + event_fill_start + + ; force xor a if we just to wrote to it above + IF (_NARG < 3) || (((\1) % 8) != 0) + xor a + ENDC + + REPT event_fill_count + -1 + ld [hli], a + ENDR + + ld [hl], a + ENDC + + IF ((\2) % 8) == 0 + ld hl, wEventFlags + event_end_byte + res 0, [hl] + ELSE + IF ((\2) % 8) != 7 + ld a, [wEventFlags + event_end_byte] + and ~((1 << (((\2) % 8) + 1)) - 1) & $ff + ld [wEventFlags + event_end_byte], a + ENDC + ENDC + ENDC + ENDM + +; returns whether both events are set in Z flag +;\1 = event index 1 +;\2 = event index 2 +CheckBothEventsSet: MACRO + IF ((\1) / 8) == ((\2) / 8) + ld a, [wEventFlags + ((\1) / 8)] + and (1 << ((\1) % 8)) | (1 << ((\2) % 8)) + cp (1 << ((\1) % 8)) | (1 << ((\2) % 8)) + ELSE + ; This case doesn't happen in the original ROM. + IF ((\1) % 8) == ((\2) % 8) + push hl + ld a, [wEventFlags + ((\1) / 8)] + ld hl, wEventFlags + ((\2) / 8) + and [hl] + cpl + bit ((\1) % 8), a + pop hl + ELSE + push bc + ld a, [wEventFlags + ((\1) / 8)] + and (1 << ((\1) % 8)) + ld b, a + ld a, [wEventFlags + ((\2) / 8)] + and (1 << ((\2) % 8)) + or b + cp (1 << ((\1) % 8)) | (1 << ((\2) % 8)) + pop bc + ENDC + ENDC + ENDM + +; returns the complement of whether either event is set in Z flag +;\1 = event index 1 +;\2 = event index 2 +CheckEitherEventSet: MACRO + IF ((\1) / 8) == ((\2) / 8) + ld a, [wEventFlags + ((\1) / 8)] + and (1 << ((\1) % 8)) | (1 << ((\2) % 8)) + ELSE + ; This case doesn't happen in the original ROM. + IF ((\1) % 8) == ((\2) % 8) + push hl + ld a, [wEventFlags + ((\1) / 8)] + ld hl, wEventFlags + ((\2) / 8) + or [hl] + bit ((\1) % 8), a + pop hl + ELSE + push bc + ld a, [wEventFlags + ((\1) / 8)] + and (1 << ((\1) % 8)) + ld b, a + ld a, [wEventFlags + ((\2) / 8)] + and (1 << ((\2) % 8)) + or b + pop bc + ENDC + ENDC + ENDM + +; for handling fixed event bits when events are inserted/removed +;\1 = event index +;\2 = fixed flag bit +AdjustEventBit: MACRO + IF ((\1) % 8) != (\2) + add ((\1) % 8) - (\2) + ENDC + ENDM \ No newline at end of file diff --git a/macros.asm b/macros.asm index 62fd4b53..659b0722 100644 --- a/macros.asm +++ b/macros.asm @@ -79,432 +79,6 @@ bcd3: MACRO coins equs "bcd2" money equs "bcd3" -;\1 = event index -;\2 = return result in carry instead of zero flag -CheckEvent: MACRO -event_byte = ((\1) / 8) - ld a, [wEventFlags + event_byte] - - IF _NARG > 1 - IF ((\1) % 8) == 7 - add a - ELSE - REPT ((\1) % 8) + 1 - rrca - ENDR - ENDC - ELSE - bit (\1) % 8, a - ENDC - ENDM - -;\1 = event index -CheckEventReuseA: MACRO -IF event_byte != ((\1) / 8) -event_byte = ((\1) / 8) - ld a, [wEventFlags + event_byte] - ENDC - - bit (\1) % 8, a - ENDM - -;\1 = reg -;\2 = event index -;\3 = event index this event is relative to (optional, this is needed when there is a fixed flag address) -EventFlagBit: MACRO - IF _NARG > 2 - ld \1, ((\3) % 8) + ((\2) - (\3)) - ELSE - ld \1, (\2) % 8 - ENDC - ENDM - -;\1 = reg -;\2 = event index -EventFlagAddress: MACRO -event_byte = ((\2) / 8) - ld \1, wEventFlags + event_byte - ENDM - -;\1 = event index -CheckEventHL: MACRO -event_byte = ((\1) / 8) - ld hl, wEventFlags + event_byte - bit (\1) % 8, [hl] - ENDM - -;\1 = event index -CheckEventReuseHL: MACRO -IF event_byte != ((\1) / 8) -event_byte = ((\1) / 8) - ld hl, wEventFlags + event_byte - ENDC - - bit (\1) % 8, [hl] - ENDM - -; dangerous, only use when HL is guaranteed to be the desired value -;\1 = event index -CheckEventForceReuseHL: MACRO -event_byte = ((\1) / 8) - bit (\1) % 8, [hl] - ENDM - -;\1 = event index -;\2 = event index of the last event used before the branch -CheckEventAfterBranchReuseHL: MACRO -event_byte = ((\2) / 8) -IF event_byte != ((\1) / 8) -event_byte = ((\1) / 8) - ld hl, wEventFlags + event_byte - ENDC - - bit (\1) % 8, [hl] - ENDM - -;\1 = event index -CheckAndSetEvent: MACRO -event_byte = ((\1) / 8) - ld hl, wEventFlags + event_byte - bit (\1) % 8, [hl] - set (\1) % 8, [hl] - ENDM - -;\1 = event index -CheckAndResetEvent: MACRO -event_byte = ((\1) / 8) - ld hl, wEventFlags + event_byte - bit (\1) % 8, [hl] - res (\1) % 8, [hl] - ENDM - -;\1 = event index -CheckAndSetEventA: MACRO - ld a, [wEventFlags + ((\1) / 8)] - bit (\1) % 8, a - set (\1) % 8, a - ld [wEventFlags + ((\1) / 8)], a - ENDM - -;\1 = event index -CheckAndResetEventA: MACRO - ld a, [wEventFlags + ((\1) / 8)] - bit (\1) % 8, a - res (\1) % 8, a - ld [wEventFlags + ((\1) / 8)], a - ENDM - -;\1 = event index -SetEvent: MACRO -event_byte = ((\1) / 8) - ld hl, wEventFlags + event_byte - set (\1) % 8, [hl] - ENDM - -;\1 = event index -SetEventReuseHL: MACRO - IF event_byte != ((\1) / 8) -event_byte = ((\1) / 8) - ld hl, wEventFlags + event_byte - ENDC - - set (\1) % 8, [hl] - ENDM - -;\1 = event index -;\2 = event index of the last event used before the branch -SetEventAfterBranchReuseHL: MACRO -event_byte = ((\2) / 8) -IF event_byte != ((\1) / 8) -event_byte = ((\1) / 8) - ld hl, wEventFlags + event_byte - ENDC - - set (\1) % 8, [hl] - ENDM - -; dangerous, only use when HL is guaranteed to be the desired value -;\1 = event index -SetEventForceReuseHL: MACRO -event_byte = ((\1) / 8) - set (\1) % 8, [hl] - ENDM - -;\1 = event index -;\2 = event index -;\3 = event index (optional) -SetEvents: MACRO - SetEvent \1 - SetEventReuseHL \2 - - IF _NARG > 2 - SetEventReuseHL \3 - ENDC - ENDM - -;\1 = event index -ResetEvent: MACRO -event_byte = ((\1) / 8) - ld hl, wEventFlags + event_byte - res (\1) % 8, [hl] - ENDM - -;\1 = event index -ResetEventReuseHL: MACRO - IF event_byte != ((\1) / 8) -event_byte = ((\1) / 8) - ld hl, wEventFlags + event_byte - ENDC - - res (\1) % 8, [hl] - ENDM - -;\1 = event index -;\2 = event index of the last event used before the branch -ResetEventAfterBranchReuseHL: MACRO -event_byte = ((\2) / 8) -IF event_byte != ((\1) / 8) -event_byte = ((\1) / 8) - ld hl, wEventFlags + event_byte - ENDC - - res (\1) % 8, [hl] - ENDM - -; dangerous, only use when HL is guaranteed to be the desired value -;\1 = event index -ResetEventForceReuseHL: MACRO -event_byte = ((\1) / 8) - res (\1) % 8, [hl] - ENDM - -;\1 = event index -;\2 = event index -;\3 = event index (optional) -ResetEvents: MACRO - ResetEvent \1 - ResetEventReuseHL \2 - - IF _NARG > 2 - ResetEventReuseHL \3 - ENDC - ENDM - -;\1 = event index -;\2 = number of bytes away from the base address (optional, for matching the ROM) -dbEventFlagBit: MACRO - IF _NARG > 1 - db ((\1) % 8) + ((\2) * 8) - ELSE - db ((\1) % 8) - ENDC - ENDM - -;\1 = event index -;\2 = number of bytes away from the base address (optional, for matching the ROM) -dwEventFlagAddress: MACRO - IF _NARG > 1 - dw wEventFlags + ((\1) / 8) - (\2) - ELSE - dw wEventFlags + ((\1) / 8) - ENDC - ENDM - -;\1 = start -;\2 = end -SetEventRange: MACRO -event_start_byte = ((\1) / 8) -event_end_byte = ((\2) / 8) - - IF event_end_byte < event_start_byte - FAIL "Incorrect argument order in SetEventRange." - ENDC - - IF event_start_byte == event_end_byte - ld a, [wEventFlags + event_start_byte] - or (1 << (((\2) % 8) + 1)) - (1 << ((\1) % 8)) - ld [wEventFlags + event_start_byte], a - ELSE -event_fill_start = event_start_byte + 1 -event_fill_count = event_end_byte - event_start_byte - 1 - - IF ((\1) % 8) == 0 -event_fill_start = -1 + event_fill_start -event_fill_count = 1 + event_fill_count - ELSE - ld a, [wEventFlags + event_start_byte] - or $ff - ((1 << ((\1) % 8)) - 1) - ld [wEventFlags + event_start_byte], a - ENDC - - IF ((\2) % 8) == 7 -event_fill_count = 1 + event_fill_count - ENDC - - IF event_fill_count == 1 - ld hl, wEventFlags + event_fill_start - ld [hl], $ff - ENDC - - IF event_fill_count > 1 - ld a, $ff - ld hl, wEventFlags + event_fill_start - - REPT -1 + event_fill_count - ld [hli], a - ENDR - - ld [hl], a - ENDC - - IF ((\2) % 8) == 0 - ld hl, wEventFlags + event_end_byte - set 0, [hl] - ELSE - IF ((\2) % 8) != 7 - ld a, [wEventFlags + event_end_byte] - or (1 << (((\2) % 8) + 1)) - 1 - ld [wEventFlags + event_end_byte], a - ENDC - ENDC - ENDC - ENDM - -;\1 = start -;\2 = end -;\3 = assume a is 0 if present -ResetEventRange: MACRO -event_start_byte = ((\1) / 8) -event_end_byte = ((\2) / 8) - - IF event_end_byte < event_start_byte - FAIL "Incorrect argument order in ResetEventRange." - ENDC - - IF event_start_byte == event_end_byte - ld a, [wEventFlags + event_start_byte] - and ~((1 << (((\2) % 8) + 1)) - (1 << ((\1) % 8))) & $ff - ld [wEventFlags + event_start_byte], a - ELSE -event_fill_start = event_start_byte + 1 -event_fill_count = event_end_byte - event_start_byte - 1 - - IF ((\1) % 8) == 0 -event_fill_start = -1 + event_fill_start -event_fill_count = 1 + event_fill_count - ELSE - ld a, [wEventFlags + event_start_byte] - and ~($ff - ((1 << ((\1) % 8)) - 1)) & $ff - ld [wEventFlags + event_start_byte], a - ENDC - - IF ((\2) % 8) == 7 -event_fill_count = 1 + event_fill_count - ENDC - - IF event_fill_count == 1 - ld hl, wEventFlags + event_fill_start - ld [hl], 0 - ENDC - - IF event_fill_count > 1 - ld hl, wEventFlags + event_fill_start - - ; force xor a if we just to wrote to it above - IF (_NARG < 3) || (((\1) % 8) != 0) - xor a - ENDC - - REPT -1 + event_fill_count - ld [hli], a - ENDR - - ld [hl], a - ENDC - - IF ((\2) % 8) == 0 - ld hl, wEventFlags + event_end_byte - res 0, [hl] - ELSE - IF ((\2) % 8) != 7 - ld a, [wEventFlags + event_end_byte] - and ~((1 << (((\2) % 8) + 1)) - 1) & $ff - ld [wEventFlags + event_end_byte], a - ENDC - ENDC - ENDC - ENDM - -; returns whether both events are set in Z flag -;\1 = event index 1 -;\2 = event index 2 -CheckBothEventsSet: MACRO - IF ((\1) / 8) == ((\2) / 8) - ld a, [wEventFlags + ((\1) / 8)] - and (1 << ((\1) % 8)) | (1 << ((\2) % 8)) - cp (1 << ((\1) % 8)) | (1 << ((\2) % 8)) - ELSE - ; This case doesn't happen in the original ROM. - IF ((\1) % 8) == ((\2) % 8) - push hl - ld a, [wEventFlags + ((\1) / 8)] - ld hl, wEventFlags + ((\2) / 8) - and [hl] - cpl - bit ((\1) % 8), a - pop hl - ELSE - push bc - ld a, [wEventFlags + ((\1) / 8)] - and (1 << ((\1) % 8)) - ld b, a - ld a, [wEventFlags + ((\2) / 8)] - and (1 << ((\2) % 8)) - or b - cp (1 << ((\1) % 8)) | (1 << ((\2) % 8)) - pop bc - ENDC - ENDC - ENDM - -; returns the complement of whether either event is set in Z flag -;\1 = event index 1 -;\2 = event index 2 -CheckEitherEventSet: MACRO - IF ((\1) / 8) == ((\2) / 8) - ld a, [wEventFlags + ((\1) / 8)] - and (1 << ((\1) % 8)) | (1 << ((\2) % 8)) - ELSE - ; This case doesn't happen in the original ROM. - IF ((\1) % 8) == ((\2) % 8) - push hl - ld a, [wEventFlags + ((\1) / 8)] - ld hl, wEventFlags + ((\2) / 8) - or [hl] - bit ((\1) % 8), a - pop hl - ELSE - push bc - ld a, [wEventFlags + ((\1) / 8)] - and (1 << ((\1) % 8)) - ld b, a - ld a, [wEventFlags + ((\2) / 8)] - and (1 << ((\2) % 8)) - or b - pop bc - ENDC - ENDC - ENDM - -; for handling fixed event bits when events are inserted/removed -;\1 = event index -;\2 = fixed flag bit -AdjustEventBit: MACRO - IF ((\1) % 8) != (\2) - add ((\1) % 8) - (\2) - ENDC - ENDM - ;\1 = r ;\2 = X ;\3 = Y -- cgit v1.2.3 From 73171bfff573fa8900563319c014f3e626db6b3e Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 21 Jul 2015 10:36:03 -0700 Subject: named most of the used events --- constants/event_constants.asm | 268 +++++++++++++++++------------------ constants/event_macros.asm | 24 +++- constants/hide_show_constants.asm | 2 +- engine/hidden_object_functions18.asm | 2 +- engine/hidden_object_functions7.asm | 8 +- engine/items/items.asm | 2 +- engine/menu/bills_pc.asm | 2 +- engine/menu/pc.asm | 2 +- engine/overworld/cinnabar_lab.asm | 2 +- main.asm | 2 +- scripts/agatha.asm | 2 +- scripts/bikeshop.asm | 6 +- scripts/billshouse.asm | 12 +- scripts/blueshouse.asm | 6 +- scripts/bruno.asm | 2 +- scripts/celadoncity.asm | 4 +- scripts/celadondiner.asm | 4 +- scripts/celadongamecorner.asm | 16 +-- scripts/celadonmart3.asm | 4 +- scripts/celadonmartroof.asm | 12 +- scripts/ceruleancity.asm | 12 +- scripts/cinnabarisland.asm | 4 +- scripts/copycatshouse2f.asm | 4 +- scripts/fanclub.asm | 12 +- scripts/fightingdojo.asm | 18 +-- scripts/fuchsiacity.asm | 4 +- scripts/fuchsiahouse2.asm | 8 +- scripts/gary.asm | 4 +- scripts/halloffameroom.asm | 2 +- scripts/indigoplateaulobby.asm | 4 +- scripts/lab3.asm | 4 +- scripts/lab4.asm | 8 +- scripts/lance.asm | 8 +- scripts/lavenderhouse1.asm | 8 +- scripts/lavenderhouse2.asm | 2 +- scripts/lavendermart.asm | 2 +- scripts/lorelei.asm | 2 +- scripts/mansion1.asm | 6 +- scripts/mansion2.asm | 6 +- scripts/mansion3.asm | 2 +- scripts/mansion4.asm | 2 +- scripts/mtmoon3.asm | 16 +-- scripts/museum1f.asm | 10 +- scripts/oakslab.asm | 34 ++--- scripts/pallettown.asm | 15 +- scripts/pewtercity.asm | 2 +- scripts/pewtergym.asm | 2 +- scripts/pokemontower2.asm | 13 +- scripts/pokemontower5.asm | 4 +- scripts/pokemontower6.asm | 4 +- scripts/pokemontower7.asm | 4 +- scripts/rockethideout4.asm | 13 +- scripts/route1.asm | 2 +- scripts/route11gateupstairs.asm | 4 +- scripts/route12gateupstairs.asm | 4 +- scripts/route15gateupstairs.asm | 4 +- scripts/route16house.asm | 4 +- scripts/route20.asm | 6 +- scripts/route22.asm | 18 +-- scripts/route23.asm | 24 ++-- scripts/route24.asm | 14 +- scripts/route25.asm | 10 +- scripts/route2gate.asm | 4 +- scripts/safarizonesecrethouse.asm | 4 +- scripts/saffronhouse2.asm | 4 +- scripts/seafoamislands1.asm | 8 +- scripts/seafoamislands2.asm | 6 +- scripts/seafoamislands3.asm | 6 +- scripts/seafoamislands4.asm | 10 +- scripts/seafoamislands5.asm | 4 +- scripts/silphco1.asm | 6 +- scripts/silphco10.asm | 6 +- scripts/silphco11.asm | 12 +- scripts/silphco2.asm | 14 +- scripts/silphco3.asm | 12 +- scripts/silphco4.asm | 10 +- scripts/silphco5.asm | 14 +- scripts/silphco6.asm | 6 +- scripts/silphco7.asm | 26 ++-- scripts/silphco8.asm | 6 +- scripts/silphco9.asm | 20 +-- scripts/ssanne7.asm | 8 +- scripts/vermilioncity.asm | 4 +- scripts/vermiliondock.asm | 12 +- scripts/victoryroad1.asm | 6 +- scripts/victoryroad2.asm | 14 +- scripts/victoryroad3.asm | 6 +- scripts/viridiancity.asm | 8 +- scripts/viridiangym.asm | 2 +- scripts/viridianmart.asm | 4 +- 90 files changed, 485 insertions(+), 468 deletions(-) diff --git a/constants/event_constants.asm b/constants/event_constants.asm index 072a90b8..c5ca0b39 100755 --- a/constants/event_constants.asm +++ b/constants/event_constants.asm @@ -1,12 +1,12 @@ const_value = 0 - const EVENT_STOPPED_FROM_LEAVING_PALLET + const EVENT_FOLLOWED_OAK_INTO_LAB const EVENT_001 const EVENT_002 const EVENT_003 const EVENT_004 const EVENT_005 - const EVENT_006 + const EVENT_PALLET_AFTER_GETTING_POKEBALLS const EVENT_007 const EVENT_008 const EVENT_009 @@ -24,24 +24,24 @@ const_value = 0 const EVENT_015 const EVENT_016 const EVENT_017 - const EVENT_018 - const EVENT_019 - const EVENT_01A + const EVENT_GOT_TOWN_MAP + const EVENT_ENTERED_BLUES_HOUSE + const EVENT_DAISY_WALKING const EVENT_01B const EVENT_01C const EVENT_01D const EVENT_01E const EVENT_01F - const EVENT_FOLLOWED_OAK_INSIDE_LAB + const EVENT_FOLLOWED_OAK_INTO_LAB_2 const EVENT_OAK_ASKED_TO_CHOOSE_MON const EVENT_GOT_STARTER const EVENT_BATTLED_RIVAL_IN_OAKS_LAB const EVENT_GOT_POKEBALLS_FROM_OAK const EVENT_GOT_POKEDEX - const EVENT_026 - const EVENT_027 - const EVENT_028 - const EVENT_029 + const EVENT_PALLET_AFTER_GETTING_POKEBALLS_2 + const EVENT_OAK_APPEARED_IN_PALLET + const EVENT_VIRIDIAN_GYM_OPEN + const EVENT_GOT_TM42 const EVENT_02A const EVENT_02B const EVENT_02C @@ -56,8 +56,8 @@ const_value = 0 const EVENT_035 const EVENT_036 const EVENT_037 - const EVENT_038 - const EVENT_039 + const EVENT_OAK_GOT_PARCEL + const EVENT_GOT_OAKS_PARCEL const EVENT_03A const EVENT_03B const EVENT_03C @@ -104,8 +104,8 @@ const_value = 0 const EVENT_065 const EVENT_066 const EVENT_067 - const EVENT_068 - const EVENT_069 + const EVENT_BOUGHT_MUSEUM_TICKET + const EVENT_GOT_OLD_AMBER const EVENT_06A const EVENT_06B const EVENT_06C @@ -152,7 +152,7 @@ const_value = 0 const EVENT_095 const EVENT_096 const EVENT_097 - const EVENT_098 + const EVENT_BEAT_CERULEAN_RIVAL const EVENT_099 const EVENT_09A const EVENT_09B @@ -167,7 +167,7 @@ const_value = 0 const EVENT_0A4 const EVENT_0A5 const EVENT_0A6 - const EVENT_0A7 + const EVENT_BEAT_CERULEAN_ROCKET_THIEF const EVENT_0A8 const EVENT_0A9 const EVENT_0AA @@ -192,7 +192,7 @@ const_value = 0 const EVENT_0BD const EVENT_GOT_TM11 const EVENT_BEAT_MISTY - const EVENT_0C0 + const EVENT_GOT_BICYCLE const EVENT_0C1 const EVENT_0C2 const EVENT_0C3 @@ -238,8 +238,8 @@ const_value = 0 const EVENT_0EB const EVENT_0EC const EVENT_0ED - const EVENT_0EE - const EVENT_0EF + const EVENT_POKEMON_TOWER_RIVAL_ON_LEFT + const EVENT_BEAT_POKEMON_TOWER_RIVAL const EVENT_0F0 const EVENT_BEAT_POKEMONTOWER_3_TRAINER_0 const EVENT_BEAT_POKEMONTOWER_3_TRAINER_1 @@ -263,7 +263,7 @@ const_value = 0 const EVENT_BEAT_POKEMONTOWER_5_TRAINER_2 const EVENT_BEAT_POKEMONTOWER_5_TRAINER_3 const EVENT_106 - const EVENT_107 + const EVENT_IN_PURIFIED_ZONE const EVENT_108 const EVENT_BEAT_POKEMONTOWER_6_TRAINER_0 const EVENT_BEAT_POKEMONTOWER_6_TRAINER_1 @@ -271,7 +271,7 @@ const_value = 0 const EVENT_10C const EVENT_10D const EVENT_10E - const EVENT_10F + const EVENT_BEAT_GHOST_MAROWAK const EVENT_110 const EVENT_BEAT_POKEMONTOWER_7_TRAINER_0 const EVENT_BEAT_POKEMONTOWER_7_TRAINER_1 @@ -279,7 +279,7 @@ const_value = 0 const EVENT_114 const EVENT_115 const EVENT_116 - const EVENT_117 + const EVENT_RESCUED_MR_FUJI_2 const EVENT_118 const EVENT_119 const EVENT_11A @@ -296,7 +296,7 @@ const_value = 0 const EVENT_125 const EVENT_126 const EVENT_127 - const EVENT_128 + const EVENT_GOT_POKE_FLUTE const EVENT_129 const EVENT_12A const EVENT_12B @@ -342,8 +342,8 @@ const_value = 0 const EVENT_153 const EVENT_154 const EVENT_155 - const EVENT_156 - const EVENT_157 + const EVENT_SEEL_FAN_BOAST + const EVENT_PIKACHU_FAN_BOAST const EVENT_158 const EVENT_159 const EVENT_15A @@ -384,7 +384,7 @@ const_value = 0 const EVENT_17D const EVENT_17E const EVENT_17F - const EVENT_180 + const EVENT_GOT_TM41 const EVENT_181 const EVENT_182 const EVENT_183 @@ -396,10 +396,10 @@ const_value = 0 const EVENT_189 const EVENT_18A const EVENT_18B - const EVENT_18C - const EVENT_18D - const EVENT_18E - const EVENT_18F + const EVENT_GOT_TM13 + const EVENT_GOT_TM48 + const EVENT_GOT_TM49 + const EVENT_GOT_TM18 const EVENT_190 const EVENT_191 const EVENT_192 @@ -441,10 +441,10 @@ const_value = 0 const EVENT_1B6 const EVENT_1B7 const EVENT_1B8 - const EVENT_1B9 - const EVENT_1BA - const EVENT_1BB - const EVENT_1BC + const EVENT_FOUND_ROCKET_HIDEOUT + const EVENT_GOT_10_COINS + const EVENT_GOT_20_COINS + const EVENT_GOT_20_COINS_2 const EVENT_1BD const EVENT_1BE const EVENT_1BF @@ -480,7 +480,7 @@ const_value = 0 const EVENT_1DD const EVENT_1DE const EVENT_1DF - const EVENT_1E0 + const EVENT_GOT_COIN_CASE const EVENT_1E1 const EVENT_1E2 const EVENT_1E3 @@ -568,8 +568,8 @@ const_value = 0 const EVENT_235 const EVENT_236 const EVENT_237 - const EVENT_238 - const EVENT_239 + const EVENT_GOT_HM04 + const EVENT_GAVE_GOLD_TEETH const EVENT_23A const EVENT_23B const EVENT_23C @@ -632,7 +632,7 @@ const_value = 0 const EVENT_275 const EVENT_276 const EVENT_277 - const EVENT_278 + const EVENT_MANSION_SWITCH_ON const EVENT_279 const EVENT_27A const EVENT_27B @@ -727,7 +727,7 @@ const_value = 0 const EVENT_2D4 const EVENT_2D5 const EVENT_2D6 - const EVENT_2D7 + const EVENT_GOT_TM35 const EVENT_2D8 const EVENT_2D9 const EVENT_2DA @@ -736,9 +736,9 @@ const_value = 0 const EVENT_2DD const EVENT_2DE const EVENT_2DF - const EVENT_2E0 - const EVENT_2E1 - const EVENT_2E2 + const EVENT_GAVE_FOSSIL_TO_LAB + const EVENT_LAB_STILL_REVIVING_FOSSIL + const EVENT_LAB_HANDING_OVER_FOSSIL_MON const EVENT_2E3 const EVENT_2E4 const EVENT_2E5 @@ -832,7 +832,7 @@ const_value = 0 const EVENT_33D const EVENT_33E const EVENT_33F - const EVENT_340 + const EVENT_GOT_TM31 const EVENT_341 const EVENT_342 const EVENT_343 @@ -848,14 +848,14 @@ const_value = 0 const EVENT_34D const EVENT_34E const EVENT_34F - const EVENT_350 - const EVENT_351 + const EVENT_DEFEATED_FIGHTING_DOJO + const EVENT_BEAT_KARATE_MASTER const EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 const EVENT_BEAT_FIGHTING_DOJO_TRAINER_1 const EVENT_BEAT_FIGHTING_DOJO_TRAINER_2 const EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 - const EVENT_356 - const EVENT_357 + const EVENT_GOT_HITMONLEE + const EVENT_GOT_HITMONCHAN const EVENT_358 const EVENT_359 const EVENT_35A @@ -919,7 +919,7 @@ const_value = 0 const EVENT_394 const EVENT_395 const EVENT_396 - const EVENT_397 + const EVENT_SILPH_CO_RECEPTIONIST_AT_DESK const EVENT_398 const EVENT_399 const EVENT_39A @@ -944,7 +944,7 @@ const_value = 0 const EVENT_3AD const EVENT_3AE const EVENT_3AF - const EVENT_3B0 + const EVENT_GOT_TM29 const EVENT_3B1 const EVENT_3B2 const EVENT_3B3 @@ -960,7 +960,7 @@ const_value = 0 const EVENT_3BD const EVENT_3BE const EVENT_3BF - const EVENT_3C0 + const EVENT_GOT_POTION_SAMPLE const EVENT_3C1 const EVENT_3C2 const EVENT_3C3 @@ -984,7 +984,7 @@ const_value = 0 const EVENT_3D5 const EVENT_3D6 const EVENT_3D7 - const EVENT_3D8 + const EVENT_GOT_HM05 const EVENT_3D9 const EVENT_3DA const EVENT_3DB @@ -1151,8 +1151,8 @@ const_value = 0 const EVENT_47C const EVENT_47D const EVENT_47E - const EVENT_47F - const EVENT_480 + const EVENT_GOT_ITEMFINDER + const EVENT_GOT_TM39 const EVENT_481 const EVENT_BEAT_ROUTE_12_TRAINER_0 const EVENT_BEAT_ROUTE_12_TRAINER_1 @@ -1200,7 +1200,7 @@ const_value = 0 const EVENT_4AD const EVENT_4AE const EVENT_4AF - const EVENT_4B0 + const EVENT_GOT_EXP_ALL const EVENT_BEAT_ROUTE_15_TRAINER_0 const EVENT_BEAT_ROUTE_15_TRAINER_1 const EVENT_BEAT_ROUTE_15_TRAINER_2 @@ -1230,8 +1230,8 @@ const_value = 0 const EVENT_4CB const EVENT_4CC const EVENT_4CD - const EVENT_4CE - const EVENT_4CF + const EVENT_GOT_HM02 + const EVENT_RESCUED_MR_FUJI const EVENT_4D0 const EVENT_BEAT_ROUTE_17_TRAINER_0 const EVENT_BEAT_ROUTE_17_TRAINER_1 @@ -1280,7 +1280,7 @@ const_value = 0 const EVENT_4FD const EVENT_4FE const EVENT_4FF - const EVENT_500 + const EVENT_IN_SEAFOAM_ISLANDS const EVENT_BEAT_ROUTE_20_TRAINER_0 const EVENT_BEAT_ROUTE_20_TRAINER_2 const EVENT_BEAT_ROUTE_20_TRAINER_3 @@ -1294,8 +1294,8 @@ const_value = 0 const EVENT_50B const EVENT_50C const EVENT_50D - const EVENT_50E - const EVENT_50F + const EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE + const EVENT_SEAFOAM1_BOULDER2_DOWN_HOLE const EVENT_510 const EVENT_BEAT_ROUTE_21_TRAINER_0 const EVENT_BEAT_ROUTE_21_TRAINER_1 @@ -1312,14 +1312,14 @@ const_value = 0 const EVENT_51D const EVENT_51E const EVENT_51F - const EVENT_520 - const EVENT_521 + const EVENT_1ST_ROUTE22_RIVAL_BATTLE + const EVENT_2ND_ROUTE22_RIVAL_BATTLE const EVENT_522 const EVENT_523 const EVENT_524 - const EVENT_525 - const EVENT_526 - const EVENT_527 + const EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT + const EVENT_BEAT_ROUTE22_RIVAL_2ND_FIGHT + const EVENT_ROUTE22_RIVAL_WANTS_FIGHT const EVENT_528 const EVENT_529 const EVENT_52A @@ -1328,24 +1328,24 @@ const_value = 0 const EVENT_52D const EVENT_52E const EVENT_52F - const EVENT_530 - const EVENT_531 - const EVENT_532 - const EVENT_533 - const EVENT_534 - const EVENT_535 - const EVENT_536 + const EVENT_PASSED_CASCADEBADGE_CHECK + const EVENT_PASSED_THUNDERBADGE_CHECK + const EVENT_PASSED_RAINBOWBADGE_CHECK + const EVENT_PASSED_SOULBADGE_CHECK + const EVENT_PASSED_MARSHBADGE_CHECK + const EVENT_PASSED_VOLCANOBADGE_CHECK + const EVENT_PASSED_EARTHBADGE_CHECK const EVENT_537 - const EVENT_538 + const EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0 const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2 const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3 const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4 const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_5 const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_6 - const EVENT_53F - const EVENT_540 - const EVENT_541 + const EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2 + const EVENT_GOT_NUGGET + const EVENT_BEAT_ROUTE24_ROCKET const EVENT_BEAT_ROUTE_24_TRAINER_0 const EVENT_BEAT_ROUTE_24_TRAINER_2 const EVENT_BEAT_ROUTE_24_TRAINER_3 @@ -1353,14 +1353,14 @@ const_value = 0 const EVENT_BEAT_ROUTE_24_TRAINER_5 const EVENT_BEAT_ROUTE_24_TRAINER_6 const EVENT_548 - const EVENT_549 + const EVENT_NUGGET_REWARD_AVAILABLE const EVENT_54A const EVENT_54B const EVENT_54C const EVENT_54D const EVENT_54E const EVENT_54F - const EVENT_550 + const EVENT_MET_BILL const EVENT_BEAT_ROUTE_25_TRAINER_0 const EVENT_BEAT_ROUTE_25_TRAINER_2 const EVENT_BEAT_ROUTE_25_TRAINER_3 @@ -1371,11 +1371,11 @@ const_value = 0 const EVENT_BEAT_ROUTE_25_TRAINER_8 const EVENT_BEAT_ROUTE_25_TRAINER_9 const EVENT_55A - const EVENT_55B - const EVENT_55C - const EVENT_55D - const EVENT_55E - const EVENT_55F + const EVENT_USED_CELL_SEPARATOR_ON_BILL + const EVENT_GOT_SS_TICKET + const EVENT_MET_BILL_2 + const EVENT_BILL_SAID_USE_CELL_SEPARATOR + const EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING const EVENT_560 const EVENT_561 const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 @@ -1401,13 +1401,13 @@ const_value = 0 const EVENT_BEAT_MT_MOON_1_TRAINER_6 const EVENT_BEAT_MT_MOON_1_TRAINER_7 const EVENT_578 - const EVENT_579 + const EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD const EVENT_BEAT_MT_MOON_3_TRAINER_0 const EVENT_BEAT_MT_MOON_3_TRAINER_2 const EVENT_BEAT_MT_MOON_3_TRAINER_3 const EVENT_BEAT_MT_MOON_3_TRAINER_4 - const EVENT_57E - const EVENT_57F + const EVENT_GOT_DOME_FOSSIL + const EVENT_GOT_HELIX_FOSSIL const EVENT_580 const EVENT_581 const EVENT_582 @@ -1504,12 +1504,12 @@ const_value = 0 const EVENT_5DD const EVENT_5DE const EVENT_5DF - const EVENT_5E0 - const EVENT_5E1 + const EVENT_GOT_HM01 + const EVENT_RUBBED_CAPTAINS_BACK const EVENT_SS_ANNE_LEFT - const EVENT_5E3 - const EVENT_5E4 - const EVENT_5E5 + const EVENT_WALKED_PAST_GUARD_AFTER_SS_ANNE_LEFT + const EVENT_STARTED_WALKING_OUT_OF_DOCK + const EVENT_WALKED_OUT_OF_DOCK const EVENT_5E6 const EVENT_5E7 const EVENT_5E8 @@ -1632,13 +1632,13 @@ const_value = 0 const EVENT_65D const EVENT_65E const EVENT_65F - const EVENT_660 + const EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1 const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0 const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2 const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3 const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_4 const EVENT_665 - const EVENT_666 + const EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH2 const EVENT_667 const EVENT_668 const EVENT_669 @@ -1701,9 +1701,9 @@ const_value = 0 const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0 const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2 const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_3 - const EVENT_6A5 - const EVENT_6A6 - const EVENT_6A7 + const EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED + const EVENT_ROCKET_DROPPED_LIFT_KEY + const EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI const EVENT_6A8 const EVENT_6A9 const EVENT_6AA @@ -1789,9 +1789,9 @@ const_value = 0 const EVENT_6FA const EVENT_6FB const EVENT_6FC - const EVENT_6FD - const EVENT_6FE - const EVENT_6FF + const EVENT_SILPH_CO_2_UNLOCKED_DOOR1 + const EVENT_SILPH_CO_2_UNLOCKED_DOOR2 + const EVENT_GOT_TM36 const EVENT_700 const EVENT_701 const EVENT_BEAT_SILPH_CO_3F_TRAINER_0 @@ -1800,8 +1800,8 @@ const_value = 0 const EVENT_705 const EVENT_706 const EVENT_707 - const EVENT_708 - const EVENT_709 + const EVENT_SILPH_CO_3_UNLOCKED_DOOR1 + const EVENT_SILPH_CO_3_UNLOCKED_DOOR2 const EVENT_70A const EVENT_70B const EVENT_70C @@ -1816,8 +1816,8 @@ const_value = 0 const EVENT_715 const EVENT_716 const EVENT_717 - const EVENT_718 - const EVENT_719 + const EVENT_SILPH_CO_4_UNLOCKED_DOOR1 + const EVENT_SILPH_CO_4_UNLOCKED_DOOR2 const EVENT_71A const EVENT_71B const EVENT_71C @@ -1832,9 +1832,9 @@ const_value = 0 const EVENT_BEAT_SILPH_CO_5F_TRAINER_4 const EVENT_726 const EVENT_727 - const EVENT_728 - const EVENT_729 - const EVENT_72A + const EVENT_SILPH_CO_5_UNLOCKED_DOOR1 + const EVENT_SILPH_CO_5_UNLOCKED_DOOR2 + const EVENT_SILPH_CO_5_UNLOCKED_DOOR3 const EVENT_72B const EVENT_72C const EVENT_72D @@ -1855,8 +1855,8 @@ const_value = 0 const EVENT_73C const EVENT_73D const EVENT_73E - const EVENT_73F - const EVENT_740 + const EVENT_SILPH_CO_6_UNLOCKED_DOOR + const EVENT_BEAT_SILPH_CO_RIVAL const EVENT_741 const EVENT_742 const EVENT_743 @@ -1868,9 +1868,9 @@ const_value = 0 const EVENT_749 const EVENT_74A const EVENT_74B - const EVENT_74C - const EVENT_74D - const EVENT_74E + const EVENT_SILPH_CO_7_UNLOCKED_DOOR1 + const EVENT_SILPH_CO_7_UNLOCKED_DOOR2 + const EVENT_SILPH_CO_7_UNLOCKED_DOOR3 const EVENT_74F const EVENT_750 const EVENT_751 @@ -1880,7 +1880,7 @@ const_value = 0 const EVENT_755 const EVENT_756 const EVENT_757 - const EVENT_758 + const EVENT_SILPH_CO_8_UNLOCKED_DOOR const EVENT_759 const EVENT_75A const EVENT_75B @@ -1896,10 +1896,10 @@ const_value = 0 const EVENT_765 const EVENT_766 const EVENT_767 - const EVENT_768 - const EVENT_769 - const EVENT_76A - const EVENT_76B + const EVENT_SILPH_CO_9_UNLOCKED_DOOR1 + const EVENT_SILPH_CO_9_UNLOCKED_DOOR2 + const EVENT_SILPH_CO_9_UNLOCKED_DOOR3 + const EVENT_SILPH_CO_9_UNLOCKED_DOOR4 const EVENT_76C const EVENT_76D const EVENT_76E @@ -1912,7 +1912,7 @@ const_value = 0 const EVENT_775 const EVENT_776 const EVENT_777 - const EVENT_778 + const EVENT_SILPH_CO_10_UNLOCKED_DOOR const EVENT_779 const EVENT_77A const EVENT_77B @@ -1928,14 +1928,14 @@ const_value = 0 const EVENT_BEAT_SILPH_CO_11F_TRAINER_1 const EVENT_786 const EVENT_787 - const EVENT_788 + const EVENT_SILPH_CO_11_UNLOCKED_DOOR const EVENT_789 const EVENT_78A const EVENT_78B const EVENT_78C - const EVENT_78D + const EVENT_GOT_MASTER_BALL const EVENT_78E - const EVENT_78F + const EVENT_BEAT_SILPH_CO_GIOVANNI const EVENT_790 const EVENT_791 const EVENT_792 @@ -2176,7 +2176,7 @@ const_value = 0 const EVENT_87D const EVENT_87E const EVENT_87F - const EVENT_880 + const EVENT_GOT_HM03 const EVENT_881 const EVENT_882 const EVENT_883 @@ -2272,13 +2272,13 @@ const_value = 0 const EVENT_8DD const EVENT_8DE const EVENT_8DF - const EVENT_8E0 + const EVENT_ELITE4_EVENTS_START const EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 const EVENT_8E2 const EVENT_8E3 const EVENT_8E4 const EVENT_8E5 - const EVENT_8E6 + const EVENT_AUTOWALKED_INTO_LORELEIS_ROOM const EVENT_8E7 const EVENT_8E8 const EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 @@ -2286,7 +2286,7 @@ const_value = 0 const EVENT_8EB const EVENT_8EC const EVENT_8ED - const EVENT_8EE + const EVENT_AUTOWALKED_INTO_BRUNOS_ROOM const EVENT_8EF const EVENT_8F0 const EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 @@ -2294,7 +2294,7 @@ const_value = 0 const EVENT_8F3 const EVENT_8F4 const EVENT_8F5 - const EVENT_8F6 + const EVENT_AUTOWALKED_INTO_AGATHAS_ROOM const EVENT_8F7 const EVENT_8F8 const EVENT_BEAT_LANCES_ROOM_TRAINER_0 @@ -2302,10 +2302,10 @@ const_value = 0 const EVENT_8FB const EVENT_8FC const EVENT_8FD - const EVENT_8FE - const EVENT_8FF + const EVENT_BEAT_LANCE + const EVENT_LANCES_ROOM_LOCK_DOOR const EVENT_900 - const EVENT_901 + const EVENT_BEAT_CHAMPION_RIVAL const EVENT_902 const EVENT_903 const EVENT_904 @@ -2327,7 +2327,7 @@ const_value = 0 const EVENT_914 const EVENT_915 const EVENT_916 - const EVENT_917 + const EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH const EVENT_918 const EVENT_919 const EVENT_91A @@ -2496,24 +2496,24 @@ const_value = 0 const EVENT_9BD const EVENT_9BE const EVENT_9BF - const EVENT_9C0 - const EVENT_9C1 + const EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE + const EVENT_SEAFOAM2_BOULDER2_DOWN_HOLE const EVENT_9C2 const EVENT_9C3 const EVENT_9C4 const EVENT_9C5 const EVENT_9C6 const EVENT_9C7 - const EVENT_9C8 - const EVENT_9C9 + const EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE + const EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE const EVENT_9CA const EVENT_9CB const EVENT_9CC const EVENT_9CD const EVENT_9CE const EVENT_9CF - const EVENT_9D0 - const EVENT_9D1 + const EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE + const EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE const EVENT_9D2 const EVENT_9D3 const EVENT_9D4 diff --git a/constants/event_macros.asm b/constants/event_macros.asm index 8daaea28..cc7c03f5 100755 --- a/constants/event_macros.asm +++ b/constants/event_macros.asm @@ -19,7 +19,19 @@ event_byte = ((\1) / 8) ;\1 = event index CheckEventReuseA: MACRO -IF event_byte != ((\1) / 8) + IF event_byte != ((\1) / 8) +event_byte = ((\1) / 8) + ld a, [wEventFlags + event_byte] + ENDC + + bit (\1) % 8, a + ENDM + +;\1 = event index +;\2 = event index of the last event used before the branch +CheckEventAfterBranchReuseA: MACRO +event_byte = ((\2) / 8) + IF event_byte != ((\1) / 8) event_byte = ((\1) / 8) ld a, [wEventFlags + event_byte] ENDC @@ -355,11 +367,17 @@ event_fill_count = event_fill_count + 1 ENDM ; returns whether both events are set in Z flag +; This is counter-intuitive because the other event checks set the Z flag when +; the event is not set, but this sets the Z flag when the event is set. ;\1 = event index 1 ;\2 = event index 2 +;\3 = try to reuse a (optional) CheckBothEventsSet: MACRO IF ((\1) / 8) == ((\2) / 8) - ld a, [wEventFlags + ((\1) / 8)] + IF (_NARG < 3) || (((\1) / 8) != event_byte) +event_byte = ((\1) / 8) + ld a, [wEventFlags + ((\1) / 8)] + ENDC and (1 << ((\1) % 8)) | (1 << ((\2) % 8)) cp (1 << ((\1) % 8)) | (1 << ((\2) % 8)) ELSE @@ -422,4 +440,4 @@ AdjustEventBit: MACRO IF ((\1) % 8) != (\2) add ((\1) % 8) - (\2) ENDC - ENDM \ No newline at end of file + ENDM diff --git a/constants/hide_show_constants.asm b/constants/hide_show_constants.asm index 1c5beb77..2afe9914 100755 --- a/constants/hide_show_constants.asm +++ b/constants/hide_show_constants.asm @@ -82,7 +82,7 @@ const_value = 0 const HS_MANSION_1_ITEM_2 ; 49 X const HS_FIGHTING_DOJO_GIFT_1 ; 4A const HS_FIGHTING_DOJO_GIFT_2 ; 4B - const HS_SILPH_CO_1F_1 ; 4C + const HS_SILPH_CO_1F_RECEPTIONIST ; 4C const HS_VOLTORB_1 ; 4D X const HS_VOLTORB_2 ; 4E X const HS_VOLTORB_3 ; 4F X diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index cf18799d..00744c5d 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -152,7 +152,7 @@ CinnabarIslandPokecenterBenchGuyText: ; 624df (18:64df) SaffronCityPokecenterBenchGuyText: ; 624e4 (18:64e4) TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SaffronCityPokecenterBenchGuyText2 jr nz, .asm_624f2 ld hl, SaffronCityPokecenterBenchGuyText1 diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index d4a0ce88..90de784f 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -322,11 +322,11 @@ BillsHousePC: ; 1eb6e (7:6b6e) ld a, [wSpriteStateData1 + 9] cp SPRITE_FACING_UP ret nz - CheckEvent EVENT_55F + CheckEvent EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING jr nz, .asm_1ebd2 - CheckEventReuseA EVENT_55B + CheckEventReuseA EVENT_USED_CELL_SEPARATOR_ON_BILL jr nz, .asm_1eb86 - CheckEventReuseA EVENT_55E + CheckEventReuseA EVENT_BILL_SAID_USE_CELL_SEPARATOR jr nz, .asm_1eb8b .asm_1eb86 tx_pre_jump BillsHouseMonitorText @@ -355,7 +355,7 @@ BillsHousePC: ; 1eb6e (7:6b6e) call PlaySound call WaitForSoundToFinish call PlayDefaultMusic - SetEvent EVENT_55B + SetEvent EVENT_USED_CELL_SEPARATOR_ON_BILL ret .asm_1ebd2 ld a, $1 diff --git a/engine/items/items.asm b/engine/items/items.asm index a7c731c2..eb9f5663 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -432,7 +432,7 @@ ItemUseBall: ; d687 (3:5687) call ClearSprites call SendNewMonToBox ld hl,ItemUseBallText07 - CheckEvent EVENT_550 + CheckEvent EVENT_MET_BILL jr nz,.sendToBox2 ld hl,ItemUseBallText08 .sendToBox2 diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm index f9df345f..a810afd2 100644 --- a/engine/menu/bills_pc.asm +++ b/engine/menu/bills_pc.asm @@ -28,7 +28,7 @@ DisplayPCMainMenu:: ; 213c8 (8:53c8) call UpdateSprites ld a, 3 ld [wMaxMenuItem], a - CheckEvent EVENT_550 + CheckEvent EVENT_MET_BILL jr nz, .metBill coord hl, 2, 2 ld de, SomeonesPCText diff --git a/engine/menu/pc.asm b/engine/menu/pc.asm index 43bd8452..a804abb2 100755 --- a/engine/menu/pc.asm +++ b/engine/menu/pc.asm @@ -74,7 +74,7 @@ BillsPC: ; 17ee4 (5:7ee4) ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish - CheckEvent EVENT_550 + CheckEvent EVENT_MET_BILL jr nz, .billsPC ;if you've met bill, use that bill's instead of someone's ld hl, AccessedSomeonesPCText jr .printText diff --git a/engine/overworld/cinnabar_lab.asm b/engine/overworld/cinnabar_lab.asm index 5cc5536c..1b96b4c6 100755 --- a/engine/overworld/cinnabar_lab.asm +++ b/engine/overworld/cinnabar_lab.asm @@ -65,7 +65,7 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006) callba RemoveItemByID ld hl, LabFossil_610b8 call PrintText - SetEvents EVENT_2E0, EVENT_2E1 + SetEvents EVENT_GAVE_FOSSIL_TO_LAB, EVENT_LAB_STILL_REVIVING_FOSSIL ret .asm_610a7 ld hl, LabFossil_610bd diff --git a/main.asm b/main.asm index ea13bd64..ed1dfe25 100755 --- a/main.asm +++ b/main.asm @@ -2760,7 +2760,7 @@ CheckForForcedBikeSurf: ; cdc0 (3:4dc0) ld a, [W_CURMAP] cp SEAFOAM_ISLANDS_5 ret nz - CheckBothEventsSet EVENT_9D0, EVENT_9D1 + CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE ret z ld hl, CoordsData_cdf7 call ArePlayerCoordsInArray diff --git a/scripts/agatha.asm b/scripts/agatha.asm index c9df27d2..f0607785 100755 --- a/scripts/agatha.asm +++ b/scripts/agatha.asm @@ -69,7 +69,7 @@ AgathaScript0: ; 76490 (1d:6490) ld a, [wCoordIndex] cp $3 jr c, .asm_764b4 - CheckAndSetEvent EVENT_8F6 + CheckAndSetEvent EVENT_AUTOWALKED_INTO_AGATHAS_ROOM jr z, AgathaScript_76474 .asm_764b4 ld a, $2 diff --git a/scripts/bikeshop.asm b/scripts/bikeshop.asm index bdae3536..f0bdf615 100755 --- a/scripts/bikeshop.asm +++ b/scripts/bikeshop.asm @@ -8,7 +8,7 @@ BikeShopTextPointers: ; 1d73f (7:573f) BikeShopText1: ; 1d745 (7:5745) TX_ASM - CheckEvent EVENT_0C0 + CheckEvent EVENT_GOT_BICYCLE jr z, .asm_260d4 ld hl, BikeShopText_1d82f call PrintText @@ -25,7 +25,7 @@ BikeShopText1: ; 1d745 (7:5745) ld a, BIKE_VOUCHER ld [$ffdb], a callba RemoveItemByID - SetEvent EVENT_0C0 + SetEvent EVENT_GOT_BICYCLE ld hl, BikeShopText_1d824 call PrintText jr .Done @@ -129,7 +129,7 @@ BikeShopText_1d843: ; 1d843 (7:5843) BikeShopText3: ; 1d848 (7:5848) TX_ASM - CheckEvent EVENT_0C0 + CheckEvent EVENT_GOT_BICYCLE ld hl, BikeShopText_1d861 jr nz, .asm_34d2d ld hl, BikeShopText_1d85c diff --git a/scripts/billshouse.asm b/scripts/billshouse.asm index b7e85f9a..71e61603 100755 --- a/scripts/billshouse.asm +++ b/scripts/billshouse.asm @@ -51,7 +51,7 @@ BillsHouseScript2: ; 1e7a6 (7:67a6) ld a, HS_BILL_POKEMON ld [wcc4d], a predef HideObject - SetEvent EVENT_55E + SetEvent EVENT_BILL_SAID_USE_CELL_SEPARATOR xor a ld [wJoyIgnore], a ld a, $3 @@ -59,7 +59,7 @@ BillsHouseScript2: ; 1e7a6 (7:67a6) ret BillsHouseScript3: ; 1e7c5 (7:67c5) - CheckEvent EVENT_55B + CheckEvent EVENT_USED_CELL_SEPARATOR_ON_BILL ret z ld a, $f0 ld [wJoyIgnore], a @@ -101,8 +101,8 @@ BillsHouseScript4: ; 1e80d (7:680d) ret nz xor a ld [wJoyIgnore], a - SetEvent EVENT_55D - SetEvent EVENT_550 + SetEvent EVENT_MET_BILL_2 ; this event seems redundant + SetEvent EVENT_MET_BILL ld a, $0 ld [W_BILLSHOUSECURSCRIPT], a ret @@ -159,7 +159,7 @@ BillsHouseText_1e86f: ; 1e86f (7:686f) BillsHouseText2: ; 1e874 (7:6874) TX_ASM - CheckEvent EVENT_55C + CheckEvent EVENT_GOT_SS_TICKET jr nz, .asm_1e8a9 ld hl, BillThankYouText call PrintText @@ -168,7 +168,7 @@ BillsHouseText2: ; 1e874 (7:6874) jr nc, .BagFull ld hl, SSTicketReceivedText call PrintText - SetEvent EVENT_55C + SetEvent EVENT_GOT_SS_TICKET ld a, HS_CERULEAN_GUARD_1 ld [wcc4d], a predef ShowObject diff --git a/scripts/blueshouse.asm b/scripts/blueshouse.asm index 17b182f5..12ca9106 100755 --- a/scripts/blueshouse.asm +++ b/scripts/blueshouse.asm @@ -9,7 +9,7 @@ BluesHouseScriptPointers: ; 19b47 (6:5b47) dw BluesHouseScript1 BluesHouseScript0: ; 19b4b (6:5b4b) - SetEvent EVENT_019 + SetEvent EVENT_ENTERED_BLUES_HOUSE ; trigger the next script ld a,1 @@ -26,7 +26,7 @@ BluesHouseTextPointers: ; 19b57 (6:5b57) BluesHouseText1: ; 19b5d (6:5b5d) TX_ASM - CheckEvent EVENT_018 + CheckEvent EVENT_GOT_TOWN_MAP jr nz,.GotMap CheckEvent EVENT_GOT_POKEDEX jr nz,.GiveMap @@ -44,7 +44,7 @@ BluesHouseText1: ; 19b5d (6:5b5d) predef HideObject ; hide table map object ld hl,GotMapText call PrintText - SetEvent EVENT_018 + SetEvent EVENT_GOT_TOWN_MAP jr .done .GotMap ld hl,DaisyUseMapText diff --git a/scripts/bruno.asm b/scripts/bruno.asm index 9cd55193..1aae7d19 100755 --- a/scripts/bruno.asm +++ b/scripts/bruno.asm @@ -69,7 +69,7 @@ BrunoScript0: ; 76339 (1d:6339) ld a, [wCoordIndex] cp $3 jr c, .asm_7635d - CheckAndSetEvent EVENT_8EE + CheckAndSetEvent EVENT_AUTOWALKED_INTO_BRUNOS_ROOM jr z, BrunoScript_7631d .asm_7635d ld a, $2 diff --git a/scripts/celadoncity.asm b/scripts/celadoncity.asm index 65e71cca..ce0c4731 100755 --- a/scripts/celadoncity.asm +++ b/scripts/celadoncity.asm @@ -42,7 +42,7 @@ CeladonCityText4: ; 19999 (6:5999) CeladonCityText5: ; 1999e (6:599e) TX_ASM - CheckEvent EVENT_180 + CheckEvent EVENT_GOT_TM41 jr nz, .asm_7053f ld hl, TM41PreText call PrintText @@ -55,7 +55,7 @@ CeladonCityText5: ; 1999e (6:599e) .Success ld hl, ReceivedTM41Text call PrintText - SetEvent EVENT_180 + SetEvent EVENT_GOT_TM41 jr .Done .asm_7053f ld hl, TM41ExplanationText diff --git a/scripts/celadondiner.asm b/scripts/celadondiner.asm index d4d4b84b..a37bc558 100755 --- a/scripts/celadondiner.asm +++ b/scripts/celadondiner.asm @@ -27,14 +27,14 @@ CeladonDinerText4: ; 4916e (12:516e) CeladonDinerText5: ; 49173 (12:5173) TX_ASM - CheckEvent EVENT_1E0 + CheckEvent EVENT_GOT_COIN_CASE jr nz, .asm_eb14d ld hl, CeladonDinerText_491a7 call PrintText ld bc, (COIN_CASE << 8) | 1 call GiveItem jr nc, .BagFull - SetEvent EVENT_1E0 + SetEvent EVENT_GOT_COIN_CASE ld hl, ReceivedCoinCaseText call PrintText jr .asm_68b61 diff --git a/scripts/celadongamecorner.asm b/scripts/celadongamecorner.asm index ef4b4760..48264603 100755 --- a/scripts/celadongamecorner.asm +++ b/scripts/celadongamecorner.asm @@ -28,7 +28,7 @@ CeladonGameCornerScript_48bec: ; 48bec (12:4bec) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_1B9 + CheckEvent EVENT_FOUND_ROCKET_HIDEOUT ret nz ld a, $2a ld [wd09f], a @@ -226,7 +226,7 @@ CeladonGameCornerText4: ; 48d45 (12:4d45) CeladonGameCornerText5: ; 48d4a (12:4d4a) TX_ASM - CheckEvent EVENT_1BA + CheckEvent EVENT_GOT_10_COINS jr nz, .asm_48d89 ld hl, CeladonGameCornerText_48d9c call PrintText @@ -244,7 +244,7 @@ CeladonGameCornerText5: ; 48d4a (12:4d4a) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - SetEvent EVENT_1BA + SetEvent EVENT_GOT_10_COINS ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, Received10CoinsText @@ -305,7 +305,7 @@ CeladonGameCornerText8: ; 48dd4 (12:4dd4) CeladonGameCornerText9: ; 48dd9 (12:4dd9) TX_ASM - CheckEvent EVENT_1BC + CheckEvent EVENT_GOT_20_COINS_2 jr nz, .asm_48e13 ld hl, CeladonGameCornerText_48e26 call PrintText @@ -323,7 +323,7 @@ CeladonGameCornerText9: ; 48dd9 (12:4dd9) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - SetEvent EVENT_1BC + SetEvent EVENT_GOT_20_COINS_2 ld hl, Received20CoinsText jr .asm_48e20 .asm_48e13 @@ -356,7 +356,7 @@ CeladonGameCornerText_48e36: ; 48e36 (12:4e36) CeladonGameCornerText10: ; 48e3b (12:4e3b) TX_ASM - CheckEvent EVENT_1BB + CheckEvent EVENT_GOT_20_COINS jr nz, .asm_48e75 ld hl, CeladonGameCornerText_48e88 call PrintText @@ -374,7 +374,7 @@ CeladonGameCornerText10: ; 48e3b (12:4e3b) ld hl, hCoins + 1 ld c, $2 predef AddBCDPredef - SetEvent EVENT_1BB + SetEvent EVENT_GOT_20_COINS ld hl, CeladonGameCornerText_48e8d jr .asm_48e82 .asm_48e75 @@ -449,7 +449,7 @@ CeladonGameCornerText12: ; 48edd (12:4edd) ld a, SFX_GO_INSIDE call PlaySound call WaitForSoundToFinish - SetEvent EVENT_1B9 + SetEvent EVENT_FOUND_ROCKET_HIDEOUT ld a, $43 ld [wd09f], a ld bc, $0208 diff --git a/scripts/celadonmart3.asm b/scripts/celadonmart3.asm index 6e17ac77..f525d0af 100755 --- a/scripts/celadonmart3.asm +++ b/scripts/celadonmart3.asm @@ -22,14 +22,14 @@ CeladonMart3TextPointers: ; 48228 (12:4228) CeladonMart3Text1: ; 4824a (12:424a) TX_ASM - CheckEvent EVENT_18F + CheckEvent EVENT_GOT_TM18 jr nz, .asm_a5463 ld hl, TM18PreReceiveText call PrintText ld bc, (TM_18 << 8) | 1 call GiveItem jr nc, .BagFull - SetEvent EVENT_18F + SetEvent EVENT_GOT_TM18 ld hl, ReceivedTM18Text jr .asm_81359 .BagFull diff --git a/scripts/celadonmartroof.asm b/scripts/celadonmartroof.asm index e509ffeb..113044cd 100755 --- a/scripts/celadonmartroof.asm +++ b/scripts/celadonmartroof.asm @@ -83,7 +83,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr z, .asm_484b6 cp SODA_POP jr z, .asm_48492 - CheckEvent EVENT_18E + CheckEvent EVENT_GOT_TM49 jr nz, .asm_484e0 ld hl, CeladonMartRoofText_48515 call PrintText @@ -93,10 +93,10 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, ReceivedTM49Text call PrintText - SetEvent EVENT_18E + SetEvent EVENT_GOT_TM49 ret .asm_48492 - CheckEvent EVENT_18D + CheckEvent EVENT_GOT_TM48 jr nz, .asm_484e0 ld hl, CeladonMartRoofText_48504 call PrintText @@ -106,10 +106,10 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, CeladonMartRoofText_4850a call PrintText - SetEvent EVENT_18D + SetEvent EVENT_GOT_TM48 ret .asm_484b6 - CheckEvent EVENT_18C + CheckEvent EVENT_GOT_TM13 jr nz, .asm_484e0 ld hl, CeladonMartRoofText_484f3 call PrintText @@ -119,7 +119,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, CeladonMartRoofText_484f9 call PrintText - SetEvent EVENT_18C + SetEvent EVENT_GOT_TM13 ret .BagFull ld hl, CeladonMartRoofText_48526 diff --git a/scripts/ceruleancity.asm b/scripts/ceruleancity.asm index b009ca95..5da549f3 100755 --- a/scripts/ceruleancity.asm +++ b/scripts/ceruleancity.asm @@ -25,7 +25,7 @@ CeruleanCityScript4: ; 194a7 (6:54a7) jp z, CeruleanCityScript_1948c ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_0A7 + SetEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF ld a, $2 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -35,7 +35,7 @@ CeruleanCityScript4: ; 194a7 (6:54a7) ret CeruleanCityScript0: ; 194c8 (6:54c8) - CheckEvent EVENT_0A7 + CheckEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF jr nz, .asm_194f7 ld hl, CeruleanCityCoords1 call ArePlayerCoordsInArray @@ -56,7 +56,7 @@ CeruleanCityScript0: ; 194c8 (6:54c8) ld [hSpriteIndexOrTextID], a jp DisplayTextID .asm_194f7 - CheckEvent EVENT_098 + CheckEvent EVENT_BEAT_CERULEAN_RIVAL ret nz ld hl, CeruleanCityCoords2 call ArePlayerCoordsInArray @@ -167,7 +167,7 @@ CeruleanCityScript2: ; 195b1 (6:55b1) call CeruleanCityScript_1955d ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_098 + SetEvent EVENT_BEAT_CERULEAN_RIVAL ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -248,7 +248,7 @@ CeruleanCityTextPointers: ; 1962d (6:562d) CeruleanCityText1: ; 1964f (6:564f) TX_ASM - CheckEvent EVENT_098 + CheckEvent EVENT_BEAT_CERULEAN_RIVAL ; do pre-battle text jr z, .PreBattleText ; or talk about bill @@ -279,7 +279,7 @@ CeruleanCityText_19677: ; 19677 (6:5677) CeruleanCityText2: ; 1967c (6:567c) TX_ASM - CheckEvent EVENT_0A7 + CheckEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF jr nz, .asm_4ca20 ld hl, CeruleanCityText_196d9 call PrintText diff --git a/scripts/cinnabarisland.asm b/scripts/cinnabarisland.asm index 2fc0503f..c06c784c 100755 --- a/scripts/cinnabarisland.asm +++ b/scripts/cinnabarisland.asm @@ -2,8 +2,8 @@ CinnabarIslandScript: ; 1ca19 (7:4a19) call EnableAutoTextBoxDrawing ld hl, wd126 set 5, [hl] - ResetEvent EVENT_278 - ResetEvent EVENT_2E1 + ResetEvent EVENT_MANSION_SWITCH_ON + ResetEvent EVENT_LAB_STILL_REVIVING_FOSSIL ld hl, CinnabarIslandScriptPointers ld a, [W_CINNABARISLANDCURSCRIPT] jp CallFunctionInTable diff --git a/scripts/copycatshouse2f.asm b/scripts/copycatshouse2f.asm index d6a330f3..953c7126 100755 --- a/scripts/copycatshouse2f.asm +++ b/scripts/copycatshouse2f.asm @@ -12,7 +12,7 @@ CopycatsHouse2FTextPointers: ; 5cc74 (17:4c74) CopycatsHouse2FText1: ; 5cc82 (17:4c82) TX_ASM - CheckEvent EVENT_340 + CheckEvent EVENT_GOT_TM31 jr nz, .asm_7ccf3 ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -31,7 +31,7 @@ CopycatsHouse2FText1: ; 5cc82 (17:4c82) ld a, POKE_DOLL ld [$ffdb], a callba RemoveItemByID - SetEvent EVENT_340 + SetEvent EVENT_GOT_TM31 jr .asm_62ecd .BagFull ld hl, TM31NoRoomText diff --git a/scripts/fanclub.asm b/scripts/fanclub.asm index 45298c0b..adde809f 100755 --- a/scripts/fanclub.asm +++ b/scripts/fanclub.asm @@ -24,16 +24,16 @@ FanClubTextPointers: ; 59b84 (16:5b84) FanClubText1: ; pikachu fan TX_ASM - CheckEvent EVENT_157 + CheckEvent EVENT_PIKACHU_FAN_BOAST jr nz, .mineisbetter ld hl, .normaltext call PrintText - SetEvent EVENT_156 + SetEvent EVENT_SEEL_FAN_BOAST jr .done .mineisbetter ld hl, .bettertext call PrintText - ResetEvent EVENT_157 + ResetEvent EVENT_PIKACHU_FAN_BOAST .done jp TextScriptEnd @@ -48,16 +48,16 @@ FanClubText1: FanClubText2: ; seel fan TX_ASM - CheckEvent EVENT_156 + CheckEvent EVENT_SEEL_FAN_BOAST jr nz, .mineisbetter ld hl, .normaltext call PrintText - SetEvent EVENT_157 + SetEvent EVENT_PIKACHU_FAN_BOAST jr .done .mineisbetter ld hl, .bettertext call PrintText - ResetEvent EVENT_156 + ResetEvent EVENT_SEEL_FAN_BOAST .done jp TextScriptEnd diff --git a/scripts/fightingdojo.asm b/scripts/fightingdojo.asm index e27baf57..91d8a484 100755 --- a/scripts/fightingdojo.asm +++ b/scripts/fightingdojo.asm @@ -21,13 +21,13 @@ FightingDojoScriptPointers: ; 5cd7b (17:4d7b) dw FightingDojoScript3 FightingDojoScript1: ; 5cd83 (17:4d83) - CheckEvent EVENT_350 + CheckEvent EVENT_DEFEATED_FIGHTING_DOJO ret nz call CheckFightingMapTrainers ld a, [wTrainerHeaderFlagBit] and a ret nz - CheckEvent EVENT_351 + CheckEvent EVENT_BEAT_KARATE_MASTER ret nz xor a ld [hJoyHeld], a @@ -70,7 +70,7 @@ FightingDojoScript3: ; 5cdc6 (17:4dc6) .asm_5cde4 ld a, $f0 ld [wJoyIgnore], a - SetEventRange EVENT_351, EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 + SetEventRange EVENT_BEAT_KARATE_MASTER, EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 ld a, $8 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -131,9 +131,9 @@ FightingDojoTrainerHeader3: ; 5ce37 (17:4e37) FightingDojoText1: ; 5ce44 (17:4e44) TX_ASM - CheckEvent EVENT_350 + CheckEvent EVENT_DEFEATED_FIGHTING_DOJO jp nz, .continue1 - CheckEventReuseA EVENT_351 + CheckEventReuseA EVENT_BEAT_KARATE_MASTER jp nz, .continue2 ld hl, FightingDojoText_5ce8e call PrintText @@ -252,7 +252,7 @@ FightingDojoAfterBattleText4: ; 5cf01 (17:4f01) FightingDojoText6: ; 5cf06 (17:4f06) ; Hitmonlee Poké Ball TX_ASM - CheckEitherEventSet EVENT_356, EVENT_357 + CheckEitherEventSet EVENT_GOT_HITMONLEE, EVENT_GOT_HITMONCHAN jr z, .GetMon ld hl, OtherHitmonText call PrintText @@ -276,7 +276,7 @@ FightingDojoText6: ; 5cf06 (17:4f06) ld a, HS_FIGHTING_DOJO_GIFT_1 ld [wcc4d], a predef HideObject - SetEvents EVENT_356, EVENT_350 + SetEvents EVENT_GOT_HITMONLEE, EVENT_DEFEATED_FIGHTING_DOJO .done jp TextScriptEnd @@ -287,7 +287,7 @@ WantHitmonleeText: ; 5cf49 (17:4f49) FightingDojoText7: ; 5cf4e (17:4f4e) ; Hitmonchan Poké Ball TX_ASM - CheckEitherEventSet EVENT_356, EVENT_357 + CheckEitherEventSet EVENT_GOT_HITMONLEE, EVENT_GOT_HITMONCHAN jr z, .GetMon ld hl, OtherHitmonText call PrintText @@ -306,7 +306,7 @@ FightingDojoText7: ; 5cf4e (17:4f4e) ld c,30 call GivePokemon jr nc, .done - SetEvents EVENT_357, EVENT_350 + SetEvents EVENT_GOT_HITMONCHAN, EVENT_DEFEATED_FIGHTING_DOJO ; once Poké Ball is taken, hide sprite ld a, HS_FIGHTING_DOJO_GIFT_2 diff --git a/scripts/fuchsiacity.asm b/scripts/fuchsiacity.asm index b314b983..cdf8e203 100755 --- a/scripts/fuchsiacity.asm +++ b/scripts/fuchsiacity.asm @@ -135,9 +135,9 @@ FuchsiaCityLaprasText: ; 19aef (6:5aef) FuchsiaCityText24: ; 19af4 (6:5af4) TX_ASM - CheckEvent EVENT_57E + CheckEvent EVENT_GOT_DOME_FOSSIL jr nz, .asm_3b4e8 - CheckEventReuseA EVENT_57F + CheckEventReuseA EVENT_GOT_HELIX_FOSSIL jr nz, .asm_667d5 ld hl, FuchsiaCityText_19b2a call PrintText diff --git a/scripts/fuchsiahouse2.asm b/scripts/fuchsiahouse2.asm index b755b3bc..37aebd23 100755 --- a/scripts/fuchsiahouse2.asm +++ b/scripts/fuchsiahouse2.asm @@ -10,12 +10,12 @@ FuchsiaHouse2TextPointers: ; 750b8 (1d:50b8) FuchsiaHouse2Text1: ; 750c2 (1d:50c2) TX_ASM - CheckEvent EVENT_238 + CheckEvent EVENT_GOT_HM04 jr nz, .subtract ld b,GOLD_TEETH call IsItemInBag jr nz, .asm_3f30f - CheckEvent EVENT_239 + CheckEvent EVENT_GAVE_GOLD_TEETH jr nz, .asm_60cba ld hl, WardenGibberishText1 call PrintText @@ -34,7 +34,7 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) ld a, GOLD_TEETH ld [$ffdb], a callba RemoveItemByID - SetEvent EVENT_239 + SetEvent EVENT_GAVE_GOLD_TEETH .asm_60cba ld hl, WardenThankYouText call PrintText @@ -43,7 +43,7 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) jr nc, .BagFull ld hl, ReceivedHM04Text call PrintText - SetEvent EVENT_238 + SetEvent EVENT_GOT_HM04 jr .asm_52039 .subtract ld hl, HM04ExplanationText diff --git a/scripts/gary.asm b/scripts/gary.asm index ab991942..24a2d2de 100755 --- a/scripts/gary.asm +++ b/scripts/gary.asm @@ -94,7 +94,7 @@ GaryScript3: ; 75fbb (1d:5fbb) cp $ff jp z, GaryScript_75f29 call UpdateSprites - SetEvent EVENT_901 + SetEvent EVENT_BEAT_CHAMPION_RIVAL ld a, $f0 ld [wJoyIgnore], a ld a, $1 @@ -248,7 +248,7 @@ GaryTextPointers: ; 760d6 (1d:60d6) GaryText1: ; 760e0 (1d:60e0) TX_ASM - CheckEvent EVENT_901 + CheckEvent EVENT_BEAT_CHAMPION_RIVAL ld hl, GaryText_760f4 jr z, .asm_17e9f ld hl, GaryText_76103 diff --git a/scripts/halloffameroom.asm b/scripts/halloffameroom.asm index 136061d8..503327f3 100755 --- a/scripts/halloffameroom.asm +++ b/scripts/halloffameroom.asm @@ -40,7 +40,7 @@ HallofFameRoomScript2: ; 5a4bb (16:64bb) ld [W_LANCECURSCRIPT], a ld [W_HALLOFFAMEROOMCURSCRIPT], a ; Elite 4 events - ResetEventRange EVENT_8E0, EVENT_907, 1 + ResetEventRange EVENT_ELITE4_EVENTS_START, EVENT_907, 1 xor a ld [W_HALLOFFAMEROOMCURSCRIPT], a ld a, PALLET_TOWN diff --git a/scripts/indigoplateaulobby.asm b/scripts/indigoplateaulobby.asm index 8cde0854..e4a64ce6 100755 --- a/scripts/indigoplateaulobby.asm +++ b/scripts/indigoplateaulobby.asm @@ -5,13 +5,13 @@ IndigoPlateauLobbyScript: ; 19c5b (6:5c5b) bit 6, [hl] res 6, [hl] ret z - ResetEvent EVENT_917 + ResetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH ld hl, wd734 bit 1, [hl] res 1, [hl] ret z ; Elite 4 events - ResetEventRange EVENT_8E0, EVENT_8FF + ResetEventRange EVENT_ELITE4_EVENTS_START, EVENT_LANCES_ROOM_LOCK_DOOR ret IndigoPlateauLobbyTextPointers: ; 19c7f (6:5c7f) diff --git a/scripts/lab3.asm b/scripts/lab3.asm index 0351038d..59b04b8c 100755 --- a/scripts/lab3.asm +++ b/scripts/lab3.asm @@ -10,7 +10,7 @@ Lab3TextPointers: ; 75c8a (1d:5c8a) Lab3Text1: ; 75c94 (1d:5c94) TX_ASM - CheckEvent EVENT_2D7 + CheckEvent EVENT_GOT_TM35 jr nz, .asm_e551a ld hl, TM35PreReceiveText call PrintText @@ -19,7 +19,7 @@ Lab3Text1: ; 75c94 (1d:5c94) jr nc, .BagFull ld hl, ReceivedTM35Text call PrintText - SetEvent EVENT_2D7 + SetEvent EVENT_GOT_TM35 jr .asm_eb896 .BagFull ld hl, TM35NoRoomText diff --git a/scripts/lab4.asm b/scripts/lab4.asm index 44dcb2c3..f2c4d8d7 100755 --- a/scripts/lab4.asm +++ b/scripts/lab4.asm @@ -49,7 +49,7 @@ FossilsList: ; 75d68 (1d:5d68) Lab4Text1: ; 75d6c (1d:5d6c) TX_ASM - CheckEvent EVENT_2E0 + CheckEvent EVENT_GAVE_FOSSIL_TO_LAB jr nz, .asm_75d96 ld hl, Lab4Text_75dc6 call PrintText @@ -65,7 +65,7 @@ Lab4Text1: ; 75d6c (1d:5d6c) .asm_75d93 jp TextScriptEnd .asm_75d96 - bit 1, a + CheckEventAfterBranchReuseA EVENT_LAB_STILL_REVIVING_FOSSIL, EVENT_GAVE_FOSSIL_TO_LAB jr z, .asm_75da2 ld hl, Lab4Text_75dd0 call PrintText @@ -74,13 +74,13 @@ Lab4Text1: ; 75d6c (1d:5d6c) call LoadFossilItemAndMonNameBank1D ld hl, Lab4Text_75dd5 call PrintText - SetEvent EVENT_2E2 + SetEvent EVENT_LAB_HANDING_OVER_FOSSIL_MON ld a, [W_FOSSILMON] ld b, a ld c, 30 call GivePokemon jr nc, .asm_75d93 - ResetEvents EVENT_2E0, EVENT_2E1, EVENT_2E2 + ResetEvents EVENT_GAVE_FOSSIL_TO_LAB, EVENT_LAB_STILL_REVIVING_FOSSIL, EVENT_LAB_HANDING_OVER_FOSSIL_MON jr .asm_75d93 Lab4Text_75dc6: ; 75dc6 (1d:5dc6) diff --git a/scripts/lance.asm b/scripts/lance.asm index 9d3a2f99..4d0072be 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -13,7 +13,7 @@ LanceScript_5a2c4: ; 5a2c4 (16:62c4) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_8FF + CheckEvent EVENT_LANCES_ROOM_LOCK_DOOR jr nz, .asm_5a2da ld a, $31 ld b, $32 @@ -51,7 +51,7 @@ LanceScript4: ; 5a304 (16:6304) ret LanceScript0: ; 5a305 (16:6305) - CheckEvent EVENT_8FE + CheckEvent EVENT_BEAT_LANCE ret nz ld hl, CoordsData_5a33e call ArePlayerCoordsInArray @@ -67,7 +67,7 @@ LanceScript0: ; 5a305 (16:6305) .asm_5a325 cp $5 jr z, LanceScript_5a35b - CheckAndSetEvent EVENT_8FF + CheckAndSetEvent EVENT_LANCES_ROOM_LOCK_DOOR ret nz ld hl, wd126 set 5, [hl] @@ -156,5 +156,5 @@ LanceEndBattleText: ; 5a3b3 (16:63b3) LanceAfterBattleText: ; 5a3b8 (16:63b8) TX_FAR _LanceAfterBattleText TX_ASM - SetEvent EVENT_8FE + SetEvent EVENT_BEAT_LANCE jp TextScriptEnd diff --git a/scripts/lavenderhouse1.asm b/scripts/lavenderhouse1.asm index 21e67013..556e94a3 100755 --- a/scripts/lavenderhouse1.asm +++ b/scripts/lavenderhouse1.asm @@ -12,7 +12,7 @@ LavenderHouse1TextPointers: ; 1d8ac (7:58ac) LavenderHouse1Text1: ; 1d8b8 (7:58b8) TX_ASM - CheckEvent EVENT_4CF + CheckEvent EVENT_RESCUED_MR_FUJI jr nz, .asm_72e5d ld hl, LavenderHouse1Text_1d8d1 call PrintText @@ -33,7 +33,7 @@ LavenderHouse1Text_1d8d6: ; 1d8d6 (7:58d6) LavenderHouse1Text2: ; 1d8db (7:58db) TX_ASM - CheckEvent EVENT_4CF + CheckEvent EVENT_RESCUED_MR_FUJI jr nz, .asm_06470 ld hl, LavenderHouse1Text_1d8f4 call PrintText @@ -68,7 +68,7 @@ LavenderHouse1Text4: ; 1d90b (7:590b) LavenderHouse1Text5: ; 1d918 (7:5918) TX_ASM - CheckEvent EVENT_128 + CheckEvent EVENT_GOT_POKE_FLUTE jr nz, .asm_15ac2 ld hl, LavenderHouse1Text_1d94c call PrintText @@ -77,7 +77,7 @@ LavenderHouse1Text5: ; 1d918 (7:5918) jr nc, .BagFull ld hl, ReceivedFluteText call PrintText - SetEvent EVENT_128 + SetEvent EVENT_GOT_POKE_FLUTE jr .asm_da749 .BagFull ld hl, FluteNoRoomText diff --git a/scripts/lavenderhouse2.asm b/scripts/lavenderhouse2.asm index 4c3ad333..fe0b3ee2 100755 --- a/scripts/lavenderhouse2.asm +++ b/scripts/lavenderhouse2.asm @@ -15,7 +15,7 @@ LavenderHouse2Text1: ; 1d9b6 (7:59b6) LavenderHouse2Text2: ; 1d9c3 (7:59c3) TX_ASM - CheckEvent EVENT_4CF + CheckEvent EVENT_RESCUED_MR_FUJI jr nz, .asm_65711 ld hl, LavenderHouse2Text_1d9dc call PrintText diff --git a/scripts/lavendermart.asm b/scripts/lavendermart.asm index ababf70d..85518fd2 100755 --- a/scripts/lavendermart.asm +++ b/scripts/lavendermart.asm @@ -12,7 +12,7 @@ LavenderMartText2: ; 5c935 (17:4935) LavenderMartText3: ; 5c93a (17:493a) TX_ASM - CheckEvent EVENT_4CF + CheckEvent EVENT_RESCUED_MR_FUJI jr nz, .asm_c88d4 ld hl, LavenderMart_5c953 call PrintText diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index a8e0cb5b..fe136784 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -70,7 +70,7 @@ LoreleiScript0: ; 761e2 (1d:61e2) ld a, [wCoordIndex] cp $3 jr c, .asm_76206 - CheckAndSetEvent EVENT_8E6 + CheckAndSetEvent EVENT_AUTOWALKED_INTO_LORELEIS_ROOM jr z, LoreleiScript_761c6 .asm_76206 ld a, $2 diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm index ff8707e0..7d349276 100755 --- a/scripts/mansion1.asm +++ b/scripts/mansion1.asm @@ -13,7 +13,7 @@ Mansion1Subscript1: ; 442c5 (11:42c5) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_278 + CheckEvent EVENT_MANSION_SWITCH_ON jr nz, .asm_442ec ld bc, $060c call Mansion1Script_4430b @@ -112,9 +112,9 @@ Mansion1Text4: ; 4435a (11:435a) call PrintText ld a, SFX_GO_INSIDE call PlaySound - CheckAndSetEvent EVENT_278 + CheckAndSetEvent EVENT_MANSION_SWITCH_ON jr z, .asm_44392 - ResetEventReuseHL EVENT_278 + ResetEventReuseHL EVENT_MANSION_SWITCH_ON jr .asm_44392 .asm_4438c ld hl, MansionSwitchNotPressedText diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm index 6e1a26c0..4f5aac9f 100755 --- a/scripts/mansion2.asm +++ b/scripts/mansion2.asm @@ -13,7 +13,7 @@ Mansion2Script_51fee: ; 51fee (14:5fee) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_278 + CheckEvent EVENT_MANSION_SWITCH_ON jr nz, .asm_52016 ld a, $e ld bc, $204 @@ -118,9 +118,9 @@ Mansion2Text5: ; 52087 (14:6087) call PrintText ld a, SFX_GO_INSIDE call PlaySound - CheckAndSetEvent EVENT_278 + CheckAndSetEvent EVENT_MANSION_SWITCH_ON jr z, .asm_520bf - ResetEventReuseHL EVENT_278 + ResetEventReuseHL EVENT_MANSION_SWITCH_ON jr .asm_520bf .asm_520b9 ld hl, Mansion2Text_520cc diff --git a/scripts/mansion3.asm b/scripts/mansion3.asm index 0aec82b3..e49667ef 100755 --- a/scripts/mansion3.asm +++ b/scripts/mansion3.asm @@ -13,7 +13,7 @@ Mansion3Script_52204: ; 52204 (14:6204) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_278 + CheckEvent EVENT_MANSION_SWITCH_ON jr nz, .asm_52224 ld a, $e ld bc, $207 diff --git a/scripts/mansion4.asm b/scripts/mansion4.asm index 98c55a76..59ee3704 100755 --- a/scripts/mansion4.asm +++ b/scripts/mansion4.asm @@ -13,7 +13,7 @@ Mansion4Script_523cf: ; 523cf (14:63cf) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_278 + CheckEvent EVENT_MANSION_SWITCH_ON jr nz, .asm_523ff ld a, $e ld bc, $80d diff --git a/scripts/mtmoon3.asm b/scripts/mtmoon3.asm index dfa92260..4542cc53 100755 --- a/scripts/mtmoon3.asm +++ b/scripts/mtmoon3.asm @@ -5,7 +5,7 @@ MtMoon3Script: ; 49d0b (12:5d0b) ld a, [W_MTMOON3CURSCRIPT] call ExecuteCurMapScriptInTable ld [W_MTMOON3CURSCRIPT], a - CheckEvent EVENT_579 + CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD ret z ld hl, CoordsData_49d37 call ArePlayerCoordsInArray @@ -53,7 +53,7 @@ MtMoon3ScriptPointers: ; 49d63 (12:5d63) dw MtMoon3Script5 MtMoon3Script0: ; 49d6f (12:5d6f) - CheckEvent EVENT_579 + CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD jp nz, MtMoon3Script_49d91 ld a, [W_YCOORD] cp $8 @@ -68,7 +68,7 @@ MtMoon3Script0: ; 49d6f (12:5d6f) jp DisplayTextID MtMoon3Script_49d91: ; 49d91 (12:5d91) - CheckEitherEventSet EVENT_57E, EVENT_57F + CheckEitherEventSet EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL jp z, CheckFightingMapTrainers ret @@ -78,7 +78,7 @@ MtMoon3Script3: ; 49d9a (12:5d9a) jp z, MtMoon3Script_49d58 call UpdateSprites call Delay3 - SetEvent EVENT_579 + SetEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD xor a ld [wJoyIgnore], a ld a, $0 @@ -138,7 +138,7 @@ MtMoon3Script5: ; 49dfb (12:5dfb) ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID - CheckEvent EVENT_57E + CheckEvent EVENT_GOT_DOME_FOSSIL jr z, .asm_49e1d ld a, HS_MT_MOON_3_FOSSIL_2 jr .asm_49e1f @@ -207,7 +207,7 @@ MtMoon3TrainerHeader4: ; 49e6c (12:5e6c) MtMoon3Text1: ; 49e79 (12:5e79) TX_ASM - CheckEvent EVENT_579 + CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD jr z, .asm_49e8d and $c0 jr nz, .asm_49eb8 @@ -278,7 +278,7 @@ MtMoon3Text6: ; 49ee9 (12:5ee9) ld a, HS_MT_MOON_3_FOSSIL_1 ld [wcc4d], a predef HideObject - SetEvent EVENT_57E + SetEvent EVENT_GOT_DOME_FOSSIL ld a, $4 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a @@ -306,7 +306,7 @@ MtMoon3Text7: ; 49f29 (12:5f29) ld a, HS_MT_MOON_3_FOSSIL_2 ld [wcc4d], a predef HideObject - SetEvent EVENT_57F + SetEvent EVENT_GOT_HELIX_FOSSIL ld a, $4 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a diff --git a/scripts/museum1f.asm b/scripts/museum1f.asm index 2acf1af5..77c7f270 100755 --- a/scripts/museum1f.asm +++ b/scripts/museum1f.asm @@ -54,13 +54,13 @@ Museum1FText1: ; 5c135 (17:4135) cp $c jp z, Museum1FScript_5c1f9 .asm_d49e7 - CheckEvent EVENT_068 + CheckEvent EVENT_BOUGHT_MUSEUM_TICKET jr nz, .asm_31a16 ld hl, Museum1FText_5c23d call PrintText jp Museum1FScriptEnd .asm_b8709 - CheckEvent EVENT_068 + CheckEvent EVENT_BOUGHT_MUSEUM_TICKET jr z, .asm_3ded4 .asm_31a16 ld hl, Museum1FText_5c242 @@ -91,7 +91,7 @@ Museum1FText1: ; 5c135 (17:4135) .asm_0f3e3 ld hl, Museum1FText_5c224 call PrintText - SetEvent EVENT_068 + SetEvent EVENT_BOUGHT_MUSEUM_TICKET xor a ld [wPriceTemp], a ld [wPriceTemp + 1], a @@ -187,14 +187,14 @@ Museum1FText_5c251: ; 5c251 (17:4251) Museum1FText3: ; 5c256 (17:4256) TX_ASM - CheckEvent EVENT_069 + CheckEvent EVENT_GOT_OLD_AMBER jr nz, .asm_5c285 ld hl, Museum1FText_5c28e call PrintText ld bc, (OLD_AMBER << 8) | 1 call GiveItem jr nc, .BagFull - SetEvent EVENT_069 + SetEvent EVENT_GOT_OLD_AMBER ld a, HS_OLD_AMBER ld [wcc4d], a predef HideObject diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index 6f51aca0..620923ad 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -1,5 +1,5 @@ OaksLabScript: ; 1cb0e (7:4b0e) - CheckEvent EVENT_026 + CheckEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS_2 call nz, OaksLabScript_1d076 ld a, $1 ld [wAutoTextBoxDrawingControl], a @@ -31,7 +31,7 @@ OaksLabScriptPointers: ; 1cb28 (7:4b28) dw OaksLabScript18 OaksLabScript0: ; 1cb4e (7:4b4e) - CheckEvent EVENT_027 + CheckEvent EVENT_OAK_APPEARED_IN_PALLET ret z ld a, [wNPCMovementScriptFunctionNum] and a @@ -108,8 +108,8 @@ OaksLabScript4: ; 1cbd2 (7:4bd2) ld a, [wSimulatedJoypadStatesIndex] and a ret nz - SetEvent EVENT_STOPPED_FROM_LEAVING_PALLET - SetEvent EVENT_FOLLOWED_OAK_INSIDE_LAB + SetEvent EVENT_FOLLOWED_OAK_INTO_LAB + SetEvent EVENT_FOLLOWED_OAK_INTO_LAB_2 ld a, $1 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_UP @@ -597,7 +597,7 @@ OaksLabScript16: ; 1cf12 (7:4f12) ld [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_POKEDEX - SetEvent EVENT_038 + SetEvent EVENT_OAK_GOT_PARCEL ld a, HS_LYING_OLD_MAN ld [wcc4d], a predef HideObject @@ -632,9 +632,9 @@ OaksLabScript17: ; 1cfd4 (7:4fd4) ld a, HS_OAKS_LAB_RIVAL ld [wcc4d], a predef HideObject - SetEvent EVENT_520 - ResetEventReuseHL EVENT_521 - SetEventReuseHL EVENT_527 + SetEvent EVENT_1ST_ROUTE22_RIVAL_BATTLE + ResetEventReuseHL EVENT_2ND_ROUTE22_RIVAL_BATTLE + SetEventReuseHL EVENT_ROUTE22_RIVAL_WANTS_FIGHT ld a, HS_ROUTE_22_RIVAL_1 ld [wcc4d], a predef ShowObject @@ -650,19 +650,19 @@ OaksLabScript17: ; 1cfd4 (7:4fd4) OaksLabScript18: ; 1d009 (7:5009) ret -OaksLabScript_1d00a: ; 1d00a (7:500a) +OaksLabScript_RemoveParcel: ; 1d00a (7:500a) ld hl, wBagItems ld bc, $0000 -.asm_1d010 +.loop ld a, [hli] cp $ff ret z cp OAKS_PARCEL - jr z, .GotParcel + jr z, .foundParcel inc hl inc c - jr .asm_1d010 -.GotParcel + jr .loop +.foundParcel ld hl, wNumBagItems ld a, c ld [wWhichPokemon], a @@ -762,7 +762,7 @@ OaksLabTextPointers: ; 1d082 (7:5082) OaksLabText28: ; 1d0ce (7:50ce) OaksLabText1: ; 1d0ce (7:50ce) TX_ASM - CheckEvent EVENT_FOLLOWED_OAK_INSIDE_LAB + CheckEvent EVENT_FOLLOWED_OAK_INTO_LAB_2 jr nz, .asm_1d0de ld hl, OaksLabGaryText1 call PrintText @@ -964,7 +964,7 @@ OaksLabLastMonText: ; 1d243 (7:5243) OaksLabText32: ; 1d248 (7:5248) OaksLabText5: ; 1d248 (7:5248) TX_ASM - CheckEvent EVENT_006 + CheckEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS jr nz, .asm_1d266 ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned @@ -985,7 +985,7 @@ OaksLabText5: ; 1d248 (7:5248) ld b,POKE_BALL call IsItemInBag jr nz, .asm_1d2e7 - CheckEvent EVENT_525 + CheckEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT jr nz, .asm_1d2d0 CheckEvent EVENT_GOT_POKEDEX jr nz, .asm_1d2c8 @@ -1011,7 +1011,7 @@ OaksLabText5: ; 1d248 (7:5248) .asm_1d2b8 ld hl, OaksLabDeliverParcelText call PrintText - call OaksLabScript_1d00a + call OaksLabScript_RemoveParcel ld a, $f ld [W_OAKSLABCURSCRIPT], a jr .asm_1d2ed diff --git a/scripts/pallettown.asm b/scripts/pallettown.asm index 15956e7b..0fd7300e 100755 --- a/scripts/pallettown.asm +++ b/scripts/pallettown.asm @@ -1,7 +1,7 @@ PalletTownScript: ; 18e5b (6:4e5b) CheckEvent EVENT_GOT_POKEBALLS_FROM_OAK jr z,.next - SetEvent EVENT_006 + SetEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS .next call EnableAutoTextBoxDrawing ld hl,PalletTownScriptPointers @@ -18,7 +18,7 @@ PalletTownScriptPointers: ; 18e73 (6:4e73) dw PalletTownScript6 PalletTownScript0: ; 18e81 (6:4e81) - CheckEvent EVENT_STOPPED_FROM_LEAVING_PALLET + CheckEvent EVENT_FOLLOWED_OAK_INTO_LAB ret nz ld a,[W_YCOORD] cp 1 ; is player near north exit? @@ -35,7 +35,7 @@ PalletTownScript0: ; 18e81 (6:4e81) call PlayMusic ld a,$FC ld [wJoyIgnore],a - SetEvent EVENT_027 + SetEvent EVENT_OAK_APPEARED_IN_PALLET ; trigger the next script ld a,1 @@ -130,12 +130,11 @@ PalletTownScript4: ; 18f4b (6:4f4b) ret PalletTownScript5: ; 18f56 (6:4f56) - CheckEvent EVENT_01A + CheckEvent EVENT_DAISY_WALKING jr nz,.next - and 3 - cp 3 + CheckBothEventsSet EVENT_GOT_TOWN_MAP, EVENT_ENTERED_BLUES_HOUSE, 1 jr nz,.next - SetEvent EVENT_01A + SetEvent EVENT_DAISY_WALKING ld a,HS_DAISY_SITTING ld [wcc4d],a predef HideObject @@ -145,7 +144,7 @@ PalletTownScript5: ; 18f56 (6:4f56) .next CheckEvent EVENT_GOT_POKEBALLS_FROM_OAK ret z - SetEvent EVENT_026 + SetEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS_2 PalletTownScript6: ; 18f87 (6:4f87) ret diff --git a/scripts/pewtercity.asm b/scripts/pewtercity.asm index 8e72ee4b..77da14f8 100755 --- a/scripts/pewtercity.asm +++ b/scripts/pewtercity.asm @@ -16,7 +16,7 @@ PewterCityScriptPointers: ; 19243 (6:5243) PewterCityScript0: ; 19251 (6:5251) xor a ld [W_MUSEUM1FCURSCRIPT], a - ResetEvent EVENT_068 + ResetEvent EVENT_BOUGHT_MUSEUM_TICKET call PewterCityScript_1925e ret diff --git a/scripts/pewtergym.asm b/scripts/pewtergym.asm index 03a1c218..186d0176 100755 --- a/scripts/pewtergym.asm +++ b/scripts/pewtergym.asm @@ -72,7 +72,7 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) ld [wcc4d], a predef HideObject - ResetEvents EVENT_520, EVENT_527 + ResetEvents EVENT_1ST_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_FIGHT ; deactivate gym trainers SetEvent EVENT_BEAT_PEWTER_GYM_TRAINER_0 diff --git a/scripts/pokemontower2.asm b/scripts/pokemontower2.asm index a9619170..c7b94c4f 100755 --- a/scripts/pokemontower2.asm +++ b/scripts/pokemontower2.asm @@ -17,7 +17,7 @@ PokemonTower2ScriptPointers: ; 60509 (18:4509) dw PokemonTower2Script2 PokemonTower2Script0: ; 6050f (18:450f) - CheckEvent EVENT_0EF + CheckEvent EVENT_BEAT_POKEMON_TOWER_RIVAL ret nz ld hl, CoordsData_6055e call ArePlayerCoordsInArray @@ -28,13 +28,14 @@ PokemonTower2Script0: ; 6050f (18:450f) ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL call PlayMusic - ResetEvent EVENT_0EE + ResetEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT ld a, [wCoordIndex] cp $1 ld a, PLAYER_DIR_UP ld b, SPRITE_FACING_DOWN jr nz, .asm_60544 - SetEvent EVENT_0EE +; the rival is on the left side and the player is on the right side + SetEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT ld a, PLAYER_DIR_LEFT ld b, SPRITE_FACING_RIGHT .asm_60544 @@ -63,12 +64,12 @@ PokemonTower2Script1: ; 60563 (18:4563) jp z, PokemonTower2Script_604fe ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_0EF + SetEvent EVENT_BEAT_POKEMON_TOWER_RIVAL ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID ld de, MovementData_605b2 - CheckEvent EVENT_0EE + CheckEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT jr nz, .asm_60589 ld de, MovementData_605a9 .asm_60589 @@ -127,7 +128,7 @@ PokemonTower2TextPointers: ; 605db (18:45db) PokemonTower2Text1: ; 605df (18:45df) TX_ASM - CheckEvent EVENT_0EF + CheckEvent EVENT_BEAT_POKEMON_TOWER_RIVAL jr z, .asm_16f24 ld hl, PokemonTower2Text_6063c call PrintText diff --git a/scripts/pokemontower5.asm b/scripts/pokemontower5.asm index b418b361..c4e9eed9 100755 --- a/scripts/pokemontower5.asm +++ b/scripts/pokemontower5.asm @@ -18,10 +18,10 @@ PokemonTower5Script0: ; 6094b (18:494b) jr c, .asm_60960 ld hl, wd72e res 4, [hl] - ResetEvent EVENT_107 + ResetEvent EVENT_IN_PURIFIED_ZONE jp CheckFightingMapTrainers .asm_60960 - CheckAndSetEvent EVENT_107 + CheckAndSetEvent EVENT_IN_PURIFIED_ZONE ret nz xor a ld [hJoyHeld], a diff --git a/scripts/pokemontower6.asm b/scripts/pokemontower6.asm index 68260484..37ca1b33 100755 --- a/scripts/pokemontower6.asm +++ b/scripts/pokemontower6.asm @@ -22,7 +22,7 @@ PokemonTower6ScriptPointers: ; 60b0d (18:4b0d) dw PokemonTower6Script4 PokemonTower6Script0: ; 60b17 (18:4b17) - CheckEvent EVENT_10F + CheckEvent EVENT_BEAT_GHOST_MAROWAK jp nz, CheckFightingMapTrainers ld hl, CoordsData_60b45 call ArePlayerCoordsInArray @@ -59,7 +59,7 @@ PokemonTower6Script4: ; 60b48 (18:4b48) ld a, [wBattleResult] and a jr nz, .asm_60b82 - SetEvent EVENT_10F + SetEvent EVENT_BEAT_GHOST_MAROWAK ld a, $7 ld [hSpriteIndexOrTextID], a call DisplayTextID diff --git a/scripts/pokemontower7.asm b/scripts/pokemontower7.asm index c2fe1508..3698f4ee 100755 --- a/scripts/pokemontower7.asm +++ b/scripts/pokemontower7.asm @@ -256,8 +256,8 @@ PokemonTower7FujiText: TX_ASM ld hl, TowerRescueFujiText call PrintText - SetEvent EVENT_4CF - SetEvent EVENT_117 + SetEvent EVENT_RESCUED_MR_FUJI + SetEvent EVENT_RESCUED_MR_FUJI_2 ld a, HS_LAVENDER_HOUSE_1_MR_FUJI ld [wcc4d], a predef ShowObject diff --git a/scripts/rockethideout4.asm b/scripts/rockethideout4.asm index e6ba430b..3c312d4c 100755 --- a/scripts/rockethideout4.asm +++ b/scripts/rockethideout4.asm @@ -13,17 +13,16 @@ RocketHideout4Script_45473: ; 45473 (11:5473) bit 5, [hl] res 5, [hl] ret z - CheckEvent EVENT_6A5 + CheckEvent EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED jr nz, .asm_45496 - and $c - cp $c + CheckBothEventsSet EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0, EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2, 1 jr z, .asm_4548c ld a, $2d jr .asm_45498 .asm_4548c ld a, SFX_GO_INSIDE call PlaySound - SetEvent EVENT_6A5 + SetEvent EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED .asm_45496 ld a, $e .asm_45498 @@ -51,7 +50,7 @@ RocketHideout4Script3: ; 454b6 (11:54b6) call UpdateSprites ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_6A7 + SetEvent EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -117,7 +116,7 @@ RocketHideout4TrainerHeader3: ; 4552d (11:552d) RocketHideout4Text1: ; 4553a (11:553a) TX_ASM - CheckEvent EVENT_6A7 + CheckEvent EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI jp nz, .asm_545571 ld hl, RocketHideout4Text_4557a call PrintText @@ -209,7 +208,7 @@ RocketHideout4AfterBattleText4: ; 455cf (11:55cf) TX_ASM ld hl, RocketHideout4Text_455ec call PrintText - CheckAndSetEvent EVENT_6A6 + CheckAndSetEvent EVENT_ROCKET_DROPPED_LIFT_KEY jr nz, .asm_455e9 ld a, HS_ROCKET_HIDEOUT_4_ITEM_5 ld [wcc4d], a diff --git a/scripts/route1.asm b/scripts/route1.asm index d1e39c06..6c00e555 100755 --- a/scripts/route1.asm +++ b/scripts/route1.asm @@ -8,7 +8,7 @@ Route1TextPointers: ; 1cab2 (7:4ab2) Route1Text1: ; 1cab8 (7:4ab8) TX_ASM - CheckAndSetEvent EVENT_3C0 + CheckAndSetEvent EVENT_GOT_POTION_SAMPLE jr nz, .asm_1cada ld hl, Route1ViridianMartSampleText call PrintText diff --git a/scripts/route11gateupstairs.asm b/scripts/route11gateupstairs.asm index 7720b176..9bae1398 100755 --- a/scripts/route11gateupstairs.asm +++ b/scripts/route11gateupstairs.asm @@ -17,7 +17,7 @@ Route11GateUpstairsScriptEnd: ; 49469 (12:5469) Route11GateUpstairsText2: ; 4946c (12:546c) TX_ASM - CheckEvent EVENT_47F, 1 + CheckEvent EVENT_GOT_ITEMFINDER, 1 jr c, .asm_4949b ld a, 30 ; pokemon needed ld [$ffdb], a @@ -34,7 +34,7 @@ Route11GateUpstairsText2: ; 4946c (12:546c) ld a, [$ffdb] dec a jr nz, .asm_494a1 - SetEvent EVENT_47F + SetEvent EVENT_GOT_ITEMFINDER .asm_4949b ld hl, Route11GateUpstairsText_494a3 call PrintText diff --git a/scripts/route12gateupstairs.asm b/scripts/route12gateupstairs.asm index e1f8901f..f651d373 100755 --- a/scripts/route12gateupstairs.asm +++ b/scripts/route12gateupstairs.asm @@ -8,7 +8,7 @@ Route12GateUpstairsTextPointers: ; 49563 (12:5563) Route12GateUpstairsText1: ; 49569 (12:5569) TX_ASM - CheckEvent EVENT_480, 1 + CheckEvent EVENT_GOT_TM39, 1 jr c, .asm_0ad3c ld hl, TM39PreReceiveText call PrintText @@ -17,7 +17,7 @@ Route12GateUpstairsText1: ; 49569 (12:5569) jr nc, .BagFull ld hl, ReceivedTM39Text call PrintText - SetEvent EVENT_480 + SetEvent EVENT_GOT_TM39 jr .asm_4ba56 .BagFull ld hl, TM39NoRoomText diff --git a/scripts/route15gateupstairs.asm b/scripts/route15gateupstairs.asm index e3a3cf3b..cedabdc0 100755 --- a/scripts/route15gateupstairs.asm +++ b/scripts/route15gateupstairs.asm @@ -7,7 +7,7 @@ Route15GateUpstairsTextPointers: ; 4964d (12:564d) Route15GateUpstairsText1: ; 49651 (12:5651) TX_ASM - CheckEvent EVENT_4B0 + CheckEvent EVENT_GOT_EXP_ALL jr nz, .asm_49683 ld a, 50 ; pokemon needed ld [$ffdb], a @@ -23,7 +23,7 @@ Route15GateUpstairsText1: ; 49651 (12:5651) ld a, [$ffdb] cp $1 jr nz, .asm_49689 - SetEvent EVENT_4B0 + SetEvent EVENT_GOT_EXP_ALL .asm_49683 ld hl, Route15GateUpstairsText_4968c call PrintText diff --git a/scripts/route16house.asm b/scripts/route16house.asm index d01465cb..4a0ac0c3 100755 --- a/scripts/route16house.asm +++ b/scripts/route16house.asm @@ -7,7 +7,7 @@ Route16HouseTextPointers: ; 1e5fb (7:65fb) Route16HouseText1: ; 1e5ff (7:65ff) TX_ASM - CheckEvent EVENT_4CE + CheckEvent EVENT_GOT_HM02 ld hl, HM02ExplanationText jr nz, .asm_13616 ld hl, Route16HouseText3 @@ -15,7 +15,7 @@ Route16HouseText1: ; 1e5ff (7:65ff) ld bc, (HM_02 << 8) | 1 call GiveItem jr nc, .BagFull - SetEvent EVENT_4CE + SetEvent EVENT_GOT_HM02 ld hl, ReceivedHM02Text jr .asm_13616 .BagFull diff --git a/scripts/route20.asm b/scripts/route20.asm index f4690732..2ef51da9 100755 --- a/scripts/route20.asm +++ b/scripts/route20.asm @@ -1,5 +1,5 @@ Route20Script: ; 50ca9 (14:4ca9) - CheckAndResetEvent EVENT_500 + CheckAndResetEvent EVENT_IN_SEAFOAM_ISLANDS call nz, Route20Script_50cc6 call EnableAutoTextBoxDrawing ld hl, Route20TrainerHeader0 @@ -10,7 +10,7 @@ Route20Script: ; 50ca9 (14:4ca9) ret Route20Script_50cc6: ; 50cc6 (14:4cc6) - CheckBothEventsSet EVENT_9C8, EVENT_9C9 + CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE jr z, .asm_50cef ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_1 call Route20Script_50d0c @@ -36,7 +36,7 @@ Route20Script_50cc6: ; 50cc6 (14:4cc6) db $FF .asm_50cef - CheckBothEventsSet EVENT_9D0, EVENT_9D1 + CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE ret z ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_1 call Route20Script_50d0c diff --git a/scripts/route22.asm b/scripts/route22.asm index dec8afd6..73fe2f55 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -55,7 +55,7 @@ Route22RivalMovementData: ; 50efb (14:4efb) db $FF Route22Script0: ; 50f00 (14:4f00) - CheckEvent EVENT_527 + CheckEvent EVENT_ROUTE22_RIVAL_WANTS_FIGHT ret z ld hl, .Route22RivalBattleCoords call ArePlayerCoordsInArray @@ -68,9 +68,9 @@ Route22Script0: ; 50f00 (14:4f00) ld [wJoyIgnore], a ld a, PLAYER_DIR_LEFT ld [wPlayerMovingDirection], a - CheckEvent EVENT_520 + CheckEvent EVENT_1ST_ROUTE22_RIVAL_BATTLE jr nz, .firstRivalBattle - CheckEventReuseA EVENT_521 ; is this the rival at the end of the game? + CheckEventReuseA EVENT_2ND_ROUTE22_RIVAL_BATTLE ; is this the rival at the end of the game? jp nz, Route22Script_5104e ret @@ -163,7 +163,7 @@ Route22Script2: ; 50fb5 (14:4fb5) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_525 + SetEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -227,7 +227,7 @@ Route22Script3: ; 5102a (14:502a) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ResetEvents EVENT_520, EVENT_527 + ResetEvents EVENT_1ST_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_FIGHT ld a, $0 ld [W_ROUTE22CURSCRIPT], a ret @@ -322,7 +322,7 @@ Route22Script5: ; 510df (14:50df) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_526 + SetEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_FIGHT ld a, $2 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -372,7 +372,7 @@ Route22Script6: ; 51151 (14:5151) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ResetEvents EVENT_521, EVENT_527 + ResetEvents EVENT_2ND_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_FIGHT ld a, $7 ld [W_ROUTE22CURSCRIPT], a ret @@ -384,7 +384,7 @@ Route22TextPointers: ; 51175 (14:5175) Route22Text1: ; 5117b (14:517b) TX_ASM - CheckEvent EVENT_525 + CheckEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT jr z, .asm_5118b ld hl, Route22RivalAfterBattleText1 call PrintText @@ -397,7 +397,7 @@ Route22Text1: ; 5117b (14:517b) Route22Text2: ; 51194 (14:5194) TX_ASM - CheckEvent EVENT_526 + CheckEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_FIGHT jr z, .asm_511a4 ld hl, Route22RivalAfterBattleText2 call PrintText diff --git a/scripts/route23.asm b/scripts/route23.asm index e17b7d23..adc631d8 100755 --- a/scripts/route23.asm +++ b/scripts/route23.asm @@ -10,8 +10,8 @@ Route23Script_511e9: ; 511e9 (14:51e9) bit 6, [hl] res 6, [hl] ret z - ResetEvents EVENT_538, EVENT_53F - ResetEvents EVENT_660, EVENT_666 + ResetEvents EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2 + ResetEvents EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1, EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH2 ld a, HS_VICTORY_ROAD_3_BOULDER ld [wcc4d], a predef ShowObject @@ -29,7 +29,7 @@ Route23Script0: ; 51219 (14:5219) ld a, [W_YCOORD] ld b, a ld e, $0 - EventFlagBit c, EVENT_536 + 1, EVENT_530 + EventFlagBit c, EVENT_PASSED_EARTHBADGE_CHECK + 1, EVENT_PASSED_CASCADEBADGE_CHECK .asm_51224 ld a, [hli] cp $ff @@ -49,7 +49,7 @@ Route23Script0: ; 51219 (14:5219) ld a, c ld [wWhichBadge], a ld b, FLAG_TEST - EventFlagAddress hl, EVENT_530 + EventFlagAddress hl, EVENT_PASSED_CASCADEBADGE_CHECK predef FlagActionPredef ld a, c and a @@ -143,43 +143,43 @@ Route23TextPointers: ; 512f7 (14:52f7) Route23Text1: ; 51307 (14:5307) TX_ASM - EventFlagBit a, EVENT_536, EVENT_530 + EventFlagBit a, EVENT_PASSED_EARTHBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd Route23Text2: ; 51310 (14:5310) TX_ASM - EventFlagBit a, EVENT_535, EVENT_530 + EventFlagBit a, EVENT_PASSED_VOLCANOBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd Route23Text3: ; 51319 (14:5319) TX_ASM - EventFlagBit a, EVENT_534, EVENT_530 + EventFlagBit a, EVENT_PASSED_MARSHBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd Route23Text4: ; 51322 (14:5322) TX_ASM - EventFlagBit a, EVENT_533, EVENT_530 + EventFlagBit a, EVENT_PASSED_SOULBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd Route23Text5: ; 5132b (14:532b) TX_ASM - EventFlagBit a, EVENT_532, EVENT_530 + EventFlagBit a, EVENT_PASSED_RAINBOWBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd Route23Text6: ; 51334 (14:5334) TX_ASM - EventFlagBit a, EVENT_531, EVENT_530 + EventFlagBit a, EVENT_PASSED_THUNDERBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd Route23Text7: ; 5133d (14:533d) TX_ASM - EventFlagBit a, EVENT_530 + EventFlagBit a, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd @@ -207,7 +207,7 @@ Route23Script_51346: ; 51346 (14:5346) ld a, [wWhichBadge] ld c, a ld b, FLAG_SET - EventFlagAddress hl, EVENT_530 + EventFlagAddress hl, EVENT_PASSED_CASCADEBADGE_CHECK predef FlagActionPredef ld a, $2 ld [W_ROUTE23CURSCRIPT], a diff --git a/scripts/route24.asm b/scripts/route24.asm index c946159c..4e83a5cd 100755 --- a/scripts/route24.asm +++ b/scripts/route24.asm @@ -22,7 +22,7 @@ Route24ScriptPointers: ; 513cb (14:53cb) dw Route24Script4 Route24Script0: ; 513d5 (14:53d5) - CheckEvent EVENT_540 + CheckEvent EVENT_GOT_NUGGET jp nz, CheckFightingMapTrainers ld hl, CoordsData_5140e call ArePlayerCoordsInArray @@ -32,7 +32,7 @@ Route24Script0: ; 513d5 (14:53d5) ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID - CheckAndResetEvent EVENT_549 + CheckAndResetEvent EVENT_NUGGET_REWARD_AVAILABLE ret z ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a @@ -64,7 +64,7 @@ Route24Script3: ; 51422 (14:5422) call UpdateSprites ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_541 + SetEvent EVENT_BEAT_ROUTE24_ROCKET ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -144,15 +144,15 @@ Route24TrainerHeader6: ; 51497 (14:5497) Route24Text1: ; 514a4 (14:54a4) TX_ASM - ResetEvent EVENT_549 - CheckEvent EVENT_540 + ResetEvent EVENT_NUGGET_REWARD_AVAILABLE + CheckEvent EVENT_GOT_NUGGET jr nz, .asm_514f9 ld hl, Route24Text_51510 call PrintText ld bc, (NUGGET << 8) | 1 call GiveItem jr nc, .BagFull - SetEvent EVENT_540 + SetEvent EVENT_GOT_NUGGET ld hl, Route24Text_5151a call PrintText ld hl, Route24Text_51526 @@ -180,7 +180,7 @@ Route24Text1: ; 514a4 (14:54a4) .BagFull ld hl, Route24Text_51521 call PrintText - SetEvent EVENT_549 + SetEvent EVENT_NUGGET_REWARD_AVAILABLE jp TextScriptEnd Route24Text_51510: ; 51510 (14:5510) diff --git a/scripts/route25.asm b/scripts/route25.asm index 6bbb5e26..a123d74a 100755 --- a/scripts/route25.asm +++ b/scripts/route25.asm @@ -13,18 +13,18 @@ Route25Script_515e1: ; 515e1 (14:55e1) bit 6, [hl] res 6, [hl] ret z - CheckEventHL EVENT_55F + CheckEventHL EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING ret nz - CheckEventReuseHL EVENT_55D + CheckEventReuseHL EVENT_MET_BILL_2 jr nz, .asm_515ff - ResetEventReuseHL EVENT_55E + ResetEventReuseHL EVENT_BILL_SAID_USE_CELL_SEPARATOR ld a, HS_BILL_POKEMON ld [wcc4d], a predef_jump ShowObject .asm_515ff - CheckEventAfterBranchReuseHL EVENT_55C, EVENT_55D + CheckEventAfterBranchReuseHL EVENT_GOT_SS_TICKET, EVENT_MET_BILL_2 ret z - SetEventReuseHL EVENT_55F + SetEventReuseHL EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING ld a, HS_NUGGET_BRIDGE_GUY ld [wcc4d], a predef HideObject diff --git a/scripts/route2gate.asm b/scripts/route2gate.asm index 49c28e02..789482dc 100755 --- a/scripts/route2gate.asm +++ b/scripts/route2gate.asm @@ -7,7 +7,7 @@ Route2GateTextPointers: ; 5d5d7 (17:55d7) Route2GateText1: ; 5d5db (17:55db) TX_ASM - CheckEvent EVENT_3D8 + CheckEvent EVENT_GOT_HM05 jr nz, .asm_5d60d ld a, 10 ; pokemon needed ld [$ffdb], a @@ -23,7 +23,7 @@ Route2GateText1: ; 5d5db (17:55db) ld a, [$ffdb] cp $1 jr nz, .asm_5d613 - SetEvent EVENT_3D8 + SetEvent EVENT_GOT_HM05 .asm_5d60d ld hl, Route2GateText_5d616 call PrintText diff --git a/scripts/safarizonesecrethouse.asm b/scripts/safarizonesecrethouse.asm index 48992d94..6cf17b9d 100755 --- a/scripts/safarizonesecrethouse.asm +++ b/scripts/safarizonesecrethouse.asm @@ -6,7 +6,7 @@ SafariZoneSecretHouseTextPointers: ; 4a31a (12:631a) SafariZoneSecretHouseText1: ; 4a31c (12:631c) TX_ASM - CheckEvent EVENT_880 + CheckEvent EVENT_GOT_HM03 jr nz, .asm_20a9b ld hl, SafariZoneSecretHouseText_4a350 call PrintText @@ -15,7 +15,7 @@ SafariZoneSecretHouseText1: ; 4a31c (12:631c) jr nc, .BagFull ld hl, ReceivedHM03Text call PrintText - SetEvent EVENT_880 + SetEvent EVENT_GOT_HM03 jr .asm_8f1fc .BagFull ld hl, HM03NoRoomText diff --git a/scripts/saffronhouse2.asm b/scripts/saffronhouse2.asm index 68300183..f3ec4c99 100755 --- a/scripts/saffronhouse2.asm +++ b/scripts/saffronhouse2.asm @@ -6,7 +6,7 @@ SaffronHouse2TextPointers: ; 1de3f (7:5e3f) SaffronHouse2Text1: ; 1de41 (7:5e41) TX_ASM - CheckEvent EVENT_3B0 + CheckEvent EVENT_GOT_TM29 jr nz, .asm_9e72b ld hl, TM29PreReceiveText call PrintText @@ -15,7 +15,7 @@ SaffronHouse2Text1: ; 1de41 (7:5e41) jr nc, .BagFull ld hl, ReceivedTM29Text call PrintText - SetEvent EVENT_3B0 + SetEvent EVENT_GOT_TM29 jr .asm_fe4e1 .BagFull ld hl, TM29NoRoomText diff --git a/scripts/seafoamislands1.asm b/scripts/seafoamislands1.asm index 89972aca..542afe18 100755 --- a/scripts/seafoamislands1.asm +++ b/scripts/seafoamislands1.asm @@ -1,6 +1,6 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) call EnableAutoTextBoxDrawing - SetEvent EVENT_500 + SetEvent EVENT_IN_SEAFOAM_ISLANDS ld hl, wFlags_0xcd60 bit 7, [hl] res 7, [hl] @@ -8,18 +8,18 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) ld hl, Seafoam1HolesCoords call CheckBoulderCoords ret nc - EventFlagAddress hl, EVENT_50E + EventFlagAddress hl, EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE ld a, [wCoordIndex] cp $1 jr nz, .asm_44819 - SetEventReuseHL EVENT_50E + SetEventReuseHL EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_1 ld [wd07a], a jr .asm_44825 .asm_44819 - SetEventAfterBranchReuseHL EVENT_50F, EVENT_50E + SetEventAfterBranchReuseHL EVENT_SEAFOAM1_BOULDER2_DOWN_HOLE, EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_2 diff --git a/scripts/seafoamislands2.asm b/scripts/seafoamislands2.asm index c24ba601..bf81a467 100755 --- a/scripts/seafoamislands2.asm +++ b/scripts/seafoamislands2.asm @@ -7,18 +7,18 @@ SeafoamIslands2Script: ; 46315 (11:6315) ld hl, Seafoam2HolesCoords call CheckBoulderCoords ret nc - EventFlagAddress hl, EVENT_9C0 + EventFlagAddress hl, EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE ld a, [wCoordIndex] cp $1 jr nz, .asm_46340 - SetEventReuseHL EVENT_9C0 + SetEventReuseHL EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_1 ld [wd07a], a jr .asm_4634c .asm_46340 - SetEventAfterBranchReuseHL EVENT_9C1, EVENT_9C0 + SetEventAfterBranchReuseHL EVENT_SEAFOAM2_BOULDER2_DOWN_HOLE, EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_2_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_2 diff --git a/scripts/seafoamislands3.asm b/scripts/seafoamislands3.asm index f117c2a7..8f66a0ca 100755 --- a/scripts/seafoamislands3.asm +++ b/scripts/seafoamislands3.asm @@ -7,18 +7,18 @@ SeafoamIslands3Script: ; 46451 (11:6451) ld hl, Seafoam3HolesCoords call CheckBoulderCoords ret nc - EventFlagAddress hl, EVENT_9C8 + EventFlagAddress hl, EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE ld a, [wCoordIndex] cp $1 jr nz, .asm_4647c - SetEventReuseHL EVENT_9C8 + SetEventReuseHL EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_3 ld [wd07a], a jr .asm_46488 .asm_4647c - SetEventAfterBranchReuseHL EVENT_9C9, EVENT_9C8 + SetEventAfterBranchReuseHL EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_3_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_4 diff --git a/scripts/seafoamislands4.asm b/scripts/seafoamislands4.asm index 031f9d13..dc198123 100755 --- a/scripts/seafoamislands4.asm +++ b/scripts/seafoamislands4.asm @@ -7,18 +7,18 @@ SeafoamIslands4Script: ; 4658d (11:658d) ld hl, Seafoam4HolesCoords call CheckBoulderCoords ret nc - EventFlagAddress hl, EVENT_9D0 + EventFlagAddress hl, EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE ld a, [wCoordIndex] cp $1 jr nz, .asm_465b8 - SetEventReuseHL EVENT_9D0 + SetEventReuseHL EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_1 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_5_BOULDER_1 ld [wd07a], a jr .asm_465c4 .asm_465b8 - SetEventAfterBranchReuseHL EVENT_9D1, EVENT_9D0 + SetEventAfterBranchReuseHL EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE ld a, HS_SEAFOAM_ISLANDS_4_BOULDER_2 ld [wd079], a ld a, HS_SEAFOAM_ISLANDS_5_BOULDER_2 @@ -56,7 +56,7 @@ SeafoamIslands4ScriptPointers: ; 465fb (11:65fb) dw SeafoamIslands4Script3 SeafoamIslands4Script0: ; 46603 (11:6603) - CheckBothEventsSet EVENT_9C8, EVENT_9C9 + CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE ret z ld a, [W_YCOORD] cp $8 @@ -91,7 +91,7 @@ SeafoamIslands4Script1: ; 46639 (11:6639) ret SeafoamIslands4Script2: ; 46644 (11:6644) - CheckBothEventsSet EVENT_9C8, EVENT_9C9 + CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE ret z ld a, [W_XCOORD] cp $12 diff --git a/scripts/seafoamislands5.asm b/scripts/seafoamislands5.asm index 9324a187..eca361f3 100755 --- a/scripts/seafoamislands5.asm +++ b/scripts/seafoamislands5.asm @@ -27,7 +27,7 @@ SeafoamIslands5Script4: ; 467b7 (11:67b7) ret SeafoamIslands5Script0: ; 467c7 (11:67c7) - CheckBothEventsSet EVENT_9C8, EVENT_9C9 + CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE ret z ld hl, CoordsData_467fe call ArePlayerCoordsInArray @@ -70,7 +70,7 @@ SeafoamIslands5Script1: ; 46807 (11:6807) ret SeafoamIslands5Script2: ; 46816 (11:6816) - CheckBothEventsSet EVENT_9D0, EVENT_9D1 + CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE ld a, $0 jr z, .asm_46849 ld hl, CoordsData_4684d diff --git a/scripts/silphco1.asm b/scripts/silphco1.asm index 26c8c888..71b59d72 100755 --- a/scripts/silphco1.asm +++ b/scripts/silphco1.asm @@ -1,10 +1,10 @@ SilphCo1Script: ; 5d44e (17:544e) call EnableAutoTextBoxDrawing - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ret z - CheckAndSetEvent EVENT_397 + CheckAndSetEvent EVENT_SILPH_CO_RECEPTIONIST_AT_DESK ret nz - ld a, HS_SILPH_CO_1F_1 + ld a, HS_SILPH_CO_1F_RECEPTIONIST ld [wcc4d], a predef_jump ShowObject diff --git a/scripts/silphco10.asm b/scripts/silphco10.asm index 7c7bf785..326b0aeb 100755 --- a/scripts/silphco10.asm +++ b/scripts/silphco10.asm @@ -16,7 +16,7 @@ SilphCo10Script_5a14f: ; 5a14f (16:614f) ld hl, DataTable_5a173 call SilphCo2Script_59d43 call SilphCo10Text_5a176 - CheckEvent EVENT_778 + CheckEvent EVENT_SILPH_CO_10_UNLOCKED_DOOR ret nz ld a, $54 ld [wd09f], a @@ -30,7 +30,7 @@ SilphCo10Text_5a176: ; 5a176 (16:6176) ld a, [$ffe0] and a ret z - SetEvent EVENT_778 + SetEvent EVENT_SILPH_CO_10_UNLOCKED_DOOR ret SilphCo10ScriptPointers: ; 5a180 (16:6180) @@ -81,7 +81,7 @@ SilphCo10Text2: ; 5a1b5 (16:61b5) SilphCo10Text3: ; 5a1bf (16:61bf) TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SilphCo10Text_5a1d8 jr nz, .asm_cf85f ld hl, SilphCo10Text_5a1d3 diff --git a/scripts/silphco11.asm b/scripts/silphco11.asm index b855e6d0..8f37b57f 100755 --- a/scripts/silphco11.asm +++ b/scripts/silphco11.asm @@ -16,7 +16,7 @@ SilphCo11Script_62110: ; 62110 (18:6110) ld hl, DataTable_62134 call SilphCo11Script_62137 call SilphCo11Script_62163 - CheckEvent EVENT_788 + CheckEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR ret nz ld a, $20 ld [wd09f], a @@ -66,7 +66,7 @@ SilphCo11Script_62163: ; 62163 (18:6163) ld a, [$ffe0] and a ret z - SetEvent EVENT_788 + SetEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR ret SilphCo11Script_6216d: ; 6216d (18:616d) @@ -162,7 +162,7 @@ SilphCo11ScriptPointers: ; 621cf (18:61cf) dw SilphCo11Script5 SilphCo11Script0: ; 621db (18:61db) - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ret nz ld hl, CoordsData_62211 call ArePlayerCoordsInArray @@ -228,7 +228,7 @@ SilphCo11Script5: ; 62227 (18:6227) call UpdateSprites call Delay3 call GBFadeInFromBlack - SetEvent EVENT_78F + SetEvent EVENT_BEAT_SILPH_CO_GIOVANNI xor a ld [wJoyIgnore], a jp SilphCo11Script_621c8 @@ -302,7 +302,7 @@ SilphCo11TrainerHeader1: ; 622cf (18:62cf) SilphCo11Text1: ; 622dc (18:62dc) TX_ASM - CheckEvent EVENT_78D + CheckEvent EVENT_GOT_MASTER_BALL jp nz, .asm_62308 ld hl, SilphCoPresidentText call PrintText @@ -311,7 +311,7 @@ SilphCo11Text1: ; 622dc (18:62dc) jr nc, .BagFull ld hl, ReceivedSilphCoMasterBallText call PrintText - SetEvent EVENT_78D + SetEvent EVENT_GOT_MASTER_BALL jr .asm_6230e .BagFull ld hl, SilphCoMasterBallNoRoomText diff --git a/scripts/silphco2.asm b/scripts/silphco2.asm index eb6b1b8e..a8d0fa56 100755 --- a/scripts/silphco2.asm +++ b/scripts/silphco2.asm @@ -16,7 +16,7 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07) ld hl, DataTable_59d3e call SilphCo2Script_59d43 call SilphCo2Script_59d6f - CheckEvent EVENT_6FD + CheckEvent EVENT_SILPH_CO_2_UNLOCKED_DOOR1 jr nz, .asm_59d2e push af ld a, $54 @@ -25,7 +25,7 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07) predef ReplaceTileBlock pop af .asm_59d2e - bit 6, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_2_UNLOCKED_DOOR2, EVENT_SILPH_CO_2_UNLOCKED_DOOR1 ret nz ld a, $54 ld [wd09f], a @@ -72,16 +72,16 @@ SilphCo2Script_59d43: ; 59d43 (16:5d43) ret SilphCo2Script_59d6f: ; 59d6f (16:5d6f) - EventFlagAddress hl, EVENT_6FD + EventFlagAddress hl, EVENT_SILPH_CO_2_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next - SetEventReuseHL EVENT_6FD + SetEventReuseHL EVENT_SILPH_CO_2_UNLOCKED_DOOR1 ret .next - SetEventAfterBranchReuseHL EVENT_6FE, EVENT_6FD + SetEventAfterBranchReuseHL EVENT_SILPH_CO_2_UNLOCKED_DOOR2, EVENT_SILPH_CO_2_UNLOCKED_DOOR1 ret SilphCo2ScriptPointers: ; 59d80 (16:5d80) @@ -137,7 +137,7 @@ SilphCo2TrainerHeader3: ; 59db4 (16:5db4) SilphCo2Text1: ; 59dc1 (16:5dc1) TX_ASM - CheckEvent EVENT_6FF + CheckEvent EVENT_GOT_TM36 jr nz, .asm_59de4 ld hl, SilphCo2Text_59ded call PrintText @@ -145,7 +145,7 @@ SilphCo2Text1: ; 59dc1 (16:5dc1) call GiveItem ld hl, TM36NoRoomText jr nc, .asm_59de7 - SetEvent EVENT_6FF + SetEvent EVENT_GOT_TM36 ld hl, ReceivedTM36Text jr .asm_59de7 .asm_59de4 diff --git a/scripts/silphco3.asm b/scripts/silphco3.asm index 0cb54726..b55cc5eb 100755 --- a/scripts/silphco3.asm +++ b/scripts/silphco3.asm @@ -16,7 +16,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) ld hl, DataTable_59fa8 call SilphCo2Script_59d43 call SilphCo3Script_59fad - CheckEvent EVENT_708 + CheckEvent EVENT_SILPH_CO_3_UNLOCKED_DOOR1 jr nz, .asm_59f98 push af ld a, $5f @@ -25,7 +25,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) predef ReplaceTileBlock pop af .asm_59f98 - bit 1, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_3_UNLOCKED_DOOR2, EVENT_SILPH_CO_3_UNLOCKED_DOOR1 ret nz ld a, $5f ld [wd09f], a @@ -36,16 +36,16 @@ DataTable_59fa8: ; 59fa8 (16:5fa8) db $04,$04,$04,$08,$FF SilphCo3Script_59fad: ; 59fad (16:5fad) - EventFlagAddress hl, EVENT_708 + EventFlagAddress hl, EVENT_SILPH_CO_3_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next - SetEventReuseHL EVENT_708 + SetEventReuseHL EVENT_SILPH_CO_3_UNLOCKED_DOOR1 ret .next - SetEventAfterBranchReuseHL EVENT_709, EVENT_708 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_3_UNLOCKED_DOOR2, EVENT_SILPH_CO_3_UNLOCKED_DOOR1 ret SilphCo3ScriptPointers: ; 59fbe (16:5fbe) @@ -82,7 +82,7 @@ SilphCo3TrainerHeader1: ; 59fd8 (16:5fd8) SilphCo3Text1: ; 59fe5 (16:5fe5) TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SilphCo3Text_59ffe jr nz, .asm_59fee ld hl, SilphCo3Text_59ff9 diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index aff77e4a..815170ff 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -16,7 +16,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) ld hl, SilphCo4Data19d58 call SilphCo4Script_19d5d call SilphCo4Script_19d89 - CheckEvent EVENT_718 + CheckEvent EVENT_SILPH_CO_4_UNLOCKED_DOOR1 jr nz, .asm_19d48 push af ld a, $54 @@ -25,7 +25,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) predef ReplaceTileBlock pop af .asm_19d48 - bit 1, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret nz ld a, $54 ld [wd09f], a @@ -72,16 +72,16 @@ SilphCo4Script_19d5d: ; 19d5d (6:5d5d) ret SilphCo4Script_19d89: ; 19d89 (6:5d89) - EventFlagAddress hl, EVENT_718 + EventFlagAddress hl, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next - SetEventReuseHL EVENT_718 + SetEventReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret .next - SetEventAfterBranchReuseHL EVENT_719, EVENT_718 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret SilphCo4ScriptPointers: ; 19d9a (6:5d9a) diff --git a/scripts/silphco5.asm b/scripts/silphco5.asm index cd220b3e..ecc57537 100755 --- a/scripts/silphco5.asm +++ b/scripts/silphco5.asm @@ -16,7 +16,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) ld hl, SilphCo5Coords call SilphCo4Script_19d5d call SilphCo5Script_19f9e - CheckEvent EVENT_728 + CheckEvent EVENT_SILPH_CO_5_UNLOCKED_DOOR1 jr nz, .asm_19f74 push af ld a, $5f @@ -25,7 +25,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) predef ReplaceTileBlock pop af .asm_19f74 - bit 1, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_5_UNLOCKED_DOOR2, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 jr nz, .asm_19f87 push af ld a, $5f @@ -34,7 +34,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) predef ReplaceTileBlock pop af .asm_19f87 - bit 2, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_5_UNLOCKED_DOOR3, EVENT_SILPH_CO_5_UNLOCKED_DOOR2 ret nz ld a, $5f ld [wd09f], a @@ -45,21 +45,21 @@ SilphCo5Coords: ; 19f97 (6:5f97) db $02, $03, $06, $03, $05, $07, $ff SilphCo5Script_19f9e: ; 19f9e (6:5f9e) - EventFlagAddress hl, EVENT_728 + EventFlagAddress hl, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next1 - SetEventReuseHL EVENT_728 + SetEventReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR1 ret .next1 cp $2 jr nz, .next2 - SetEventAfterBranchReuseHL EVENT_729, EVENT_728 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR2, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 ret .next2 - SetEventAfterBranchReuseHL EVENT_72A, EVENT_728 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR3, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 ret SilphCo5ScriptPointers: ; 19fb6 (6:5fb6) diff --git a/scripts/silphco6.asm b/scripts/silphco6.asm index ca52d05c..a84f0dc4 100755 --- a/scripts/silphco6.asm +++ b/scripts/silphco6.asm @@ -16,7 +16,7 @@ SilphCo6Script_1a1bf: ; 1a1bf (6:61bf) ld hl, SilphCo6Coords1 call SilphCo4Script_19d5d call SilphCo6Script_1a1e6 - CheckEvent EVENT_73F + CheckEvent EVENT_SILPH_CO_6_UNLOCKED_DOOR ret nz ld a, $5f ld [wd09f], a @@ -31,7 +31,7 @@ SilphCo6Script_1a1e6: ; 1a1e6 (6:61e6) ld a, [$ffe0] and a ret z - SetEvent EVENT_73F + SetEvent EVENT_SILPH_CO_6_UNLOCKED_DOOR ret SilphCo6ScriptPointers: ; 1a1f0 (6:61f0) @@ -82,7 +82,7 @@ SilphCo6TrainerHeader3: ; 1a222 (6:6222) db $ff SilphCo6Script_1a22f: ; 1a22f (6:622f) - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .asm_1a238 jr .asm_1a23a .asm_1a238 diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm index 64c79c3a..26d9e62f 100755 --- a/scripts/silphco7.asm +++ b/scripts/silphco7.asm @@ -16,7 +16,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) ld hl, DataTable_51bc1 call SilphCo7Text_51bc8 call SilphCo7Text_51bf4 - CheckEvent EVENT_74C + CheckEvent EVENT_SILPH_CO_7_UNLOCKED_DOOR1 jr nz, .asm_51b9e push af ld a, $54 @@ -25,7 +25,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) predef ReplaceTileBlock pop af .asm_51b9e - bit 5, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_7_UNLOCKED_DOOR2, EVENT_SILPH_CO_7_UNLOCKED_DOOR1 jr nz, .asm_51bb1 push af ld a, $54 @@ -34,7 +34,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) predef ReplaceTileBlock pop af .asm_51bb1 - bit 6, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_7_UNLOCKED_DOOR3, EVENT_SILPH_CO_7_UNLOCKED_DOOR2 ret nz ld a, $54 ld [wd09f], a @@ -81,21 +81,21 @@ SilphCo7Text_51bc8: ; 51bc8 (14:5bc8) ret SilphCo7Text_51bf4: ; 51bf4 (14:5bf4) - EventFlagAddress hl, EVENT_74C + EventFlagAddress hl, EVENT_SILPH_CO_7_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next1 - SetEventReuseHL EVENT_74C + SetEventReuseHL EVENT_SILPH_CO_7_UNLOCKED_DOOR1 ret .next1 cp $2 jr nz, .next2 - SetEventAfterBranchReuseHL EVENT_74D, EVENT_74C + SetEventAfterBranchReuseHL EVENT_SILPH_CO_7_UNLOCKED_DOOR2, EVENT_SILPH_CO_7_UNLOCKED_DOOR1 ret .next2 - SetEventAfterBranchReuseHL EVENT_74E, EVENT_74C + SetEventAfterBranchReuseHL EVENT_SILPH_CO_7_UNLOCKED_DOOR3, EVENT_SILPH_CO_7_UNLOCKED_DOOR1 ret SilphCo7Text_51c0c: ; 51c0c (14:5c0c) @@ -116,7 +116,7 @@ SilphCo7ScriptPointers: ; 51c17 (14:5c17) dw SilphCo7Script5 SilphCo7Script0: ; 51c23 (14:5c23) - CheckEvent EVENT_740 + CheckEvent EVENT_BEAT_SILPH_CO_RIVAL jp nz, CheckFightingMapTrainers ld hl, CoordsData_51c78 call ArePlayerCoordsInArray @@ -205,7 +205,7 @@ SilphCo7Script4: ; 51cc8 (14:5cc8) jp z, SilphCo7Text_51c0c ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_740 + SetEvent EVENT_BEAT_SILPH_CO_RIVAL ld a, PLAYER_DIR_DOWN ld [wPlayerMovingDirection], a ld a, $9 @@ -321,7 +321,7 @@ SilphCo7Text1: ld a, [wd72e] bit 0, a ; got lapras? jr z, .givelapras - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .savedsilph ld hl, .LaprasGuyText call PrintText @@ -365,7 +365,7 @@ SilphCo7Text1: SilphCo7Text2: TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .savedsilph ld hl, .rockettext call PrintText @@ -386,7 +386,7 @@ SilphCo7Text2: SilphCo7Text3: TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .savedsilph ld hl, .rockettext call PrintText @@ -407,7 +407,7 @@ SilphCo7Text3: SilphCo7Text4: TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .savedsilph ld hl, .rockettext call PrintText diff --git a/scripts/silphco8.asm b/scripts/silphco8.asm index ec54ea8e..26a89355 100755 --- a/scripts/silphco8.asm +++ b/scripts/silphco8.asm @@ -16,7 +16,7 @@ SilphCo8Script_5651a: ; 5651a (15:651a) ld hl, DataTable_5653e call SilphCo8Script_56541 call SilphCo8Script_5656d - CheckEvent EVENT_758 + CheckEvent EVENT_SILPH_CO_8_UNLOCKED_DOOR ret nz ld a, $5f ld [wd09f], a @@ -66,7 +66,7 @@ SilphCo8Script_5656d: ; 5656d (15:656d) ld a, [$ffe0] and a ret z - SetEvent EVENT_758 + SetEvent EVENT_SILPH_CO_8_UNLOCKED_DOOR ret SilphCo8ScriptPointers: ; 56577 (15:6577) @@ -112,7 +112,7 @@ SilphCo8TrainerHeader2: ; 5659d (15:659d) SilphCo8Text1: ; 565aa (15:65aa) TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SilphCo8Text_565c3 jr nz, .asm_565b8 ld hl, SilphCo8Text_565be diff --git a/scripts/silphco9.asm b/scripts/silphco9.asm index 2c41e019..8960c290 100755 --- a/scripts/silphco9.asm +++ b/scripts/silphco9.asm @@ -16,7 +16,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) ld hl, DataTable_5d82e call SilphCo9Script_5d837 call SilphCo9Script_5d863 - CheckEvent EVENT_768 + CheckEvent EVENT_SILPH_CO_9_UNLOCKED_DOOR1 jr nz, .asm_5d7f8 push af ld a, $5f @@ -25,7 +25,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) predef ReplaceTileBlock pop af .asm_5d7f8 - bit 1, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR2, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 jr nz, .asm_5d80b push af ld a, $54 @@ -34,7 +34,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) predef ReplaceTileBlock pop af .asm_5d80b - bit 2, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR3, EVENT_SILPH_CO_9_UNLOCKED_DOOR2 jr nz, .asm_5d81e push af ld a, $54 @@ -43,7 +43,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) predef ReplaceTileBlock pop af .asm_5d81e - bit 3, a + CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR4, EVENT_SILPH_CO_9_UNLOCKED_DOOR3 ret nz ld a, $5f ld [wd09f], a @@ -90,28 +90,28 @@ SilphCo9Script_5d837: ; 5d837 (17:5837) ret SilphCo9Script_5d863: ; 5d863 (17:5863) - EventFlagAddress hl, EVENT_768 + EventFlagAddress hl, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next1 - SetEventReuseHL EVENT_768 + SetEventReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ret .next1 cp $2 jr nz, .next2 - SetEventAfterBranchReuseHL EVENT_769, EVENT_768 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR2, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ret .next2 cp $3 jr nz, .next3 - SetEventAfterBranchReuseHL EVENT_76A, EVENT_768 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR3, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ret .next3 cp $4 ret nz - SetEventAfterBranchReuseHL EVENT_76B, EVENT_768 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR4, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ret SilphCo9ScriptPointers: ; 5d885 (17:5885) @@ -157,7 +157,7 @@ SilphCo9TrainerHeader2: ; 5d8ab (17:58ab) SilphCo9Text1: ; 5d8b8 (17:58b8) TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .asm_5d8dc ld hl, SilphCo9Text_5d8e5 call PrintText diff --git a/scripts/ssanne7.asm b/scripts/ssanne7.asm index a47cc069..a445ad46 100755 --- a/scripts/ssanne7.asm +++ b/scripts/ssanne7.asm @@ -3,7 +3,7 @@ SSAnne7Script: ; 61895 (18:5895) jp EnableAutoTextBoxDrawing SSAnne7Script_6189b: ; 6189b (18:589b) - CheckEvent EVENT_5E1 + CheckEvent EVENT_RUBBED_CAPTAINS_BACK ret nz ld hl, wd72d set 5, [hl] @@ -16,7 +16,7 @@ SSAnne7TextPointers: ; 618a7 (18:58a7) SSAnne7Text1: ; 618ad (18:58ad) TX_ASM - CheckEvent EVENT_5E0 + CheckEvent EVENT_GOT_HM01 jr nz, .asm_797c4 ld hl, SSAnne7RubText call PrintText @@ -27,7 +27,7 @@ SSAnne7Text1: ; 618ad (18:58ad) jr nc, .BagFull ld hl, ReceivedHM01Text call PrintText - SetEvent EVENT_5E0 + SetEvent EVENT_GOT_HM01 jr .asm_0faf5 .BagFull ld hl, HM01NoRoomText @@ -62,7 +62,7 @@ SSAnne7RubText: ; 618ec (18:58ec) cp MUSIC_PKMN_HEALED jr z, .asm_61910 call PlayDefaultMusic - SetEvent EVENT_5E1 + SetEvent EVENT_RUBBED_CAPTAINS_BACK ld hl, wd72d res 5, [hl] jp TextScriptEnd diff --git a/scripts/vermilioncity.asm b/scripts/vermilioncity.asm index 0d6ccbee..7448e8f9 100755 --- a/scripts/vermilioncity.asm +++ b/scripts/vermilioncity.asm @@ -23,8 +23,8 @@ VermilionCityScript_197c0: ; 197c0 (6:57c0) VermilionCityScript_197cb: ; 197cb (6:57cb) CheckEventHL EVENT_SS_ANNE_LEFT ret z - CheckEventReuseHL EVENT_5E3 - SetEventReuseHL EVENT_5E3 + CheckEventReuseHL EVENT_WALKED_PAST_GUARD_AFTER_SS_ANNE_LEFT + SetEventReuseHL EVENT_WALKED_PAST_GUARD_AFTER_SS_ANNE_LEFT ret nz ld a, $2 ld [W_VERMILIONCITYCURSCRIPT], a diff --git a/scripts/vermiliondock.asm b/scripts/vermiliondock.asm index 20288102..a65b3603 100755 --- a/scripts/vermiliondock.asm +++ b/scripts/vermiliondock.asm @@ -1,20 +1,20 @@ VermilionDockScript: ; 1db52 (7:5b52) call EnableAutoTextBoxDrawing - CheckEventHL EVENT_5E4 + CheckEventHL EVENT_STARTED_WALKING_OUT_OF_DOCK jr nz, .asm_1db8d - CheckEventReuseHL EVENT_5E0 + CheckEventReuseHL EVENT_GOT_HM01 ret z ld a, [wDestinationWarpID] cp $1 ret nz CheckEventReuseHL EVENT_SS_ANNE_LEFT jp z, VermilionDock_1db9b - SetEventReuseHL EVENT_5E4 + SetEventReuseHL EVENT_STARTED_WALKING_OUT_OF_DOCK call Delay3 ld hl, wd730 set 7, [hl] ld hl, wSimulatedJoypadStatesEnd - ld a, $40 + ld a, D_UP ld [hli], a ld [hli], a ld [hl], a @@ -27,13 +27,13 @@ VermilionDockScript: ; 1db52 (7:5b52) ld [wJoyIgnore], a ret .asm_1db8d - CheckEventAfterBranchReuseHL EVENT_5E5, EVENT_5E4 + CheckEventAfterBranchReuseHL EVENT_WALKED_OUT_OF_DOCK, EVENT_STARTED_WALKING_OUT_OF_DOCK ret nz ld a, [wSimulatedJoypadStatesIndex] and a ret nz ld [wJoyIgnore], a - SetEventReuseHL EVENT_5E5 + SetEventReuseHL EVENT_WALKED_OUT_OF_DOCK ret VermilionDock_1db9b: ; 1db9b (7:5b9b) diff --git a/scripts/victoryroad1.asm b/scripts/victoryroad1.asm index e8b90e05..91e20ad3 100755 --- a/scripts/victoryroad1.asm +++ b/scripts/victoryroad1.asm @@ -11,7 +11,7 @@ VictoryRoad1Script: ; 5da0a (17:5a0a) ld [W_VICTORYROAD1CURSCRIPT], a ret .next - CheckEvent EVENT_917 + CheckEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH ret z ld a, $1d ld [wd09f], a @@ -24,14 +24,14 @@ VictoryRoad1ScriptPointers: ; 5da3a (17:5a3a) dw EndTrainerBattle VictoryRoad1Script0: ; 5da40 (17:5a40) - CheckEvent EVENT_917 + CheckEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH jp nz, CheckFightingMapTrainers ld hl, CoordsData_5da5c call CheckBoulderCoords jp nc, CheckFightingMapTrainers ld hl, wd126 set 5, [hl] - SetEvent EVENT_917 + SetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH ret CoordsData_5da5c: ; 5da5c (17:5a5c) diff --git a/scripts/victoryroad2.asm b/scripts/victoryroad2.asm index 46755c46..b7aa40b5 100755 --- a/scripts/victoryroad2.asm +++ b/scripts/victoryroad2.asm @@ -16,10 +16,10 @@ VictoryRoad2Script: ; 5179d (14:579d) ret VictoryRoad2Script_517c4: ; 517c4 (14:57c4) - ResetEvent EVENT_917 + ResetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH VictoryRoad2Script_517c9: ; 517c9 (14:57c9) - CheckEvent EVENT_538 + CheckEvent EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 jr z, .asm_517da push af ld a, $15 @@ -46,17 +46,17 @@ VictoryRoad2Script0: ; 517f1 (14:57f1) ld hl, CoordsData_51816 call CheckBoulderCoords jp nc, CheckFightingMapTrainers - EventFlagAddress hl, EVENT_538 + EventFlagAddress hl, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 ld a, [wCoordIndex] cp $2 jr z, .asm_5180b - CheckEventReuseHL EVENT_538 - SetEventReuseHL EVENT_538 + CheckEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 + SetEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 ret nz jr .asm_51810 .asm_5180b - CheckEventAfterBranchReuseHL EVENT_53F, EVENT_538 - SetEventReuseHL EVENT_53F + CheckEventAfterBranchReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 + SetEventReuseHL EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2 ret nz .asm_51810 ld hl, wd126 diff --git a/scripts/victoryroad3.asm b/scripts/victoryroad3.asm index bbb64272..2984e4ae 100755 --- a/scripts/victoryroad3.asm +++ b/scripts/victoryroad3.asm @@ -13,7 +13,7 @@ VictoryRoad3Script_44996: ; 44996 (11:4996) bit 5, [hl] res 5, [hl] ret z - CheckEventHL EVENT_660 + CheckEventHL EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1 ret z ld a, $1d ld [wd09f], a @@ -38,10 +38,10 @@ VictoryRoad3Script0: ; 449b7 (11:49b7) jr nz, .asm_449dc ld hl, wd126 set 5, [hl] - SetEvent EVENT_660 + SetEvent EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1 ret .asm_449dc - CheckAndSetEvent EVENT_666 + CheckAndSetEvent EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH2 jr nz, .asm_449fe ld a, HS_VICTORY_ROAD_3_BOULDER ld [wcc4d], a diff --git a/scripts/viridiancity.asm b/scripts/viridiancity.asm index 2d55cc44..7cdf5ad8 100755 --- a/scripts/viridiancity.asm +++ b/scripts/viridiancity.asm @@ -15,12 +15,12 @@ ViridianCityScript0: ; 19005 (6:5005) jp ViridianCityScript_1903d ViridianCityScript_1900b: ; 1900b (6:500b) - CheckEvent EVENT_028 + CheckEvent EVENT_VIRIDIAN_GYM_OPEN ret nz ld a, [W_OBTAINEDBADGES] cp %01111111 jr nz, .asm_1901e - SetEvent EVENT_028 + SetEvent EVENT_VIRIDIAN_GYM_OPEN ret .asm_1901e ld a, [W_YCOORD] @@ -231,7 +231,7 @@ ViridianCityText_19191: ; 19191 (6:5191) ViridianCityText6: ; 19196 (6:5196) TX_ASM - CheckEvent EVENT_029 + CheckEvent EVENT_GOT_TM42 jr nz, .asm_4e5a0 ld hl, ViridianCityText_191ca call PrintText @@ -240,7 +240,7 @@ ViridianCityText6: ; 19196 (6:5196) jr nc, .BagFull ld hl, ReceivedTM42Text call PrintText - SetEvent EVENT_029 + SetEvent EVENT_GOT_TM42 jr .asm_3c73c .BagFull ld hl, TM42NoRoomText diff --git a/scripts/viridiangym.asm b/scripts/viridiangym.asm index 1dd736cf..2124d965 100755 --- a/scripts/viridiangym.asm +++ b/scripts/viridiangym.asm @@ -165,7 +165,7 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) ld a, HS_ROUTE_22_RIVAL_2 ld [wcc4d], a predef ShowObject - SetEvents EVENT_521, EVENT_527 + SetEvents EVENT_2ND_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_FIGHT jp ViridianGymScript_748d6 ViridianGymTextPointers: ; 749ec (1d:49ec) diff --git a/scripts/viridianmart.asm b/scripts/viridianmart.asm index 7008ba5b..986ac8f1 100755 --- a/scripts/viridianmart.asm +++ b/scripts/viridianmart.asm @@ -6,7 +6,7 @@ ViridianMartScript: ; 1d46e (7:546e) jp CallFunctionInTable ViridianMartScript_1d47d: ; 1d47d (7:547d) - CheckEvent EVENT_038 + CheckEvent EVENT_OAK_GOT_PARCEL jr nz, .asm_1d489 ld hl, ViridianMartTextPointers jr .asm_1d48c @@ -54,7 +54,7 @@ ViridianMartScript1: ; 1d4c0 (7:54c0) call DisplayTextID ld bc, (OAKS_PARCEL << 8) + 1 call GiveItem - SetEvent EVENT_039 + SetEvent EVENT_GOT_OAKS_PARCEL ld a, $2 ld [W_VIRIDIANMARKETCURSCRIPT], a ; fallthrough -- cgit v1.2.3 From 5ce58a048cecba5435d74b14652c58004d3f95b1 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 21 Jul 2015 10:49:53 -0700 Subject: comments for event constants --- constants/event_constants.asm | 5124 ++++++++++++++++++------------------- constants/hide_show_constants.asm | 2 +- 2 files changed, 2563 insertions(+), 2563 deletions(-) diff --git a/constants/event_constants.asm b/constants/event_constants.asm index c5ca0b39..1eb68941 100755 --- a/constants/event_constants.asm +++ b/constants/event_constants.asm @@ -1,2562 +1,2562 @@ -const_value = 0 - - const EVENT_FOLLOWED_OAK_INTO_LAB - const EVENT_001 - const EVENT_002 - const EVENT_003 - const EVENT_004 - const EVENT_005 - const EVENT_PALLET_AFTER_GETTING_POKEBALLS - const EVENT_007 - const EVENT_008 - const EVENT_009 - const EVENT_00A - const EVENT_00B - const EVENT_00C - const EVENT_00D - const EVENT_00E - const EVENT_00F - const EVENT_010 - const EVENT_011 - const EVENT_012 - const EVENT_013 - const EVENT_014 - const EVENT_015 - const EVENT_016 - const EVENT_017 - const EVENT_GOT_TOWN_MAP - const EVENT_ENTERED_BLUES_HOUSE - const EVENT_DAISY_WALKING - const EVENT_01B - const EVENT_01C - const EVENT_01D - const EVENT_01E - const EVENT_01F - const EVENT_FOLLOWED_OAK_INTO_LAB_2 - const EVENT_OAK_ASKED_TO_CHOOSE_MON - const EVENT_GOT_STARTER - const EVENT_BATTLED_RIVAL_IN_OAKS_LAB - const EVENT_GOT_POKEBALLS_FROM_OAK - const EVENT_GOT_POKEDEX - const EVENT_PALLET_AFTER_GETTING_POKEBALLS_2 - const EVENT_OAK_APPEARED_IN_PALLET - const EVENT_VIRIDIAN_GYM_OPEN - const EVENT_GOT_TM42 - const EVENT_02A - const EVENT_02B - const EVENT_02C - const EVENT_02D - const EVENT_02E - const EVENT_02F - const EVENT_030 - const EVENT_031 - const EVENT_032 - const EVENT_033 - const EVENT_034 - const EVENT_035 - const EVENT_036 - const EVENT_037 - const EVENT_OAK_GOT_PARCEL - const EVENT_GOT_OAKS_PARCEL - const EVENT_03A - const EVENT_03B - const EVENT_03C - const EVENT_03D - const EVENT_03E - const EVENT_03F - const EVENT_040 - const EVENT_041 - const EVENT_042 - const EVENT_043 - const EVENT_044 - const EVENT_045 - const EVENT_046 - const EVENT_047 - const EVENT_048 - const EVENT_049 - const EVENT_04A - const EVENT_04B - const EVENT_04C - const EVENT_04D - const EVENT_04E - const EVENT_04F - const EVENT_GOT_TM27 - const EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI - const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0 - const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1 - const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2 - const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3 - const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4 - const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5 - const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6 - const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7 - const EVENT_05A - const EVENT_05B - const EVENT_05C - const EVENT_05D - const EVENT_05E - const EVENT_05F - const EVENT_060 - const EVENT_061 - const EVENT_062 - const EVENT_063 - const EVENT_064 - const EVENT_065 - const EVENT_066 - const EVENT_067 - const EVENT_BOUGHT_MUSEUM_TICKET - const EVENT_GOT_OLD_AMBER - const EVENT_06A - const EVENT_06B - const EVENT_06C - const EVENT_06D - const EVENT_06E - const EVENT_06F - const EVENT_070 - const EVENT_071 - const EVENT_BEAT_PEWTER_GYM_TRAINER_0 - const EVENT_073 - const EVENT_074 - const EVENT_075 - const EVENT_GOT_TM34 - const EVENT_BEAT_BROCK - const EVENT_078 - const EVENT_079 - const EVENT_07A - const EVENT_07B - const EVENT_07C - const EVENT_07D - const EVENT_07E - const EVENT_07F - const EVENT_080 - const EVENT_081 - const EVENT_082 - const EVENT_083 - const EVENT_084 - const EVENT_085 - const EVENT_086 - const EVENT_087 - const EVENT_088 - const EVENT_089 - const EVENT_08A - const EVENT_08B - const EVENT_08C - const EVENT_08D - const EVENT_08E - const EVENT_08F - const EVENT_090 - const EVENT_091 - const EVENT_092 - const EVENT_093 - const EVENT_094 - const EVENT_095 - const EVENT_096 - const EVENT_097 - const EVENT_BEAT_CERULEAN_RIVAL - const EVENT_099 - const EVENT_09A - const EVENT_09B - const EVENT_09C - const EVENT_09D - const EVENT_09E - const EVENT_09F - const EVENT_0A0 - const EVENT_0A1 - const EVENT_0A2 - const EVENT_0A3 - const EVENT_0A4 - const EVENT_0A5 - const EVENT_0A6 - const EVENT_BEAT_CERULEAN_ROCKET_THIEF - const EVENT_0A8 - const EVENT_0A9 - const EVENT_0AA - const EVENT_0AB - const EVENT_0AC - const EVENT_0AD - const EVENT_0AE - const EVENT_0AF - const EVENT_0B0 - const EVENT_0B1 - const EVENT_0B2 - const EVENT_0B3 - const EVENT_0B4 - const EVENT_0B5 - const EVENT_0B6 - const EVENT_0B7 - const EVENT_0B8 - const EVENT_0B9 - const EVENT_BEAT_CERULEAN_GYM_TRAINER_0 - const EVENT_BEAT_CERULEAN_GYM_TRAINER_1 - const EVENT_0BC - const EVENT_0BD - const EVENT_GOT_TM11 - const EVENT_BEAT_MISTY - const EVENT_GOT_BICYCLE - const EVENT_0C1 - const EVENT_0C2 - const EVENT_0C3 - const EVENT_0C4 - const EVENT_0C5 - const EVENT_0C6 - const EVENT_0C7 - const EVENT_0C8 - const EVENT_0C9 - const EVENT_0CA - const EVENT_0CB - const EVENT_0CC - const EVENT_0CD - const EVENT_0CE - const EVENT_0CF - const EVENT_0D0 - const EVENT_0D1 - const EVENT_0D2 - const EVENT_0D3 - const EVENT_0D4 - const EVENT_0D5 - const EVENT_0D6 - const EVENT_0D7 - const EVENT_0D8 - const EVENT_0D9 - const EVENT_0DA - const EVENT_0DB - const EVENT_0DC - const EVENT_0DD - const EVENT_0DE - const EVENT_0DF - const EVENT_0E0 - const EVENT_0E1 - const EVENT_0E2 - const EVENT_0E3 - const EVENT_0E4 - const EVENT_0E5 - const EVENT_0E6 - const EVENT_0E7 - const EVENT_0E8 - const EVENT_0E9 - const EVENT_0EA - const EVENT_0EB - const EVENT_0EC - const EVENT_0ED - const EVENT_POKEMON_TOWER_RIVAL_ON_LEFT - const EVENT_BEAT_POKEMON_TOWER_RIVAL - const EVENT_0F0 - const EVENT_BEAT_POKEMONTOWER_3_TRAINER_0 - const EVENT_BEAT_POKEMONTOWER_3_TRAINER_1 - const EVENT_BEAT_POKEMONTOWER_3_TRAINER_2 - const EVENT_0F4 - const EVENT_0F5 - const EVENT_0F6 - const EVENT_0F7 - const EVENT_0F8 - const EVENT_BEAT_POKEMONTOWER_4_TRAINER_0 - const EVENT_BEAT_POKEMONTOWER_4_TRAINER_1 - const EVENT_BEAT_POKEMONTOWER_4_TRAINER_2 - const EVENT_0FC - const EVENT_0FD - const EVENT_0FE - const EVENT_0FF - const EVENT_100 - const EVENT_101 - const EVENT_BEAT_POKEMONTOWER_5_TRAINER_0 - const EVENT_BEAT_POKEMONTOWER_5_TRAINER_1 - const EVENT_BEAT_POKEMONTOWER_5_TRAINER_2 - const EVENT_BEAT_POKEMONTOWER_5_TRAINER_3 - const EVENT_106 - const EVENT_IN_PURIFIED_ZONE - const EVENT_108 - const EVENT_BEAT_POKEMONTOWER_6_TRAINER_0 - const EVENT_BEAT_POKEMONTOWER_6_TRAINER_1 - const EVENT_BEAT_POKEMONTOWER_6_TRAINER_2 - const EVENT_10C - const EVENT_10D - const EVENT_10E - const EVENT_BEAT_GHOST_MAROWAK - const EVENT_110 - const EVENT_BEAT_POKEMONTOWER_7_TRAINER_0 - const EVENT_BEAT_POKEMONTOWER_7_TRAINER_1 - const EVENT_BEAT_POKEMONTOWER_7_TRAINER_2 - const EVENT_114 - const EVENT_115 - const EVENT_116 - const EVENT_RESCUED_MR_FUJI_2 - const EVENT_118 - const EVENT_119 - const EVENT_11A - const EVENT_11B - const EVENT_11C - const EVENT_11D - const EVENT_11E - const EVENT_11F - const EVENT_120 - const EVENT_121 - const EVENT_122 - const EVENT_123 - const EVENT_124 - const EVENT_125 - const EVENT_126 - const EVENT_127 - const EVENT_GOT_POKE_FLUTE - const EVENT_129 - const EVENT_12A - const EVENT_12B - const EVENT_12C - const EVENT_12D - const EVENT_12E - const EVENT_12F - const EVENT_130 - const EVENT_131 - const EVENT_132 - const EVENT_133 - const EVENT_134 - const EVENT_135 - const EVENT_136 - const EVENT_137 - const EVENT_138 - const EVENT_139 - const EVENT_13A - const EVENT_13B - const EVENT_13C - const EVENT_13D - const EVENT_13E - const EVENT_13F - const EVENT_140 - const EVENT_141 - const EVENT_142 - const EVENT_143 - const EVENT_144 - const EVENT_145 - const EVENT_146 - const EVENT_147 - const EVENT_148 - const EVENT_149 - const EVENT_14A - const EVENT_14B - const EVENT_14C - const EVENT_14D - const EVENT_14E - const EVENT_14F - const EVENT_150 - const EVENT_GOT_BIKE_VOUCHER - const EVENT_152 - const EVENT_153 - const EVENT_154 - const EVENT_155 - const EVENT_SEEL_FAN_BOAST - const EVENT_PIKACHU_FAN_BOAST - const EVENT_158 - const EVENT_159 - const EVENT_15A - const EVENT_15B - const EVENT_15C - const EVENT_15D - const EVENT_15E - const EVENT_15F - const EVENT_2ND_LOCK_OPENED - const EVENT_1ST_LOCK_OPENED - const EVENT_BEAT_VERMILION_GYM_TRAINER_0 - const EVENT_BEAT_VERMILION_GYM_TRAINER_1 - const EVENT_BEAT_VERMILION_GYM_TRAINER_2 - const EVENT_165 - const EVENT_GOT_TM24 - const EVENT_BEAT_LT_SURGE - const EVENT_168 - const EVENT_169 - const EVENT_16A - const EVENT_16B - const EVENT_16C - const EVENT_16D - const EVENT_16E - const EVENT_16F - const EVENT_170 - const EVENT_171 - const EVENT_172 - const EVENT_173 - const EVENT_174 - const EVENT_175 - const EVENT_176 - const EVENT_177 - const EVENT_178 - const EVENT_179 - const EVENT_17A - const EVENT_17B - const EVENT_17C - const EVENT_17D - const EVENT_17E - const EVENT_17F - const EVENT_GOT_TM41 - const EVENT_181 - const EVENT_182 - const EVENT_183 - const EVENT_184 - const EVENT_185 - const EVENT_186 - const EVENT_187 - const EVENT_188 - const EVENT_189 - const EVENT_18A - const EVENT_18B - const EVENT_GOT_TM13 - const EVENT_GOT_TM48 - const EVENT_GOT_TM49 - const EVENT_GOT_TM18 - const EVENT_190 - const EVENT_191 - const EVENT_192 - const EVENT_193 - const EVENT_194 - const EVENT_195 - const EVENT_196 - const EVENT_197 - const EVENT_198 - const EVENT_199 - const EVENT_19A - const EVENT_19B - const EVENT_19C - const EVENT_19D - const EVENT_19E - const EVENT_19F - const EVENT_1A0 - const EVENT_1A1 - const EVENT_1A2 - const EVENT_1A3 - const EVENT_1A4 - const EVENT_1A5 - const EVENT_1A6 - const EVENT_1A7 - const EVENT_GOT_TM21 - const EVENT_BEAT_ERIKA - const EVENT_BEAT_CELADON_GYM_TRAINER_0 - const EVENT_BEAT_CELADON_GYM_TRAINER_2 - const EVENT_BEAT_CELADON_GYM_TRAINER_3 - const EVENT_BEAT_CELADON_GYM_TRAINER_4 - const EVENT_BEAT_CELADON_GYM_TRAINER_5 - const EVENT_BEAT_CELADON_GYM_TRAINER_6 - const EVENT_BEAT_CELADON_GYM_TRAINER_7 - const EVENT_1B1 - const EVENT_1B2 - const EVENT_1B3 - const EVENT_1B4 - const EVENT_1B5 - const EVENT_1B6 - const EVENT_1B7 - const EVENT_1B8 - const EVENT_FOUND_ROCKET_HIDEOUT - const EVENT_GOT_10_COINS - const EVENT_GOT_20_COINS - const EVENT_GOT_20_COINS_2 - const EVENT_1BD - const EVENT_1BE - const EVENT_1BF - const EVENT_1C0 - const EVENT_1C1 - const EVENT_1C2 - const EVENT_1C3 - const EVENT_1C4 - const EVENT_1C5 - const EVENT_1C6 - const EVENT_1C7 - const EVENT_1C8 - const EVENT_1C9 - const EVENT_1CA - const EVENT_1CB - const EVENT_1CC - const EVENT_1CD - const EVENT_1CE - const EVENT_1CF - const EVENT_1D0 - const EVENT_1D1 - const EVENT_1D2 - const EVENT_1D3 - const EVENT_1D4 - const EVENT_1D5 - const EVENT_1D6 - const EVENT_1D7 - const EVENT_1D8 - const EVENT_1D9 - const EVENT_1DA - const EVENT_1DB - const EVENT_1DC - const EVENT_1DD - const EVENT_1DE - const EVENT_1DF - const EVENT_GOT_COIN_CASE - const EVENT_1E1 - const EVENT_1E2 - const EVENT_1E3 - const EVENT_1E4 - const EVENT_1E5 - const EVENT_1E6 - const EVENT_1E7 - const EVENT_1E8 - const EVENT_1E9 - const EVENT_1EA - const EVENT_1EB - const EVENT_1EC - const EVENT_1ED - const EVENT_1EE - const EVENT_1EF - const EVENT_1F0 - const EVENT_1F1 - const EVENT_1F2 - const EVENT_1F3 - const EVENT_1F4 - const EVENT_1F5 - const EVENT_1F6 - const EVENT_1F7 - const EVENT_1F8 - const EVENT_1F9 - const EVENT_1FA - const EVENT_1FB - const EVENT_1FC - const EVENT_1FD - const EVENT_1FE - const EVENT_1FF - const EVENT_200 - const EVENT_201 - const EVENT_202 - const EVENT_203 - const EVENT_204 - const EVENT_205 - const EVENT_206 - const EVENT_207 - const EVENT_208 - const EVENT_209 - const EVENT_20A - const EVENT_20B - const EVENT_20C - const EVENT_20D - const EVENT_20E - const EVENT_20F - const EVENT_210 - const EVENT_211 - const EVENT_212 - const EVENT_213 - const EVENT_214 - const EVENT_215 - const EVENT_216 - const EVENT_217 - const EVENT_218 - const EVENT_219 - const EVENT_21A - const EVENT_21B - const EVENT_21C - const EVENT_21D - const EVENT_21E - const EVENT_21F - const EVENT_220 - const EVENT_221 - const EVENT_222 - const EVENT_223 - const EVENT_224 - const EVENT_225 - const EVENT_226 - const EVENT_227 - const EVENT_228 - const EVENT_229 - const EVENT_22A - const EVENT_22B - const EVENT_22C - const EVENT_22D - const EVENT_22E - const EVENT_22F - const EVENT_230 - const EVENT_231 - const EVENT_232 - const EVENT_233 - const EVENT_234 - const EVENT_235 - const EVENT_236 - const EVENT_237 - const EVENT_GOT_HM04 - const EVENT_GAVE_GOLD_TEETH - const EVENT_23A - const EVENT_23B - const EVENT_23C - const EVENT_23D - const EVENT_23E - const EVENT_23F - const EVENT_240 - const EVENT_241 - const EVENT_242 - const EVENT_243 - const EVENT_244 - const EVENT_245 - const EVENT_246 - const EVENT_247 - const EVENT_248 - const EVENT_249 - const EVENT_24A - const EVENT_24B - const EVENT_24C - const EVENT_24D - const EVENT_SAFARI_GAME_OVER - const EVENT_IN_SAFARI_ZONE - const EVENT_250 - const EVENT_251 - const EVENT_252 - const EVENT_253 - const EVENT_254 - const EVENT_255 - const EVENT_256 - const EVENT_257 - const EVENT_GOT_TM06 - const EVENT_BEAT_KOGA - const EVENT_BEAT_FUCHSIA_GYM_TRAINER_0 - const EVENT_BEAT_FUCHSIA_GYM_TRAINER_2 - const EVENT_BEAT_FUCHSIA_GYM_TRAINER_3 - const EVENT_BEAT_FUCHSIA_GYM_TRAINER_4 - const EVENT_BEAT_FUCHSIA_GYM_TRAINER_5 - const EVENT_BEAT_FUCHSIA_GYM_TRAINER_6 - const EVENT_260 - const EVENT_261 - const EVENT_262 - const EVENT_263 - const EVENT_264 - const EVENT_265 - const EVENT_266 - const EVENT_267 - const EVENT_268 - const EVENT_269 - const EVENT_26A - const EVENT_26B - const EVENT_26C - const EVENT_26D - const EVENT_26E - const EVENT_26F - const EVENT_270 - const EVENT_271 - const EVENT_272 - const EVENT_273 - const EVENT_274 - const EVENT_275 - const EVENT_276 - const EVENT_277 - const EVENT_MANSION_SWITCH_ON - const EVENT_279 - const EVENT_27A - const EVENT_27B - const EVENT_27C - const EVENT_27D - const EVENT_27E - const EVENT_27F - const EVENT_280 - const EVENT_281 - const EVENT_282 - const EVENT_283 - const EVENT_284 - const EVENT_285 - const EVENT_286 - const EVENT_287 - const EVENT_288 - const EVENT_BEAT_MANSION_1_TRAINER_0 - const EVENT_28A - const EVENT_28B - const EVENT_28C - const EVENT_28D - const EVENT_28E - const EVENT_28F - const EVENT_290 - const EVENT_291 - const EVENT_292 - const EVENT_293 - const EVENT_294 - const EVENT_295 - const EVENT_296 - const EVENT_297 - const EVENT_GOT_TM38 - const EVENT_BEAT_BLAINE - const EVENT_29A - const EVENT_29B - const EVENT_29C - const EVENT_29D - const EVENT_29E - const EVENT_29F - const EVENT_2A0 - const EVENT_2A1 - const EVENT_2A2 - const EVENT_2A3 - const EVENT_2A4 - const EVENT_2A5 - const EVENT_2A6 - const EVENT_2A7 - const EVENT_2A8 - const EVENT_2A9 - const EVENT_2AA - const EVENT_2AB - const EVENT_2AC - const EVENT_2AD - const EVENT_2AE - const EVENT_2AF - const EVENT_2B0 - const EVENT_2B1 - const EVENT_2B2 - const EVENT_2B3 - const EVENT_2B4 - const EVENT_2B5 - const EVENT_2B6 - const EVENT_2B7 - const EVENT_2B8 - const EVENT_2B9 - const EVENT_2BA - const EVENT_2BB - const EVENT_2BC - const EVENT_2BD - const EVENT_2BE - const EVENT_2BF - const EVENT_2C0 - const EVENT_2C1 - const EVENT_2C2 - const EVENT_2C3 - const EVENT_2C4 - const EVENT_2C5 - const EVENT_2C6 - const EVENT_2C7 - const EVENT_2C8 - const EVENT_2C9 - const EVENT_2CA - const EVENT_2CB - const EVENT_2CC - const EVENT_2CD - const EVENT_2CE - const EVENT_2CF - const EVENT_2D0 - const EVENT_2D1 - const EVENT_2D2 - const EVENT_2D3 - const EVENT_2D4 - const EVENT_2D5 - const EVENT_2D6 - const EVENT_GOT_TM35 - const EVENT_2D8 - const EVENT_2D9 - const EVENT_2DA - const EVENT_2DB - const EVENT_2DC - const EVENT_2DD - const EVENT_2DE - const EVENT_2DF - const EVENT_GAVE_FOSSIL_TO_LAB - const EVENT_LAB_STILL_REVIVING_FOSSIL - const EVENT_LAB_HANDING_OVER_FOSSIL_MON - const EVENT_2E3 - const EVENT_2E4 - const EVENT_2E5 - const EVENT_2E6 - const EVENT_2E7 - const EVENT_2E8 - const EVENT_2E9 - const EVENT_2EA - const EVENT_2EB - const EVENT_2EC - const EVENT_2ED - const EVENT_2EE - const EVENT_2EF - const EVENT_2F0 - const EVENT_2F1 - const EVENT_2F2 - const EVENT_2F3 - const EVENT_2F4 - const EVENT_2F5 - const EVENT_2F6 - const EVENT_2F7 - const EVENT_2F8 - const EVENT_2F9 - const EVENT_2FA - const EVENT_2FB - const EVENT_2FC - const EVENT_2FD - const EVENT_2FE - const EVENT_2FF - const EVENT_300 - const EVENT_301 - const EVENT_302 - const EVENT_303 - const EVENT_304 - const EVENT_305 - const EVENT_306 - const EVENT_307 - const EVENT_308 - const EVENT_309 - const EVENT_30A - const EVENT_30B - const EVENT_30C - const EVENT_30D - const EVENT_30E - const EVENT_30F - const EVENT_310 - const EVENT_311 - const EVENT_312 - const EVENT_313 - const EVENT_314 - const EVENT_315 - const EVENT_316 - const EVENT_317 - const EVENT_318 - const EVENT_319 - const EVENT_31A - const EVENT_31B - const EVENT_31C - const EVENT_31D - const EVENT_31E - const EVENT_31F - const EVENT_320 - const EVENT_321 - const EVENT_322 - const EVENT_323 - const EVENT_324 - const EVENT_325 - const EVENT_326 - const EVENT_327 - const EVENT_328 - const EVENT_329 - const EVENT_32A - const EVENT_32B - const EVENT_32C - const EVENT_32D - const EVENT_32E - const EVENT_32F - const EVENT_330 - const EVENT_331 - const EVENT_332 - const EVENT_333 - const EVENT_334 - const EVENT_335 - const EVENT_336 - const EVENT_337 - const EVENT_338 - const EVENT_339 - const EVENT_33A - const EVENT_33B - const EVENT_33C - const EVENT_33D - const EVENT_33E - const EVENT_33F - const EVENT_GOT_TM31 - const EVENT_341 - const EVENT_342 - const EVENT_343 - const EVENT_344 - const EVENT_345 - const EVENT_346 - const EVENT_347 - const EVENT_348 - const EVENT_349 - const EVENT_34A - const EVENT_34B - const EVENT_34C - const EVENT_34D - const EVENT_34E - const EVENT_34F - const EVENT_DEFEATED_FIGHTING_DOJO - const EVENT_BEAT_KARATE_MASTER - const EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 - const EVENT_BEAT_FIGHTING_DOJO_TRAINER_1 - const EVENT_BEAT_FIGHTING_DOJO_TRAINER_2 - const EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 - const EVENT_GOT_HITMONLEE - const EVENT_GOT_HITMONCHAN - const EVENT_358 - const EVENT_359 - const EVENT_35A - const EVENT_35B - const EVENT_35C - const EVENT_35D - const EVENT_35E - const EVENT_35F - const EVENT_GOT_TM46 - const EVENT_BEAT_SABRINA - const EVENT_BEAT_SAFFRON_GYM_TRAINER_0 - const EVENT_BEAT_SAFFRON_GYM_TRAINER_1 - const EVENT_BEAT_SAFFRON_GYM_TRAINER_2 - const EVENT_BEAT_SAFFRON_GYM_TRAINER_3 - const EVENT_BEAT_SAFFRON_GYM_TRAINER_4 - const EVENT_BEAT_SAFFRON_GYM_TRAINER_5 - const EVENT_BEAT_SAFFRON_GYM_TRAINER_6 - const EVENT_369 - const EVENT_36A - const EVENT_36B - const EVENT_36C - const EVENT_36D - const EVENT_36E - const EVENT_36F - const EVENT_370 - const EVENT_371 - const EVENT_372 - const EVENT_373 - const EVENT_374 - const EVENT_375 - const EVENT_376 - const EVENT_377 - const EVENT_378 - const EVENT_379 - const EVENT_37A - const EVENT_37B - const EVENT_37C - const EVENT_37D - const EVENT_37E - const EVENT_37F - const EVENT_380 - const EVENT_381 - const EVENT_382 - const EVENT_383 - const EVENT_384 - const EVENT_385 - const EVENT_386 - const EVENT_387 - const EVENT_388 - const EVENT_389 - const EVENT_38A - const EVENT_38B - const EVENT_38C - const EVENT_38D - const EVENT_38E - const EVENT_38F - const EVENT_390 - const EVENT_391 - const EVENT_392 - const EVENT_393 - const EVENT_394 - const EVENT_395 - const EVENT_396 - const EVENT_SILPH_CO_RECEPTIONIST_AT_DESK - const EVENT_398 - const EVENT_399 - const EVENT_39A - const EVENT_39B - const EVENT_39C - const EVENT_39D - const EVENT_39E - const EVENT_39F - const EVENT_3A0 - const EVENT_3A1 - const EVENT_3A2 - const EVENT_3A3 - const EVENT_3A4 - const EVENT_3A5 - const EVENT_3A6 - const EVENT_3A7 - const EVENT_3A8 - const EVENT_3A9 - const EVENT_3AA - const EVENT_3AB - const EVENT_3AC - const EVENT_3AD - const EVENT_3AE - const EVENT_3AF - const EVENT_GOT_TM29 - const EVENT_3B1 - const EVENT_3B2 - const EVENT_3B3 - const EVENT_3B4 - const EVENT_3B5 - const EVENT_3B6 - const EVENT_3B7 - const EVENT_3B8 - const EVENT_3B9 - const EVENT_3BA - const EVENT_3BB - const EVENT_3BC - const EVENT_3BD - const EVENT_3BE - const EVENT_3BF - const EVENT_GOT_POTION_SAMPLE - const EVENT_3C1 - const EVENT_3C2 - const EVENT_3C3 - const EVENT_3C4 - const EVENT_3C5 - const EVENT_3C6 - const EVENT_3C7 - const EVENT_3C8 - const EVENT_3C9 - const EVENT_3CA - const EVENT_3CB - const EVENT_3CC - const EVENT_3CD - const EVENT_3CE - const EVENT_3CF - const EVENT_3D0 - const EVENT_3D1 - const EVENT_3D2 - const EVENT_3D3 - const EVENT_3D4 - const EVENT_3D5 - const EVENT_3D6 - const EVENT_3D7 - const EVENT_GOT_HM05 - const EVENT_3D9 - const EVENT_3DA - const EVENT_3DB - const EVENT_3DC - const EVENT_3DD - const EVENT_3DE - const EVENT_3DF - const EVENT_3E0 - const EVENT_3E1 - const EVENT_BEAT_ROUTE_3_TRAINER_0 - const EVENT_BEAT_ROUTE_3_TRAINER_2 - const EVENT_BEAT_ROUTE_3_TRAINER_3 - const EVENT_BEAT_ROUTE_3_TRAINER_4 - const EVENT_BEAT_ROUTE_3_TRAINER_5 - const EVENT_BEAT_ROUTE_3_TRAINER_6 - const EVENT_BEAT_ROUTE_3_TRAINER_7 - const EVENT_BEAT_ROUTE_3_TRAINER_8 - const EVENT_3EA - const EVENT_3EB - const EVENT_3EC - const EVENT_3ED - const EVENT_3EE - const EVENT_3EF - const EVENT_3F0 - const EVENT_3F1 - const EVENT_BEAT_ROUTE_4_TRAINER_0 - const EVENT_3F3 - const EVENT_3F4 - const EVENT_3F5 - const EVENT_3F6 - const EVENT_3F7 - const EVENT_3F8 - const EVENT_3F9 - const EVENT_3FA - const EVENT_3FB - const EVENT_3FC - const EVENT_3FD - const EVENT_3FE - const EVENT_BOUGHT_MAGIKARP - const EVENT_400 - const EVENT_401 - const EVENT_402 - const EVENT_403 - const EVENT_404 - const EVENT_405 - const EVENT_406 - const EVENT_407 - const EVENT_408 - const EVENT_409 - const EVENT_40A - const EVENT_40B - const EVENT_40C - const EVENT_40D - const EVENT_40E - const EVENT_40F - const EVENT_410 - const EVENT_BEAT_ROUTE_6_TRAINER_0 - const EVENT_BEAT_ROUTE_6_TRAINER_1 - const EVENT_BEAT_ROUTE_6_TRAINER_2 - const EVENT_BEAT_ROUTE_6_TRAINER_3 - const EVENT_BEAT_ROUTE_6_TRAINER_4 - const EVENT_BEAT_ROUTE_6_TRAINER_5 - const EVENT_417 - const EVENT_418 - const EVENT_419 - const EVENT_41A - const EVENT_41B - const EVENT_41C - const EVENT_41D - const EVENT_41E - const EVENT_41F - const EVENT_420 - const EVENT_421 - const EVENT_422 - const EVENT_423 - const EVENT_424 - const EVENT_425 - const EVENT_426 - const EVENT_427 - const EVENT_428 - const EVENT_429 - const EVENT_42A - const EVENT_42B - const EVENT_42C - const EVENT_42D - const EVENT_42E - const EVENT_42F - const EVENT_430 - const EVENT_BEAT_ROUTE_8_TRAINER_0 - const EVENT_BEAT_ROUTE_8_TRAINER_1 - const EVENT_BEAT_ROUTE_8_TRAINER_2 - const EVENT_BEAT_ROUTE_8_TRAINER_3 - const EVENT_BEAT_ROUTE_8_TRAINER_4 - const EVENT_BEAT_ROUTE_8_TRAINER_5 - const EVENT_BEAT_ROUTE_8_TRAINER_6 - const EVENT_BEAT_ROUTE_8_TRAINER_7 - const EVENT_BEAT_ROUTE_8_TRAINER_8 - const EVENT_43A - const EVENT_43B - const EVENT_43C - const EVENT_43D - const EVENT_43E - const EVENT_43F - const EVENT_440 - const EVENT_BEAT_ROUTE_9_TRAINER_0 - const EVENT_BEAT_ROUTE_9_TRAINER_2 - const EVENT_BEAT_ROUTE_9_TRAINER_3 - const EVENT_BEAT_ROUTE_9_TRAINER_4 - const EVENT_BEAT_ROUTE_9_TRAINER_5 - const EVENT_BEAT_ROUTE_9_TRAINER_6 - const EVENT_BEAT_ROUTE_9_TRAINER_7 - const EVENT_BEAT_ROUTE_9_TRAINER_8 - const EVENT_BEAT_ROUTE_9_TRAINER_9 - const EVENT_44A - const EVENT_44B - const EVENT_44C - const EVENT_44D - const EVENT_44E - const EVENT_44F - const EVENT_450 - const EVENT_BEAT_ROUTE_10_TRAINER_0 - const EVENT_BEAT_ROUTE_10_TRAINER_1 - const EVENT_BEAT_ROUTE_10_TRAINER_2 - const EVENT_BEAT_ROUTE_10_TRAINER_3 - const EVENT_BEAT_ROUTE_10_TRAINER_4 - const EVENT_BEAT_ROUTE_10_TRAINER_5 - const EVENT_457 - const EVENT_458 - const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1 - const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2 - const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3 - const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4 - const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5 - const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6 - const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_7 - const EVENT_460 - const EVENT_BEAT_POWER_PLANT_TRAINER_0 - const EVENT_BEAT_POWER_PLANT_TRAINER_1 - const EVENT_BEAT_POWER_PLANT_TRAINER_2 - const EVENT_BEAT_POWER_PLANT_TRAINER_3 - const EVENT_BEAT_POWER_PLANT_TRAINER_4 - const EVENT_BEAT_POWER_PLANT_TRAINER_5 - const EVENT_BEAT_POWER_PLANT_TRAINER_6 - const EVENT_BEAT_POWER_PLANT_TRAINER_7 - const EVENT_BEAT_POWER_PLANT_TRAINER_8 - const EVENT_46A - const EVENT_46B - const EVENT_46C - const EVENT_46D - const EVENT_46E - const EVENT_46F - const EVENT_470 - const EVENT_BEAT_ROUTE_11_TRAINER_0 - const EVENT_BEAT_ROUTE_11_TRAINER_1 - const EVENT_BEAT_ROUTE_11_TRAINER_2 - const EVENT_BEAT_ROUTE_11_TRAINER_3 - const EVENT_BEAT_ROUTE_11_TRAINER_4 - const EVENT_BEAT_ROUTE_11_TRAINER_5 - const EVENT_BEAT_ROUTE_11_TRAINER_6 - const EVENT_BEAT_ROUTE_11_TRAINER_7 - const EVENT_BEAT_ROUTE_11_TRAINER_8 - const EVENT_BEAT_ROUTE_11_TRAINER_9 - const EVENT_47B - const EVENT_47C - const EVENT_47D - const EVENT_47E - const EVENT_GOT_ITEMFINDER - const EVENT_GOT_TM39 - const EVENT_481 - const EVENT_BEAT_ROUTE_12_TRAINER_0 - const EVENT_BEAT_ROUTE_12_TRAINER_1 - const EVENT_BEAT_ROUTE_12_TRAINER_2 - const EVENT_BEAT_ROUTE_12_TRAINER_3 - const EVENT_BEAT_ROUTE_12_TRAINER_4 - const EVENT_BEAT_ROUTE_12_TRAINER_5 - const EVENT_BEAT_ROUTE_12_TRAINER_6 - const EVENT_489 - const EVENT_48A - const EVENT_48B - const EVENT_48C - const EVENT_48D - const EVENT_FIGHT_ROUTE12_SNORLAX - const EVENT_BEAT_ROUTE12_SNORLAX - const EVENT_490 - const EVENT_BEAT_ROUTE_13_TRAINER_0 - const EVENT_BEAT_ROUTE_13_TRAINER_2 - const EVENT_BEAT_ROUTE_13_TRAINER_3 - const EVENT_BEAT_ROUTE_13_TRAINER_4 - const EVENT_BEAT_ROUTE_13_TRAINER_5 - const EVENT_BEAT_ROUTE_13_TRAINER_6 - const EVENT_BEAT_ROUTE_13_TRAINER_7 - const EVENT_BEAT_ROUTE_13_TRAINER_8 - const EVENT_BEAT_ROUTE_13_TRAINER_9 - const EVENT_BEAT_ROUTE_13_TRAINER_10 - const EVENT_49B - const EVENT_49C - const EVENT_49D - const EVENT_49E - const EVENT_49F - const EVENT_4A0 - const EVENT_BEAT_ROUTE_14_TRAINER_0 - const EVENT_BEAT_ROUTE_14_TRAINER_1 - const EVENT_BEAT_ROUTE_14_TRAINER_2 - const EVENT_BEAT_ROUTE_14_TRAINER_3 - const EVENT_BEAT_ROUTE_14_TRAINER_4 - const EVENT_BEAT_ROUTE_14_TRAINER_5 - const EVENT_BEAT_ROUTE_14_TRAINER_6 - const EVENT_BEAT_ROUTE_14_TRAINER_7 - const EVENT_BEAT_ROUTE_14_TRAINER_8 - const EVENT_BEAT_ROUTE_14_TRAINER_9 - const EVENT_4AB - const EVENT_4AC - const EVENT_4AD - const EVENT_4AE - const EVENT_4AF - const EVENT_GOT_EXP_ALL - const EVENT_BEAT_ROUTE_15_TRAINER_0 - const EVENT_BEAT_ROUTE_15_TRAINER_1 - const EVENT_BEAT_ROUTE_15_TRAINER_2 - const EVENT_BEAT_ROUTE_15_TRAINER_3 - const EVENT_BEAT_ROUTE_15_TRAINER_4 - const EVENT_BEAT_ROUTE_15_TRAINER_5 - const EVENT_BEAT_ROUTE_15_TRAINER_6 - const EVENT_BEAT_ROUTE_15_TRAINER_7 - const EVENT_BEAT_ROUTE_15_TRAINER_8 - const EVENT_BEAT_ROUTE_15_TRAINER_9 - const EVENT_4BB - const EVENT_4BC - const EVENT_4BD - const EVENT_4BE - const EVENT_4BF - const EVENT_4C0 - const EVENT_BEAT_ROUTE_16_TRAINER_0 - const EVENT_BEAT_ROUTE_16_TRAINER_1 - const EVENT_BEAT_ROUTE_16_TRAINER_2 - const EVENT_BEAT_ROUTE_16_TRAINER_3 - const EVENT_BEAT_ROUTE_16_TRAINER_4 - const EVENT_BEAT_ROUTE_16_TRAINER_5 - const EVENT_4C7 - const EVENT_FIGHT_ROUTE16_SNORLAX - const EVENT_BEAT_ROUTE16_SNORLAX - const EVENT_4CA - const EVENT_4CB - const EVENT_4CC - const EVENT_4CD - const EVENT_GOT_HM02 - const EVENT_RESCUED_MR_FUJI - const EVENT_4D0 - const EVENT_BEAT_ROUTE_17_TRAINER_0 - const EVENT_BEAT_ROUTE_17_TRAINER_1 - const EVENT_BEAT_ROUTE_17_TRAINER_2 - const EVENT_BEAT_ROUTE_17_TRAINER_3 - const EVENT_BEAT_ROUTE_17_TRAINER_4 - const EVENT_BEAT_ROUTE_17_TRAINER_5 - const EVENT_BEAT_ROUTE_17_TRAINER_6 - const EVENT_BEAT_ROUTE_17_TRAINER_7 - const EVENT_BEAT_ROUTE_17_TRAINER_8 - const EVENT_BEAT_ROUTE_17_TRAINER_9 - const EVENT_4DB - const EVENT_4DC - const EVENT_4DD - const EVENT_4DE - const EVENT_4DF - const EVENT_4E0 - const EVENT_BEAT_ROUTE_18_TRAINER_0 - const EVENT_BEAT_ROUTE_18_TRAINER_1 - const EVENT_BEAT_ROUTE_18_TRAINER_2 - const EVENT_4E4 - const EVENT_4E5 - const EVENT_4E6 - const EVENT_4E7 - const EVENT_4E8 - const EVENT_4E9 - const EVENT_4EA - const EVENT_4EB - const EVENT_4EC - const EVENT_4ED - const EVENT_4EE - const EVENT_4EF - const EVENT_4F0 - const EVENT_BEAT_ROUTE_19_TRAINER_0 - const EVENT_BEAT_ROUTE_19_TRAINER_1 - const EVENT_BEAT_ROUTE_19_TRAINER_2 - const EVENT_BEAT_ROUTE_19_TRAINER_3 - const EVENT_BEAT_ROUTE_19_TRAINER_4 - const EVENT_BEAT_ROUTE_19_TRAINER_5 - const EVENT_BEAT_ROUTE_19_TRAINER_6 - const EVENT_BEAT_ROUTE_19_TRAINER_7 - const EVENT_BEAT_ROUTE_19_TRAINER_8 - const EVENT_BEAT_ROUTE_19_TRAINER_9 - const EVENT_4FB - const EVENT_4FC - const EVENT_4FD - const EVENT_4FE - const EVENT_4FF - const EVENT_IN_SEAFOAM_ISLANDS - const EVENT_BEAT_ROUTE_20_TRAINER_0 - const EVENT_BEAT_ROUTE_20_TRAINER_2 - const EVENT_BEAT_ROUTE_20_TRAINER_3 - const EVENT_BEAT_ROUTE_20_TRAINER_4 - const EVENT_BEAT_ROUTE_20_TRAINER_5 - const EVENT_BEAT_ROUTE_20_TRAINER_6 - const EVENT_BEAT_ROUTE_20_TRAINER_7 - const EVENT_BEAT_ROUTE_20_TRAINER_8 - const EVENT_BEAT_ROUTE_20_TRAINER_9 - const EVENT_BEAT_ROUTE_20_TRAINER_10 - const EVENT_50B - const EVENT_50C - const EVENT_50D - const EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE - const EVENT_SEAFOAM1_BOULDER2_DOWN_HOLE - const EVENT_510 - const EVENT_BEAT_ROUTE_21_TRAINER_0 - const EVENT_BEAT_ROUTE_21_TRAINER_1 - const EVENT_BEAT_ROUTE_21_TRAINER_2 - const EVENT_BEAT_ROUTE_21_TRAINER_3 - const EVENT_BEAT_ROUTE_21_TRAINER_4 - const EVENT_BEAT_ROUTE_21_TRAINER_5 - const EVENT_BEAT_ROUTE_21_TRAINER_6 - const EVENT_BEAT_ROUTE_21_TRAINER_7 - const EVENT_BEAT_ROUTE_21_TRAINER_8 - const EVENT_51A - const EVENT_51B - const EVENT_51C - const EVENT_51D - const EVENT_51E - const EVENT_51F - const EVENT_1ST_ROUTE22_RIVAL_BATTLE - const EVENT_2ND_ROUTE22_RIVAL_BATTLE - const EVENT_522 - const EVENT_523 - const EVENT_524 - const EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT - const EVENT_BEAT_ROUTE22_RIVAL_2ND_FIGHT - const EVENT_ROUTE22_RIVAL_WANTS_FIGHT - const EVENT_528 - const EVENT_529 - const EVENT_52A - const EVENT_52B - const EVENT_52C - const EVENT_52D - const EVENT_52E - const EVENT_52F - const EVENT_PASSED_CASCADEBADGE_CHECK - const EVENT_PASSED_THUNDERBADGE_CHECK - const EVENT_PASSED_RAINBOWBADGE_CHECK - const EVENT_PASSED_SOULBADGE_CHECK - const EVENT_PASSED_MARSHBADGE_CHECK - const EVENT_PASSED_VOLCANOBADGE_CHECK - const EVENT_PASSED_EARTHBADGE_CHECK - const EVENT_537 - const EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 - const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0 - const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2 - const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3 - const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4 - const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_5 - const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_6 - const EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2 - const EVENT_GOT_NUGGET - const EVENT_BEAT_ROUTE24_ROCKET - const EVENT_BEAT_ROUTE_24_TRAINER_0 - const EVENT_BEAT_ROUTE_24_TRAINER_2 - const EVENT_BEAT_ROUTE_24_TRAINER_3 - const EVENT_BEAT_ROUTE_24_TRAINER_4 - const EVENT_BEAT_ROUTE_24_TRAINER_5 - const EVENT_BEAT_ROUTE_24_TRAINER_6 - const EVENT_548 - const EVENT_NUGGET_REWARD_AVAILABLE - const EVENT_54A - const EVENT_54B - const EVENT_54C - const EVENT_54D - const EVENT_54E - const EVENT_54F - const EVENT_MET_BILL - const EVENT_BEAT_ROUTE_25_TRAINER_0 - const EVENT_BEAT_ROUTE_25_TRAINER_2 - const EVENT_BEAT_ROUTE_25_TRAINER_3 - const EVENT_BEAT_ROUTE_25_TRAINER_4 - const EVENT_BEAT_ROUTE_25_TRAINER_5 - const EVENT_BEAT_ROUTE_25_TRAINER_6 - const EVENT_BEAT_ROUTE_25_TRAINER_7 - const EVENT_BEAT_ROUTE_25_TRAINER_8 - const EVENT_BEAT_ROUTE_25_TRAINER_9 - const EVENT_55A - const EVENT_USED_CELL_SEPARATOR_ON_BILL - const EVENT_GOT_SS_TICKET - const EVENT_MET_BILL_2 - const EVENT_BILL_SAID_USE_CELL_SEPARATOR - const EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING - const EVENT_560 - const EVENT_561 - const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 - const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1 - const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 - const EVENT_565 - const EVENT_566 - const EVENT_567 - const EVENT_568 - const EVENT_569 - const EVENT_56A - const EVENT_56B - const EVENT_56C - const EVENT_56D - const EVENT_56E - const EVENT_56F - const EVENT_570 - const EVENT_BEAT_MT_MOON_1_TRAINER_0 - const EVENT_BEAT_MT_MOON_1_TRAINER_2 - const EVENT_BEAT_MT_MOON_1_TRAINER_3 - const EVENT_BEAT_MT_MOON_1_TRAINER_4 - const EVENT_BEAT_MT_MOON_1_TRAINER_5 - const EVENT_BEAT_MT_MOON_1_TRAINER_6 - const EVENT_BEAT_MT_MOON_1_TRAINER_7 - const EVENT_578 - const EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD - const EVENT_BEAT_MT_MOON_3_TRAINER_0 - const EVENT_BEAT_MT_MOON_3_TRAINER_2 - const EVENT_BEAT_MT_MOON_3_TRAINER_3 - const EVENT_BEAT_MT_MOON_3_TRAINER_4 - const EVENT_GOT_DOME_FOSSIL - const EVENT_GOT_HELIX_FOSSIL - const EVENT_580 - const EVENT_581 - const EVENT_582 - const EVENT_583 - const EVENT_584 - const EVENT_585 - const EVENT_586 - const EVENT_587 - const EVENT_588 - const EVENT_589 - const EVENT_58A - const EVENT_58B - const EVENT_58C - const EVENT_58D - const EVENT_58E - const EVENT_58F - const EVENT_590 - const EVENT_591 - const EVENT_592 - const EVENT_593 - const EVENT_594 - const EVENT_595 - const EVENT_596 - const EVENT_597 - const EVENT_598 - const EVENT_599 - const EVENT_59A - const EVENT_59B - const EVENT_59C - const EVENT_59D - const EVENT_59E - const EVENT_59F - const EVENT_5A0 - const EVENT_5A1 - const EVENT_5A2 - const EVENT_5A3 - const EVENT_5A4 - const EVENT_5A5 - const EVENT_5A6 - const EVENT_5A7 - const EVENT_5A8 - const EVENT_5A9 - const EVENT_5AA - const EVENT_5AB - const EVENT_5AC - const EVENT_5AD - const EVENT_5AE - const EVENT_5AF - const EVENT_5B0 - const EVENT_5B1 - const EVENT_5B2 - const EVENT_5B3 - const EVENT_5B4 - const EVENT_5B5 - const EVENT_5B6 - const EVENT_5B7 - const EVENT_5B8 - const EVENT_5B9 - const EVENT_5BA - const EVENT_5BB - const EVENT_5BC - const EVENT_5BD - const EVENT_5BE - const EVENT_5BF - const EVENT_5C0 - const EVENT_5C1 - const EVENT_5C2 - const EVENT_5C3 - const EVENT_BEAT_SS_ANNE_5_TRAINER_0 - const EVENT_BEAT_SS_ANNE_5_TRAINER_1 - const EVENT_5C6 - const EVENT_5C7 - const EVENT_5C8 - const EVENT_5C9 - const EVENT_5CA - const EVENT_5CB - const EVENT_5CC - const EVENT_5CD - const EVENT_5CE - const EVENT_5CF - const EVENT_5D0 - const EVENT_5D1 - const EVENT_5D2 - const EVENT_5D3 - const EVENT_5D4 - const EVENT_5D5 - const EVENT_5D6 - const EVENT_5D7 - const EVENT_5D8 - const EVENT_5D9 - const EVENT_5DA - const EVENT_5DB - const EVENT_5DC - const EVENT_5DD - const EVENT_5DE - const EVENT_5DF - const EVENT_GOT_HM01 - const EVENT_RUBBED_CAPTAINS_BACK - const EVENT_SS_ANNE_LEFT - const EVENT_WALKED_PAST_GUARD_AFTER_SS_ANNE_LEFT - const EVENT_STARTED_WALKING_OUT_OF_DOCK - const EVENT_WALKED_OUT_OF_DOCK - const EVENT_5E6 - const EVENT_5E7 - const EVENT_5E8 - const EVENT_5E9 - const EVENT_5EA - const EVENT_5EB - const EVENT_5EC - const EVENT_5ED - const EVENT_5EE - const EVENT_5EF - const EVENT_5F0 - const EVENT_BEAT_SS_ANNE_8_TRAINER_0 - const EVENT_BEAT_SS_ANNE_8_TRAINER_1 - const EVENT_BEAT_SS_ANNE_8_TRAINER_2 - const EVENT_BEAT_SS_ANNE_8_TRAINER_3 - const EVENT_5F5 - const EVENT_5F6 - const EVENT_5F7 - const EVENT_5F8 - const EVENT_5F9 - const EVENT_5FA - const EVENT_5FB - const EVENT_5FC - const EVENT_5FD - const EVENT_5FE - const EVENT_5FF - const EVENT_600 - const EVENT_BEAT_SS_ANNE_9_TRAINER_0 - const EVENT_BEAT_SS_ANNE_9_TRAINER_1 - const EVENT_BEAT_SS_ANNE_9_TRAINER_2 - const EVENT_BEAT_SS_ANNE_9_TRAINER_3 - const EVENT_605 - const EVENT_606 - const EVENT_607 - const EVENT_608 - const EVENT_609 - const EVENT_60A - const EVENT_60B - const EVENT_60C - const EVENT_60D - const EVENT_60E - const EVENT_60F - const EVENT_610 - const EVENT_BEAT_SS_ANNE_10_TRAINER_0 - const EVENT_BEAT_SS_ANNE_10_TRAINER_1 - const EVENT_BEAT_SS_ANNE_10_TRAINER_2 - const EVENT_BEAT_SS_ANNE_10_TRAINER_3 - const EVENT_BEAT_SS_ANNE_10_TRAINER_4 - const EVENT_BEAT_SS_ANNE_10_TRAINER_5 - const EVENT_617 - const EVENT_618 - const EVENT_619 - const EVENT_61A - const EVENT_61B - const EVENT_61C - const EVENT_61D - const EVENT_61E - const EVENT_61F - const EVENT_620 - const EVENT_621 - const EVENT_622 - const EVENT_623 - const EVENT_624 - const EVENT_625 - const EVENT_626 - const EVENT_627 - const EVENT_628 - const EVENT_629 - const EVENT_62A - const EVENT_62B - const EVENT_62C - const EVENT_62D - const EVENT_62E - const EVENT_62F - const EVENT_630 - const EVENT_631 - const EVENT_632 - const EVENT_633 - const EVENT_634 - const EVENT_635 - const EVENT_636 - const EVENT_637 - const EVENT_638 - const EVENT_639 - const EVENT_63A - const EVENT_63B - const EVENT_63C - const EVENT_63D - const EVENT_63E - const EVENT_63F - const EVENT_640 - const EVENT_641 - const EVENT_642 - const EVENT_643 - const EVENT_644 - const EVENT_645 - const EVENT_646 - const EVENT_647 - const EVENT_648 - const EVENT_649 - const EVENT_64A - const EVENT_64B - const EVENT_64C - const EVENT_64D - const EVENT_64E - const EVENT_64F - const EVENT_650 - const EVENT_651 - const EVENT_652 - const EVENT_653 - const EVENT_654 - const EVENT_655 - const EVENT_656 - const EVENT_657 - const EVENT_658 - const EVENT_659 - const EVENT_65A - const EVENT_65B - const EVENT_65C - const EVENT_65D - const EVENT_65E - const EVENT_65F - const EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1 - const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0 - const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2 - const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3 - const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_4 - const EVENT_665 - const EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH2 - const EVENT_667 - const EVENT_668 - const EVENT_669 - const EVENT_66A - const EVENT_66B - const EVENT_66C - const EVENT_66D - const EVENT_66E - const EVENT_66F - const EVENT_670 - const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0 - const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2 - const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3 - const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4 - const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 - const EVENT_676 - const EVENT_677 - const EVENT_678 - const EVENT_679 - const EVENT_67A - const EVENT_67B - const EVENT_67C - const EVENT_67D - const EVENT_67E - const EVENT_67F - const EVENT_680 - const EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0 - const EVENT_682 - const EVENT_683 - const EVENT_684 - const EVENT_685 - const EVENT_686 - const EVENT_687 - const EVENT_688 - const EVENT_689 - const EVENT_68A - const EVENT_68B - const EVENT_68C - const EVENT_68D - const EVENT_68E - const EVENT_68F - const EVENT_690 - const EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0 - const EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_2 - const EVENT_693 - const EVENT_694 - const EVENT_695 - const EVENT_696 - const EVENT_697 - const EVENT_698 - const EVENT_699 - const EVENT_69A - const EVENT_69B - const EVENT_69C - const EVENT_69D - const EVENT_69E - const EVENT_69F - const EVENT_6A0 - const EVENT_6A1 - const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0 - const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2 - const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_3 - const EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED - const EVENT_ROCKET_DROPPED_LIFT_KEY - const EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI - const EVENT_6A8 - const EVENT_6A9 - const EVENT_6AA - const EVENT_6AB - const EVENT_6AC - const EVENT_6AD - const EVENT_6AE - const EVENT_6AF - const EVENT_6B0 - const EVENT_6B1 - const EVENT_6B2 - const EVENT_6B3 - const EVENT_6B4 - const EVENT_6B5 - const EVENT_6B6 - const EVENT_6B7 - const EVENT_6B8 - const EVENT_6B9 - const EVENT_6BA - const EVENT_6BB - const EVENT_6BC - const EVENT_6BD - const EVENT_6BE - const EVENT_6BF - const EVENT_6C0 - const EVENT_6C1 - const EVENT_6C2 - const EVENT_6C3 - const EVENT_6C4 - const EVENT_6C5 - const EVENT_6C6 - const EVENT_6C7 - const EVENT_6C8 - const EVENT_6C9 - const EVENT_6CA - const EVENT_6CB - const EVENT_6CC - const EVENT_6CD - const EVENT_6CE - const EVENT_6CF - const EVENT_6D0 - const EVENT_6D1 - const EVENT_6D2 - const EVENT_6D3 - const EVENT_6D4 - const EVENT_6D5 - const EVENT_6D6 - const EVENT_6D7 - const EVENT_6D8 - const EVENT_6D9 - const EVENT_6DA - const EVENT_6DB - const EVENT_6DC - const EVENT_6DD - const EVENT_6DE - const EVENT_6DF - const EVENT_6E0 - const EVENT_6E1 - const EVENT_6E2 - const EVENT_6E3 - const EVENT_6E4 - const EVENT_6E5 - const EVENT_6E6 - const EVENT_6E7 - const EVENT_6E8 - const EVENT_6E9 - const EVENT_6EA - const EVENT_6EB - const EVENT_6EC - const EVENT_6ED - const EVENT_6EE - const EVENT_6EF - const EVENT_6F0 - const EVENT_6F1 - const EVENT_BEAT_SILPH_CO_2F_TRAINER_0 - const EVENT_BEAT_SILPH_CO_2F_TRAINER_1 - const EVENT_BEAT_SILPH_CO_2F_TRAINER_2 - const EVENT_BEAT_SILPH_CO_2F_TRAINER_3 - const EVENT_6F6 - const EVENT_6F7 - const EVENT_6F8 - const EVENT_6F9 - const EVENT_6FA - const EVENT_6FB - const EVENT_6FC - const EVENT_SILPH_CO_2_UNLOCKED_DOOR1 - const EVENT_SILPH_CO_2_UNLOCKED_DOOR2 - const EVENT_GOT_TM36 - const EVENT_700 - const EVENT_701 - const EVENT_BEAT_SILPH_CO_3F_TRAINER_0 - const EVENT_BEAT_SILPH_CO_3F_TRAINER_1 - const EVENT_704 - const EVENT_705 - const EVENT_706 - const EVENT_707 - const EVENT_SILPH_CO_3_UNLOCKED_DOOR1 - const EVENT_SILPH_CO_3_UNLOCKED_DOOR2 - const EVENT_70A - const EVENT_70B - const EVENT_70C - const EVENT_70D - const EVENT_70E - const EVENT_70F - const EVENT_710 - const EVENT_711 - const EVENT_BEAT_SILPH_CO_4F_TRAINER_0 - const EVENT_BEAT_SILPH_CO_4F_TRAINER_2 - const EVENT_BEAT_SILPH_CO_4F_TRAINER_3 - const EVENT_715 - const EVENT_716 - const EVENT_717 - const EVENT_SILPH_CO_4_UNLOCKED_DOOR1 - const EVENT_SILPH_CO_4_UNLOCKED_DOOR2 - const EVENT_71A - const EVENT_71B - const EVENT_71C - const EVENT_71D - const EVENT_71E - const EVENT_71F - const EVENT_720 - const EVENT_721 - const EVENT_BEAT_SILPH_CO_5F_TRAINER_0 - const EVENT_BEAT_SILPH_CO_5F_TRAINER_2 - const EVENT_BEAT_SILPH_CO_5F_TRAINER_3 - const EVENT_BEAT_SILPH_CO_5F_TRAINER_4 - const EVENT_726 - const EVENT_727 - const EVENT_SILPH_CO_5_UNLOCKED_DOOR1 - const EVENT_SILPH_CO_5_UNLOCKED_DOOR2 - const EVENT_SILPH_CO_5_UNLOCKED_DOOR3 - const EVENT_72B - const EVENT_72C - const EVENT_72D - const EVENT_72E - const EVENT_72F - const EVENT_730 - const EVENT_731 - const EVENT_732 - const EVENT_733 - const EVENT_734 - const EVENT_735 - const EVENT_BEAT_SILPH_CO_6F_TRAINER_0 - const EVENT_BEAT_SILPH_CO_6F_TRAINER_2 - const EVENT_BEAT_SILPH_CO_6F_TRAINER_3 - const EVENT_739 - const EVENT_73A - const EVENT_73B - const EVENT_73C - const EVENT_73D - const EVENT_73E - const EVENT_SILPH_CO_6_UNLOCKED_DOOR - const EVENT_BEAT_SILPH_CO_RIVAL - const EVENT_741 - const EVENT_742 - const EVENT_743 - const EVENT_744 - const EVENT_BEAT_SILPH_CO_7F_TRAINER_0 - const EVENT_BEAT_SILPH_CO_7F_TRAINER_2 - const EVENT_BEAT_SILPH_CO_7F_TRAINER_3 - const EVENT_BEAT_SILPH_CO_7F_TRAINER_4 - const EVENT_749 - const EVENT_74A - const EVENT_74B - const EVENT_SILPH_CO_7_UNLOCKED_DOOR1 - const EVENT_SILPH_CO_7_UNLOCKED_DOOR2 - const EVENT_SILPH_CO_7_UNLOCKED_DOOR3 - const EVENT_74F - const EVENT_750 - const EVENT_751 - const EVENT_BEAT_SILPH_CO_8F_TRAINER_0 - const EVENT_BEAT_SILPH_CO_8F_TRAINER_1 - const EVENT_BEAT_SILPH_CO_8F_TRAINER_2 - const EVENT_755 - const EVENT_756 - const EVENT_757 - const EVENT_SILPH_CO_8_UNLOCKED_DOOR - const EVENT_759 - const EVENT_75A - const EVENT_75B - const EVENT_75C - const EVENT_75D - const EVENT_75E - const EVENT_75F - const EVENT_760 - const EVENT_761 - const EVENT_BEAT_SILPH_CO_9F_TRAINER_0 - const EVENT_BEAT_SILPH_CO_9F_TRAINER_1 - const EVENT_BEAT_SILPH_CO_9F_TRAINER_2 - const EVENT_765 - const EVENT_766 - const EVENT_767 - const EVENT_SILPH_CO_9_UNLOCKED_DOOR1 - const EVENT_SILPH_CO_9_UNLOCKED_DOOR2 - const EVENT_SILPH_CO_9_UNLOCKED_DOOR3 - const EVENT_SILPH_CO_9_UNLOCKED_DOOR4 - const EVENT_76C - const EVENT_76D - const EVENT_76E - const EVENT_76F - const EVENT_770 - const EVENT_BEAT_SILPH_CO_10F_TRAINER_0 - const EVENT_BEAT_SILPH_CO_10F_TRAINER_1 - const EVENT_773 - const EVENT_774 - const EVENT_775 - const EVENT_776 - const EVENT_777 - const EVENT_SILPH_CO_10_UNLOCKED_DOOR - const EVENT_779 - const EVENT_77A - const EVENT_77B - const EVENT_77C - const EVENT_77D - const EVENT_77E - const EVENT_77F - const EVENT_780 - const EVENT_781 - const EVENT_782 - const EVENT_783 - const EVENT_BEAT_SILPH_CO_11F_TRAINER_0 - const EVENT_BEAT_SILPH_CO_11F_TRAINER_1 - const EVENT_786 - const EVENT_787 - const EVENT_SILPH_CO_11_UNLOCKED_DOOR - const EVENT_789 - const EVENT_78A - const EVENT_78B - const EVENT_78C - const EVENT_GOT_MASTER_BALL - const EVENT_78E - const EVENT_BEAT_SILPH_CO_GIOVANNI - const EVENT_790 - const EVENT_791 - const EVENT_792 - const EVENT_793 - const EVENT_794 - const EVENT_795 - const EVENT_796 - const EVENT_797 - const EVENT_798 - const EVENT_799 - const EVENT_79A - const EVENT_79B - const EVENT_79C - const EVENT_79D - const EVENT_79E - const EVENT_79F - const EVENT_7A0 - const EVENT_7A1 - const EVENT_7A2 - const EVENT_7A3 - const EVENT_7A4 - const EVENT_7A5 - const EVENT_7A6 - const EVENT_7A7 - const EVENT_7A8 - const EVENT_7A9 - const EVENT_7AA - const EVENT_7AB - const EVENT_7AC - const EVENT_7AD - const EVENT_7AE - const EVENT_7AF - const EVENT_7B0 - const EVENT_7B1 - const EVENT_7B2 - const EVENT_7B3 - const EVENT_7B4 - const EVENT_7B5 - const EVENT_7B6 - const EVENT_7B7 - const EVENT_7B8 - const EVENT_7B9 - const EVENT_7BA - const EVENT_7BB - const EVENT_7BC - const EVENT_7BD - const EVENT_7BE - const EVENT_7BF - const EVENT_7C0 - const EVENT_7C1 - const EVENT_7C2 - const EVENT_7C3 - const EVENT_7C4 - const EVENT_7C5 - const EVENT_7C6 - const EVENT_7C7 - const EVENT_7C8 - const EVENT_7C9 - const EVENT_7CA - const EVENT_7CB - const EVENT_7CC - const EVENT_7CD - const EVENT_7CE - const EVENT_7CF - const EVENT_7D0 - const EVENT_7D1 - const EVENT_7D2 - const EVENT_7D3 - const EVENT_7D4 - const EVENT_7D5 - const EVENT_7D6 - const EVENT_7D7 - const EVENT_7D8 - const EVENT_7D9 - const EVENT_7DA - const EVENT_7DB - const EVENT_7DC - const EVENT_7DD - const EVENT_7DE - const EVENT_7DF - const EVENT_7E0 - const EVENT_7E1 - const EVENT_7E2 - const EVENT_7E3 - const EVENT_7E4 - const EVENT_7E5 - const EVENT_7E6 - const EVENT_7E7 - const EVENT_7E8 - const EVENT_7E9 - const EVENT_7EA - const EVENT_7EB - const EVENT_7EC - const EVENT_7ED - const EVENT_7EE - const EVENT_7EF - const EVENT_7F0 - const EVENT_7F1 - const EVENT_7F2 - const EVENT_7F3 - const EVENT_7F4 - const EVENT_7F5 - const EVENT_7F6 - const EVENT_7F7 - const EVENT_7F8 - const EVENT_7F9 - const EVENT_7FA - const EVENT_7FB - const EVENT_7FC - const EVENT_7FD - const EVENT_7FE - const EVENT_7FF - const EVENT_800 - const EVENT_BEAT_MANSION_2_TRAINER_0 - const EVENT_802 - const EVENT_803 - const EVENT_804 - const EVENT_805 - const EVENT_806 - const EVENT_807 - const EVENT_808 - const EVENT_809 - const EVENT_80A - const EVENT_80B - const EVENT_80C - const EVENT_80D - const EVENT_80E - const EVENT_80F - const EVENT_810 - const EVENT_BEAT_MANSION_3_TRAINER_0 - const EVENT_BEAT_MANSION_3_TRAINER_2 - const EVENT_813 - const EVENT_814 - const EVENT_815 - const EVENT_816 - const EVENT_817 - const EVENT_818 - const EVENT_819 - const EVENT_81A - const EVENT_81B - const EVENT_81C - const EVENT_81D - const EVENT_81E - const EVENT_81F - const EVENT_820 - const EVENT_BEAT_MANSION_4_TRAINER_0 - const EVENT_BEAT_MANSION_4_TRAINER_2 - const EVENT_823 - const EVENT_824 - const EVENT_825 - const EVENT_826 - const EVENT_827 - const EVENT_828 - const EVENT_829 - const EVENT_82A - const EVENT_82B - const EVENT_82C - const EVENT_82D - const EVENT_82E - const EVENT_82F - const EVENT_830 - const EVENT_831 - const EVENT_832 - const EVENT_833 - const EVENT_834 - const EVENT_835 - const EVENT_836 - const EVENT_837 - const EVENT_838 - const EVENT_839 - const EVENT_83A - const EVENT_83B - const EVENT_83C - const EVENT_83D - const EVENT_83E - const EVENT_83F - const EVENT_840 - const EVENT_841 - const EVENT_842 - const EVENT_843 - const EVENT_844 - const EVENT_845 - const EVENT_846 - const EVENT_847 - const EVENT_848 - const EVENT_849 - const EVENT_84A - const EVENT_84B - const EVENT_84C - const EVENT_84D - const EVENT_84E - const EVENT_84F - const EVENT_850 - const EVENT_851 - const EVENT_852 - const EVENT_853 - const EVENT_854 - const EVENT_855 - const EVENT_856 - const EVENT_857 - const EVENT_858 - const EVENT_859 - const EVENT_85A - const EVENT_85B - const EVENT_85C - const EVENT_85D - const EVENT_85E - const EVENT_85F - const EVENT_860 - const EVENT_861 - const EVENT_862 - const EVENT_863 - const EVENT_864 - const EVENT_865 - const EVENT_866 - const EVENT_867 - const EVENT_868 - const EVENT_869 - const EVENT_86A - const EVENT_86B - const EVENT_86C - const EVENT_86D - const EVENT_86E - const EVENT_86F - const EVENT_870 - const EVENT_871 - const EVENT_872 - const EVENT_873 - const EVENT_874 - const EVENT_875 - const EVENT_876 - const EVENT_877 - const EVENT_878 - const EVENT_879 - const EVENT_87A - const EVENT_87B - const EVENT_87C - const EVENT_87D - const EVENT_87E - const EVENT_87F - const EVENT_GOT_HM03 - const EVENT_881 - const EVENT_882 - const EVENT_883 - const EVENT_884 - const EVENT_885 - const EVENT_886 - const EVENT_887 - const EVENT_888 - const EVENT_889 - const EVENT_88A - const EVENT_88B - const EVENT_88C - const EVENT_88D - const EVENT_88E - const EVENT_88F - const EVENT_890 - const EVENT_891 - const EVENT_892 - const EVENT_893 - const EVENT_894 - const EVENT_895 - const EVENT_896 - const EVENT_897 - const EVENT_898 - const EVENT_899 - const EVENT_89A - const EVENT_89B - const EVENT_89C - const EVENT_89D - const EVENT_89E - const EVENT_89F - const EVENT_8A0 - const EVENT_8A1 - const EVENT_8A2 - const EVENT_8A3 - const EVENT_8A4 - const EVENT_8A5 - const EVENT_8A6 - const EVENT_8A7 - const EVENT_8A8 - const EVENT_8A9 - const EVENT_8AA - const EVENT_8AB - const EVENT_8AC - const EVENT_8AD - const EVENT_8AE - const EVENT_8AF - const EVENT_8B0 - const EVENT_8B1 - const EVENT_8B2 - const EVENT_8B3 - const EVENT_8B4 - const EVENT_8B5 - const EVENT_8B6 - const EVENT_8B7 - const EVENT_8B8 - const EVENT_8B9 - const EVENT_8BA - const EVENT_8BB - const EVENT_8BC - const EVENT_8BD - const EVENT_8BE - const EVENT_8BF - const EVENT_8C0 - const EVENT_BEAT_UNKNOWN_DUNGEON_3_TRAINER_0 - const EVENT_8C2 - const EVENT_8C3 - const EVENT_8C4 - const EVENT_8C5 - const EVENT_8C6 - const EVENT_8C7 - const EVENT_8C8 - const EVENT_8C9 - const EVENT_8CA - const EVENT_8CB - const EVENT_8CC - const EVENT_8CD - const EVENT_8CE - const EVENT_8CF - const EVENT_8D0 - const EVENT_8D1 - const EVENT_8D2 - const EVENT_8D3 - const EVENT_8D4 - const EVENT_8D5 - const EVENT_8D6 - const EVENT_8D7 - const EVENT_8D8 - const EVENT_8D9 - const EVENT_8DA - const EVENT_8DB - const EVENT_8DC - const EVENT_8DD - const EVENT_8DE - const EVENT_8DF - const EVENT_ELITE4_EVENTS_START - const EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 - const EVENT_8E2 - const EVENT_8E3 - const EVENT_8E4 - const EVENT_8E5 - const EVENT_AUTOWALKED_INTO_LORELEIS_ROOM - const EVENT_8E7 - const EVENT_8E8 - const EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 - const EVENT_8EA - const EVENT_8EB - const EVENT_8EC - const EVENT_8ED - const EVENT_AUTOWALKED_INTO_BRUNOS_ROOM - const EVENT_8EF - const EVENT_8F0 - const EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 - const EVENT_8F2 - const EVENT_8F3 - const EVENT_8F4 - const EVENT_8F5 - const EVENT_AUTOWALKED_INTO_AGATHAS_ROOM - const EVENT_8F7 - const EVENT_8F8 - const EVENT_BEAT_LANCES_ROOM_TRAINER_0 - const EVENT_8FA - const EVENT_8FB - const EVENT_8FC - const EVENT_8FD - const EVENT_BEAT_LANCE - const EVENT_LANCES_ROOM_LOCK_DOOR - const EVENT_900 - const EVENT_BEAT_CHAMPION_RIVAL - const EVENT_902 - const EVENT_903 - const EVENT_904 - const EVENT_905 - const EVENT_906 - const EVENT_907 - const EVENT_908 - const EVENT_909 - const EVENT_90A - const EVENT_90B - const EVENT_90C - const EVENT_90D - const EVENT_90E - const EVENT_90F - const EVENT_910 - const EVENT_BEAT_VICTORY_ROAD_1_TRAINER_0 - const EVENT_BEAT_VICTORY_ROAD_1_TRAINER_1 - const EVENT_913 - const EVENT_914 - const EVENT_915 - const EVENT_916 - const EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH - const EVENT_918 - const EVENT_919 - const EVENT_91A - const EVENT_91B - const EVENT_91C - const EVENT_91D - const EVENT_91E - const EVENT_91F - const EVENT_920 - const EVENT_921 - const EVENT_922 - const EVENT_923 - const EVENT_924 - const EVENT_925 - const EVENT_926 - const EVENT_927 - const EVENT_928 - const EVENT_929 - const EVENT_92A - const EVENT_92B - const EVENT_92C - const EVENT_92D - const EVENT_92E - const EVENT_92F - const EVENT_930 - const EVENT_931 - const EVENT_932 - const EVENT_933 - const EVENT_934 - const EVENT_935 - const EVENT_936 - const EVENT_937 - const EVENT_938 - const EVENT_939 - const EVENT_93A - const EVENT_93B - const EVENT_93C - const EVENT_93D - const EVENT_93E - const EVENT_93F - const EVENT_940 - const EVENT_941 - const EVENT_942 - const EVENT_943 - const EVENT_944 - const EVENT_945 - const EVENT_946 - const EVENT_947 - const EVENT_948 - const EVENT_949 - const EVENT_94A - const EVENT_94B - const EVENT_94C - const EVENT_94D - const EVENT_94E - const EVENT_94F - const EVENT_950 - const EVENT_951 - const EVENT_952 - const EVENT_953 - const EVENT_954 - const EVENT_955 - const EVENT_956 - const EVENT_957 - const EVENT_958 - const EVENT_959 - const EVENT_95A - const EVENT_95B - const EVENT_95C - const EVENT_95D - const EVENT_95E - const EVENT_95F - const EVENT_960 - const EVENT_961 - const EVENT_962 - const EVENT_963 - const EVENT_964 - const EVENT_965 - const EVENT_966 - const EVENT_967 - const EVENT_968 - const EVENT_969 - const EVENT_96A - const EVENT_96B - const EVENT_96C - const EVENT_96D - const EVENT_96E - const EVENT_96F - const EVENT_970 - const EVENT_971 - const EVENT_972 - const EVENT_973 - const EVENT_974 - const EVENT_975 - const EVENT_976 - const EVENT_977 - const EVENT_978 - const EVENT_979 - const EVENT_97A - const EVENT_97B - const EVENT_97C - const EVENT_97D - const EVENT_97E - const EVENT_97F - const EVENT_980 - const EVENT_981 - const EVENT_982 - const EVENT_983 - const EVENT_984 - const EVENT_985 - const EVENT_986 - const EVENT_987 - const EVENT_988 - const EVENT_989 - const EVENT_98A - const EVENT_98B - const EVENT_98C - const EVENT_98D - const EVENT_98E - const EVENT_98F - const EVENT_990 - const EVENT_991 - const EVENT_992 - const EVENT_993 - const EVENT_994 - const EVENT_995 - const EVENT_996 - const EVENT_997 - const EVENT_998 - const EVENT_999 - const EVENT_99A - const EVENT_99B - const EVENT_99C - const EVENT_99D - const EVENT_99E - const EVENT_99F - const EVENT_9A0 - const EVENT_9A1 - const EVENT_9A2 - const EVENT_9A3 - const EVENT_9A4 - const EVENT_9A5 - const EVENT_9A6 - const EVENT_9A7 - const EVENT_9A8 - const EVENT_9A9 - const EVENT_9AA - const EVENT_9AB - const EVENT_9AC - const EVENT_9AD - const EVENT_9AE - const EVENT_9AF - const EVENT_9B0 - const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0 - const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2 - const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3 - const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4 - const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5 - const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6 - const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7 - const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_8 - const EVENT_9B9 - const EVENT_9BA - const EVENT_9BB - const EVENT_9BC - const EVENT_9BD - const EVENT_9BE - const EVENT_9BF - const EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE - const EVENT_SEAFOAM2_BOULDER2_DOWN_HOLE - const EVENT_9C2 - const EVENT_9C3 - const EVENT_9C4 - const EVENT_9C5 - const EVENT_9C6 - const EVENT_9C7 - const EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE - const EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE - const EVENT_9CA - const EVENT_9CB - const EVENT_9CC - const EVENT_9CD - const EVENT_9CE - const EVENT_9CF - const EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE - const EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE - const EVENT_9D2 - const EVENT_9D3 - const EVENT_9D4 - const EVENT_9D5 - const EVENT_9D6 - const EVENT_9D7 - const EVENT_9D8 - const EVENT_9D9 - const EVENT_BEAT_SEAFOAM_ISLANDS_5_TRAINER_0 - const EVENT_9DB - const EVENT_9DC - const EVENT_9DD - const EVENT_9DE - const EVENT_9DF - const EVENT_9E0 - const EVENT_9E1 - const EVENT_9E2 - const EVENT_9E3 - const EVENT_9E4 - const EVENT_9E5 - const EVENT_9E6 - const EVENT_9E7 - const EVENT_9E8 - const EVENT_9E9 - const EVENT_9EA - const EVENT_9EB - const EVENT_9EC - const EVENT_9ED - const EVENT_9EE - const EVENT_9EF - const EVENT_9F0 - const EVENT_9F1 - const EVENT_9F2 - const EVENT_9F3 - const EVENT_9F4 - const EVENT_9F5 - const EVENT_9F6 - const EVENT_9F7 - const EVENT_9F8 - const EVENT_9F9 - const EVENT_9FA - const EVENT_9FB - const EVENT_9FC - const EVENT_9FD - const EVENT_9FE - const EVENT_9FF +const_value = 0 + + const EVENT_FOLLOWED_OAK_INTO_LAB ; 000, (D747, bit 0) + const EVENT_001 ; 001, (D747, bit 1) + const EVENT_002 ; 002, (D747, bit 2) + const EVENT_003 ; 003, (D747, bit 3) + const EVENT_004 ; 004, (D747, bit 4) + const EVENT_005 ; 005, (D747, bit 5) + const EVENT_PALLET_AFTER_GETTING_POKEBALLS ; 006, (D747, bit 6) + const EVENT_007 ; 007, (D747, bit 7) + const EVENT_008 ; 008, (D748, bit 0) + const EVENT_009 ; 009, (D748, bit 1) + const EVENT_00A ; 00A, (D748, bit 2) + const EVENT_00B ; 00B, (D748, bit 3) + const EVENT_00C ; 00C, (D748, bit 4) + const EVENT_00D ; 00D, (D748, bit 5) + const EVENT_00E ; 00E, (D748, bit 6) + const EVENT_00F ; 00F, (D748, bit 7) + const EVENT_010 ; 010, (D749, bit 0) + const EVENT_011 ; 011, (D749, bit 1) + const EVENT_012 ; 012, (D749, bit 2) + const EVENT_013 ; 013, (D749, bit 3) + const EVENT_014 ; 014, (D749, bit 4) + const EVENT_015 ; 015, (D749, bit 5) + const EVENT_016 ; 016, (D749, bit 6) + const EVENT_017 ; 017, (D749, bit 7) + const EVENT_GOT_TOWN_MAP ; 018, (D74A, bit 0) + const EVENT_ENTERED_BLUES_HOUSE ; 019, (D74A, bit 1) + const EVENT_DAISY_WALKING ; 01A, (D74A, bit 2) + const EVENT_01B ; 01B, (D74A, bit 3) + const EVENT_01C ; 01C, (D74A, bit 4) + const EVENT_01D ; 01D, (D74A, bit 5) + const EVENT_01E ; 01E, (D74A, bit 6) + const EVENT_01F ; 01F, (D74A, bit 7) + const EVENT_FOLLOWED_OAK_INTO_LAB_2 ; 020, (D74B, bit 0) + const EVENT_OAK_ASKED_TO_CHOOSE_MON ; 021, (D74B, bit 1) + const EVENT_GOT_STARTER ; 022, (D74B, bit 2) + const EVENT_BATTLED_RIVAL_IN_OAKS_LAB ; 023, (D74B, bit 3) + const EVENT_GOT_POKEBALLS_FROM_OAK ; 024, (D74B, bit 4) + const EVENT_GOT_POKEDEX ; 025, (D74B, bit 5) + const EVENT_PALLET_AFTER_GETTING_POKEBALLS_2 ; 026, (D74B, bit 6) + const EVENT_OAK_APPEARED_IN_PALLET ; 027, (D74B, bit 7) + const EVENT_VIRIDIAN_GYM_OPEN ; 028, (D74C, bit 0) + const EVENT_GOT_TM42 ; 029, (D74C, bit 1) + const EVENT_02A ; 02A, (D74C, bit 2) + const EVENT_02B ; 02B, (D74C, bit 3) + const EVENT_02C ; 02C, (D74C, bit 4) + const EVENT_02D ; 02D, (D74C, bit 5) + const EVENT_02E ; 02E, (D74C, bit 6) + const EVENT_02F ; 02F, (D74C, bit 7) + const EVENT_030 ; 030, (D74D, bit 0) + const EVENT_031 ; 031, (D74D, bit 1) + const EVENT_032 ; 032, (D74D, bit 2) + const EVENT_033 ; 033, (D74D, bit 3) + const EVENT_034 ; 034, (D74D, bit 4) + const EVENT_035 ; 035, (D74D, bit 5) + const EVENT_036 ; 036, (D74D, bit 6) + const EVENT_037 ; 037, (D74D, bit 7) + const EVENT_OAK_GOT_PARCEL ; 038, (D74E, bit 0) + const EVENT_GOT_OAKS_PARCEL ; 039, (D74E, bit 1) + const EVENT_03A ; 03A, (D74E, bit 2) + const EVENT_03B ; 03B, (D74E, bit 3) + const EVENT_03C ; 03C, (D74E, bit 4) + const EVENT_03D ; 03D, (D74E, bit 5) + const EVENT_03E ; 03E, (D74E, bit 6) + const EVENT_03F ; 03F, (D74E, bit 7) + const EVENT_040 ; 040, (D74F, bit 0) + const EVENT_041 ; 041, (D74F, bit 1) + const EVENT_042 ; 042, (D74F, bit 2) + const EVENT_043 ; 043, (D74F, bit 3) + const EVENT_044 ; 044, (D74F, bit 4) + const EVENT_045 ; 045, (D74F, bit 5) + const EVENT_046 ; 046, (D74F, bit 6) + const EVENT_047 ; 047, (D74F, bit 7) + const EVENT_048 ; 048, (D750, bit 0) + const EVENT_049 ; 049, (D750, bit 1) + const EVENT_04A ; 04A, (D750, bit 2) + const EVENT_04B ; 04B, (D750, bit 3) + const EVENT_04C ; 04C, (D750, bit 4) + const EVENT_04D ; 04D, (D750, bit 5) + const EVENT_04E ; 04E, (D750, bit 6) + const EVENT_04F ; 04F, (D750, bit 7) + const EVENT_GOT_TM27 ; 050, (D751, bit 0) + const EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI ; 051, (D751, bit 1) + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0 ; 052, (D751, bit 2) + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1 ; 053, (D751, bit 3) + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2 ; 054, (D751, bit 4) + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3 ; 055, (D751, bit 5) + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4 ; 056, (D751, bit 6) + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5 ; 057, (D751, bit 7) + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6 ; 058, (D752, bit 0) + const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7 ; 059, (D752, bit 1) + const EVENT_05A ; 05A, (D752, bit 2) + const EVENT_05B ; 05B, (D752, bit 3) + const EVENT_05C ; 05C, (D752, bit 4) + const EVENT_05D ; 05D, (D752, bit 5) + const EVENT_05E ; 05E, (D752, bit 6) + const EVENT_05F ; 05F, (D752, bit 7) + const EVENT_060 ; 060, (D753, bit 0) + const EVENT_061 ; 061, (D753, bit 1) + const EVENT_062 ; 062, (D753, bit 2) + const EVENT_063 ; 063, (D753, bit 3) + const EVENT_064 ; 064, (D753, bit 4) + const EVENT_065 ; 065, (D753, bit 5) + const EVENT_066 ; 066, (D753, bit 6) + const EVENT_067 ; 067, (D753, bit 7) + const EVENT_BOUGHT_MUSEUM_TICKET ; 068, (D754, bit 0) + const EVENT_GOT_OLD_AMBER ; 069, (D754, bit 1) + const EVENT_06A ; 06A, (D754, bit 2) + const EVENT_06B ; 06B, (D754, bit 3) + const EVENT_06C ; 06C, (D754, bit 4) + const EVENT_06D ; 06D, (D754, bit 5) + const EVENT_06E ; 06E, (D754, bit 6) + const EVENT_06F ; 06F, (D754, bit 7) + const EVENT_070 ; 070, (D755, bit 0) + const EVENT_071 ; 071, (D755, bit 1) + const EVENT_BEAT_PEWTER_GYM_TRAINER_0 ; 072, (D755, bit 2) + const EVENT_073 ; 073, (D755, bit 3) + const EVENT_074 ; 074, (D755, bit 4) + const EVENT_075 ; 075, (D755, bit 5) + const EVENT_GOT_TM34 ; 076, (D755, bit 6) + const EVENT_BEAT_BROCK ; 077, (D755, bit 7) + const EVENT_078 ; 078, (D756, bit 0) + const EVENT_079 ; 079, (D756, bit 1) + const EVENT_07A ; 07A, (D756, bit 2) + const EVENT_07B ; 07B, (D756, bit 3) + const EVENT_07C ; 07C, (D756, bit 4) + const EVENT_07D ; 07D, (D756, bit 5) + const EVENT_07E ; 07E, (D756, bit 6) + const EVENT_07F ; 07F, (D756, bit 7) + const EVENT_080 ; 080, (D757, bit 0) + const EVENT_081 ; 081, (D757, bit 1) + const EVENT_082 ; 082, (D757, bit 2) + const EVENT_083 ; 083, (D757, bit 3) + const EVENT_084 ; 084, (D757, bit 4) + const EVENT_085 ; 085, (D757, bit 5) + const EVENT_086 ; 086, (D757, bit 6) + const EVENT_087 ; 087, (D757, bit 7) + const EVENT_088 ; 088, (D758, bit 0) + const EVENT_089 ; 089, (D758, bit 1) + const EVENT_08A ; 08A, (D758, bit 2) + const EVENT_08B ; 08B, (D758, bit 3) + const EVENT_08C ; 08C, (D758, bit 4) + const EVENT_08D ; 08D, (D758, bit 5) + const EVENT_08E ; 08E, (D758, bit 6) + const EVENT_08F ; 08F, (D758, bit 7) + const EVENT_090 ; 090, (D759, bit 0) + const EVENT_091 ; 091, (D759, bit 1) + const EVENT_092 ; 092, (D759, bit 2) + const EVENT_093 ; 093, (D759, bit 3) + const EVENT_094 ; 094, (D759, bit 4) + const EVENT_095 ; 095, (D759, bit 5) + const EVENT_096 ; 096, (D759, bit 6) + const EVENT_097 ; 097, (D759, bit 7) + const EVENT_BEAT_CERULEAN_RIVAL ; 098, (D75A, bit 0) + const EVENT_099 ; 099, (D75A, bit 1) + const EVENT_09A ; 09A, (D75A, bit 2) + const EVENT_09B ; 09B, (D75A, bit 3) + const EVENT_09C ; 09C, (D75A, bit 4) + const EVENT_09D ; 09D, (D75A, bit 5) + const EVENT_09E ; 09E, (D75A, bit 6) + const EVENT_09F ; 09F, (D75A, bit 7) + const EVENT_0A0 ; 0A0, (D75B, bit 0) + const EVENT_0A1 ; 0A1, (D75B, bit 1) + const EVENT_0A2 ; 0A2, (D75B, bit 2) + const EVENT_0A3 ; 0A3, (D75B, bit 3) + const EVENT_0A4 ; 0A4, (D75B, bit 4) + const EVENT_0A5 ; 0A5, (D75B, bit 5) + const EVENT_0A6 ; 0A6, (D75B, bit 6) + const EVENT_BEAT_CERULEAN_ROCKET_THIEF ; 0A7, (D75B, bit 7) + const EVENT_0A8 ; 0A8, (D75C, bit 0) + const EVENT_0A9 ; 0A9, (D75C, bit 1) + const EVENT_0AA ; 0AA, (D75C, bit 2) + const EVENT_0AB ; 0AB, (D75C, bit 3) + const EVENT_0AC ; 0AC, (D75C, bit 4) + const EVENT_0AD ; 0AD, (D75C, bit 5) + const EVENT_0AE ; 0AE, (D75C, bit 6) + const EVENT_0AF ; 0AF, (D75C, bit 7) + const EVENT_0B0 ; 0B0, (D75D, bit 0) + const EVENT_0B1 ; 0B1, (D75D, bit 1) + const EVENT_0B2 ; 0B2, (D75D, bit 2) + const EVENT_0B3 ; 0B3, (D75D, bit 3) + const EVENT_0B4 ; 0B4, (D75D, bit 4) + const EVENT_0B5 ; 0B5, (D75D, bit 5) + const EVENT_0B6 ; 0B6, (D75D, bit 6) + const EVENT_0B7 ; 0B7, (D75D, bit 7) + const EVENT_0B8 ; 0B8, (D75E, bit 0) + const EVENT_0B9 ; 0B9, (D75E, bit 1) + const EVENT_BEAT_CERULEAN_GYM_TRAINER_0 ; 0BA, (D75E, bit 2) + const EVENT_BEAT_CERULEAN_GYM_TRAINER_1 ; 0BB, (D75E, bit 3) + const EVENT_0BC ; 0BC, (D75E, bit 4) + const EVENT_0BD ; 0BD, (D75E, bit 5) + const EVENT_GOT_TM11 ; 0BE, (D75E, bit 6) + const EVENT_BEAT_MISTY ; 0BF, (D75E, bit 7) + const EVENT_GOT_BICYCLE ; 0C0, (D75F, bit 0) + const EVENT_0C1 ; 0C1, (D75F, bit 1) + const EVENT_0C2 ; 0C2, (D75F, bit 2) + const EVENT_0C3 ; 0C3, (D75F, bit 3) + const EVENT_0C4 ; 0C4, (D75F, bit 4) + const EVENT_0C5 ; 0C5, (D75F, bit 5) + const EVENT_0C6 ; 0C6, (D75F, bit 6) + const EVENT_0C7 ; 0C7, (D75F, bit 7) + const EVENT_0C8 ; 0C8, (D760, bit 0) + const EVENT_0C9 ; 0C9, (D760, bit 1) + const EVENT_0CA ; 0CA, (D760, bit 2) + const EVENT_0CB ; 0CB, (D760, bit 3) + const EVENT_0CC ; 0CC, (D760, bit 4) + const EVENT_0CD ; 0CD, (D760, bit 5) + const EVENT_0CE ; 0CE, (D760, bit 6) + const EVENT_0CF ; 0CF, (D760, bit 7) + const EVENT_0D0 ; 0D0, (D761, bit 0) + const EVENT_0D1 ; 0D1, (D761, bit 1) + const EVENT_0D2 ; 0D2, (D761, bit 2) + const EVENT_0D3 ; 0D3, (D761, bit 3) + const EVENT_0D4 ; 0D4, (D761, bit 4) + const EVENT_0D5 ; 0D5, (D761, bit 5) + const EVENT_0D6 ; 0D6, (D761, bit 6) + const EVENT_0D7 ; 0D7, (D761, bit 7) + const EVENT_0D8 ; 0D8, (D762, bit 0) + const EVENT_0D9 ; 0D9, (D762, bit 1) + const EVENT_0DA ; 0DA, (D762, bit 2) + const EVENT_0DB ; 0DB, (D762, bit 3) + const EVENT_0DC ; 0DC, (D762, bit 4) + const EVENT_0DD ; 0DD, (D762, bit 5) + const EVENT_0DE ; 0DE, (D762, bit 6) + const EVENT_0DF ; 0DF, (D762, bit 7) + const EVENT_0E0 ; 0E0, (D763, bit 0) + const EVENT_0E1 ; 0E1, (D763, bit 1) + const EVENT_0E2 ; 0E2, (D763, bit 2) + const EVENT_0E3 ; 0E3, (D763, bit 3) + const EVENT_0E4 ; 0E4, (D763, bit 4) + const EVENT_0E5 ; 0E5, (D763, bit 5) + const EVENT_0E6 ; 0E6, (D763, bit 6) + const EVENT_0E7 ; 0E7, (D763, bit 7) + const EVENT_0E8 ; 0E8, (D764, bit 0) + const EVENT_0E9 ; 0E9, (D764, bit 1) + const EVENT_0EA ; 0EA, (D764, bit 2) + const EVENT_0EB ; 0EB, (D764, bit 3) + const EVENT_0EC ; 0EC, (D764, bit 4) + const EVENT_0ED ; 0ED, (D764, bit 5) + const EVENT_POKEMON_TOWER_RIVAL_ON_LEFT ; 0EE, (D764, bit 6) + const EVENT_BEAT_POKEMON_TOWER_RIVAL ; 0EF, (D764, bit 7) + const EVENT_0F0 ; 0F0, (D765, bit 0) + const EVENT_BEAT_POKEMONTOWER_3_TRAINER_0 ; 0F1, (D765, bit 1) + const EVENT_BEAT_POKEMONTOWER_3_TRAINER_1 ; 0F2, (D765, bit 2) + const EVENT_BEAT_POKEMONTOWER_3_TRAINER_2 ; 0F3, (D765, bit 3) + const EVENT_0F4 ; 0F4, (D765, bit 4) + const EVENT_0F5 ; 0F5, (D765, bit 5) + const EVENT_0F6 ; 0F6, (D765, bit 6) + const EVENT_0F7 ; 0F7, (D765, bit 7) + const EVENT_0F8 ; 0F8, (D766, bit 0) + const EVENT_BEAT_POKEMONTOWER_4_TRAINER_0 ; 0F9, (D766, bit 1) + const EVENT_BEAT_POKEMONTOWER_4_TRAINER_1 ; 0FA, (D766, bit 2) + const EVENT_BEAT_POKEMONTOWER_4_TRAINER_2 ; 0FB, (D766, bit 3) + const EVENT_0FC ; 0FC, (D766, bit 4) + const EVENT_0FD ; 0FD, (D766, bit 5) + const EVENT_0FE ; 0FE, (D766, bit 6) + const EVENT_0FF ; 0FF, (D766, bit 7) + const EVENT_100 ; 100, (D767, bit 0) + const EVENT_101 ; 101, (D767, bit 1) + const EVENT_BEAT_POKEMONTOWER_5_TRAINER_0 ; 102, (D767, bit 2) + const EVENT_BEAT_POKEMONTOWER_5_TRAINER_1 ; 103, (D767, bit 3) + const EVENT_BEAT_POKEMONTOWER_5_TRAINER_2 ; 104, (D767, bit 4) + const EVENT_BEAT_POKEMONTOWER_5_TRAINER_3 ; 105, (D767, bit 5) + const EVENT_106 ; 106, (D767, bit 6) + const EVENT_IN_PURIFIED_ZONE ; 107, (D767, bit 7) + const EVENT_108 ; 108, (D768, bit 0) + const EVENT_BEAT_POKEMONTOWER_6_TRAINER_0 ; 109, (D768, bit 1) + const EVENT_BEAT_POKEMONTOWER_6_TRAINER_1 ; 10A, (D768, bit 2) + const EVENT_BEAT_POKEMONTOWER_6_TRAINER_2 ; 10B, (D768, bit 3) + const EVENT_10C ; 10C, (D768, bit 4) + const EVENT_10D ; 10D, (D768, bit 5) + const EVENT_10E ; 10E, (D768, bit 6) + const EVENT_BEAT_GHOST_MAROWAK ; 10F, (D768, bit 7) + const EVENT_110 ; 110, (D769, bit 0) + const EVENT_BEAT_POKEMONTOWER_7_TRAINER_0 ; 111, (D769, bit 1) + const EVENT_BEAT_POKEMONTOWER_7_TRAINER_1 ; 112, (D769, bit 2) + const EVENT_BEAT_POKEMONTOWER_7_TRAINER_2 ; 113, (D769, bit 3) + const EVENT_114 ; 114, (D769, bit 4) + const EVENT_115 ; 115, (D769, bit 5) + const EVENT_116 ; 116, (D769, bit 6) + const EVENT_RESCUED_MR_FUJI_2 ; 117, (D769, bit 7) + const EVENT_118 ; 118, (D76A, bit 0) + const EVENT_119 ; 119, (D76A, bit 1) + const EVENT_11A ; 11A, (D76A, bit 2) + const EVENT_11B ; 11B, (D76A, bit 3) + const EVENT_11C ; 11C, (D76A, bit 4) + const EVENT_11D ; 11D, (D76A, bit 5) + const EVENT_11E ; 11E, (D76A, bit 6) + const EVENT_11F ; 11F, (D76A, bit 7) + const EVENT_120 ; 120, (D76B, bit 0) + const EVENT_121 ; 121, (D76B, bit 1) + const EVENT_122 ; 122, (D76B, bit 2) + const EVENT_123 ; 123, (D76B, bit 3) + const EVENT_124 ; 124, (D76B, bit 4) + const EVENT_125 ; 125, (D76B, bit 5) + const EVENT_126 ; 126, (D76B, bit 6) + const EVENT_127 ; 127, (D76B, bit 7) + const EVENT_GOT_POKE_FLUTE ; 128, (D76C, bit 0) + const EVENT_129 ; 129, (D76C, bit 1) + const EVENT_12A ; 12A, (D76C, bit 2) + const EVENT_12B ; 12B, (D76C, bit 3) + const EVENT_12C ; 12C, (D76C, bit 4) + const EVENT_12D ; 12D, (D76C, bit 5) + const EVENT_12E ; 12E, (D76C, bit 6) + const EVENT_12F ; 12F, (D76C, bit 7) + const EVENT_130 ; 130, (D76D, bit 0) + const EVENT_131 ; 131, (D76D, bit 1) + const EVENT_132 ; 132, (D76D, bit 2) + const EVENT_133 ; 133, (D76D, bit 3) + const EVENT_134 ; 134, (D76D, bit 4) + const EVENT_135 ; 135, (D76D, bit 5) + const EVENT_136 ; 136, (D76D, bit 6) + const EVENT_137 ; 137, (D76D, bit 7) + const EVENT_138 ; 138, (D76E, bit 0) + const EVENT_139 ; 139, (D76E, bit 1) + const EVENT_13A ; 13A, (D76E, bit 2) + const EVENT_13B ; 13B, (D76E, bit 3) + const EVENT_13C ; 13C, (D76E, bit 4) + const EVENT_13D ; 13D, (D76E, bit 5) + const EVENT_13E ; 13E, (D76E, bit 6) + const EVENT_13F ; 13F, (D76E, bit 7) + const EVENT_140 ; 140, (D76F, bit 0) + const EVENT_141 ; 141, (D76F, bit 1) + const EVENT_142 ; 142, (D76F, bit 2) + const EVENT_143 ; 143, (D76F, bit 3) + const EVENT_144 ; 144, (D76F, bit 4) + const EVENT_145 ; 145, (D76F, bit 5) + const EVENT_146 ; 146, (D76F, bit 6) + const EVENT_147 ; 147, (D76F, bit 7) + const EVENT_148 ; 148, (D770, bit 0) + const EVENT_149 ; 149, (D770, bit 1) + const EVENT_14A ; 14A, (D770, bit 2) + const EVENT_14B ; 14B, (D770, bit 3) + const EVENT_14C ; 14C, (D770, bit 4) + const EVENT_14D ; 14D, (D770, bit 5) + const EVENT_14E ; 14E, (D770, bit 6) + const EVENT_14F ; 14F, (D770, bit 7) + const EVENT_150 ; 150, (D771, bit 0) + const EVENT_GOT_BIKE_VOUCHER ; 151, (D771, bit 1) + const EVENT_152 ; 152, (D771, bit 2) + const EVENT_153 ; 153, (D771, bit 3) + const EVENT_154 ; 154, (D771, bit 4) + const EVENT_155 ; 155, (D771, bit 5) + const EVENT_SEEL_FAN_BOAST ; 156, (D771, bit 6) + const EVENT_PIKACHU_FAN_BOAST ; 157, (D771, bit 7) + const EVENT_158 ; 158, (D772, bit 0) + const EVENT_159 ; 159, (D772, bit 1) + const EVENT_15A ; 15A, (D772, bit 2) + const EVENT_15B ; 15B, (D772, bit 3) + const EVENT_15C ; 15C, (D772, bit 4) + const EVENT_15D ; 15D, (D772, bit 5) + const EVENT_15E ; 15E, (D772, bit 6) + const EVENT_15F ; 15F, (D772, bit 7) + const EVENT_2ND_LOCK_OPENED ; 160, (D773, bit 0) + const EVENT_1ST_LOCK_OPENED ; 161, (D773, bit 1) + const EVENT_BEAT_VERMILION_GYM_TRAINER_0 ; 162, (D773, bit 2) + const EVENT_BEAT_VERMILION_GYM_TRAINER_1 ; 163, (D773, bit 3) + const EVENT_BEAT_VERMILION_GYM_TRAINER_2 ; 164, (D773, bit 4) + const EVENT_165 ; 165, (D773, bit 5) + const EVENT_GOT_TM24 ; 166, (D773, bit 6) + const EVENT_BEAT_LT_SURGE ; 167, (D773, bit 7) + const EVENT_168 ; 168, (D774, bit 0) + const EVENT_169 ; 169, (D774, bit 1) + const EVENT_16A ; 16A, (D774, bit 2) + const EVENT_16B ; 16B, (D774, bit 3) + const EVENT_16C ; 16C, (D774, bit 4) + const EVENT_16D ; 16D, (D774, bit 5) + const EVENT_16E ; 16E, (D774, bit 6) + const EVENT_16F ; 16F, (D774, bit 7) + const EVENT_170 ; 170, (D775, bit 0) + const EVENT_171 ; 171, (D775, bit 1) + const EVENT_172 ; 172, (D775, bit 2) + const EVENT_173 ; 173, (D775, bit 3) + const EVENT_174 ; 174, (D775, bit 4) + const EVENT_175 ; 175, (D775, bit 5) + const EVENT_176 ; 176, (D775, bit 6) + const EVENT_177 ; 177, (D775, bit 7) + const EVENT_178 ; 178, (D776, bit 0) + const EVENT_179 ; 179, (D776, bit 1) + const EVENT_17A ; 17A, (D776, bit 2) + const EVENT_17B ; 17B, (D776, bit 3) + const EVENT_17C ; 17C, (D776, bit 4) + const EVENT_17D ; 17D, (D776, bit 5) + const EVENT_17E ; 17E, (D776, bit 6) + const EVENT_17F ; 17F, (D776, bit 7) + const EVENT_GOT_TM41 ; 180, (D777, bit 0) + const EVENT_181 ; 181, (D777, bit 1) + const EVENT_182 ; 182, (D777, bit 2) + const EVENT_183 ; 183, (D777, bit 3) + const EVENT_184 ; 184, (D777, bit 4) + const EVENT_185 ; 185, (D777, bit 5) + const EVENT_186 ; 186, (D777, bit 6) + const EVENT_187 ; 187, (D777, bit 7) + const EVENT_188 ; 188, (D778, bit 0) + const EVENT_189 ; 189, (D778, bit 1) + const EVENT_18A ; 18A, (D778, bit 2) + const EVENT_18B ; 18B, (D778, bit 3) + const EVENT_GOT_TM13 ; 18C, (D778, bit 4) + const EVENT_GOT_TM48 ; 18D, (D778, bit 5) + const EVENT_GOT_TM49 ; 18E, (D778, bit 6) + const EVENT_GOT_TM18 ; 18F, (D778, bit 7) + const EVENT_190 ; 190, (D779, bit 0) + const EVENT_191 ; 191, (D779, bit 1) + const EVENT_192 ; 192, (D779, bit 2) + const EVENT_193 ; 193, (D779, bit 3) + const EVENT_194 ; 194, (D779, bit 4) + const EVENT_195 ; 195, (D779, bit 5) + const EVENT_196 ; 196, (D779, bit 6) + const EVENT_197 ; 197, (D779, bit 7) + const EVENT_198 ; 198, (D77A, bit 0) + const EVENT_199 ; 199, (D77A, bit 1) + const EVENT_19A ; 19A, (D77A, bit 2) + const EVENT_19B ; 19B, (D77A, bit 3) + const EVENT_19C ; 19C, (D77A, bit 4) + const EVENT_19D ; 19D, (D77A, bit 5) + const EVENT_19E ; 19E, (D77A, bit 6) + const EVENT_19F ; 19F, (D77A, bit 7) + const EVENT_1A0 ; 1A0, (D77B, bit 0) + const EVENT_1A1 ; 1A1, (D77B, bit 1) + const EVENT_1A2 ; 1A2, (D77B, bit 2) + const EVENT_1A3 ; 1A3, (D77B, bit 3) + const EVENT_1A4 ; 1A4, (D77B, bit 4) + const EVENT_1A5 ; 1A5, (D77B, bit 5) + const EVENT_1A6 ; 1A6, (D77B, bit 6) + const EVENT_1A7 ; 1A7, (D77B, bit 7) + const EVENT_GOT_TM21 ; 1A8, (D77C, bit 0) + const EVENT_BEAT_ERIKA ; 1A9, (D77C, bit 1) + const EVENT_BEAT_CELADON_GYM_TRAINER_0 ; 1AA, (D77C, bit 2) + const EVENT_BEAT_CELADON_GYM_TRAINER_2 ; 1AB, (D77C, bit 3) + const EVENT_BEAT_CELADON_GYM_TRAINER_3 ; 1AC, (D77C, bit 4) + const EVENT_BEAT_CELADON_GYM_TRAINER_4 ; 1AD, (D77C, bit 5) + const EVENT_BEAT_CELADON_GYM_TRAINER_5 ; 1AE, (D77C, bit 6) + const EVENT_BEAT_CELADON_GYM_TRAINER_6 ; 1AF, (D77C, bit 7) + const EVENT_BEAT_CELADON_GYM_TRAINER_7 ; 1B0, (D77D, bit 0) + const EVENT_1B1 ; 1B1, (D77D, bit 1) + const EVENT_1B2 ; 1B2, (D77D, bit 2) + const EVENT_1B3 ; 1B3, (D77D, bit 3) + const EVENT_1B4 ; 1B4, (D77D, bit 4) + const EVENT_1B5 ; 1B5, (D77D, bit 5) + const EVENT_1B6 ; 1B6, (D77D, bit 6) + const EVENT_1B7 ; 1B7, (D77D, bit 7) + const EVENT_1B8 ; 1B8, (D77E, bit 0) + const EVENT_FOUND_ROCKET_HIDEOUT ; 1B9, (D77E, bit 1) + const EVENT_GOT_10_COINS ; 1BA, (D77E, bit 2) + const EVENT_GOT_20_COINS ; 1BB, (D77E, bit 3) + const EVENT_GOT_20_COINS_2 ; 1BC, (D77E, bit 4) + const EVENT_1BD ; 1BD, (D77E, bit 5) + const EVENT_1BE ; 1BE, (D77E, bit 6) + const EVENT_1BF ; 1BF, (D77E, bit 7) + const EVENT_1C0 ; 1C0, (D77F, bit 0) + const EVENT_1C1 ; 1C1, (D77F, bit 1) + const EVENT_1C2 ; 1C2, (D77F, bit 2) + const EVENT_1C3 ; 1C3, (D77F, bit 3) + const EVENT_1C4 ; 1C4, (D77F, bit 4) + const EVENT_1C5 ; 1C5, (D77F, bit 5) + const EVENT_1C6 ; 1C6, (D77F, bit 6) + const EVENT_1C7 ; 1C7, (D77F, bit 7) + const EVENT_1C8 ; 1C8, (D780, bit 0) + const EVENT_1C9 ; 1C9, (D780, bit 1) + const EVENT_1CA ; 1CA, (D780, bit 2) + const EVENT_1CB ; 1CB, (D780, bit 3) + const EVENT_1CC ; 1CC, (D780, bit 4) + const EVENT_1CD ; 1CD, (D780, bit 5) + const EVENT_1CE ; 1CE, (D780, bit 6) + const EVENT_1CF ; 1CF, (D780, bit 7) + const EVENT_1D0 ; 1D0, (D781, bit 0) + const EVENT_1D1 ; 1D1, (D781, bit 1) + const EVENT_1D2 ; 1D2, (D781, bit 2) + const EVENT_1D3 ; 1D3, (D781, bit 3) + const EVENT_1D4 ; 1D4, (D781, bit 4) + const EVENT_1D5 ; 1D5, (D781, bit 5) + const EVENT_1D6 ; 1D6, (D781, bit 6) + const EVENT_1D7 ; 1D7, (D781, bit 7) + const EVENT_1D8 ; 1D8, (D782, bit 0) + const EVENT_1D9 ; 1D9, (D782, bit 1) + const EVENT_1DA ; 1DA, (D782, bit 2) + const EVENT_1DB ; 1DB, (D782, bit 3) + const EVENT_1DC ; 1DC, (D782, bit 4) + const EVENT_1DD ; 1DD, (D782, bit 5) + const EVENT_1DE ; 1DE, (D782, bit 6) + const EVENT_1DF ; 1DF, (D782, bit 7) + const EVENT_GOT_COIN_CASE ; 1E0, (D783, bit 0) + const EVENT_1E1 ; 1E1, (D783, bit 1) + const EVENT_1E2 ; 1E2, (D783, bit 2) + const EVENT_1E3 ; 1E3, (D783, bit 3) + const EVENT_1E4 ; 1E4, (D783, bit 4) + const EVENT_1E5 ; 1E5, (D783, bit 5) + const EVENT_1E6 ; 1E6, (D783, bit 6) + const EVENT_1E7 ; 1E7, (D783, bit 7) + const EVENT_1E8 ; 1E8, (D784, bit 0) + const EVENT_1E9 ; 1E9, (D784, bit 1) + const EVENT_1EA ; 1EA, (D784, bit 2) + const EVENT_1EB ; 1EB, (D784, bit 3) + const EVENT_1EC ; 1EC, (D784, bit 4) + const EVENT_1ED ; 1ED, (D784, bit 5) + const EVENT_1EE ; 1EE, (D784, bit 6) + const EVENT_1EF ; 1EF, (D784, bit 7) + const EVENT_1F0 ; 1F0, (D785, bit 0) + const EVENT_1F1 ; 1F1, (D785, bit 1) + const EVENT_1F2 ; 1F2, (D785, bit 2) + const EVENT_1F3 ; 1F3, (D785, bit 3) + const EVENT_1F4 ; 1F4, (D785, bit 4) + const EVENT_1F5 ; 1F5, (D785, bit 5) + const EVENT_1F6 ; 1F6, (D785, bit 6) + const EVENT_1F7 ; 1F7, (D785, bit 7) + const EVENT_1F8 ; 1F8, (D786, bit 0) + const EVENT_1F9 ; 1F9, (D786, bit 1) + const EVENT_1FA ; 1FA, (D786, bit 2) + const EVENT_1FB ; 1FB, (D786, bit 3) + const EVENT_1FC ; 1FC, (D786, bit 4) + const EVENT_1FD ; 1FD, (D786, bit 5) + const EVENT_1FE ; 1FE, (D786, bit 6) + const EVENT_1FF ; 1FF, (D786, bit 7) + const EVENT_200 ; 200, (D787, bit 0) + const EVENT_201 ; 201, (D787, bit 1) + const EVENT_202 ; 202, (D787, bit 2) + const EVENT_203 ; 203, (D787, bit 3) + const EVENT_204 ; 204, (D787, bit 4) + const EVENT_205 ; 205, (D787, bit 5) + const EVENT_206 ; 206, (D787, bit 6) + const EVENT_207 ; 207, (D787, bit 7) + const EVENT_208 ; 208, (D788, bit 0) + const EVENT_209 ; 209, (D788, bit 1) + const EVENT_20A ; 20A, (D788, bit 2) + const EVENT_20B ; 20B, (D788, bit 3) + const EVENT_20C ; 20C, (D788, bit 4) + const EVENT_20D ; 20D, (D788, bit 5) + const EVENT_20E ; 20E, (D788, bit 6) + const EVENT_20F ; 20F, (D788, bit 7) + const EVENT_210 ; 210, (D789, bit 0) + const EVENT_211 ; 211, (D789, bit 1) + const EVENT_212 ; 212, (D789, bit 2) + const EVENT_213 ; 213, (D789, bit 3) + const EVENT_214 ; 214, (D789, bit 4) + const EVENT_215 ; 215, (D789, bit 5) + const EVENT_216 ; 216, (D789, bit 6) + const EVENT_217 ; 217, (D789, bit 7) + const EVENT_218 ; 218, (D78A, bit 0) + const EVENT_219 ; 219, (D78A, bit 1) + const EVENT_21A ; 21A, (D78A, bit 2) + const EVENT_21B ; 21B, (D78A, bit 3) + const EVENT_21C ; 21C, (D78A, bit 4) + const EVENT_21D ; 21D, (D78A, bit 5) + const EVENT_21E ; 21E, (D78A, bit 6) + const EVENT_21F ; 21F, (D78A, bit 7) + const EVENT_220 ; 220, (D78B, bit 0) + const EVENT_221 ; 221, (D78B, bit 1) + const EVENT_222 ; 222, (D78B, bit 2) + const EVENT_223 ; 223, (D78B, bit 3) + const EVENT_224 ; 224, (D78B, bit 4) + const EVENT_225 ; 225, (D78B, bit 5) + const EVENT_226 ; 226, (D78B, bit 6) + const EVENT_227 ; 227, (D78B, bit 7) + const EVENT_228 ; 228, (D78C, bit 0) + const EVENT_229 ; 229, (D78C, bit 1) + const EVENT_22A ; 22A, (D78C, bit 2) + const EVENT_22B ; 22B, (D78C, bit 3) + const EVENT_22C ; 22C, (D78C, bit 4) + const EVENT_22D ; 22D, (D78C, bit 5) + const EVENT_22E ; 22E, (D78C, bit 6) + const EVENT_22F ; 22F, (D78C, bit 7) + const EVENT_230 ; 230, (D78D, bit 0) + const EVENT_231 ; 231, (D78D, bit 1) + const EVENT_232 ; 232, (D78D, bit 2) + const EVENT_233 ; 233, (D78D, bit 3) + const EVENT_234 ; 234, (D78D, bit 4) + const EVENT_235 ; 235, (D78D, bit 5) + const EVENT_236 ; 236, (D78D, bit 6) + const EVENT_237 ; 237, (D78D, bit 7) + const EVENT_GOT_HM04 ; 238, (D78E, bit 0) + const EVENT_GAVE_GOLD_TEETH ; 239, (D78E, bit 1) + const EVENT_23A ; 23A, (D78E, bit 2) + const EVENT_23B ; 23B, (D78E, bit 3) + const EVENT_23C ; 23C, (D78E, bit 4) + const EVENT_23D ; 23D, (D78E, bit 5) + const EVENT_23E ; 23E, (D78E, bit 6) + const EVENT_23F ; 23F, (D78E, bit 7) + const EVENT_240 ; 240, (D78F, bit 0) + const EVENT_241 ; 241, (D78F, bit 1) + const EVENT_242 ; 242, (D78F, bit 2) + const EVENT_243 ; 243, (D78F, bit 3) + const EVENT_244 ; 244, (D78F, bit 4) + const EVENT_245 ; 245, (D78F, bit 5) + const EVENT_246 ; 246, (D78F, bit 6) + const EVENT_247 ; 247, (D78F, bit 7) + const EVENT_248 ; 248, (D790, bit 0) + const EVENT_249 ; 249, (D790, bit 1) + const EVENT_24A ; 24A, (D790, bit 2) + const EVENT_24B ; 24B, (D790, bit 3) + const EVENT_24C ; 24C, (D790, bit 4) + const EVENT_24D ; 24D, (D790, bit 5) + const EVENT_SAFARI_GAME_OVER ; 24E, (D790, bit 6) + const EVENT_IN_SAFARI_ZONE ; 24F, (D790, bit 7) + const EVENT_250 ; 250, (D791, bit 0) + const EVENT_251 ; 251, (D791, bit 1) + const EVENT_252 ; 252, (D791, bit 2) + const EVENT_253 ; 253, (D791, bit 3) + const EVENT_254 ; 254, (D791, bit 4) + const EVENT_255 ; 255, (D791, bit 5) + const EVENT_256 ; 256, (D791, bit 6) + const EVENT_257 ; 257, (D791, bit 7) + const EVENT_GOT_TM06 ; 258, (D792, bit 0) + const EVENT_BEAT_KOGA ; 259, (D792, bit 1) + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_0 ; 25A, (D792, bit 2) + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_2 ; 25B, (D792, bit 3) + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_3 ; 25C, (D792, bit 4) + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_4 ; 25D, (D792, bit 5) + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_5 ; 25E, (D792, bit 6) + const EVENT_BEAT_FUCHSIA_GYM_TRAINER_6 ; 25F, (D792, bit 7) + const EVENT_260 ; 260, (D793, bit 0) + const EVENT_261 ; 261, (D793, bit 1) + const EVENT_262 ; 262, (D793, bit 2) + const EVENT_263 ; 263, (D793, bit 3) + const EVENT_264 ; 264, (D793, bit 4) + const EVENT_265 ; 265, (D793, bit 5) + const EVENT_266 ; 266, (D793, bit 6) + const EVENT_267 ; 267, (D793, bit 7) + const EVENT_268 ; 268, (D794, bit 0) + const EVENT_269 ; 269, (D794, bit 1) + const EVENT_26A ; 26A, (D794, bit 2) + const EVENT_26B ; 26B, (D794, bit 3) + const EVENT_26C ; 26C, (D794, bit 4) + const EVENT_26D ; 26D, (D794, bit 5) + const EVENT_26E ; 26E, (D794, bit 6) + const EVENT_26F ; 26F, (D794, bit 7) + const EVENT_270 ; 270, (D795, bit 0) + const EVENT_271 ; 271, (D795, bit 1) + const EVENT_272 ; 272, (D795, bit 2) + const EVENT_273 ; 273, (D795, bit 3) + const EVENT_274 ; 274, (D795, bit 4) + const EVENT_275 ; 275, (D795, bit 5) + const EVENT_276 ; 276, (D795, bit 6) + const EVENT_277 ; 277, (D795, bit 7) + const EVENT_MANSION_SWITCH_ON ; 278, (D796, bit 0) + const EVENT_279 ; 279, (D796, bit 1) + const EVENT_27A ; 27A, (D796, bit 2) + const EVENT_27B ; 27B, (D796, bit 3) + const EVENT_27C ; 27C, (D796, bit 4) + const EVENT_27D ; 27D, (D796, bit 5) + const EVENT_27E ; 27E, (D796, bit 6) + const EVENT_27F ; 27F, (D796, bit 7) + const EVENT_280 ; 280, (D797, bit 0) + const EVENT_281 ; 281, (D797, bit 1) + const EVENT_282 ; 282, (D797, bit 2) + const EVENT_283 ; 283, (D797, bit 3) + const EVENT_284 ; 284, (D797, bit 4) + const EVENT_285 ; 285, (D797, bit 5) + const EVENT_286 ; 286, (D797, bit 6) + const EVENT_287 ; 287, (D797, bit 7) + const EVENT_288 ; 288, (D798, bit 0) + const EVENT_BEAT_MANSION_1_TRAINER_0 ; 289, (D798, bit 1) + const EVENT_28A ; 28A, (D798, bit 2) + const EVENT_28B ; 28B, (D798, bit 3) + const EVENT_28C ; 28C, (D798, bit 4) + const EVENT_28D ; 28D, (D798, bit 5) + const EVENT_28E ; 28E, (D798, bit 6) + const EVENT_28F ; 28F, (D798, bit 7) + const EVENT_290 ; 290, (D799, bit 0) + const EVENT_291 ; 291, (D799, bit 1) + const EVENT_292 ; 292, (D799, bit 2) + const EVENT_293 ; 293, (D799, bit 3) + const EVENT_294 ; 294, (D799, bit 4) + const EVENT_295 ; 295, (D799, bit 5) + const EVENT_296 ; 296, (D799, bit 6) + const EVENT_297 ; 297, (D799, bit 7) + const EVENT_GOT_TM38 ; 298, (D79A, bit 0) + const EVENT_BEAT_BLAINE ; 299, (D79A, bit 1) + const EVENT_29A ; 29A, (D79A, bit 2) + const EVENT_29B ; 29B, (D79A, bit 3) + const EVENT_29C ; 29C, (D79A, bit 4) + const EVENT_29D ; 29D, (D79A, bit 5) + const EVENT_29E ; 29E, (D79A, bit 6) + const EVENT_29F ; 29F, (D79A, bit 7) + const EVENT_2A0 ; 2A0, (D79B, bit 0) + const EVENT_2A1 ; 2A1, (D79B, bit 1) + const EVENT_2A2 ; 2A2, (D79B, bit 2) + const EVENT_2A3 ; 2A3, (D79B, bit 3) + const EVENT_2A4 ; 2A4, (D79B, bit 4) + const EVENT_2A5 ; 2A5, (D79B, bit 5) + const EVENT_2A6 ; 2A6, (D79B, bit 6) + const EVENT_2A7 ; 2A7, (D79B, bit 7) + const EVENT_2A8 ; 2A8, (D79C, bit 0) + const EVENT_2A9 ; 2A9, (D79C, bit 1) + const EVENT_2AA ; 2AA, (D79C, bit 2) + const EVENT_2AB ; 2AB, (D79C, bit 3) + const EVENT_2AC ; 2AC, (D79C, bit 4) + const EVENT_2AD ; 2AD, (D79C, bit 5) + const EVENT_2AE ; 2AE, (D79C, bit 6) + const EVENT_2AF ; 2AF, (D79C, bit 7) + const EVENT_2B0 ; 2B0, (D79D, bit 0) + const EVENT_2B1 ; 2B1, (D79D, bit 1) + const EVENT_2B2 ; 2B2, (D79D, bit 2) + const EVENT_2B3 ; 2B3, (D79D, bit 3) + const EVENT_2B4 ; 2B4, (D79D, bit 4) + const EVENT_2B5 ; 2B5, (D79D, bit 5) + const EVENT_2B6 ; 2B6, (D79D, bit 6) + const EVENT_2B7 ; 2B7, (D79D, bit 7) + const EVENT_2B8 ; 2B8, (D79E, bit 0) + const EVENT_2B9 ; 2B9, (D79E, bit 1) + const EVENT_2BA ; 2BA, (D79E, bit 2) + const EVENT_2BB ; 2BB, (D79E, bit 3) + const EVENT_2BC ; 2BC, (D79E, bit 4) + const EVENT_2BD ; 2BD, (D79E, bit 5) + const EVENT_2BE ; 2BE, (D79E, bit 6) + const EVENT_2BF ; 2BF, (D79E, bit 7) + const EVENT_2C0 ; 2C0, (D79F, bit 0) + const EVENT_2C1 ; 2C1, (D79F, bit 1) + const EVENT_2C2 ; 2C2, (D79F, bit 2) + const EVENT_2C3 ; 2C3, (D79F, bit 3) + const EVENT_2C4 ; 2C4, (D79F, bit 4) + const EVENT_2C5 ; 2C5, (D79F, bit 5) + const EVENT_2C6 ; 2C6, (D79F, bit 6) + const EVENT_2C7 ; 2C7, (D79F, bit 7) + const EVENT_2C8 ; 2C8, (D7A0, bit 0) + const EVENT_2C9 ; 2C9, (D7A0, bit 1) + const EVENT_2CA ; 2CA, (D7A0, bit 2) + const EVENT_2CB ; 2CB, (D7A0, bit 3) + const EVENT_2CC ; 2CC, (D7A0, bit 4) + const EVENT_2CD ; 2CD, (D7A0, bit 5) + const EVENT_2CE ; 2CE, (D7A0, bit 6) + const EVENT_2CF ; 2CF, (D7A0, bit 7) + const EVENT_2D0 ; 2D0, (D7A1, bit 0) + const EVENT_2D1 ; 2D1, (D7A1, bit 1) + const EVENT_2D2 ; 2D2, (D7A1, bit 2) + const EVENT_2D3 ; 2D3, (D7A1, bit 3) + const EVENT_2D4 ; 2D4, (D7A1, bit 4) + const EVENT_2D5 ; 2D5, (D7A1, bit 5) + const EVENT_2D6 ; 2D6, (D7A1, bit 6) + const EVENT_GOT_TM35 ; 2D7, (D7A1, bit 7) + const EVENT_2D8 ; 2D8, (D7A2, bit 0) + const EVENT_2D9 ; 2D9, (D7A2, bit 1) + const EVENT_2DA ; 2DA, (D7A2, bit 2) + const EVENT_2DB ; 2DB, (D7A2, bit 3) + const EVENT_2DC ; 2DC, (D7A2, bit 4) + const EVENT_2DD ; 2DD, (D7A2, bit 5) + const EVENT_2DE ; 2DE, (D7A2, bit 6) + const EVENT_2DF ; 2DF, (D7A2, bit 7) + const EVENT_GAVE_FOSSIL_TO_LAB ; 2E0, (D7A3, bit 0) + const EVENT_LAB_STILL_REVIVING_FOSSIL ; 2E1, (D7A3, bit 1) + const EVENT_LAB_HANDING_OVER_FOSSIL_MON ; 2E2, (D7A3, bit 2) + const EVENT_2E3 ; 2E3, (D7A3, bit 3) + const EVENT_2E4 ; 2E4, (D7A3, bit 4) + const EVENT_2E5 ; 2E5, (D7A3, bit 5) + const EVENT_2E6 ; 2E6, (D7A3, bit 6) + const EVENT_2E7 ; 2E7, (D7A3, bit 7) + const EVENT_2E8 ; 2E8, (D7A4, bit 0) + const EVENT_2E9 ; 2E9, (D7A4, bit 1) + const EVENT_2EA ; 2EA, (D7A4, bit 2) + const EVENT_2EB ; 2EB, (D7A4, bit 3) + const EVENT_2EC ; 2EC, (D7A4, bit 4) + const EVENT_2ED ; 2ED, (D7A4, bit 5) + const EVENT_2EE ; 2EE, (D7A4, bit 6) + const EVENT_2EF ; 2EF, (D7A4, bit 7) + const EVENT_2F0 ; 2F0, (D7A5, bit 0) + const EVENT_2F1 ; 2F1, (D7A5, bit 1) + const EVENT_2F2 ; 2F2, (D7A5, bit 2) + const EVENT_2F3 ; 2F3, (D7A5, bit 3) + const EVENT_2F4 ; 2F4, (D7A5, bit 4) + const EVENT_2F5 ; 2F5, (D7A5, bit 5) + const EVENT_2F6 ; 2F6, (D7A5, bit 6) + const EVENT_2F7 ; 2F7, (D7A5, bit 7) + const EVENT_2F8 ; 2F8, (D7A6, bit 0) + const EVENT_2F9 ; 2F9, (D7A6, bit 1) + const EVENT_2FA ; 2FA, (D7A6, bit 2) + const EVENT_2FB ; 2FB, (D7A6, bit 3) + const EVENT_2FC ; 2FC, (D7A6, bit 4) + const EVENT_2FD ; 2FD, (D7A6, bit 5) + const EVENT_2FE ; 2FE, (D7A6, bit 6) + const EVENT_2FF ; 2FF, (D7A6, bit 7) + const EVENT_300 ; 300, (D7A7, bit 0) + const EVENT_301 ; 301, (D7A7, bit 1) + const EVENT_302 ; 302, (D7A7, bit 2) + const EVENT_303 ; 303, (D7A7, bit 3) + const EVENT_304 ; 304, (D7A7, bit 4) + const EVENT_305 ; 305, (D7A7, bit 5) + const EVENT_306 ; 306, (D7A7, bit 6) + const EVENT_307 ; 307, (D7A7, bit 7) + const EVENT_308 ; 308, (D7A8, bit 0) + const EVENT_309 ; 309, (D7A8, bit 1) + const EVENT_30A ; 30A, (D7A8, bit 2) + const EVENT_30B ; 30B, (D7A8, bit 3) + const EVENT_30C ; 30C, (D7A8, bit 4) + const EVENT_30D ; 30D, (D7A8, bit 5) + const EVENT_30E ; 30E, (D7A8, bit 6) + const EVENT_30F ; 30F, (D7A8, bit 7) + const EVENT_310 ; 310, (D7A9, bit 0) + const EVENT_311 ; 311, (D7A9, bit 1) + const EVENT_312 ; 312, (D7A9, bit 2) + const EVENT_313 ; 313, (D7A9, bit 3) + const EVENT_314 ; 314, (D7A9, bit 4) + const EVENT_315 ; 315, (D7A9, bit 5) + const EVENT_316 ; 316, (D7A9, bit 6) + const EVENT_317 ; 317, (D7A9, bit 7) + const EVENT_318 ; 318, (D7AA, bit 0) + const EVENT_319 ; 319, (D7AA, bit 1) + const EVENT_31A ; 31A, (D7AA, bit 2) + const EVENT_31B ; 31B, (D7AA, bit 3) + const EVENT_31C ; 31C, (D7AA, bit 4) + const EVENT_31D ; 31D, (D7AA, bit 5) + const EVENT_31E ; 31E, (D7AA, bit 6) + const EVENT_31F ; 31F, (D7AA, bit 7) + const EVENT_320 ; 320, (D7AB, bit 0) + const EVENT_321 ; 321, (D7AB, bit 1) + const EVENT_322 ; 322, (D7AB, bit 2) + const EVENT_323 ; 323, (D7AB, bit 3) + const EVENT_324 ; 324, (D7AB, bit 4) + const EVENT_325 ; 325, (D7AB, bit 5) + const EVENT_326 ; 326, (D7AB, bit 6) + const EVENT_327 ; 327, (D7AB, bit 7) + const EVENT_328 ; 328, (D7AC, bit 0) + const EVENT_329 ; 329, (D7AC, bit 1) + const EVENT_32A ; 32A, (D7AC, bit 2) + const EVENT_32B ; 32B, (D7AC, bit 3) + const EVENT_32C ; 32C, (D7AC, bit 4) + const EVENT_32D ; 32D, (D7AC, bit 5) + const EVENT_32E ; 32E, (D7AC, bit 6) + const EVENT_32F ; 32F, (D7AC, bit 7) + const EVENT_330 ; 330, (D7AD, bit 0) + const EVENT_331 ; 331, (D7AD, bit 1) + const EVENT_332 ; 332, (D7AD, bit 2) + const EVENT_333 ; 333, (D7AD, bit 3) + const EVENT_334 ; 334, (D7AD, bit 4) + const EVENT_335 ; 335, (D7AD, bit 5) + const EVENT_336 ; 336, (D7AD, bit 6) + const EVENT_337 ; 337, (D7AD, bit 7) + const EVENT_338 ; 338, (D7AE, bit 0) + const EVENT_339 ; 339, (D7AE, bit 1) + const EVENT_33A ; 33A, (D7AE, bit 2) + const EVENT_33B ; 33B, (D7AE, bit 3) + const EVENT_33C ; 33C, (D7AE, bit 4) + const EVENT_33D ; 33D, (D7AE, bit 5) + const EVENT_33E ; 33E, (D7AE, bit 6) + const EVENT_33F ; 33F, (D7AE, bit 7) + const EVENT_GOT_TM31 ; 340, (D7AF, bit 0) + const EVENT_341 ; 341, (D7AF, bit 1) + const EVENT_342 ; 342, (D7AF, bit 2) + const EVENT_343 ; 343, (D7AF, bit 3) + const EVENT_344 ; 344, (D7AF, bit 4) + const EVENT_345 ; 345, (D7AF, bit 5) + const EVENT_346 ; 346, (D7AF, bit 6) + const EVENT_347 ; 347, (D7AF, bit 7) + const EVENT_348 ; 348, (D7B0, bit 0) + const EVENT_349 ; 349, (D7B0, bit 1) + const EVENT_34A ; 34A, (D7B0, bit 2) + const EVENT_34B ; 34B, (D7B0, bit 3) + const EVENT_34C ; 34C, (D7B0, bit 4) + const EVENT_34D ; 34D, (D7B0, bit 5) + const EVENT_34E ; 34E, (D7B0, bit 6) + const EVENT_34F ; 34F, (D7B0, bit 7) + const EVENT_DEFEATED_FIGHTING_DOJO ; 350, (D7B1, bit 0) + const EVENT_BEAT_KARATE_MASTER ; 351, (D7B1, bit 1) + const EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 ; 352, (D7B1, bit 2) + const EVENT_BEAT_FIGHTING_DOJO_TRAINER_1 ; 353, (D7B1, bit 3) + const EVENT_BEAT_FIGHTING_DOJO_TRAINER_2 ; 354, (D7B1, bit 4) + const EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 ; 355, (D7B1, bit 5) + const EVENT_GOT_HITMONLEE ; 356, (D7B1, bit 6) + const EVENT_GOT_HITMONCHAN ; 357, (D7B1, bit 7) + const EVENT_358 ; 358, (D7B2, bit 0) + const EVENT_359 ; 359, (D7B2, bit 1) + const EVENT_35A ; 35A, (D7B2, bit 2) + const EVENT_35B ; 35B, (D7B2, bit 3) + const EVENT_35C ; 35C, (D7B2, bit 4) + const EVENT_35D ; 35D, (D7B2, bit 5) + const EVENT_35E ; 35E, (D7B2, bit 6) + const EVENT_35F ; 35F, (D7B2, bit 7) + const EVENT_GOT_TM46 ; 360, (D7B3, bit 0) + const EVENT_BEAT_SABRINA ; 361, (D7B3, bit 1) + const EVENT_BEAT_SAFFRON_GYM_TRAINER_0 ; 362, (D7B3, bit 2) + const EVENT_BEAT_SAFFRON_GYM_TRAINER_1 ; 363, (D7B3, bit 3) + const EVENT_BEAT_SAFFRON_GYM_TRAINER_2 ; 364, (D7B3, bit 4) + const EVENT_BEAT_SAFFRON_GYM_TRAINER_3 ; 365, (D7B3, bit 5) + const EVENT_BEAT_SAFFRON_GYM_TRAINER_4 ; 366, (D7B3, bit 6) + const EVENT_BEAT_SAFFRON_GYM_TRAINER_5 ; 367, (D7B3, bit 7) + const EVENT_BEAT_SAFFRON_GYM_TRAINER_6 ; 368, (D7B4, bit 0) + const EVENT_369 ; 369, (D7B4, bit 1) + const EVENT_36A ; 36A, (D7B4, bit 2) + const EVENT_36B ; 36B, (D7B4, bit 3) + const EVENT_36C ; 36C, (D7B4, bit 4) + const EVENT_36D ; 36D, (D7B4, bit 5) + const EVENT_36E ; 36E, (D7B4, bit 6) + const EVENT_36F ; 36F, (D7B4, bit 7) + const EVENT_370 ; 370, (D7B5, bit 0) + const EVENT_371 ; 371, (D7B5, bit 1) + const EVENT_372 ; 372, (D7B5, bit 2) + const EVENT_373 ; 373, (D7B5, bit 3) + const EVENT_374 ; 374, (D7B5, bit 4) + const EVENT_375 ; 375, (D7B5, bit 5) + const EVENT_376 ; 376, (D7B5, bit 6) + const EVENT_377 ; 377, (D7B5, bit 7) + const EVENT_378 ; 378, (D7B6, bit 0) + const EVENT_379 ; 379, (D7B6, bit 1) + const EVENT_37A ; 37A, (D7B6, bit 2) + const EVENT_37B ; 37B, (D7B6, bit 3) + const EVENT_37C ; 37C, (D7B6, bit 4) + const EVENT_37D ; 37D, (D7B6, bit 5) + const EVENT_37E ; 37E, (D7B6, bit 6) + const EVENT_37F ; 37F, (D7B6, bit 7) + const EVENT_380 ; 380, (D7B7, bit 0) + const EVENT_381 ; 381, (D7B7, bit 1) + const EVENT_382 ; 382, (D7B7, bit 2) + const EVENT_383 ; 383, (D7B7, bit 3) + const EVENT_384 ; 384, (D7B7, bit 4) + const EVENT_385 ; 385, (D7B7, bit 5) + const EVENT_386 ; 386, (D7B7, bit 6) + const EVENT_387 ; 387, (D7B7, bit 7) + const EVENT_388 ; 388, (D7B8, bit 0) + const EVENT_389 ; 389, (D7B8, bit 1) + const EVENT_38A ; 38A, (D7B8, bit 2) + const EVENT_38B ; 38B, (D7B8, bit 3) + const EVENT_38C ; 38C, (D7B8, bit 4) + const EVENT_38D ; 38D, (D7B8, bit 5) + const EVENT_38E ; 38E, (D7B8, bit 6) + const EVENT_38F ; 38F, (D7B8, bit 7) + const EVENT_390 ; 390, (D7B9, bit 0) + const EVENT_391 ; 391, (D7B9, bit 1) + const EVENT_392 ; 392, (D7B9, bit 2) + const EVENT_393 ; 393, (D7B9, bit 3) + const EVENT_394 ; 394, (D7B9, bit 4) + const EVENT_395 ; 395, (D7B9, bit 5) + const EVENT_396 ; 396, (D7B9, bit 6) + const EVENT_SILPH_CO_RECEPTIONIST_AT_DESK ; 397, (D7B9, bit 7) + const EVENT_398 ; 398, (D7BA, bit 0) + const EVENT_399 ; 399, (D7BA, bit 1) + const EVENT_39A ; 39A, (D7BA, bit 2) + const EVENT_39B ; 39B, (D7BA, bit 3) + const EVENT_39C ; 39C, (D7BA, bit 4) + const EVENT_39D ; 39D, (D7BA, bit 5) + const EVENT_39E ; 39E, (D7BA, bit 6) + const EVENT_39F ; 39F, (D7BA, bit 7) + const EVENT_3A0 ; 3A0, (D7BB, bit 0) + const EVENT_3A1 ; 3A1, (D7BB, bit 1) + const EVENT_3A2 ; 3A2, (D7BB, bit 2) + const EVENT_3A3 ; 3A3, (D7BB, bit 3) + const EVENT_3A4 ; 3A4, (D7BB, bit 4) + const EVENT_3A5 ; 3A5, (D7BB, bit 5) + const EVENT_3A6 ; 3A6, (D7BB, bit 6) + const EVENT_3A7 ; 3A7, (D7BB, bit 7) + const EVENT_3A8 ; 3A8, (D7BC, bit 0) + const EVENT_3A9 ; 3A9, (D7BC, bit 1) + const EVENT_3AA ; 3AA, (D7BC, bit 2) + const EVENT_3AB ; 3AB, (D7BC, bit 3) + const EVENT_3AC ; 3AC, (D7BC, bit 4) + const EVENT_3AD ; 3AD, (D7BC, bit 5) + const EVENT_3AE ; 3AE, (D7BC, bit 6) + const EVENT_3AF ; 3AF, (D7BC, bit 7) + const EVENT_GOT_TM29 ; 3B0, (D7BD, bit 0) + const EVENT_3B1 ; 3B1, (D7BD, bit 1) + const EVENT_3B2 ; 3B2, (D7BD, bit 2) + const EVENT_3B3 ; 3B3, (D7BD, bit 3) + const EVENT_3B4 ; 3B4, (D7BD, bit 4) + const EVENT_3B5 ; 3B5, (D7BD, bit 5) + const EVENT_3B6 ; 3B6, (D7BD, bit 6) + const EVENT_3B7 ; 3B7, (D7BD, bit 7) + const EVENT_3B8 ; 3B8, (D7BE, bit 0) + const EVENT_3B9 ; 3B9, (D7BE, bit 1) + const EVENT_3BA ; 3BA, (D7BE, bit 2) + const EVENT_3BB ; 3BB, (D7BE, bit 3) + const EVENT_3BC ; 3BC, (D7BE, bit 4) + const EVENT_3BD ; 3BD, (D7BE, bit 5) + const EVENT_3BE ; 3BE, (D7BE, bit 6) + const EVENT_3BF ; 3BF, (D7BE, bit 7) + const EVENT_GOT_POTION_SAMPLE ; 3C0, (D7BF, bit 0) + const EVENT_3C1 ; 3C1, (D7BF, bit 1) + const EVENT_3C2 ; 3C2, (D7BF, bit 2) + const EVENT_3C3 ; 3C3, (D7BF, bit 3) + const EVENT_3C4 ; 3C4, (D7BF, bit 4) + const EVENT_3C5 ; 3C5, (D7BF, bit 5) + const EVENT_3C6 ; 3C6, (D7BF, bit 6) + const EVENT_3C7 ; 3C7, (D7BF, bit 7) + const EVENT_3C8 ; 3C8, (D7C0, bit 0) + const EVENT_3C9 ; 3C9, (D7C0, bit 1) + const EVENT_3CA ; 3CA, (D7C0, bit 2) + const EVENT_3CB ; 3CB, (D7C0, bit 3) + const EVENT_3CC ; 3CC, (D7C0, bit 4) + const EVENT_3CD ; 3CD, (D7C0, bit 5) + const EVENT_3CE ; 3CE, (D7C0, bit 6) + const EVENT_3CF ; 3CF, (D7C0, bit 7) + const EVENT_3D0 ; 3D0, (D7C1, bit 0) + const EVENT_3D1 ; 3D1, (D7C1, bit 1) + const EVENT_3D2 ; 3D2, (D7C1, bit 2) + const EVENT_3D3 ; 3D3, (D7C1, bit 3) + const EVENT_3D4 ; 3D4, (D7C1, bit 4) + const EVENT_3D5 ; 3D5, (D7C1, bit 5) + const EVENT_3D6 ; 3D6, (D7C1, bit 6) + const EVENT_3D7 ; 3D7, (D7C1, bit 7) + const EVENT_GOT_HM05 ; 3D8, (D7C2, bit 0) + const EVENT_3D9 ; 3D9, (D7C2, bit 1) + const EVENT_3DA ; 3DA, (D7C2, bit 2) + const EVENT_3DB ; 3DB, (D7C2, bit 3) + const EVENT_3DC ; 3DC, (D7C2, bit 4) + const EVENT_3DD ; 3DD, (D7C2, bit 5) + const EVENT_3DE ; 3DE, (D7C2, bit 6) + const EVENT_3DF ; 3DF, (D7C2, bit 7) + const EVENT_3E0 ; 3E0, (D7C3, bit 0) + const EVENT_3E1 ; 3E1, (D7C3, bit 1) + const EVENT_BEAT_ROUTE_3_TRAINER_0 ; 3E2, (D7C3, bit 2) + const EVENT_BEAT_ROUTE_3_TRAINER_2 ; 3E3, (D7C3, bit 3) + const EVENT_BEAT_ROUTE_3_TRAINER_3 ; 3E4, (D7C3, bit 4) + const EVENT_BEAT_ROUTE_3_TRAINER_4 ; 3E5, (D7C3, bit 5) + const EVENT_BEAT_ROUTE_3_TRAINER_5 ; 3E6, (D7C3, bit 6) + const EVENT_BEAT_ROUTE_3_TRAINER_6 ; 3E7, (D7C3, bit 7) + const EVENT_BEAT_ROUTE_3_TRAINER_7 ; 3E8, (D7C4, bit 0) + const EVENT_BEAT_ROUTE_3_TRAINER_8 ; 3E9, (D7C4, bit 1) + const EVENT_3EA ; 3EA, (D7C4, bit 2) + const EVENT_3EB ; 3EB, (D7C4, bit 3) + const EVENT_3EC ; 3EC, (D7C4, bit 4) + const EVENT_3ED ; 3ED, (D7C4, bit 5) + const EVENT_3EE ; 3EE, (D7C4, bit 6) + const EVENT_3EF ; 3EF, (D7C4, bit 7) + const EVENT_3F0 ; 3F0, (D7C5, bit 0) + const EVENT_3F1 ; 3F1, (D7C5, bit 1) + const EVENT_BEAT_ROUTE_4_TRAINER_0 ; 3F2, (D7C5, bit 2) + const EVENT_3F3 ; 3F3, (D7C5, bit 3) + const EVENT_3F4 ; 3F4, (D7C5, bit 4) + const EVENT_3F5 ; 3F5, (D7C5, bit 5) + const EVENT_3F6 ; 3F6, (D7C5, bit 6) + const EVENT_3F7 ; 3F7, (D7C5, bit 7) + const EVENT_3F8 ; 3F8, (D7C6, bit 0) + const EVENT_3F9 ; 3F9, (D7C6, bit 1) + const EVENT_3FA ; 3FA, (D7C6, bit 2) + const EVENT_3FB ; 3FB, (D7C6, bit 3) + const EVENT_3FC ; 3FC, (D7C6, bit 4) + const EVENT_3FD ; 3FD, (D7C6, bit 5) + const EVENT_3FE ; 3FE, (D7C6, bit 6) + const EVENT_BOUGHT_MAGIKARP ; 3FF, (D7C6, bit 7) + const EVENT_400 ; 400, (D7C7, bit 0) + const EVENT_401 ; 401, (D7C7, bit 1) + const EVENT_402 ; 402, (D7C7, bit 2) + const EVENT_403 ; 403, (D7C7, bit 3) + const EVENT_404 ; 404, (D7C7, bit 4) + const EVENT_405 ; 405, (D7C7, bit 5) + const EVENT_406 ; 406, (D7C7, bit 6) + const EVENT_407 ; 407, (D7C7, bit 7) + const EVENT_408 ; 408, (D7C8, bit 0) + const EVENT_409 ; 409, (D7C8, bit 1) + const EVENT_40A ; 40A, (D7C8, bit 2) + const EVENT_40B ; 40B, (D7C8, bit 3) + const EVENT_40C ; 40C, (D7C8, bit 4) + const EVENT_40D ; 40D, (D7C8, bit 5) + const EVENT_40E ; 40E, (D7C8, bit 6) + const EVENT_40F ; 40F, (D7C8, bit 7) + const EVENT_410 ; 410, (D7C9, bit 0) + const EVENT_BEAT_ROUTE_6_TRAINER_0 ; 411, (D7C9, bit 1) + const EVENT_BEAT_ROUTE_6_TRAINER_1 ; 412, (D7C9, bit 2) + const EVENT_BEAT_ROUTE_6_TRAINER_2 ; 413, (D7C9, bit 3) + const EVENT_BEAT_ROUTE_6_TRAINER_3 ; 414, (D7C9, bit 4) + const EVENT_BEAT_ROUTE_6_TRAINER_4 ; 415, (D7C9, bit 5) + const EVENT_BEAT_ROUTE_6_TRAINER_5 ; 416, (D7C9, bit 6) + const EVENT_417 ; 417, (D7C9, bit 7) + const EVENT_418 ; 418, (D7CA, bit 0) + const EVENT_419 ; 419, (D7CA, bit 1) + const EVENT_41A ; 41A, (D7CA, bit 2) + const EVENT_41B ; 41B, (D7CA, bit 3) + const EVENT_41C ; 41C, (D7CA, bit 4) + const EVENT_41D ; 41D, (D7CA, bit 5) + const EVENT_41E ; 41E, (D7CA, bit 6) + const EVENT_41F ; 41F, (D7CA, bit 7) + const EVENT_420 ; 420, (D7CB, bit 0) + const EVENT_421 ; 421, (D7CB, bit 1) + const EVENT_422 ; 422, (D7CB, bit 2) + const EVENT_423 ; 423, (D7CB, bit 3) + const EVENT_424 ; 424, (D7CB, bit 4) + const EVENT_425 ; 425, (D7CB, bit 5) + const EVENT_426 ; 426, (D7CB, bit 6) + const EVENT_427 ; 427, (D7CB, bit 7) + const EVENT_428 ; 428, (D7CC, bit 0) + const EVENT_429 ; 429, (D7CC, bit 1) + const EVENT_42A ; 42A, (D7CC, bit 2) + const EVENT_42B ; 42B, (D7CC, bit 3) + const EVENT_42C ; 42C, (D7CC, bit 4) + const EVENT_42D ; 42D, (D7CC, bit 5) + const EVENT_42E ; 42E, (D7CC, bit 6) + const EVENT_42F ; 42F, (D7CC, bit 7) + const EVENT_430 ; 430, (D7CD, bit 0) + const EVENT_BEAT_ROUTE_8_TRAINER_0 ; 431, (D7CD, bit 1) + const EVENT_BEAT_ROUTE_8_TRAINER_1 ; 432, (D7CD, bit 2) + const EVENT_BEAT_ROUTE_8_TRAINER_2 ; 433, (D7CD, bit 3) + const EVENT_BEAT_ROUTE_8_TRAINER_3 ; 434, (D7CD, bit 4) + const EVENT_BEAT_ROUTE_8_TRAINER_4 ; 435, (D7CD, bit 5) + const EVENT_BEAT_ROUTE_8_TRAINER_5 ; 436, (D7CD, bit 6) + const EVENT_BEAT_ROUTE_8_TRAINER_6 ; 437, (D7CD, bit 7) + const EVENT_BEAT_ROUTE_8_TRAINER_7 ; 438, (D7CE, bit 0) + const EVENT_BEAT_ROUTE_8_TRAINER_8 ; 439, (D7CE, bit 1) + const EVENT_43A ; 43A, (D7CE, bit 2) + const EVENT_43B ; 43B, (D7CE, bit 3) + const EVENT_43C ; 43C, (D7CE, bit 4) + const EVENT_43D ; 43D, (D7CE, bit 5) + const EVENT_43E ; 43E, (D7CE, bit 6) + const EVENT_43F ; 43F, (D7CE, bit 7) + const EVENT_440 ; 440, (D7CF, bit 0) + const EVENT_BEAT_ROUTE_9_TRAINER_0 ; 441, (D7CF, bit 1) + const EVENT_BEAT_ROUTE_9_TRAINER_2 ; 442, (D7CF, bit 2) + const EVENT_BEAT_ROUTE_9_TRAINER_3 ; 443, (D7CF, bit 3) + const EVENT_BEAT_ROUTE_9_TRAINER_4 ; 444, (D7CF, bit 4) + const EVENT_BEAT_ROUTE_9_TRAINER_5 ; 445, (D7CF, bit 5) + const EVENT_BEAT_ROUTE_9_TRAINER_6 ; 446, (D7CF, bit 6) + const EVENT_BEAT_ROUTE_9_TRAINER_7 ; 447, (D7CF, bit 7) + const EVENT_BEAT_ROUTE_9_TRAINER_8 ; 448, (D7D0, bit 0) + const EVENT_BEAT_ROUTE_9_TRAINER_9 ; 449, (D7D0, bit 1) + const EVENT_44A ; 44A, (D7D0, bit 2) + const EVENT_44B ; 44B, (D7D0, bit 3) + const EVENT_44C ; 44C, (D7D0, bit 4) + const EVENT_44D ; 44D, (D7D0, bit 5) + const EVENT_44E ; 44E, (D7D0, bit 6) + const EVENT_44F ; 44F, (D7D0, bit 7) + const EVENT_450 ; 450, (D7D1, bit 0) + const EVENT_BEAT_ROUTE_10_TRAINER_0 ; 451, (D7D1, bit 1) + const EVENT_BEAT_ROUTE_10_TRAINER_1 ; 452, (D7D1, bit 2) + const EVENT_BEAT_ROUTE_10_TRAINER_2 ; 453, (D7D1, bit 3) + const EVENT_BEAT_ROUTE_10_TRAINER_3 ; 454, (D7D1, bit 4) + const EVENT_BEAT_ROUTE_10_TRAINER_4 ; 455, (D7D1, bit 5) + const EVENT_BEAT_ROUTE_10_TRAINER_5 ; 456, (D7D1, bit 6) + const EVENT_457 ; 457, (D7D1, bit 7) + const EVENT_458 ; 458, (D7D2, bit 0) + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1 ; 459, (D7D2, bit 1) + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2 ; 45A, (D7D2, bit 2) + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3 ; 45B, (D7D2, bit 3) + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4 ; 45C, (D7D2, bit 4) + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5 ; 45D, (D7D2, bit 5) + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6 ; 45E, (D7D2, bit 6) + const EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_7 ; 45F, (D7D2, bit 7) + const EVENT_460 ; 460, (D7D3, bit 0) + const EVENT_BEAT_POWER_PLANT_TRAINER_0 ; 461, (D7D3, bit 1) + const EVENT_BEAT_POWER_PLANT_TRAINER_1 ; 462, (D7D3, bit 2) + const EVENT_BEAT_POWER_PLANT_TRAINER_2 ; 463, (D7D3, bit 3) + const EVENT_BEAT_POWER_PLANT_TRAINER_3 ; 464, (D7D3, bit 4) + const EVENT_BEAT_POWER_PLANT_TRAINER_4 ; 465, (D7D3, bit 5) + const EVENT_BEAT_POWER_PLANT_TRAINER_5 ; 466, (D7D3, bit 6) + const EVENT_BEAT_POWER_PLANT_TRAINER_6 ; 467, (D7D3, bit 7) + const EVENT_BEAT_POWER_PLANT_TRAINER_7 ; 468, (D7D4, bit 0) + const EVENT_BEAT_POWER_PLANT_TRAINER_8 ; 469, (D7D4, bit 1) + const EVENT_46A ; 46A, (D7D4, bit 2) + const EVENT_46B ; 46B, (D7D4, bit 3) + const EVENT_46C ; 46C, (D7D4, bit 4) + const EVENT_46D ; 46D, (D7D4, bit 5) + const EVENT_46E ; 46E, (D7D4, bit 6) + const EVENT_46F ; 46F, (D7D4, bit 7) + const EVENT_470 ; 470, (D7D5, bit 0) + const EVENT_BEAT_ROUTE_11_TRAINER_0 ; 471, (D7D5, bit 1) + const EVENT_BEAT_ROUTE_11_TRAINER_1 ; 472, (D7D5, bit 2) + const EVENT_BEAT_ROUTE_11_TRAINER_2 ; 473, (D7D5, bit 3) + const EVENT_BEAT_ROUTE_11_TRAINER_3 ; 474, (D7D5, bit 4) + const EVENT_BEAT_ROUTE_11_TRAINER_4 ; 475, (D7D5, bit 5) + const EVENT_BEAT_ROUTE_11_TRAINER_5 ; 476, (D7D5, bit 6) + const EVENT_BEAT_ROUTE_11_TRAINER_6 ; 477, (D7D5, bit 7) + const EVENT_BEAT_ROUTE_11_TRAINER_7 ; 478, (D7D6, bit 0) + const EVENT_BEAT_ROUTE_11_TRAINER_8 ; 479, (D7D6, bit 1) + const EVENT_BEAT_ROUTE_11_TRAINER_9 ; 47A, (D7D6, bit 2) + const EVENT_47B ; 47B, (D7D6, bit 3) + const EVENT_47C ; 47C, (D7D6, bit 4) + const EVENT_47D ; 47D, (D7D6, bit 5) + const EVENT_47E ; 47E, (D7D6, bit 6) + const EVENT_GOT_ITEMFINDER ; 47F, (D7D6, bit 7) + const EVENT_GOT_TM39 ; 480, (D7D7, bit 0) + const EVENT_481 ; 481, (D7D7, bit 1) + const EVENT_BEAT_ROUTE_12_TRAINER_0 ; 482, (D7D7, bit 2) + const EVENT_BEAT_ROUTE_12_TRAINER_1 ; 483, (D7D7, bit 3) + const EVENT_BEAT_ROUTE_12_TRAINER_2 ; 484, (D7D7, bit 4) + const EVENT_BEAT_ROUTE_12_TRAINER_3 ; 485, (D7D7, bit 5) + const EVENT_BEAT_ROUTE_12_TRAINER_4 ; 486, (D7D7, bit 6) + const EVENT_BEAT_ROUTE_12_TRAINER_5 ; 487, (D7D7, bit 7) + const EVENT_BEAT_ROUTE_12_TRAINER_6 ; 488, (D7D8, bit 0) + const EVENT_489 ; 489, (D7D8, bit 1) + const EVENT_48A ; 48A, (D7D8, bit 2) + const EVENT_48B ; 48B, (D7D8, bit 3) + const EVENT_48C ; 48C, (D7D8, bit 4) + const EVENT_48D ; 48D, (D7D8, bit 5) + const EVENT_FIGHT_ROUTE12_SNORLAX ; 48E, (D7D8, bit 6) + const EVENT_BEAT_ROUTE12_SNORLAX ; 48F, (D7D8, bit 7) + const EVENT_490 ; 490, (D7D9, bit 0) + const EVENT_BEAT_ROUTE_13_TRAINER_0 ; 491, (D7D9, bit 1) + const EVENT_BEAT_ROUTE_13_TRAINER_2 ; 492, (D7D9, bit 2) + const EVENT_BEAT_ROUTE_13_TRAINER_3 ; 493, (D7D9, bit 3) + const EVENT_BEAT_ROUTE_13_TRAINER_4 ; 494, (D7D9, bit 4) + const EVENT_BEAT_ROUTE_13_TRAINER_5 ; 495, (D7D9, bit 5) + const EVENT_BEAT_ROUTE_13_TRAINER_6 ; 496, (D7D9, bit 6) + const EVENT_BEAT_ROUTE_13_TRAINER_7 ; 497, (D7D9, bit 7) + const EVENT_BEAT_ROUTE_13_TRAINER_8 ; 498, (D7DA, bit 0) + const EVENT_BEAT_ROUTE_13_TRAINER_9 ; 499, (D7DA, bit 1) + const EVENT_BEAT_ROUTE_13_TRAINER_10 ; 49A, (D7DA, bit 2) + const EVENT_49B ; 49B, (D7DA, bit 3) + const EVENT_49C ; 49C, (D7DA, bit 4) + const EVENT_49D ; 49D, (D7DA, bit 5) + const EVENT_49E ; 49E, (D7DA, bit 6) + const EVENT_49F ; 49F, (D7DA, bit 7) + const EVENT_4A0 ; 4A0, (D7DB, bit 0) + const EVENT_BEAT_ROUTE_14_TRAINER_0 ; 4A1, (D7DB, bit 1) + const EVENT_BEAT_ROUTE_14_TRAINER_1 ; 4A2, (D7DB, bit 2) + const EVENT_BEAT_ROUTE_14_TRAINER_2 ; 4A3, (D7DB, bit 3) + const EVENT_BEAT_ROUTE_14_TRAINER_3 ; 4A4, (D7DB, bit 4) + const EVENT_BEAT_ROUTE_14_TRAINER_4 ; 4A5, (D7DB, bit 5) + const EVENT_BEAT_ROUTE_14_TRAINER_5 ; 4A6, (D7DB, bit 6) + const EVENT_BEAT_ROUTE_14_TRAINER_6 ; 4A7, (D7DB, bit 7) + const EVENT_BEAT_ROUTE_14_TRAINER_7 ; 4A8, (D7DC, bit 0) + const EVENT_BEAT_ROUTE_14_TRAINER_8 ; 4A9, (D7DC, bit 1) + const EVENT_BEAT_ROUTE_14_TRAINER_9 ; 4AA, (D7DC, bit 2) + const EVENT_4AB ; 4AB, (D7DC, bit 3) + const EVENT_4AC ; 4AC, (D7DC, bit 4) + const EVENT_4AD ; 4AD, (D7DC, bit 5) + const EVENT_4AE ; 4AE, (D7DC, bit 6) + const EVENT_4AF ; 4AF, (D7DC, bit 7) + const EVENT_GOT_EXP_ALL ; 4B0, (D7DD, bit 0) + const EVENT_BEAT_ROUTE_15_TRAINER_0 ; 4B1, (D7DD, bit 1) + const EVENT_BEAT_ROUTE_15_TRAINER_1 ; 4B2, (D7DD, bit 2) + const EVENT_BEAT_ROUTE_15_TRAINER_2 ; 4B3, (D7DD, bit 3) + const EVENT_BEAT_ROUTE_15_TRAINER_3 ; 4B4, (D7DD, bit 4) + const EVENT_BEAT_ROUTE_15_TRAINER_4 ; 4B5, (D7DD, bit 5) + const EVENT_BEAT_ROUTE_15_TRAINER_5 ; 4B6, (D7DD, bit 6) + const EVENT_BEAT_ROUTE_15_TRAINER_6 ; 4B7, (D7DD, bit 7) + const EVENT_BEAT_ROUTE_15_TRAINER_7 ; 4B8, (D7DE, bit 0) + const EVENT_BEAT_ROUTE_15_TRAINER_8 ; 4B9, (D7DE, bit 1) + const EVENT_BEAT_ROUTE_15_TRAINER_9 ; 4BA, (D7DE, bit 2) + const EVENT_4BB ; 4BB, (D7DE, bit 3) + const EVENT_4BC ; 4BC, (D7DE, bit 4) + const EVENT_4BD ; 4BD, (D7DE, bit 5) + const EVENT_4BE ; 4BE, (D7DE, bit 6) + const EVENT_4BF ; 4BF, (D7DE, bit 7) + const EVENT_4C0 ; 4C0, (D7DF, bit 0) + const EVENT_BEAT_ROUTE_16_TRAINER_0 ; 4C1, (D7DF, bit 1) + const EVENT_BEAT_ROUTE_16_TRAINER_1 ; 4C2, (D7DF, bit 2) + const EVENT_BEAT_ROUTE_16_TRAINER_2 ; 4C3, (D7DF, bit 3) + const EVENT_BEAT_ROUTE_16_TRAINER_3 ; 4C4, (D7DF, bit 4) + const EVENT_BEAT_ROUTE_16_TRAINER_4 ; 4C5, (D7DF, bit 5) + const EVENT_BEAT_ROUTE_16_TRAINER_5 ; 4C6, (D7DF, bit 6) + const EVENT_4C7 ; 4C7, (D7DF, bit 7) + const EVENT_FIGHT_ROUTE16_SNORLAX ; 4C8, (D7E0, bit 0) + const EVENT_BEAT_ROUTE16_SNORLAX ; 4C9, (D7E0, bit 1) + const EVENT_4CA ; 4CA, (D7E0, bit 2) + const EVENT_4CB ; 4CB, (D7E0, bit 3) + const EVENT_4CC ; 4CC, (D7E0, bit 4) + const EVENT_4CD ; 4CD, (D7E0, bit 5) + const EVENT_GOT_HM02 ; 4CE, (D7E0, bit 6) + const EVENT_RESCUED_MR_FUJI ; 4CF, (D7E0, bit 7) + const EVENT_4D0 ; 4D0, (D7E1, bit 0) + const EVENT_BEAT_ROUTE_17_TRAINER_0 ; 4D1, (D7E1, bit 1) + const EVENT_BEAT_ROUTE_17_TRAINER_1 ; 4D2, (D7E1, bit 2) + const EVENT_BEAT_ROUTE_17_TRAINER_2 ; 4D3, (D7E1, bit 3) + const EVENT_BEAT_ROUTE_17_TRAINER_3 ; 4D4, (D7E1, bit 4) + const EVENT_BEAT_ROUTE_17_TRAINER_4 ; 4D5, (D7E1, bit 5) + const EVENT_BEAT_ROUTE_17_TRAINER_5 ; 4D6, (D7E1, bit 6) + const EVENT_BEAT_ROUTE_17_TRAINER_6 ; 4D7, (D7E1, bit 7) + const EVENT_BEAT_ROUTE_17_TRAINER_7 ; 4D8, (D7E2, bit 0) + const EVENT_BEAT_ROUTE_17_TRAINER_8 ; 4D9, (D7E2, bit 1) + const EVENT_BEAT_ROUTE_17_TRAINER_9 ; 4DA, (D7E2, bit 2) + const EVENT_4DB ; 4DB, (D7E2, bit 3) + const EVENT_4DC ; 4DC, (D7E2, bit 4) + const EVENT_4DD ; 4DD, (D7E2, bit 5) + const EVENT_4DE ; 4DE, (D7E2, bit 6) + const EVENT_4DF ; 4DF, (D7E2, bit 7) + const EVENT_4E0 ; 4E0, (D7E3, bit 0) + const EVENT_BEAT_ROUTE_18_TRAINER_0 ; 4E1, (D7E3, bit 1) + const EVENT_BEAT_ROUTE_18_TRAINER_1 ; 4E2, (D7E3, bit 2) + const EVENT_BEAT_ROUTE_18_TRAINER_2 ; 4E3, (D7E3, bit 3) + const EVENT_4E4 ; 4E4, (D7E3, bit 4) + const EVENT_4E5 ; 4E5, (D7E3, bit 5) + const EVENT_4E6 ; 4E6, (D7E3, bit 6) + const EVENT_4E7 ; 4E7, (D7E3, bit 7) + const EVENT_4E8 ; 4E8, (D7E4, bit 0) + const EVENT_4E9 ; 4E9, (D7E4, bit 1) + const EVENT_4EA ; 4EA, (D7E4, bit 2) + const EVENT_4EB ; 4EB, (D7E4, bit 3) + const EVENT_4EC ; 4EC, (D7E4, bit 4) + const EVENT_4ED ; 4ED, (D7E4, bit 5) + const EVENT_4EE ; 4EE, (D7E4, bit 6) + const EVENT_4EF ; 4EF, (D7E4, bit 7) + const EVENT_4F0 ; 4F0, (D7E5, bit 0) + const EVENT_BEAT_ROUTE_19_TRAINER_0 ; 4F1, (D7E5, bit 1) + const EVENT_BEAT_ROUTE_19_TRAINER_1 ; 4F2, (D7E5, bit 2) + const EVENT_BEAT_ROUTE_19_TRAINER_2 ; 4F3, (D7E5, bit 3) + const EVENT_BEAT_ROUTE_19_TRAINER_3 ; 4F4, (D7E5, bit 4) + const EVENT_BEAT_ROUTE_19_TRAINER_4 ; 4F5, (D7E5, bit 5) + const EVENT_BEAT_ROUTE_19_TRAINER_5 ; 4F6, (D7E5, bit 6) + const EVENT_BEAT_ROUTE_19_TRAINER_6 ; 4F7, (D7E5, bit 7) + const EVENT_BEAT_ROUTE_19_TRAINER_7 ; 4F8, (D7E6, bit 0) + const EVENT_BEAT_ROUTE_19_TRAINER_8 ; 4F9, (D7E6, bit 1) + const EVENT_BEAT_ROUTE_19_TRAINER_9 ; 4FA, (D7E6, bit 2) + const EVENT_4FB ; 4FB, (D7E6, bit 3) + const EVENT_4FC ; 4FC, (D7E6, bit 4) + const EVENT_4FD ; 4FD, (D7E6, bit 5) + const EVENT_4FE ; 4FE, (D7E6, bit 6) + const EVENT_4FF ; 4FF, (D7E6, bit 7) + const EVENT_IN_SEAFOAM_ISLANDS ; 500, (D7E7, bit 0) + const EVENT_BEAT_ROUTE_20_TRAINER_0 ; 501, (D7E7, bit 1) + const EVENT_BEAT_ROUTE_20_TRAINER_2 ; 502, (D7E7, bit 2) + const EVENT_BEAT_ROUTE_20_TRAINER_3 ; 503, (D7E7, bit 3) + const EVENT_BEAT_ROUTE_20_TRAINER_4 ; 504, (D7E7, bit 4) + const EVENT_BEAT_ROUTE_20_TRAINER_5 ; 505, (D7E7, bit 5) + const EVENT_BEAT_ROUTE_20_TRAINER_6 ; 506, (D7E7, bit 6) + const EVENT_BEAT_ROUTE_20_TRAINER_7 ; 507, (D7E7, bit 7) + const EVENT_BEAT_ROUTE_20_TRAINER_8 ; 508, (D7E8, bit 0) + const EVENT_BEAT_ROUTE_20_TRAINER_9 ; 509, (D7E8, bit 1) + const EVENT_BEAT_ROUTE_20_TRAINER_10 ; 50A, (D7E8, bit 2) + const EVENT_50B ; 50B, (D7E8, bit 3) + const EVENT_50C ; 50C, (D7E8, bit 4) + const EVENT_50D ; 50D, (D7E8, bit 5) + const EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE ; 50E, (D7E8, bit 6) + const EVENT_SEAFOAM1_BOULDER2_DOWN_HOLE ; 50F, (D7E8, bit 7) + const EVENT_510 ; 510, (D7E9, bit 0) + const EVENT_BEAT_ROUTE_21_TRAINER_0 ; 511, (D7E9, bit 1) + const EVENT_BEAT_ROUTE_21_TRAINER_1 ; 512, (D7E9, bit 2) + const EVENT_BEAT_ROUTE_21_TRAINER_2 ; 513, (D7E9, bit 3) + const EVENT_BEAT_ROUTE_21_TRAINER_3 ; 514, (D7E9, bit 4) + const EVENT_BEAT_ROUTE_21_TRAINER_4 ; 515, (D7E9, bit 5) + const EVENT_BEAT_ROUTE_21_TRAINER_5 ; 516, (D7E9, bit 6) + const EVENT_BEAT_ROUTE_21_TRAINER_6 ; 517, (D7E9, bit 7) + const EVENT_BEAT_ROUTE_21_TRAINER_7 ; 518, (D7EA, bit 0) + const EVENT_BEAT_ROUTE_21_TRAINER_8 ; 519, (D7EA, bit 1) + const EVENT_51A ; 51A, (D7EA, bit 2) + const EVENT_51B ; 51B, (D7EA, bit 3) + const EVENT_51C ; 51C, (D7EA, bit 4) + const EVENT_51D ; 51D, (D7EA, bit 5) + const EVENT_51E ; 51E, (D7EA, bit 6) + const EVENT_51F ; 51F, (D7EA, bit 7) + const EVENT_1ST_ROUTE22_RIVAL_BATTLE ; 520, (D7EB, bit 0) + const EVENT_2ND_ROUTE22_RIVAL_BATTLE ; 521, (D7EB, bit 1) + const EVENT_522 ; 522, (D7EB, bit 2) + const EVENT_523 ; 523, (D7EB, bit 3) + const EVENT_524 ; 524, (D7EB, bit 4) + const EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT ; 525, (D7EB, bit 5) + const EVENT_BEAT_ROUTE22_RIVAL_2ND_FIGHT ; 526, (D7EB, bit 6) + const EVENT_ROUTE22_RIVAL_WANTS_FIGHT ; 527, (D7EB, bit 7) + const EVENT_528 ; 528, (D7EC, bit 0) + const EVENT_529 ; 529, (D7EC, bit 1) + const EVENT_52A ; 52A, (D7EC, bit 2) + const EVENT_52B ; 52B, (D7EC, bit 3) + const EVENT_52C ; 52C, (D7EC, bit 4) + const EVENT_52D ; 52D, (D7EC, bit 5) + const EVENT_52E ; 52E, (D7EC, bit 6) + const EVENT_52F ; 52F, (D7EC, bit 7) + const EVENT_PASSED_CASCADEBADGE_CHECK ; 530, (D7ED, bit 0) + const EVENT_PASSED_THUNDERBADGE_CHECK ; 531, (D7ED, bit 1) + const EVENT_PASSED_RAINBOWBADGE_CHECK ; 532, (D7ED, bit 2) + const EVENT_PASSED_SOULBADGE_CHECK ; 533, (D7ED, bit 3) + const EVENT_PASSED_MARSHBADGE_CHECK ; 534, (D7ED, bit 4) + const EVENT_PASSED_VOLCANOBADGE_CHECK ; 535, (D7ED, bit 5) + const EVENT_PASSED_EARTHBADGE_CHECK ; 536, (D7ED, bit 6) + const EVENT_537 ; 537, (D7ED, bit 7) + const EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1 ; 538, (D7EE, bit 0) + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0 ; 539, (D7EE, bit 1) + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2 ; 53A, (D7EE, bit 2) + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3 ; 53B, (D7EE, bit 3) + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4 ; 53C, (D7EE, bit 4) + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_5 ; 53D, (D7EE, bit 5) + const EVENT_BEAT_VICTORY_ROAD_2_TRAINER_6 ; 53E, (D7EE, bit 6) + const EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2 ; 53F, (D7EE, bit 7) + const EVENT_GOT_NUGGET ; 540, (D7EF, bit 0) + const EVENT_BEAT_ROUTE24_ROCKET ; 541, (D7EF, bit 1) + const EVENT_BEAT_ROUTE_24_TRAINER_0 ; 542, (D7EF, bit 2) + const EVENT_BEAT_ROUTE_24_TRAINER_2 ; 543, (D7EF, bit 3) + const EVENT_BEAT_ROUTE_24_TRAINER_3 ; 544, (D7EF, bit 4) + const EVENT_BEAT_ROUTE_24_TRAINER_4 ; 545, (D7EF, bit 5) + const EVENT_BEAT_ROUTE_24_TRAINER_5 ; 546, (D7EF, bit 6) + const EVENT_BEAT_ROUTE_24_TRAINER_6 ; 547, (D7EF, bit 7) + const EVENT_548 ; 548, (D7F0, bit 0) + const EVENT_NUGGET_REWARD_AVAILABLE ; 549, (D7F0, bit 1) + const EVENT_54A ; 54A, (D7F0, bit 2) + const EVENT_54B ; 54B, (D7F0, bit 3) + const EVENT_54C ; 54C, (D7F0, bit 4) + const EVENT_54D ; 54D, (D7F0, bit 5) + const EVENT_54E ; 54E, (D7F0, bit 6) + const EVENT_54F ; 54F, (D7F0, bit 7) + const EVENT_MET_BILL ; 550, (D7F1, bit 0) + const EVENT_BEAT_ROUTE_25_TRAINER_0 ; 551, (D7F1, bit 1) + const EVENT_BEAT_ROUTE_25_TRAINER_2 ; 552, (D7F1, bit 2) + const EVENT_BEAT_ROUTE_25_TRAINER_3 ; 553, (D7F1, bit 3) + const EVENT_BEAT_ROUTE_25_TRAINER_4 ; 554, (D7F1, bit 4) + const EVENT_BEAT_ROUTE_25_TRAINER_5 ; 555, (D7F1, bit 5) + const EVENT_BEAT_ROUTE_25_TRAINER_6 ; 556, (D7F1, bit 6) + const EVENT_BEAT_ROUTE_25_TRAINER_7 ; 557, (D7F1, bit 7) + const EVENT_BEAT_ROUTE_25_TRAINER_8 ; 558, (D7F2, bit 0) + const EVENT_BEAT_ROUTE_25_TRAINER_9 ; 559, (D7F2, bit 1) + const EVENT_55A ; 55A, (D7F2, bit 2) + const EVENT_USED_CELL_SEPARATOR_ON_BILL ; 55B, (D7F2, bit 3) + const EVENT_GOT_SS_TICKET ; 55C, (D7F2, bit 4) + const EVENT_MET_BILL_2 ; 55D, (D7F2, bit 5) + const EVENT_BILL_SAID_USE_CELL_SEPARATOR ; 55E, (D7F2, bit 6) + const EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING ; 55F, (D7F2, bit 7) + const EVENT_560 ; 560, (D7F3, bit 0) + const EVENT_561 ; 561, (D7F3, bit 1) + const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 ; 562, (D7F3, bit 2) + const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1 ; 563, (D7F3, bit 3) + const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 ; 564, (D7F3, bit 4) + const EVENT_565 ; 565, (D7F3, bit 5) + const EVENT_566 ; 566, (D7F3, bit 6) + const EVENT_567 ; 567, (D7F3, bit 7) + const EVENT_568 ; 568, (D7F4, bit 0) + const EVENT_569 ; 569, (D7F4, bit 1) + const EVENT_56A ; 56A, (D7F4, bit 2) + const EVENT_56B ; 56B, (D7F4, bit 3) + const EVENT_56C ; 56C, (D7F4, bit 4) + const EVENT_56D ; 56D, (D7F4, bit 5) + const EVENT_56E ; 56E, (D7F4, bit 6) + const EVENT_56F ; 56F, (D7F4, bit 7) + const EVENT_570 ; 570, (D7F5, bit 0) + const EVENT_BEAT_MT_MOON_1_TRAINER_0 ; 571, (D7F5, bit 1) + const EVENT_BEAT_MT_MOON_1_TRAINER_2 ; 572, (D7F5, bit 2) + const EVENT_BEAT_MT_MOON_1_TRAINER_3 ; 573, (D7F5, bit 3) + const EVENT_BEAT_MT_MOON_1_TRAINER_4 ; 574, (D7F5, bit 4) + const EVENT_BEAT_MT_MOON_1_TRAINER_5 ; 575, (D7F5, bit 5) + const EVENT_BEAT_MT_MOON_1_TRAINER_6 ; 576, (D7F5, bit 6) + const EVENT_BEAT_MT_MOON_1_TRAINER_7 ; 577, (D7F5, bit 7) + const EVENT_578 ; 578, (D7F6, bit 0) + const EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD ; 579, (D7F6, bit 1) + const EVENT_BEAT_MT_MOON_3_TRAINER_0 ; 57A, (D7F6, bit 2) + const EVENT_BEAT_MT_MOON_3_TRAINER_2 ; 57B, (D7F6, bit 3) + const EVENT_BEAT_MT_MOON_3_TRAINER_3 ; 57C, (D7F6, bit 4) + const EVENT_BEAT_MT_MOON_3_TRAINER_4 ; 57D, (D7F6, bit 5) + const EVENT_GOT_DOME_FOSSIL ; 57E, (D7F6, bit 6) + const EVENT_GOT_HELIX_FOSSIL ; 57F, (D7F6, bit 7) + const EVENT_580 ; 580, (D7F7, bit 0) + const EVENT_581 ; 581, (D7F7, bit 1) + const EVENT_582 ; 582, (D7F7, bit 2) + const EVENT_583 ; 583, (D7F7, bit 3) + const EVENT_584 ; 584, (D7F7, bit 4) + const EVENT_585 ; 585, (D7F7, bit 5) + const EVENT_586 ; 586, (D7F7, bit 6) + const EVENT_587 ; 587, (D7F7, bit 7) + const EVENT_588 ; 588, (D7F8, bit 0) + const EVENT_589 ; 589, (D7F8, bit 1) + const EVENT_58A ; 58A, (D7F8, bit 2) + const EVENT_58B ; 58B, (D7F8, bit 3) + const EVENT_58C ; 58C, (D7F8, bit 4) + const EVENT_58D ; 58D, (D7F8, bit 5) + const EVENT_58E ; 58E, (D7F8, bit 6) + const EVENT_58F ; 58F, (D7F8, bit 7) + const EVENT_590 ; 590, (D7F9, bit 0) + const EVENT_591 ; 591, (D7F9, bit 1) + const EVENT_592 ; 592, (D7F9, bit 2) + const EVENT_593 ; 593, (D7F9, bit 3) + const EVENT_594 ; 594, (D7F9, bit 4) + const EVENT_595 ; 595, (D7F9, bit 5) + const EVENT_596 ; 596, (D7F9, bit 6) + const EVENT_597 ; 597, (D7F9, bit 7) + const EVENT_598 ; 598, (D7FA, bit 0) + const EVENT_599 ; 599, (D7FA, bit 1) + const EVENT_59A ; 59A, (D7FA, bit 2) + const EVENT_59B ; 59B, (D7FA, bit 3) + const EVENT_59C ; 59C, (D7FA, bit 4) + const EVENT_59D ; 59D, (D7FA, bit 5) + const EVENT_59E ; 59E, (D7FA, bit 6) + const EVENT_59F ; 59F, (D7FA, bit 7) + const EVENT_5A0 ; 5A0, (D7FB, bit 0) + const EVENT_5A1 ; 5A1, (D7FB, bit 1) + const EVENT_5A2 ; 5A2, (D7FB, bit 2) + const EVENT_5A3 ; 5A3, (D7FB, bit 3) + const EVENT_5A4 ; 5A4, (D7FB, bit 4) + const EVENT_5A5 ; 5A5, (D7FB, bit 5) + const EVENT_5A6 ; 5A6, (D7FB, bit 6) + const EVENT_5A7 ; 5A7, (D7FB, bit 7) + const EVENT_5A8 ; 5A8, (D7FC, bit 0) + const EVENT_5A9 ; 5A9, (D7FC, bit 1) + const EVENT_5AA ; 5AA, (D7FC, bit 2) + const EVENT_5AB ; 5AB, (D7FC, bit 3) + const EVENT_5AC ; 5AC, (D7FC, bit 4) + const EVENT_5AD ; 5AD, (D7FC, bit 5) + const EVENT_5AE ; 5AE, (D7FC, bit 6) + const EVENT_5AF ; 5AF, (D7FC, bit 7) + const EVENT_5B0 ; 5B0, (D7FD, bit 0) + const EVENT_5B1 ; 5B1, (D7FD, bit 1) + const EVENT_5B2 ; 5B2, (D7FD, bit 2) + const EVENT_5B3 ; 5B3, (D7FD, bit 3) + const EVENT_5B4 ; 5B4, (D7FD, bit 4) + const EVENT_5B5 ; 5B5, (D7FD, bit 5) + const EVENT_5B6 ; 5B6, (D7FD, bit 6) + const EVENT_5B7 ; 5B7, (D7FD, bit 7) + const EVENT_5B8 ; 5B8, (D7FE, bit 0) + const EVENT_5B9 ; 5B9, (D7FE, bit 1) + const EVENT_5BA ; 5BA, (D7FE, bit 2) + const EVENT_5BB ; 5BB, (D7FE, bit 3) + const EVENT_5BC ; 5BC, (D7FE, bit 4) + const EVENT_5BD ; 5BD, (D7FE, bit 5) + const EVENT_5BE ; 5BE, (D7FE, bit 6) + const EVENT_5BF ; 5BF, (D7FE, bit 7) + const EVENT_5C0 ; 5C0, (D7FF, bit 0) + const EVENT_5C1 ; 5C1, (D7FF, bit 1) + const EVENT_5C2 ; 5C2, (D7FF, bit 2) + const EVENT_5C3 ; 5C3, (D7FF, bit 3) + const EVENT_BEAT_SS_ANNE_5_TRAINER_0 ; 5C4, (D7FF, bit 4) + const EVENT_BEAT_SS_ANNE_5_TRAINER_1 ; 5C5, (D7FF, bit 5) + const EVENT_5C6 ; 5C6, (D7FF, bit 6) + const EVENT_5C7 ; 5C7, (D7FF, bit 7) + const EVENT_5C8 ; 5C8, (D800, bit 0) + const EVENT_5C9 ; 5C9, (D800, bit 1) + const EVENT_5CA ; 5CA, (D800, bit 2) + const EVENT_5CB ; 5CB, (D800, bit 3) + const EVENT_5CC ; 5CC, (D800, bit 4) + const EVENT_5CD ; 5CD, (D800, bit 5) + const EVENT_5CE ; 5CE, (D800, bit 6) + const EVENT_5CF ; 5CF, (D800, bit 7) + const EVENT_5D0 ; 5D0, (D801, bit 0) + const EVENT_5D1 ; 5D1, (D801, bit 1) + const EVENT_5D2 ; 5D2, (D801, bit 2) + const EVENT_5D3 ; 5D3, (D801, bit 3) + const EVENT_5D4 ; 5D4, (D801, bit 4) + const EVENT_5D5 ; 5D5, (D801, bit 5) + const EVENT_5D6 ; 5D6, (D801, bit 6) + const EVENT_5D7 ; 5D7, (D801, bit 7) + const EVENT_5D8 ; 5D8, (D802, bit 0) + const EVENT_5D9 ; 5D9, (D802, bit 1) + const EVENT_5DA ; 5DA, (D802, bit 2) + const EVENT_5DB ; 5DB, (D802, bit 3) + const EVENT_5DC ; 5DC, (D802, bit 4) + const EVENT_5DD ; 5DD, (D802, bit 5) + const EVENT_5DE ; 5DE, (D802, bit 6) + const EVENT_5DF ; 5DF, (D802, bit 7) + const EVENT_GOT_HM01 ; 5E0, (D803, bit 0) + const EVENT_RUBBED_CAPTAINS_BACK ; 5E1, (D803, bit 1) + const EVENT_SS_ANNE_LEFT ; 5E2, (D803, bit 2) + const EVENT_WALKED_PAST_GUARD_AFTER_SS_ANNE_LEFT ; 5E3, (D803, bit 3) + const EVENT_STARTED_WALKING_OUT_OF_DOCK ; 5E4, (D803, bit 4) + const EVENT_WALKED_OUT_OF_DOCK ; 5E5, (D803, bit 5) + const EVENT_5E6 ; 5E6, (D803, bit 6) + const EVENT_5E7 ; 5E7, (D803, bit 7) + const EVENT_5E8 ; 5E8, (D804, bit 0) + const EVENT_5E9 ; 5E9, (D804, bit 1) + const EVENT_5EA ; 5EA, (D804, bit 2) + const EVENT_5EB ; 5EB, (D804, bit 3) + const EVENT_5EC ; 5EC, (D804, bit 4) + const EVENT_5ED ; 5ED, (D804, bit 5) + const EVENT_5EE ; 5EE, (D804, bit 6) + const EVENT_5EF ; 5EF, (D804, bit 7) + const EVENT_5F0 ; 5F0, (D805, bit 0) + const EVENT_BEAT_SS_ANNE_8_TRAINER_0 ; 5F1, (D805, bit 1) + const EVENT_BEAT_SS_ANNE_8_TRAINER_1 ; 5F2, (D805, bit 2) + const EVENT_BEAT_SS_ANNE_8_TRAINER_2 ; 5F3, (D805, bit 3) + const EVENT_BEAT_SS_ANNE_8_TRAINER_3 ; 5F4, (D805, bit 4) + const EVENT_5F5 ; 5F5, (D805, bit 5) + const EVENT_5F6 ; 5F6, (D805, bit 6) + const EVENT_5F7 ; 5F7, (D805, bit 7) + const EVENT_5F8 ; 5F8, (D806, bit 0) + const EVENT_5F9 ; 5F9, (D806, bit 1) + const EVENT_5FA ; 5FA, (D806, bit 2) + const EVENT_5FB ; 5FB, (D806, bit 3) + const EVENT_5FC ; 5FC, (D806, bit 4) + const EVENT_5FD ; 5FD, (D806, bit 5) + const EVENT_5FE ; 5FE, (D806, bit 6) + const EVENT_5FF ; 5FF, (D806, bit 7) + const EVENT_600 ; 600, (D807, bit 0) + const EVENT_BEAT_SS_ANNE_9_TRAINER_0 ; 601, (D807, bit 1) + const EVENT_BEAT_SS_ANNE_9_TRAINER_1 ; 602, (D807, bit 2) + const EVENT_BEAT_SS_ANNE_9_TRAINER_2 ; 603, (D807, bit 3) + const EVENT_BEAT_SS_ANNE_9_TRAINER_3 ; 604, (D807, bit 4) + const EVENT_605 ; 605, (D807, bit 5) + const EVENT_606 ; 606, (D807, bit 6) + const EVENT_607 ; 607, (D807, bit 7) + const EVENT_608 ; 608, (D808, bit 0) + const EVENT_609 ; 609, (D808, bit 1) + const EVENT_60A ; 60A, (D808, bit 2) + const EVENT_60B ; 60B, (D808, bit 3) + const EVENT_60C ; 60C, (D808, bit 4) + const EVENT_60D ; 60D, (D808, bit 5) + const EVENT_60E ; 60E, (D808, bit 6) + const EVENT_60F ; 60F, (D808, bit 7) + const EVENT_610 ; 610, (D809, bit 0) + const EVENT_BEAT_SS_ANNE_10_TRAINER_0 ; 611, (D809, bit 1) + const EVENT_BEAT_SS_ANNE_10_TRAINER_1 ; 612, (D809, bit 2) + const EVENT_BEAT_SS_ANNE_10_TRAINER_2 ; 613, (D809, bit 3) + const EVENT_BEAT_SS_ANNE_10_TRAINER_3 ; 614, (D809, bit 4) + const EVENT_BEAT_SS_ANNE_10_TRAINER_4 ; 615, (D809, bit 5) + const EVENT_BEAT_SS_ANNE_10_TRAINER_5 ; 616, (D809, bit 6) + const EVENT_617 ; 617, (D809, bit 7) + const EVENT_618 ; 618, (D80A, bit 0) + const EVENT_619 ; 619, (D80A, bit 1) + const EVENT_61A ; 61A, (D80A, bit 2) + const EVENT_61B ; 61B, (D80A, bit 3) + const EVENT_61C ; 61C, (D80A, bit 4) + const EVENT_61D ; 61D, (D80A, bit 5) + const EVENT_61E ; 61E, (D80A, bit 6) + const EVENT_61F ; 61F, (D80A, bit 7) + const EVENT_620 ; 620, (D80B, bit 0) + const EVENT_621 ; 621, (D80B, bit 1) + const EVENT_622 ; 622, (D80B, bit 2) + const EVENT_623 ; 623, (D80B, bit 3) + const EVENT_624 ; 624, (D80B, bit 4) + const EVENT_625 ; 625, (D80B, bit 5) + const EVENT_626 ; 626, (D80B, bit 6) + const EVENT_627 ; 627, (D80B, bit 7) + const EVENT_628 ; 628, (D80C, bit 0) + const EVENT_629 ; 629, (D80C, bit 1) + const EVENT_62A ; 62A, (D80C, bit 2) + const EVENT_62B ; 62B, (D80C, bit 3) + const EVENT_62C ; 62C, (D80C, bit 4) + const EVENT_62D ; 62D, (D80C, bit 5) + const EVENT_62E ; 62E, (D80C, bit 6) + const EVENT_62F ; 62F, (D80C, bit 7) + const EVENT_630 ; 630, (D80D, bit 0) + const EVENT_631 ; 631, (D80D, bit 1) + const EVENT_632 ; 632, (D80D, bit 2) + const EVENT_633 ; 633, (D80D, bit 3) + const EVENT_634 ; 634, (D80D, bit 4) + const EVENT_635 ; 635, (D80D, bit 5) + const EVENT_636 ; 636, (D80D, bit 6) + const EVENT_637 ; 637, (D80D, bit 7) + const EVENT_638 ; 638, (D80E, bit 0) + const EVENT_639 ; 639, (D80E, bit 1) + const EVENT_63A ; 63A, (D80E, bit 2) + const EVENT_63B ; 63B, (D80E, bit 3) + const EVENT_63C ; 63C, (D80E, bit 4) + const EVENT_63D ; 63D, (D80E, bit 5) + const EVENT_63E ; 63E, (D80E, bit 6) + const EVENT_63F ; 63F, (D80E, bit 7) + const EVENT_640 ; 640, (D80F, bit 0) + const EVENT_641 ; 641, (D80F, bit 1) + const EVENT_642 ; 642, (D80F, bit 2) + const EVENT_643 ; 643, (D80F, bit 3) + const EVENT_644 ; 644, (D80F, bit 4) + const EVENT_645 ; 645, (D80F, bit 5) + const EVENT_646 ; 646, (D80F, bit 6) + const EVENT_647 ; 647, (D80F, bit 7) + const EVENT_648 ; 648, (D810, bit 0) + const EVENT_649 ; 649, (D810, bit 1) + const EVENT_64A ; 64A, (D810, bit 2) + const EVENT_64B ; 64B, (D810, bit 3) + const EVENT_64C ; 64C, (D810, bit 4) + const EVENT_64D ; 64D, (D810, bit 5) + const EVENT_64E ; 64E, (D810, bit 6) + const EVENT_64F ; 64F, (D810, bit 7) + const EVENT_650 ; 650, (D811, bit 0) + const EVENT_651 ; 651, (D811, bit 1) + const EVENT_652 ; 652, (D811, bit 2) + const EVENT_653 ; 653, (D811, bit 3) + const EVENT_654 ; 654, (D811, bit 4) + const EVENT_655 ; 655, (D811, bit 5) + const EVENT_656 ; 656, (D811, bit 6) + const EVENT_657 ; 657, (D811, bit 7) + const EVENT_658 ; 658, (D812, bit 0) + const EVENT_659 ; 659, (D812, bit 1) + const EVENT_65A ; 65A, (D812, bit 2) + const EVENT_65B ; 65B, (D812, bit 3) + const EVENT_65C ; 65C, (D812, bit 4) + const EVENT_65D ; 65D, (D812, bit 5) + const EVENT_65E ; 65E, (D812, bit 6) + const EVENT_65F ; 65F, (D812, bit 7) + const EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1 ; 660, (D813, bit 0) + const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0 ; 661, (D813, bit 1) + const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2 ; 662, (D813, bit 2) + const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3 ; 663, (D813, bit 3) + const EVENT_BEAT_VICTORY_ROAD_3_TRAINER_4 ; 664, (D813, bit 4) + const EVENT_665 ; 665, (D813, bit 5) + const EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH2 ; 666, (D813, bit 6) + const EVENT_667 ; 667, (D813, bit 7) + const EVENT_668 ; 668, (D814, bit 0) + const EVENT_669 ; 669, (D814, bit 1) + const EVENT_66A ; 66A, (D814, bit 2) + const EVENT_66B ; 66B, (D814, bit 3) + const EVENT_66C ; 66C, (D814, bit 4) + const EVENT_66D ; 66D, (D814, bit 5) + const EVENT_66E ; 66E, (D814, bit 6) + const EVENT_66F ; 66F, (D814, bit 7) + const EVENT_670 ; 670, (D815, bit 0) + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0 ; 671, (D815, bit 1) + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2 ; 672, (D815, bit 2) + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3 ; 673, (D815, bit 3) + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4 ; 674, (D815, bit 4) + const EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 ; 675, (D815, bit 5) + const EVENT_676 ; 676, (D815, bit 6) + const EVENT_677 ; 677, (D815, bit 7) + const EVENT_678 ; 678, (D816, bit 0) + const EVENT_679 ; 679, (D816, bit 1) + const EVENT_67A ; 67A, (D816, bit 2) + const EVENT_67B ; 67B, (D816, bit 3) + const EVENT_67C ; 67C, (D816, bit 4) + const EVENT_67D ; 67D, (D816, bit 5) + const EVENT_67E ; 67E, (D816, bit 6) + const EVENT_67F ; 67F, (D816, bit 7) + const EVENT_680 ; 680, (D817, bit 0) + const EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0 ; 681, (D817, bit 1) + const EVENT_682 ; 682, (D817, bit 2) + const EVENT_683 ; 683, (D817, bit 3) + const EVENT_684 ; 684, (D817, bit 4) + const EVENT_685 ; 685, (D817, bit 5) + const EVENT_686 ; 686, (D817, bit 6) + const EVENT_687 ; 687, (D817, bit 7) + const EVENT_688 ; 688, (D818, bit 0) + const EVENT_689 ; 689, (D818, bit 1) + const EVENT_68A ; 68A, (D818, bit 2) + const EVENT_68B ; 68B, (D818, bit 3) + const EVENT_68C ; 68C, (D818, bit 4) + const EVENT_68D ; 68D, (D818, bit 5) + const EVENT_68E ; 68E, (D818, bit 6) + const EVENT_68F ; 68F, (D818, bit 7) + const EVENT_690 ; 690, (D819, bit 0) + const EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0 ; 691, (D819, bit 1) + const EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_2 ; 692, (D819, bit 2) + const EVENT_693 ; 693, (D819, bit 3) + const EVENT_694 ; 694, (D819, bit 4) + const EVENT_695 ; 695, (D819, bit 5) + const EVENT_696 ; 696, (D819, bit 6) + const EVENT_697 ; 697, (D819, bit 7) + const EVENT_698 ; 698, (D81A, bit 0) + const EVENT_699 ; 699, (D81A, bit 1) + const EVENT_69A ; 69A, (D81A, bit 2) + const EVENT_69B ; 69B, (D81A, bit 3) + const EVENT_69C ; 69C, (D81A, bit 4) + const EVENT_69D ; 69D, (D81A, bit 5) + const EVENT_69E ; 69E, (D81A, bit 6) + const EVENT_69F ; 69F, (D81A, bit 7) + const EVENT_6A0 ; 6A0, (D81B, bit 0) + const EVENT_6A1 ; 6A1, (D81B, bit 1) + const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0 ; 6A2, (D81B, bit 2) + const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2 ; 6A3, (D81B, bit 3) + const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_3 ; 6A4, (D81B, bit 4) + const EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED ; 6A5, (D81B, bit 5) + const EVENT_ROCKET_DROPPED_LIFT_KEY ; 6A6, (D81B, bit 6) + const EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI ; 6A7, (D81B, bit 7) + const EVENT_6A8 ; 6A8, (D81C, bit 0) + const EVENT_6A9 ; 6A9, (D81C, bit 1) + const EVENT_6AA ; 6AA, (D81C, bit 2) + const EVENT_6AB ; 6AB, (D81C, bit 3) + const EVENT_6AC ; 6AC, (D81C, bit 4) + const EVENT_6AD ; 6AD, (D81C, bit 5) + const EVENT_6AE ; 6AE, (D81C, bit 6) + const EVENT_6AF ; 6AF, (D81C, bit 7) + const EVENT_6B0 ; 6B0, (D81D, bit 0) + const EVENT_6B1 ; 6B1, (D81D, bit 1) + const EVENT_6B2 ; 6B2, (D81D, bit 2) + const EVENT_6B3 ; 6B3, (D81D, bit 3) + const EVENT_6B4 ; 6B4, (D81D, bit 4) + const EVENT_6B5 ; 6B5, (D81D, bit 5) + const EVENT_6B6 ; 6B6, (D81D, bit 6) + const EVENT_6B7 ; 6B7, (D81D, bit 7) + const EVENT_6B8 ; 6B8, (D81E, bit 0) + const EVENT_6B9 ; 6B9, (D81E, bit 1) + const EVENT_6BA ; 6BA, (D81E, bit 2) + const EVENT_6BB ; 6BB, (D81E, bit 3) + const EVENT_6BC ; 6BC, (D81E, bit 4) + const EVENT_6BD ; 6BD, (D81E, bit 5) + const EVENT_6BE ; 6BE, (D81E, bit 6) + const EVENT_6BF ; 6BF, (D81E, bit 7) + const EVENT_6C0 ; 6C0, (D81F, bit 0) + const EVENT_6C1 ; 6C1, (D81F, bit 1) + const EVENT_6C2 ; 6C2, (D81F, bit 2) + const EVENT_6C3 ; 6C3, (D81F, bit 3) + const EVENT_6C4 ; 6C4, (D81F, bit 4) + const EVENT_6C5 ; 6C5, (D81F, bit 5) + const EVENT_6C6 ; 6C6, (D81F, bit 6) + const EVENT_6C7 ; 6C7, (D81F, bit 7) + const EVENT_6C8 ; 6C8, (D820, bit 0) + const EVENT_6C9 ; 6C9, (D820, bit 1) + const EVENT_6CA ; 6CA, (D820, bit 2) + const EVENT_6CB ; 6CB, (D820, bit 3) + const EVENT_6CC ; 6CC, (D820, bit 4) + const EVENT_6CD ; 6CD, (D820, bit 5) + const EVENT_6CE ; 6CE, (D820, bit 6) + const EVENT_6CF ; 6CF, (D820, bit 7) + const EVENT_6D0 ; 6D0, (D821, bit 0) + const EVENT_6D1 ; 6D1, (D821, bit 1) + const EVENT_6D2 ; 6D2, (D821, bit 2) + const EVENT_6D3 ; 6D3, (D821, bit 3) + const EVENT_6D4 ; 6D4, (D821, bit 4) + const EVENT_6D5 ; 6D5, (D821, bit 5) + const EVENT_6D6 ; 6D6, (D821, bit 6) + const EVENT_6D7 ; 6D7, (D821, bit 7) + const EVENT_6D8 ; 6D8, (D822, bit 0) + const EVENT_6D9 ; 6D9, (D822, bit 1) + const EVENT_6DA ; 6DA, (D822, bit 2) + const EVENT_6DB ; 6DB, (D822, bit 3) + const EVENT_6DC ; 6DC, (D822, bit 4) + const EVENT_6DD ; 6DD, (D822, bit 5) + const EVENT_6DE ; 6DE, (D822, bit 6) + const EVENT_6DF ; 6DF, (D822, bit 7) + const EVENT_6E0 ; 6E0, (D823, bit 0) + const EVENT_6E1 ; 6E1, (D823, bit 1) + const EVENT_6E2 ; 6E2, (D823, bit 2) + const EVENT_6E3 ; 6E3, (D823, bit 3) + const EVENT_6E4 ; 6E4, (D823, bit 4) + const EVENT_6E5 ; 6E5, (D823, bit 5) + const EVENT_6E6 ; 6E6, (D823, bit 6) + const EVENT_6E7 ; 6E7, (D823, bit 7) + const EVENT_6E8 ; 6E8, (D824, bit 0) + const EVENT_6E9 ; 6E9, (D824, bit 1) + const EVENT_6EA ; 6EA, (D824, bit 2) + const EVENT_6EB ; 6EB, (D824, bit 3) + const EVENT_6EC ; 6EC, (D824, bit 4) + const EVENT_6ED ; 6ED, (D824, bit 5) + const EVENT_6EE ; 6EE, (D824, bit 6) + const EVENT_6EF ; 6EF, (D824, bit 7) + const EVENT_6F0 ; 6F0, (D825, bit 0) + const EVENT_6F1 ; 6F1, (D825, bit 1) + const EVENT_BEAT_SILPH_CO_2F_TRAINER_0 ; 6F2, (D825, bit 2) + const EVENT_BEAT_SILPH_CO_2F_TRAINER_1 ; 6F3, (D825, bit 3) + const EVENT_BEAT_SILPH_CO_2F_TRAINER_2 ; 6F4, (D825, bit 4) + const EVENT_BEAT_SILPH_CO_2F_TRAINER_3 ; 6F5, (D825, bit 5) + const EVENT_6F6 ; 6F6, (D825, bit 6) + const EVENT_6F7 ; 6F7, (D825, bit 7) + const EVENT_6F8 ; 6F8, (D826, bit 0) + const EVENT_6F9 ; 6F9, (D826, bit 1) + const EVENT_6FA ; 6FA, (D826, bit 2) + const EVENT_6FB ; 6FB, (D826, bit 3) + const EVENT_6FC ; 6FC, (D826, bit 4) + const EVENT_SILPH_CO_2_UNLOCKED_DOOR1 ; 6FD, (D826, bit 5) + const EVENT_SILPH_CO_2_UNLOCKED_DOOR2 ; 6FE, (D826, bit 6) + const EVENT_GOT_TM36 ; 6FF, (D826, bit 7) + const EVENT_700 ; 700, (D827, bit 0) + const EVENT_701 ; 701, (D827, bit 1) + const EVENT_BEAT_SILPH_CO_3F_TRAINER_0 ; 702, (D827, bit 2) + const EVENT_BEAT_SILPH_CO_3F_TRAINER_1 ; 703, (D827, bit 3) + const EVENT_704 ; 704, (D827, bit 4) + const EVENT_705 ; 705, (D827, bit 5) + const EVENT_706 ; 706, (D827, bit 6) + const EVENT_707 ; 707, (D827, bit 7) + const EVENT_SILPH_CO_3_UNLOCKED_DOOR1 ; 708, (D828, bit 0) + const EVENT_SILPH_CO_3_UNLOCKED_DOOR2 ; 709, (D828, bit 1) + const EVENT_70A ; 70A, (D828, bit 2) + const EVENT_70B ; 70B, (D828, bit 3) + const EVENT_70C ; 70C, (D828, bit 4) + const EVENT_70D ; 70D, (D828, bit 5) + const EVENT_70E ; 70E, (D828, bit 6) + const EVENT_70F ; 70F, (D828, bit 7) + const EVENT_710 ; 710, (D829, bit 0) + const EVENT_711 ; 711, (D829, bit 1) + const EVENT_BEAT_SILPH_CO_4F_TRAINER_0 ; 712, (D829, bit 2) + const EVENT_BEAT_SILPH_CO_4F_TRAINER_2 ; 713, (D829, bit 3) + const EVENT_BEAT_SILPH_CO_4F_TRAINER_3 ; 714, (D829, bit 4) + const EVENT_715 ; 715, (D829, bit 5) + const EVENT_716 ; 716, (D829, bit 6) + const EVENT_717 ; 717, (D829, bit 7) + const EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ; 718, (D82A, bit 0) + const EVENT_SILPH_CO_4_UNLOCKED_DOOR2 ; 719, (D82A, bit 1) + const EVENT_71A ; 71A, (D82A, bit 2) + const EVENT_71B ; 71B, (D82A, bit 3) + const EVENT_71C ; 71C, (D82A, bit 4) + const EVENT_71D ; 71D, (D82A, bit 5) + const EVENT_71E ; 71E, (D82A, bit 6) + const EVENT_71F ; 71F, (D82A, bit 7) + const EVENT_720 ; 720, (D82B, bit 0) + const EVENT_721 ; 721, (D82B, bit 1) + const EVENT_BEAT_SILPH_CO_5F_TRAINER_0 ; 722, (D82B, bit 2) + const EVENT_BEAT_SILPH_CO_5F_TRAINER_2 ; 723, (D82B, bit 3) + const EVENT_BEAT_SILPH_CO_5F_TRAINER_3 ; 724, (D82B, bit 4) + const EVENT_BEAT_SILPH_CO_5F_TRAINER_4 ; 725, (D82B, bit 5) + const EVENT_726 ; 726, (D82B, bit 6) + const EVENT_727 ; 727, (D82B, bit 7) + const EVENT_SILPH_CO_5_UNLOCKED_DOOR1 ; 728, (D82C, bit 0) + const EVENT_SILPH_CO_5_UNLOCKED_DOOR2 ; 729, (D82C, bit 1) + const EVENT_SILPH_CO_5_UNLOCKED_DOOR3 ; 72A, (D82C, bit 2) + const EVENT_72B ; 72B, (D82C, bit 3) + const EVENT_72C ; 72C, (D82C, bit 4) + const EVENT_72D ; 72D, (D82C, bit 5) + const EVENT_72E ; 72E, (D82C, bit 6) + const EVENT_72F ; 72F, (D82C, bit 7) + const EVENT_730 ; 730, (D82D, bit 0) + const EVENT_731 ; 731, (D82D, bit 1) + const EVENT_732 ; 732, (D82D, bit 2) + const EVENT_733 ; 733, (D82D, bit 3) + const EVENT_734 ; 734, (D82D, bit 4) + const EVENT_735 ; 735, (D82D, bit 5) + const EVENT_BEAT_SILPH_CO_6F_TRAINER_0 ; 736, (D82D, bit 6) + const EVENT_BEAT_SILPH_CO_6F_TRAINER_2 ; 737, (D82D, bit 7) + const EVENT_BEAT_SILPH_CO_6F_TRAINER_3 ; 738, (D82E, bit 0) + const EVENT_739 ; 739, (D82E, bit 1) + const EVENT_73A ; 73A, (D82E, bit 2) + const EVENT_73B ; 73B, (D82E, bit 3) + const EVENT_73C ; 73C, (D82E, bit 4) + const EVENT_73D ; 73D, (D82E, bit 5) + const EVENT_73E ; 73E, (D82E, bit 6) + const EVENT_SILPH_CO_6_UNLOCKED_DOOR ; 73F, (D82E, bit 7) + const EVENT_BEAT_SILPH_CO_RIVAL ; 740, (D82F, bit 0) + const EVENT_741 ; 741, (D82F, bit 1) + const EVENT_742 ; 742, (D82F, bit 2) + const EVENT_743 ; 743, (D82F, bit 3) + const EVENT_744 ; 744, (D82F, bit 4) + const EVENT_BEAT_SILPH_CO_7F_TRAINER_0 ; 745, (D82F, bit 5) + const EVENT_BEAT_SILPH_CO_7F_TRAINER_2 ; 746, (D82F, bit 6) + const EVENT_BEAT_SILPH_CO_7F_TRAINER_3 ; 747, (D82F, bit 7) + const EVENT_BEAT_SILPH_CO_7F_TRAINER_4 ; 748, (D830, bit 0) + const EVENT_749 ; 749, (D830, bit 1) + const EVENT_74A ; 74A, (D830, bit 2) + const EVENT_74B ; 74B, (D830, bit 3) + const EVENT_SILPH_CO_7_UNLOCKED_DOOR1 ; 74C, (D830, bit 4) + const EVENT_SILPH_CO_7_UNLOCKED_DOOR2 ; 74D, (D830, bit 5) + const EVENT_SILPH_CO_7_UNLOCKED_DOOR3 ; 74E, (D830, bit 6) + const EVENT_74F ; 74F, (D830, bit 7) + const EVENT_750 ; 750, (D831, bit 0) + const EVENT_751 ; 751, (D831, bit 1) + const EVENT_BEAT_SILPH_CO_8F_TRAINER_0 ; 752, (D831, bit 2) + const EVENT_BEAT_SILPH_CO_8F_TRAINER_1 ; 753, (D831, bit 3) + const EVENT_BEAT_SILPH_CO_8F_TRAINER_2 ; 754, (D831, bit 4) + const EVENT_755 ; 755, (D831, bit 5) + const EVENT_756 ; 756, (D831, bit 6) + const EVENT_757 ; 757, (D831, bit 7) + const EVENT_SILPH_CO_8_UNLOCKED_DOOR ; 758, (D832, bit 0) + const EVENT_759 ; 759, (D832, bit 1) + const EVENT_75A ; 75A, (D832, bit 2) + const EVENT_75B ; 75B, (D832, bit 3) + const EVENT_75C ; 75C, (D832, bit 4) + const EVENT_75D ; 75D, (D832, bit 5) + const EVENT_75E ; 75E, (D832, bit 6) + const EVENT_75F ; 75F, (D832, bit 7) + const EVENT_760 ; 760, (D833, bit 0) + const EVENT_761 ; 761, (D833, bit 1) + const EVENT_BEAT_SILPH_CO_9F_TRAINER_0 ; 762, (D833, bit 2) + const EVENT_BEAT_SILPH_CO_9F_TRAINER_1 ; 763, (D833, bit 3) + const EVENT_BEAT_SILPH_CO_9F_TRAINER_2 ; 764, (D833, bit 4) + const EVENT_765 ; 765, (D833, bit 5) + const EVENT_766 ; 766, (D833, bit 6) + const EVENT_767 ; 767, (D833, bit 7) + const EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ; 768, (D834, bit 0) + const EVENT_SILPH_CO_9_UNLOCKED_DOOR2 ; 769, (D834, bit 1) + const EVENT_SILPH_CO_9_UNLOCKED_DOOR3 ; 76A, (D834, bit 2) + const EVENT_SILPH_CO_9_UNLOCKED_DOOR4 ; 76B, (D834, bit 3) + const EVENT_76C ; 76C, (D834, bit 4) + const EVENT_76D ; 76D, (D834, bit 5) + const EVENT_76E ; 76E, (D834, bit 6) + const EVENT_76F ; 76F, (D834, bit 7) + const EVENT_770 ; 770, (D835, bit 0) + const EVENT_BEAT_SILPH_CO_10F_TRAINER_0 ; 771, (D835, bit 1) + const EVENT_BEAT_SILPH_CO_10F_TRAINER_1 ; 772, (D835, bit 2) + const EVENT_773 ; 773, (D835, bit 3) + const EVENT_774 ; 774, (D835, bit 4) + const EVENT_775 ; 775, (D835, bit 5) + const EVENT_776 ; 776, (D835, bit 6) + const EVENT_777 ; 777, (D835, bit 7) + const EVENT_SILPH_CO_10_UNLOCKED_DOOR ; 778, (D836, bit 0) + const EVENT_779 ; 779, (D836, bit 1) + const EVENT_77A ; 77A, (D836, bit 2) + const EVENT_77B ; 77B, (D836, bit 3) + const EVENT_77C ; 77C, (D836, bit 4) + const EVENT_77D ; 77D, (D836, bit 5) + const EVENT_77E ; 77E, (D836, bit 6) + const EVENT_77F ; 77F, (D836, bit 7) + const EVENT_780 ; 780, (D837, bit 0) + const EVENT_781 ; 781, (D837, bit 1) + const EVENT_782 ; 782, (D837, bit 2) + const EVENT_783 ; 783, (D837, bit 3) + const EVENT_BEAT_SILPH_CO_11F_TRAINER_0 ; 784, (D837, bit 4) + const EVENT_BEAT_SILPH_CO_11F_TRAINER_1 ; 785, (D837, bit 5) + const EVENT_786 ; 786, (D837, bit 6) + const EVENT_787 ; 787, (D837, bit 7) + const EVENT_SILPH_CO_11_UNLOCKED_DOOR ; 788, (D838, bit 0) + const EVENT_789 ; 789, (D838, bit 1) + const EVENT_78A ; 78A, (D838, bit 2) + const EVENT_78B ; 78B, (D838, bit 3) + const EVENT_78C ; 78C, (D838, bit 4) + const EVENT_GOT_MASTER_BALL ; 78D, (D838, bit 5) + const EVENT_78E ; 78E, (D838, bit 6) + const EVENT_BEAT_SILPH_CO_GIOVANNI ; 78F, (D838, bit 7) + const EVENT_790 ; 790, (D839, bit 0) + const EVENT_791 ; 791, (D839, bit 1) + const EVENT_792 ; 792, (D839, bit 2) + const EVENT_793 ; 793, (D839, bit 3) + const EVENT_794 ; 794, (D839, bit 4) + const EVENT_795 ; 795, (D839, bit 5) + const EVENT_796 ; 796, (D839, bit 6) + const EVENT_797 ; 797, (D839, bit 7) + const EVENT_798 ; 798, (D83A, bit 0) + const EVENT_799 ; 799, (D83A, bit 1) + const EVENT_79A ; 79A, (D83A, bit 2) + const EVENT_79B ; 79B, (D83A, bit 3) + const EVENT_79C ; 79C, (D83A, bit 4) + const EVENT_79D ; 79D, (D83A, bit 5) + const EVENT_79E ; 79E, (D83A, bit 6) + const EVENT_79F ; 79F, (D83A, bit 7) + const EVENT_7A0 ; 7A0, (D83B, bit 0) + const EVENT_7A1 ; 7A1, (D83B, bit 1) + const EVENT_7A2 ; 7A2, (D83B, bit 2) + const EVENT_7A3 ; 7A3, (D83B, bit 3) + const EVENT_7A4 ; 7A4, (D83B, bit 4) + const EVENT_7A5 ; 7A5, (D83B, bit 5) + const EVENT_7A6 ; 7A6, (D83B, bit 6) + const EVENT_7A7 ; 7A7, (D83B, bit 7) + const EVENT_7A8 ; 7A8, (D83C, bit 0) + const EVENT_7A9 ; 7A9, (D83C, bit 1) + const EVENT_7AA ; 7AA, (D83C, bit 2) + const EVENT_7AB ; 7AB, (D83C, bit 3) + const EVENT_7AC ; 7AC, (D83C, bit 4) + const EVENT_7AD ; 7AD, (D83C, bit 5) + const EVENT_7AE ; 7AE, (D83C, bit 6) + const EVENT_7AF ; 7AF, (D83C, bit 7) + const EVENT_7B0 ; 7B0, (D83D, bit 0) + const EVENT_7B1 ; 7B1, (D83D, bit 1) + const EVENT_7B2 ; 7B2, (D83D, bit 2) + const EVENT_7B3 ; 7B3, (D83D, bit 3) + const EVENT_7B4 ; 7B4, (D83D, bit 4) + const EVENT_7B5 ; 7B5, (D83D, bit 5) + const EVENT_7B6 ; 7B6, (D83D, bit 6) + const EVENT_7B7 ; 7B7, (D83D, bit 7) + const EVENT_7B8 ; 7B8, (D83E, bit 0) + const EVENT_7B9 ; 7B9, (D83E, bit 1) + const EVENT_7BA ; 7BA, (D83E, bit 2) + const EVENT_7BB ; 7BB, (D83E, bit 3) + const EVENT_7BC ; 7BC, (D83E, bit 4) + const EVENT_7BD ; 7BD, (D83E, bit 5) + const EVENT_7BE ; 7BE, (D83E, bit 6) + const EVENT_7BF ; 7BF, (D83E, bit 7) + const EVENT_7C0 ; 7C0, (D83F, bit 0) + const EVENT_7C1 ; 7C1, (D83F, bit 1) + const EVENT_7C2 ; 7C2, (D83F, bit 2) + const EVENT_7C3 ; 7C3, (D83F, bit 3) + const EVENT_7C4 ; 7C4, (D83F, bit 4) + const EVENT_7C5 ; 7C5, (D83F, bit 5) + const EVENT_7C6 ; 7C6, (D83F, bit 6) + const EVENT_7C7 ; 7C7, (D83F, bit 7) + const EVENT_7C8 ; 7C8, (D840, bit 0) + const EVENT_7C9 ; 7C9, (D840, bit 1) + const EVENT_7CA ; 7CA, (D840, bit 2) + const EVENT_7CB ; 7CB, (D840, bit 3) + const EVENT_7CC ; 7CC, (D840, bit 4) + const EVENT_7CD ; 7CD, (D840, bit 5) + const EVENT_7CE ; 7CE, (D840, bit 6) + const EVENT_7CF ; 7CF, (D840, bit 7) + const EVENT_7D0 ; 7D0, (D841, bit 0) + const EVENT_7D1 ; 7D1, (D841, bit 1) + const EVENT_7D2 ; 7D2, (D841, bit 2) + const EVENT_7D3 ; 7D3, (D841, bit 3) + const EVENT_7D4 ; 7D4, (D841, bit 4) + const EVENT_7D5 ; 7D5, (D841, bit 5) + const EVENT_7D6 ; 7D6, (D841, bit 6) + const EVENT_7D7 ; 7D7, (D841, bit 7) + const EVENT_7D8 ; 7D8, (D842, bit 0) + const EVENT_7D9 ; 7D9, (D842, bit 1) + const EVENT_7DA ; 7DA, (D842, bit 2) + const EVENT_7DB ; 7DB, (D842, bit 3) + const EVENT_7DC ; 7DC, (D842, bit 4) + const EVENT_7DD ; 7DD, (D842, bit 5) + const EVENT_7DE ; 7DE, (D842, bit 6) + const EVENT_7DF ; 7DF, (D842, bit 7) + const EVENT_7E0 ; 7E0, (D843, bit 0) + const EVENT_7E1 ; 7E1, (D843, bit 1) + const EVENT_7E2 ; 7E2, (D843, bit 2) + const EVENT_7E3 ; 7E3, (D843, bit 3) + const EVENT_7E4 ; 7E4, (D843, bit 4) + const EVENT_7E5 ; 7E5, (D843, bit 5) + const EVENT_7E6 ; 7E6, (D843, bit 6) + const EVENT_7E7 ; 7E7, (D843, bit 7) + const EVENT_7E8 ; 7E8, (D844, bit 0) + const EVENT_7E9 ; 7E9, (D844, bit 1) + const EVENT_7EA ; 7EA, (D844, bit 2) + const EVENT_7EB ; 7EB, (D844, bit 3) + const EVENT_7EC ; 7EC, (D844, bit 4) + const EVENT_7ED ; 7ED, (D844, bit 5) + const EVENT_7EE ; 7EE, (D844, bit 6) + const EVENT_7EF ; 7EF, (D844, bit 7) + const EVENT_7F0 ; 7F0, (D845, bit 0) + const EVENT_7F1 ; 7F1, (D845, bit 1) + const EVENT_7F2 ; 7F2, (D845, bit 2) + const EVENT_7F3 ; 7F3, (D845, bit 3) + const EVENT_7F4 ; 7F4, (D845, bit 4) + const EVENT_7F5 ; 7F5, (D845, bit 5) + const EVENT_7F6 ; 7F6, (D845, bit 6) + const EVENT_7F7 ; 7F7, (D845, bit 7) + const EVENT_7F8 ; 7F8, (D846, bit 0) + const EVENT_7F9 ; 7F9, (D846, bit 1) + const EVENT_7FA ; 7FA, (D846, bit 2) + const EVENT_7FB ; 7FB, (D846, bit 3) + const EVENT_7FC ; 7FC, (D846, bit 4) + const EVENT_7FD ; 7FD, (D846, bit 5) + const EVENT_7FE ; 7FE, (D846, bit 6) + const EVENT_7FF ; 7FF, (D846, bit 7) + const EVENT_800 ; 800, (D847, bit 0) + const EVENT_BEAT_MANSION_2_TRAINER_0 ; 801, (D847, bit 1) + const EVENT_802 ; 802, (D847, bit 2) + const EVENT_803 ; 803, (D847, bit 3) + const EVENT_804 ; 804, (D847, bit 4) + const EVENT_805 ; 805, (D847, bit 5) + const EVENT_806 ; 806, (D847, bit 6) + const EVENT_807 ; 807, (D847, bit 7) + const EVENT_808 ; 808, (D848, bit 0) + const EVENT_809 ; 809, (D848, bit 1) + const EVENT_80A ; 80A, (D848, bit 2) + const EVENT_80B ; 80B, (D848, bit 3) + const EVENT_80C ; 80C, (D848, bit 4) + const EVENT_80D ; 80D, (D848, bit 5) + const EVENT_80E ; 80E, (D848, bit 6) + const EVENT_80F ; 80F, (D848, bit 7) + const EVENT_810 ; 810, (D849, bit 0) + const EVENT_BEAT_MANSION_3_TRAINER_0 ; 811, (D849, bit 1) + const EVENT_BEAT_MANSION_3_TRAINER_2 ; 812, (D849, bit 2) + const EVENT_813 ; 813, (D849, bit 3) + const EVENT_814 ; 814, (D849, bit 4) + const EVENT_815 ; 815, (D849, bit 5) + const EVENT_816 ; 816, (D849, bit 6) + const EVENT_817 ; 817, (D849, bit 7) + const EVENT_818 ; 818, (D84A, bit 0) + const EVENT_819 ; 819, (D84A, bit 1) + const EVENT_81A ; 81A, (D84A, bit 2) + const EVENT_81B ; 81B, (D84A, bit 3) + const EVENT_81C ; 81C, (D84A, bit 4) + const EVENT_81D ; 81D, (D84A, bit 5) + const EVENT_81E ; 81E, (D84A, bit 6) + const EVENT_81F ; 81F, (D84A, bit 7) + const EVENT_820 ; 820, (D84B, bit 0) + const EVENT_BEAT_MANSION_4_TRAINER_0 ; 821, (D84B, bit 1) + const EVENT_BEAT_MANSION_4_TRAINER_2 ; 822, (D84B, bit 2) + const EVENT_823 ; 823, (D84B, bit 3) + const EVENT_824 ; 824, (D84B, bit 4) + const EVENT_825 ; 825, (D84B, bit 5) + const EVENT_826 ; 826, (D84B, bit 6) + const EVENT_827 ; 827, (D84B, bit 7) + const EVENT_828 ; 828, (D84C, bit 0) + const EVENT_829 ; 829, (D84C, bit 1) + const EVENT_82A ; 82A, (D84C, bit 2) + const EVENT_82B ; 82B, (D84C, bit 3) + const EVENT_82C ; 82C, (D84C, bit 4) + const EVENT_82D ; 82D, (D84C, bit 5) + const EVENT_82E ; 82E, (D84C, bit 6) + const EVENT_82F ; 82F, (D84C, bit 7) + const EVENT_830 ; 830, (D84D, bit 0) + const EVENT_831 ; 831, (D84D, bit 1) + const EVENT_832 ; 832, (D84D, bit 2) + const EVENT_833 ; 833, (D84D, bit 3) + const EVENT_834 ; 834, (D84D, bit 4) + const EVENT_835 ; 835, (D84D, bit 5) + const EVENT_836 ; 836, (D84D, bit 6) + const EVENT_837 ; 837, (D84D, bit 7) + const EVENT_838 ; 838, (D84E, bit 0) + const EVENT_839 ; 839, (D84E, bit 1) + const EVENT_83A ; 83A, (D84E, bit 2) + const EVENT_83B ; 83B, (D84E, bit 3) + const EVENT_83C ; 83C, (D84E, bit 4) + const EVENT_83D ; 83D, (D84E, bit 5) + const EVENT_83E ; 83E, (D84E, bit 6) + const EVENT_83F ; 83F, (D84E, bit 7) + const EVENT_840 ; 840, (D84F, bit 0) + const EVENT_841 ; 841, (D84F, bit 1) + const EVENT_842 ; 842, (D84F, bit 2) + const EVENT_843 ; 843, (D84F, bit 3) + const EVENT_844 ; 844, (D84F, bit 4) + const EVENT_845 ; 845, (D84F, bit 5) + const EVENT_846 ; 846, (D84F, bit 6) + const EVENT_847 ; 847, (D84F, bit 7) + const EVENT_848 ; 848, (D850, bit 0) + const EVENT_849 ; 849, (D850, bit 1) + const EVENT_84A ; 84A, (D850, bit 2) + const EVENT_84B ; 84B, (D850, bit 3) + const EVENT_84C ; 84C, (D850, bit 4) + const EVENT_84D ; 84D, (D850, bit 5) + const EVENT_84E ; 84E, (D850, bit 6) + const EVENT_84F ; 84F, (D850, bit 7) + const EVENT_850 ; 850, (D851, bit 0) + const EVENT_851 ; 851, (D851, bit 1) + const EVENT_852 ; 852, (D851, bit 2) + const EVENT_853 ; 853, (D851, bit 3) + const EVENT_854 ; 854, (D851, bit 4) + const EVENT_855 ; 855, (D851, bit 5) + const EVENT_856 ; 856, (D851, bit 6) + const EVENT_857 ; 857, (D851, bit 7) + const EVENT_858 ; 858, (D852, bit 0) + const EVENT_859 ; 859, (D852, bit 1) + const EVENT_85A ; 85A, (D852, bit 2) + const EVENT_85B ; 85B, (D852, bit 3) + const EVENT_85C ; 85C, (D852, bit 4) + const EVENT_85D ; 85D, (D852, bit 5) + const EVENT_85E ; 85E, (D852, bit 6) + const EVENT_85F ; 85F, (D852, bit 7) + const EVENT_860 ; 860, (D853, bit 0) + const EVENT_861 ; 861, (D853, bit 1) + const EVENT_862 ; 862, (D853, bit 2) + const EVENT_863 ; 863, (D853, bit 3) + const EVENT_864 ; 864, (D853, bit 4) + const EVENT_865 ; 865, (D853, bit 5) + const EVENT_866 ; 866, (D853, bit 6) + const EVENT_867 ; 867, (D853, bit 7) + const EVENT_868 ; 868, (D854, bit 0) + const EVENT_869 ; 869, (D854, bit 1) + const EVENT_86A ; 86A, (D854, bit 2) + const EVENT_86B ; 86B, (D854, bit 3) + const EVENT_86C ; 86C, (D854, bit 4) + const EVENT_86D ; 86D, (D854, bit 5) + const EVENT_86E ; 86E, (D854, bit 6) + const EVENT_86F ; 86F, (D854, bit 7) + const EVENT_870 ; 870, (D855, bit 0) + const EVENT_871 ; 871, (D855, bit 1) + const EVENT_872 ; 872, (D855, bit 2) + const EVENT_873 ; 873, (D855, bit 3) + const EVENT_874 ; 874, (D855, bit 4) + const EVENT_875 ; 875, (D855, bit 5) + const EVENT_876 ; 876, (D855, bit 6) + const EVENT_877 ; 877, (D855, bit 7) + const EVENT_878 ; 878, (D856, bit 0) + const EVENT_879 ; 879, (D856, bit 1) + const EVENT_87A ; 87A, (D856, bit 2) + const EVENT_87B ; 87B, (D856, bit 3) + const EVENT_87C ; 87C, (D856, bit 4) + const EVENT_87D ; 87D, (D856, bit 5) + const EVENT_87E ; 87E, (D856, bit 6) + const EVENT_87F ; 87F, (D856, bit 7) + const EVENT_GOT_HM03 ; 880, (D857, bit 0) + const EVENT_881 ; 881, (D857, bit 1) + const EVENT_882 ; 882, (D857, bit 2) + const EVENT_883 ; 883, (D857, bit 3) + const EVENT_884 ; 884, (D857, bit 4) + const EVENT_885 ; 885, (D857, bit 5) + const EVENT_886 ; 886, (D857, bit 6) + const EVENT_887 ; 887, (D857, bit 7) + const EVENT_888 ; 888, (D858, bit 0) + const EVENT_889 ; 889, (D858, bit 1) + const EVENT_88A ; 88A, (D858, bit 2) + const EVENT_88B ; 88B, (D858, bit 3) + const EVENT_88C ; 88C, (D858, bit 4) + const EVENT_88D ; 88D, (D858, bit 5) + const EVENT_88E ; 88E, (D858, bit 6) + const EVENT_88F ; 88F, (D858, bit 7) + const EVENT_890 ; 890, (D859, bit 0) + const EVENT_891 ; 891, (D859, bit 1) + const EVENT_892 ; 892, (D859, bit 2) + const EVENT_893 ; 893, (D859, bit 3) + const EVENT_894 ; 894, (D859, bit 4) + const EVENT_895 ; 895, (D859, bit 5) + const EVENT_896 ; 896, (D859, bit 6) + const EVENT_897 ; 897, (D859, bit 7) + const EVENT_898 ; 898, (D85A, bit 0) + const EVENT_899 ; 899, (D85A, bit 1) + const EVENT_89A ; 89A, (D85A, bit 2) + const EVENT_89B ; 89B, (D85A, bit 3) + const EVENT_89C ; 89C, (D85A, bit 4) + const EVENT_89D ; 89D, (D85A, bit 5) + const EVENT_89E ; 89E, (D85A, bit 6) + const EVENT_89F ; 89F, (D85A, bit 7) + const EVENT_8A0 ; 8A0, (D85B, bit 0) + const EVENT_8A1 ; 8A1, (D85B, bit 1) + const EVENT_8A2 ; 8A2, (D85B, bit 2) + const EVENT_8A3 ; 8A3, (D85B, bit 3) + const EVENT_8A4 ; 8A4, (D85B, bit 4) + const EVENT_8A5 ; 8A5, (D85B, bit 5) + const EVENT_8A6 ; 8A6, (D85B, bit 6) + const EVENT_8A7 ; 8A7, (D85B, bit 7) + const EVENT_8A8 ; 8A8, (D85C, bit 0) + const EVENT_8A9 ; 8A9, (D85C, bit 1) + const EVENT_8AA ; 8AA, (D85C, bit 2) + const EVENT_8AB ; 8AB, (D85C, bit 3) + const EVENT_8AC ; 8AC, (D85C, bit 4) + const EVENT_8AD ; 8AD, (D85C, bit 5) + const EVENT_8AE ; 8AE, (D85C, bit 6) + const EVENT_8AF ; 8AF, (D85C, bit 7) + const EVENT_8B0 ; 8B0, (D85D, bit 0) + const EVENT_8B1 ; 8B1, (D85D, bit 1) + const EVENT_8B2 ; 8B2, (D85D, bit 2) + const EVENT_8B3 ; 8B3, (D85D, bit 3) + const EVENT_8B4 ; 8B4, (D85D, bit 4) + const EVENT_8B5 ; 8B5, (D85D, bit 5) + const EVENT_8B6 ; 8B6, (D85D, bit 6) + const EVENT_8B7 ; 8B7, (D85D, bit 7) + const EVENT_8B8 ; 8B8, (D85E, bit 0) + const EVENT_8B9 ; 8B9, (D85E, bit 1) + const EVENT_8BA ; 8BA, (D85E, bit 2) + const EVENT_8BB ; 8BB, (D85E, bit 3) + const EVENT_8BC ; 8BC, (D85E, bit 4) + const EVENT_8BD ; 8BD, (D85E, bit 5) + const EVENT_8BE ; 8BE, (D85E, bit 6) + const EVENT_8BF ; 8BF, (D85E, bit 7) + const EVENT_8C0 ; 8C0, (D85F, bit 0) + const EVENT_BEAT_UNKNOWN_DUNGEON_3_TRAINER_0 ; 8C1, (D85F, bit 1) + const EVENT_8C2 ; 8C2, (D85F, bit 2) + const EVENT_8C3 ; 8C3, (D85F, bit 3) + const EVENT_8C4 ; 8C4, (D85F, bit 4) + const EVENT_8C5 ; 8C5, (D85F, bit 5) + const EVENT_8C6 ; 8C6, (D85F, bit 6) + const EVENT_8C7 ; 8C7, (D85F, bit 7) + const EVENT_8C8 ; 8C8, (D860, bit 0) + const EVENT_8C9 ; 8C9, (D860, bit 1) + const EVENT_8CA ; 8CA, (D860, bit 2) + const EVENT_8CB ; 8CB, (D860, bit 3) + const EVENT_8CC ; 8CC, (D860, bit 4) + const EVENT_8CD ; 8CD, (D860, bit 5) + const EVENT_8CE ; 8CE, (D860, bit 6) + const EVENT_8CF ; 8CF, (D860, bit 7) + const EVENT_8D0 ; 8D0, (D861, bit 0) + const EVENT_8D1 ; 8D1, (D861, bit 1) + const EVENT_8D2 ; 8D2, (D861, bit 2) + const EVENT_8D3 ; 8D3, (D861, bit 3) + const EVENT_8D4 ; 8D4, (D861, bit 4) + const EVENT_8D5 ; 8D5, (D861, bit 5) + const EVENT_8D6 ; 8D6, (D861, bit 6) + const EVENT_8D7 ; 8D7, (D861, bit 7) + const EVENT_8D8 ; 8D8, (D862, bit 0) + const EVENT_8D9 ; 8D9, (D862, bit 1) + const EVENT_8DA ; 8DA, (D862, bit 2) + const EVENT_8DB ; 8DB, (D862, bit 3) + const EVENT_8DC ; 8DC, (D862, bit 4) + const EVENT_8DD ; 8DD, (D862, bit 5) + const EVENT_8DE ; 8DE, (D862, bit 6) + const EVENT_8DF ; 8DF, (D862, bit 7) + const EVENT_ELITE4_EVENTS_START ; 8E0, (D863, bit 0) + const EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 ; 8E1, (D863, bit 1) + const EVENT_8E2 ; 8E2, (D863, bit 2) + const EVENT_8E3 ; 8E3, (D863, bit 3) + const EVENT_8E4 ; 8E4, (D863, bit 4) + const EVENT_8E5 ; 8E5, (D863, bit 5) + const EVENT_AUTOWALKED_INTO_LORELEIS_ROOM ; 8E6, (D863, bit 6) + const EVENT_8E7 ; 8E7, (D863, bit 7) + const EVENT_8E8 ; 8E8, (D864, bit 0) + const EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 ; 8E9, (D864, bit 1) + const EVENT_8EA ; 8EA, (D864, bit 2) + const EVENT_8EB ; 8EB, (D864, bit 3) + const EVENT_8EC ; 8EC, (D864, bit 4) + const EVENT_8ED ; 8ED, (D864, bit 5) + const EVENT_AUTOWALKED_INTO_BRUNOS_ROOM ; 8EE, (D864, bit 6) + const EVENT_8EF ; 8EF, (D864, bit 7) + const EVENT_8F0 ; 8F0, (D865, bit 0) + const EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 ; 8F1, (D865, bit 1) + const EVENT_8F2 ; 8F2, (D865, bit 2) + const EVENT_8F3 ; 8F3, (D865, bit 3) + const EVENT_8F4 ; 8F4, (D865, bit 4) + const EVENT_8F5 ; 8F5, (D865, bit 5) + const EVENT_AUTOWALKED_INTO_AGATHAS_ROOM ; 8F6, (D865, bit 6) + const EVENT_8F7 ; 8F7, (D865, bit 7) + const EVENT_8F8 ; 8F8, (D866, bit 0) + const EVENT_BEAT_LANCES_ROOM_TRAINER_0 ; 8F9, (D866, bit 1) + const EVENT_8FA ; 8FA, (D866, bit 2) + const EVENT_8FB ; 8FB, (D866, bit 3) + const EVENT_8FC ; 8FC, (D866, bit 4) + const EVENT_8FD ; 8FD, (D866, bit 5) + const EVENT_BEAT_LANCE ; 8FE, (D866, bit 6) + const EVENT_LANCES_ROOM_LOCK_DOOR ; 8FF, (D866, bit 7) + const EVENT_900 ; 900, (D867, bit 0) + const EVENT_BEAT_CHAMPION_RIVAL ; 901, (D867, bit 1) + const EVENT_902 ; 902, (D867, bit 2) + const EVENT_903 ; 903, (D867, bit 3) + const EVENT_904 ; 904, (D867, bit 4) + const EVENT_905 ; 905, (D867, bit 5) + const EVENT_906 ; 906, (D867, bit 6) + const EVENT_907 ; 907, (D867, bit 7) + const EVENT_908 ; 908, (D868, bit 0) + const EVENT_909 ; 909, (D868, bit 1) + const EVENT_90A ; 90A, (D868, bit 2) + const EVENT_90B ; 90B, (D868, bit 3) + const EVENT_90C ; 90C, (D868, bit 4) + const EVENT_90D ; 90D, (D868, bit 5) + const EVENT_90E ; 90E, (D868, bit 6) + const EVENT_90F ; 90F, (D868, bit 7) + const EVENT_910 ; 910, (D869, bit 0) + const EVENT_BEAT_VICTORY_ROAD_1_TRAINER_0 ; 911, (D869, bit 1) + const EVENT_BEAT_VICTORY_ROAD_1_TRAINER_1 ; 912, (D869, bit 2) + const EVENT_913 ; 913, (D869, bit 3) + const EVENT_914 ; 914, (D869, bit 4) + const EVENT_915 ; 915, (D869, bit 5) + const EVENT_916 ; 916, (D869, bit 6) + const EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH ; 917, (D869, bit 7) + const EVENT_918 ; 918, (D86A, bit 0) + const EVENT_919 ; 919, (D86A, bit 1) + const EVENT_91A ; 91A, (D86A, bit 2) + const EVENT_91B ; 91B, (D86A, bit 3) + const EVENT_91C ; 91C, (D86A, bit 4) + const EVENT_91D ; 91D, (D86A, bit 5) + const EVENT_91E ; 91E, (D86A, bit 6) + const EVENT_91F ; 91F, (D86A, bit 7) + const EVENT_920 ; 920, (D86B, bit 0) + const EVENT_921 ; 921, (D86B, bit 1) + const EVENT_922 ; 922, (D86B, bit 2) + const EVENT_923 ; 923, (D86B, bit 3) + const EVENT_924 ; 924, (D86B, bit 4) + const EVENT_925 ; 925, (D86B, bit 5) + const EVENT_926 ; 926, (D86B, bit 6) + const EVENT_927 ; 927, (D86B, bit 7) + const EVENT_928 ; 928, (D86C, bit 0) + const EVENT_929 ; 929, (D86C, bit 1) + const EVENT_92A ; 92A, (D86C, bit 2) + const EVENT_92B ; 92B, (D86C, bit 3) + const EVENT_92C ; 92C, (D86C, bit 4) + const EVENT_92D ; 92D, (D86C, bit 5) + const EVENT_92E ; 92E, (D86C, bit 6) + const EVENT_92F ; 92F, (D86C, bit 7) + const EVENT_930 ; 930, (D86D, bit 0) + const EVENT_931 ; 931, (D86D, bit 1) + const EVENT_932 ; 932, (D86D, bit 2) + const EVENT_933 ; 933, (D86D, bit 3) + const EVENT_934 ; 934, (D86D, bit 4) + const EVENT_935 ; 935, (D86D, bit 5) + const EVENT_936 ; 936, (D86D, bit 6) + const EVENT_937 ; 937, (D86D, bit 7) + const EVENT_938 ; 938, (D86E, bit 0) + const EVENT_939 ; 939, (D86E, bit 1) + const EVENT_93A ; 93A, (D86E, bit 2) + const EVENT_93B ; 93B, (D86E, bit 3) + const EVENT_93C ; 93C, (D86E, bit 4) + const EVENT_93D ; 93D, (D86E, bit 5) + const EVENT_93E ; 93E, (D86E, bit 6) + const EVENT_93F ; 93F, (D86E, bit 7) + const EVENT_940 ; 940, (D86F, bit 0) + const EVENT_941 ; 941, (D86F, bit 1) + const EVENT_942 ; 942, (D86F, bit 2) + const EVENT_943 ; 943, (D86F, bit 3) + const EVENT_944 ; 944, (D86F, bit 4) + const EVENT_945 ; 945, (D86F, bit 5) + const EVENT_946 ; 946, (D86F, bit 6) + const EVENT_947 ; 947, (D86F, bit 7) + const EVENT_948 ; 948, (D870, bit 0) + const EVENT_949 ; 949, (D870, bit 1) + const EVENT_94A ; 94A, (D870, bit 2) + const EVENT_94B ; 94B, (D870, bit 3) + const EVENT_94C ; 94C, (D870, bit 4) + const EVENT_94D ; 94D, (D870, bit 5) + const EVENT_94E ; 94E, (D870, bit 6) + const EVENT_94F ; 94F, (D870, bit 7) + const EVENT_950 ; 950, (D871, bit 0) + const EVENT_951 ; 951, (D871, bit 1) + const EVENT_952 ; 952, (D871, bit 2) + const EVENT_953 ; 953, (D871, bit 3) + const EVENT_954 ; 954, (D871, bit 4) + const EVENT_955 ; 955, (D871, bit 5) + const EVENT_956 ; 956, (D871, bit 6) + const EVENT_957 ; 957, (D871, bit 7) + const EVENT_958 ; 958, (D872, bit 0) + const EVENT_959 ; 959, (D872, bit 1) + const EVENT_95A ; 95A, (D872, bit 2) + const EVENT_95B ; 95B, (D872, bit 3) + const EVENT_95C ; 95C, (D872, bit 4) + const EVENT_95D ; 95D, (D872, bit 5) + const EVENT_95E ; 95E, (D872, bit 6) + const EVENT_95F ; 95F, (D872, bit 7) + const EVENT_960 ; 960, (D873, bit 0) + const EVENT_961 ; 961, (D873, bit 1) + const EVENT_962 ; 962, (D873, bit 2) + const EVENT_963 ; 963, (D873, bit 3) + const EVENT_964 ; 964, (D873, bit 4) + const EVENT_965 ; 965, (D873, bit 5) + const EVENT_966 ; 966, (D873, bit 6) + const EVENT_967 ; 967, (D873, bit 7) + const EVENT_968 ; 968, (D874, bit 0) + const EVENT_969 ; 969, (D874, bit 1) + const EVENT_96A ; 96A, (D874, bit 2) + const EVENT_96B ; 96B, (D874, bit 3) + const EVENT_96C ; 96C, (D874, bit 4) + const EVENT_96D ; 96D, (D874, bit 5) + const EVENT_96E ; 96E, (D874, bit 6) + const EVENT_96F ; 96F, (D874, bit 7) + const EVENT_970 ; 970, (D875, bit 0) + const EVENT_971 ; 971, (D875, bit 1) + const EVENT_972 ; 972, (D875, bit 2) + const EVENT_973 ; 973, (D875, bit 3) + const EVENT_974 ; 974, (D875, bit 4) + const EVENT_975 ; 975, (D875, bit 5) + const EVENT_976 ; 976, (D875, bit 6) + const EVENT_977 ; 977, (D875, bit 7) + const EVENT_978 ; 978, (D876, bit 0) + const EVENT_979 ; 979, (D876, bit 1) + const EVENT_97A ; 97A, (D876, bit 2) + const EVENT_97B ; 97B, (D876, bit 3) + const EVENT_97C ; 97C, (D876, bit 4) + const EVENT_97D ; 97D, (D876, bit 5) + const EVENT_97E ; 97E, (D876, bit 6) + const EVENT_97F ; 97F, (D876, bit 7) + const EVENT_980 ; 980, (D877, bit 0) + const EVENT_981 ; 981, (D877, bit 1) + const EVENT_982 ; 982, (D877, bit 2) + const EVENT_983 ; 983, (D877, bit 3) + const EVENT_984 ; 984, (D877, bit 4) + const EVENT_985 ; 985, (D877, bit 5) + const EVENT_986 ; 986, (D877, bit 6) + const EVENT_987 ; 987, (D877, bit 7) + const EVENT_988 ; 988, (D878, bit 0) + const EVENT_989 ; 989, (D878, bit 1) + const EVENT_98A ; 98A, (D878, bit 2) + const EVENT_98B ; 98B, (D878, bit 3) + const EVENT_98C ; 98C, (D878, bit 4) + const EVENT_98D ; 98D, (D878, bit 5) + const EVENT_98E ; 98E, (D878, bit 6) + const EVENT_98F ; 98F, (D878, bit 7) + const EVENT_990 ; 990, (D879, bit 0) + const EVENT_991 ; 991, (D879, bit 1) + const EVENT_992 ; 992, (D879, bit 2) + const EVENT_993 ; 993, (D879, bit 3) + const EVENT_994 ; 994, (D879, bit 4) + const EVENT_995 ; 995, (D879, bit 5) + const EVENT_996 ; 996, (D879, bit 6) + const EVENT_997 ; 997, (D879, bit 7) + const EVENT_998 ; 998, (D87A, bit 0) + const EVENT_999 ; 999, (D87A, bit 1) + const EVENT_99A ; 99A, (D87A, bit 2) + const EVENT_99B ; 99B, (D87A, bit 3) + const EVENT_99C ; 99C, (D87A, bit 4) + const EVENT_99D ; 99D, (D87A, bit 5) + const EVENT_99E ; 99E, (D87A, bit 6) + const EVENT_99F ; 99F, (D87A, bit 7) + const EVENT_9A0 ; 9A0, (D87B, bit 0) + const EVENT_9A1 ; 9A1, (D87B, bit 1) + const EVENT_9A2 ; 9A2, (D87B, bit 2) + const EVENT_9A3 ; 9A3, (D87B, bit 3) + const EVENT_9A4 ; 9A4, (D87B, bit 4) + const EVENT_9A5 ; 9A5, (D87B, bit 5) + const EVENT_9A6 ; 9A6, (D87B, bit 6) + const EVENT_9A7 ; 9A7, (D87B, bit 7) + const EVENT_9A8 ; 9A8, (D87C, bit 0) + const EVENT_9A9 ; 9A9, (D87C, bit 1) + const EVENT_9AA ; 9AA, (D87C, bit 2) + const EVENT_9AB ; 9AB, (D87C, bit 3) + const EVENT_9AC ; 9AC, (D87C, bit 4) + const EVENT_9AD ; 9AD, (D87C, bit 5) + const EVENT_9AE ; 9AE, (D87C, bit 6) + const EVENT_9AF ; 9AF, (D87C, bit 7) + const EVENT_9B0 ; 9B0, (D87D, bit 0) + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0 ; 9B1, (D87D, bit 1) + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2 ; 9B2, (D87D, bit 2) + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3 ; 9B3, (D87D, bit 3) + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4 ; 9B4, (D87D, bit 4) + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5 ; 9B5, (D87D, bit 5) + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6 ; 9B6, (D87D, bit 6) + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7 ; 9B7, (D87D, bit 7) + const EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_8 ; 9B8, (D87E, bit 0) + const EVENT_9B9 ; 9B9, (D87E, bit 1) + const EVENT_9BA ; 9BA, (D87E, bit 2) + const EVENT_9BB ; 9BB, (D87E, bit 3) + const EVENT_9BC ; 9BC, (D87E, bit 4) + const EVENT_9BD ; 9BD, (D87E, bit 5) + const EVENT_9BE ; 9BE, (D87E, bit 6) + const EVENT_9BF ; 9BF, (D87E, bit 7) + const EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE ; 9C0, (D87F, bit 0) + const EVENT_SEAFOAM2_BOULDER2_DOWN_HOLE ; 9C1, (D87F, bit 1) + const EVENT_9C2 ; 9C2, (D87F, bit 2) + const EVENT_9C3 ; 9C3, (D87F, bit 3) + const EVENT_9C4 ; 9C4, (D87F, bit 4) + const EVENT_9C5 ; 9C5, (D87F, bit 5) + const EVENT_9C6 ; 9C6, (D87F, bit 6) + const EVENT_9C7 ; 9C7, (D87F, bit 7) + const EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE ; 9C8, (D880, bit 0) + const EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE ; 9C9, (D880, bit 1) + const EVENT_9CA ; 9CA, (D880, bit 2) + const EVENT_9CB ; 9CB, (D880, bit 3) + const EVENT_9CC ; 9CC, (D880, bit 4) + const EVENT_9CD ; 9CD, (D880, bit 5) + const EVENT_9CE ; 9CE, (D880, bit 6) + const EVENT_9CF ; 9CF, (D880, bit 7) + const EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE ; 9D0, (D881, bit 0) + const EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE ; 9D1, (D881, bit 1) + const EVENT_9D2 ; 9D2, (D881, bit 2) + const EVENT_9D3 ; 9D3, (D881, bit 3) + const EVENT_9D4 ; 9D4, (D881, bit 4) + const EVENT_9D5 ; 9D5, (D881, bit 5) + const EVENT_9D6 ; 9D6, (D881, bit 6) + const EVENT_9D7 ; 9D7, (D881, bit 7) + const EVENT_9D8 ; 9D8, (D882, bit 0) + const EVENT_9D9 ; 9D9, (D882, bit 1) + const EVENT_BEAT_SEAFOAM_ISLANDS_5_TRAINER_0 ; 9DA, (D882, bit 2) + const EVENT_9DB ; 9DB, (D882, bit 3) + const EVENT_9DC ; 9DC, (D882, bit 4) + const EVENT_9DD ; 9DD, (D882, bit 5) + const EVENT_9DE ; 9DE, (D882, bit 6) + const EVENT_9DF ; 9DF, (D882, bit 7) + const EVENT_9E0 ; 9E0, (D883, bit 0) + const EVENT_9E1 ; 9E1, (D883, bit 1) + const EVENT_9E2 ; 9E2, (D883, bit 2) + const EVENT_9E3 ; 9E3, (D883, bit 3) + const EVENT_9E4 ; 9E4, (D883, bit 4) + const EVENT_9E5 ; 9E5, (D883, bit 5) + const EVENT_9E6 ; 9E6, (D883, bit 6) + const EVENT_9E7 ; 9E7, (D883, bit 7) + const EVENT_9E8 ; 9E8, (D884, bit 0) + const EVENT_9E9 ; 9E9, (D884, bit 1) + const EVENT_9EA ; 9EA, (D884, bit 2) + const EVENT_9EB ; 9EB, (D884, bit 3) + const EVENT_9EC ; 9EC, (D884, bit 4) + const EVENT_9ED ; 9ED, (D884, bit 5) + const EVENT_9EE ; 9EE, (D884, bit 6) + const EVENT_9EF ; 9EF, (D884, bit 7) + const EVENT_9F0 ; 9F0, (D885, bit 0) + const EVENT_9F1 ; 9F1, (D885, bit 1) + const EVENT_9F2 ; 9F2, (D885, bit 2) + const EVENT_9F3 ; 9F3, (D885, bit 3) + const EVENT_9F4 ; 9F4, (D885, bit 4) + const EVENT_9F5 ; 9F5, (D885, bit 5) + const EVENT_9F6 ; 9F6, (D885, bit 6) + const EVENT_9F7 ; 9F7, (D885, bit 7) + const EVENT_9F8 ; 9F8, (D886, bit 0) + const EVENT_9F9 ; 9F9, (D886, bit 1) + const EVENT_9FA ; 9FA, (D886, bit 2) + const EVENT_9FB ; 9FB, (D886, bit 3) + const EVENT_9FC ; 9FC, (D886, bit 4) + const EVENT_9FD ; 9FD, (D886, bit 5) + const EVENT_9FE ; 9FE, (D886, bit 6) + const EVENT_9FF ; 9FF, (D886, bit 7) diff --git a/constants/hide_show_constants.asm b/constants/hide_show_constants.asm index 2afe9914..5a517afc 100755 --- a/constants/hide_show_constants.asm +++ b/constants/hide_show_constants.asm @@ -82,7 +82,7 @@ const_value = 0 const HS_MANSION_1_ITEM_2 ; 49 X const HS_FIGHTING_DOJO_GIFT_1 ; 4A const HS_FIGHTING_DOJO_GIFT_2 ; 4B - const HS_SILPH_CO_1F_RECEPTIONIST ; 4C + const HS_SILPH_CO_1F_RECEPTIONIST ; 4C const HS_VOLTORB_1 ; 4D X const HS_VOLTORB_2 ; 4E X const HS_VOLTORB_3 ; 4F X -- cgit v1.2.3 From dcc7f3bc9f41f2d5e0f7448b4688c1058da0040b Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 21 Jul 2015 14:21:14 -0700 Subject: named more constants --- constants/event_constants.asm | 34 +++++++++++++++--------------- engine/hall_of_fame.asm | 2 +- engine/hidden_object_functions7.asm | 42 +++++++++++++++++++------------------ engine/pokedex_rating.asm | 2 +- home.asm | 4 ++-- scripts/cinnabargym.asm | 40 +++++++++++++++++------------------ scripts/halloffameroom.asm | 2 +- scripts/indigoplateaulobby.asm | 4 ++-- scripts/lorelei.asm | 2 +- wram.asm | 5 ++++- 10 files changed, 71 insertions(+), 66 deletions(-) diff --git a/constants/event_constants.asm b/constants/event_constants.asm index 1eb68941..4e3a2849 100755 --- a/constants/event_constants.asm +++ b/constants/event_constants.asm @@ -3,7 +3,7 @@ const_value = 0 const EVENT_FOLLOWED_OAK_INTO_LAB ; 000, (D747, bit 0) const EVENT_001 ; 001, (D747, bit 1) const EVENT_002 ; 002, (D747, bit 2) - const EVENT_003 ; 003, (D747, bit 3) + const EVENT_HALL_OF_FAME_DEX_RATING ; 003, (D747, bit 3) const EVENT_004 ; 004, (D747, bit 4) const EVENT_005 ; 005, (D747, bit 5) const EVENT_PALLET_AFTER_GETTING_POKEBALLS ; 006, (D747, bit 6) @@ -666,13 +666,13 @@ const_value = 0 const EVENT_297 ; 297, (D799, bit 7) const EVENT_GOT_TM38 ; 298, (D79A, bit 0) const EVENT_BEAT_BLAINE ; 299, (D79A, bit 1) - const EVENT_29A ; 29A, (D79A, bit 2) - const EVENT_29B ; 29B, (D79A, bit 3) - const EVENT_29C ; 29C, (D79A, bit 4) - const EVENT_29D ; 29D, (D79A, bit 5) - const EVENT_29E ; 29E, (D79A, bit 6) - const EVENT_29F ; 29F, (D79A, bit 7) - const EVENT_2A0 ; 2A0, (D79B, bit 0) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_0 ; 29A, (D79A, bit 2) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_1 ; 29B, (D79A, bit 3) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_2 ; 29C, (D79A, bit 4) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_3 ; 29D, (D79A, bit 5) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_4 ; 29E, (D79A, bit 6) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_5 ; 29F, (D79A, bit 7) + const EVENT_BEAT_CINNABAR_GYM_TRAINER_6 ; 2A0, (D79B, bit 0) const EVENT_2A1 ; 2A1, (D79B, bit 1) const EVENT_2A2 ; 2A2, (D79B, bit 2) const EVENT_2A3 ; 2A3, (D79B, bit 3) @@ -680,13 +680,13 @@ const_value = 0 const EVENT_2A5 ; 2A5, (D79B, bit 5) const EVENT_2A6 ; 2A6, (D79B, bit 6) const EVENT_2A7 ; 2A7, (D79B, bit 7) - const EVENT_2A8 ; 2A8, (D79C, bit 0) - const EVENT_2A9 ; 2A9, (D79C, bit 1) - const EVENT_2AA ; 2AA, (D79C, bit 2) - const EVENT_2AB ; 2AB, (D79C, bit 3) - const EVENT_2AC ; 2AC, (D79C, bit 4) - const EVENT_2AD ; 2AD, (D79C, bit 5) - const EVENT_2AE ; 2AE, (D79C, bit 6) + const EVENT_CINNABAR_GYM_GATE0_UNLOCKED ; 2A8, (D79C, bit 0) doesn't exist, but the bit is set + const EVENT_CINNABAR_GYM_GATE1_UNLOCKED ; 2A9, (D79C, bit 1) + const EVENT_CINNABAR_GYM_GATE2_UNLOCKED ; 2AA, (D79C, bit 2) + const EVENT_CINNABAR_GYM_GATE3_UNLOCKED ; 2AB, (D79C, bit 3) + const EVENT_CINNABAR_GYM_GATE4_UNLOCKED ; 2AC, (D79C, bit 4) + const EVENT_CINNABAR_GYM_GATE5_UNLOCKED ; 2AD, (D79C, bit 5) + const EVENT_CINNABAR_GYM_GATE6_UNLOCKED ; 2AE, (D79C, bit 6) const EVENT_2AF ; 2AF, (D79C, bit 7) const EVENT_2B0 ; 2B0, (D79D, bit 0) const EVENT_2B1 ; 2B1, (D79D, bit 1) @@ -2272,7 +2272,7 @@ const_value = 0 const EVENT_8DD ; 8DD, (D862, bit 5) const EVENT_8DE ; 8DE, (D862, bit 6) const EVENT_8DF ; 8DF, (D862, bit 7) - const EVENT_ELITE4_EVENTS_START ; 8E0, (D863, bit 0) + const ELITE4_EVENTS_START ; 8E0, (D863, bit 0) const EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 ; 8E1, (D863, bit 1) const EVENT_8E2 ; 8E2, (D863, bit 2) const EVENT_8E3 ; 8E3, (D863, bit 3) @@ -2311,7 +2311,7 @@ const_value = 0 const EVENT_904 ; 904, (D867, bit 4) const EVENT_905 ; 905, (D867, bit 5) const EVENT_906 ; 906, (D867, bit 6) - const EVENT_907 ; 907, (D867, bit 7) + const ELITE4_CHAMPION_EVENTS_END ; 907, (D867, bit 7) const EVENT_908 ; 908, (D868, bit 0) const EVENT_909 ; 909, (D868, bit 1) const EVENT_90A ; 90A, (D868, bit 2) diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm index 7361fea2..1fc2c5c5 100755 --- a/engine/hall_of_fame.asm +++ b/engine/hall_of_fame.asm @@ -207,7 +207,7 @@ HoFLoadMonPlayerPicTileIDs: ; 7036d (1c:436d) predef_jump CopyTileIDsFromList HoFDisplayPlayerStats: ; 70377 (1c:4377) - SetEvent EVENT_003 + SetEvent EVENT_HALL_OF_FAME_DEX_RATING predef DisplayDexRating coord hl, 0, 4 ld b, $6 diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 90de784f..08aadf02 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -188,8 +188,8 @@ CinnabarQuizQuestionsText6: ; 1ea85 (7:6a85) TX_FAR _CinnabarQuizQuestionsText6 db "@" -CinnabarGymQuiz_1ea8a: ; 1ea8a (7:6a8a) - EventFlagAddress hl, EVENT_2A8 +CinnabarGymGateFlagAction: ; 1ea8a (7:6a8a) + EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED predef_jump FlagActionPredef CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) @@ -206,11 +206,11 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) ld hl, CinnabarGymQuizCorrectText call PrintText ld a, [$ffe0] - AdjustEventBit EVENT_2A8, 0 + AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 ld c, a ld b, FLAG_SET - call CinnabarGymQuiz_1ea8a - jp CinnabarGymQuiz_1eb0a + call CinnabarGymGateFlagAction + jp UpdateCinnabarGymGateTileBlocks_ .asm_1eab8 call WaitForSoundToFinish ld a, SFX_DENIED @@ -220,10 +220,10 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) call PrintText ld a, [$ffdb] add $2 - AdjustEventBit EVENT_29A, 2 + AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2 ld c, a ld b, FLAG_TEST - EventFlagAddress hl, EVENT_29A + EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0 predef FlagActionPredef ld a, c and a @@ -240,10 +240,10 @@ CinnabarGymQuizCorrectText: ; 1eae3 (7:6ae3) TX_ASM ld a, [$ffe0] - AdjustEventBit EVENT_2A8, 0 + AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 ld c, a ld b, FLAG_TEST - call CinnabarGymQuiz_1ea8a + call CinnabarGymGateFlagAction ld a, c and a jp nz, TextScriptEnd @@ -257,15 +257,17 @@ CinnabarGymQuizIncorrectText: ; 1eb05 (7:6b05) TX_FAR _CinnabarGymQuizIncorrectText db "@" -CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a) - ld a, $6 +UpdateCinnabarGymGateTileBlocks_: ; 1eb0a (7:6b0a) +; Update the overworld map with open floor blocks or locked gate blocks +; depending on event flags. + ld a, 6 ld [$ffdb], a -.asm_1eb0e +.loop ld a, [$ffdb] dec a add a add a - ld d, $0 + ld d, 0 ld e, a ld hl, CinnabarGymGateCoords add hl, de @@ -278,24 +280,24 @@ CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a) push bc ld a, [$ffdb] ld [$ffe0], a - AdjustEventBit EVENT_2A8, 0 + AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 ld c, a ld b, FLAG_TEST - call CinnabarGymQuiz_1ea8a + call CinnabarGymGateFlagAction ld a, c and a - jr nz, .asm_1eb36 + jr nz, .unlocked ld a, [wd12f] - jr .asm_1eb38 -.asm_1eb36 + jr .next +.unlocked ld a, $e -.asm_1eb38 +.next pop bc ld [wd09f], a predef ReplaceTileBlock ld hl, $ffdb dec [hl] - jr nz, .asm_1eb0e + jr nz, .loop ret CinnabarGymGateCoords: ; 1eb48 (7:6b48) diff --git a/engine/pokedex_rating.asm b/engine/pokedex_rating.asm index 2d7073df..ca88673f 100755 --- a/engine/pokedex_rating.asm +++ b/engine/pokedex_rating.asm @@ -23,7 +23,7 @@ DisplayDexRating: ; 44169 (11:4169) ld a, [hli] ld h, [hl] ld l, a ; load text pointer into hl - CheckAndResetEventA EVENT_003 + CheckAndResetEventA EVENT_HALL_OF_FAME_DEX_RATING jr nz, .label3 push hl ld hl, PokedexRatingText_441cc diff --git a/home.asm b/home.asm index 6bb54df2..f58f6c16 100644 --- a/home.asm +++ b/home.asm @@ -4590,8 +4590,8 @@ Random:: INCLUDE "home/predef.asm" -Func_3ead:: ; 3ead (0:3ead) - jpba CinnabarGymQuiz_1eb0a +UpdateCinnabarGymGateTileBlocks:: ; 3ead (0:3ead) + jpba UpdateCinnabarGymGateTileBlocks_ CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: ; 3eb5 (0:3eb5) ld a, [H_LOADEDROMBANK] diff --git a/scripts/cinnabargym.asm b/scripts/cinnabargym.asm index f5c07317..18737d2b 100755 --- a/scripts/cinnabargym.asm +++ b/scripts/cinnabargym.asm @@ -14,7 +14,7 @@ CinnabarGymScript_75759: ; 75759 (1d:5759) pop hl bit 5, [hl] res 5, [hl] - call nz, Func_3ead + call nz, UpdateCinnabarGymGateTileBlocks ResetEvent EVENT_2A7 ret CinnabarGymScript_75772: ; 75772 (1d:5772) @@ -88,7 +88,7 @@ CinnabarGymScript1: ; 757dc (1d:57dc) ld [hSpriteIndexOrTextID], a jp DisplayTextID -CinnabarGymScript_757f1: ; 757f1 (1d:57f1) +CinnabarGymFlagAction: ; 757f1 (1d:57f1) predef_jump FlagActionPredef CinnabarGymScript2: ; 757f6 (1d:57f6) @@ -97,11 +97,11 @@ CinnabarGymScript2: ; 757f6 (1d:57f6) jp z, CinnabarGymScript_75792 ld a, [wTrainerHeaderFlagBit] ld [$ffdb], a - AdjustEventBit EVENT_29A, 2 + AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2 ld c, a ld b, FLAG_TEST - EventFlagAddress hl, EVENT_29A - call CinnabarGymScript_757f1 + EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0 + call CinnabarGymFlagAction ld a, c and a jr nz, .asm_7581b @@ -112,19 +112,19 @@ CinnabarGymScript2: ; 757f6 (1d:57f6) .asm_7581b ld a, [wTrainerHeaderFlagBit] ld [$ffdb], a - AdjustEventBit EVENT_29A, 2 + AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2 ld c, a ld b, FLAG_SET - EventFlagAddress hl, EVENT_29A - call CinnabarGymScript_757f1 + EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0 + call CinnabarGymFlagAction ld a, [wTrainerHeaderFlagBit] sub $2 - AdjustEventBit EVENT_2A8, 0 + AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 ld c, a ld b, FLAG_SET - EventFlagAddress hl, EVENT_2A8 - call CinnabarGymScript_757f1 - call Func_3ead + EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED + call CinnabarGymFlagAction + call UpdateCinnabarGymGateTileBlocks xor a ld [wJoyIgnore], a ld [wda38], a @@ -163,7 +163,7 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) set 6, [hl] ; deactivate gym trainers - SetEventRange EVENT_29A, EVENT_2A0 + SetEventRange EVENT_BEAT_CINNABAR_GYM_TRAINER_0, EVENT_BEAT_CINNABAR_GYM_TRAINER_6 ld hl, wd126 set 5, [hl] @@ -258,7 +258,7 @@ TM38NoRoomText: ; 75934 (1d:5934) CinnabarGymText2: ; 75939 (1d:5939) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_29A + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_0 jr nz, .asm_46bb4 ld hl, CinnabarGymText_7595f call PrintText @@ -286,7 +286,7 @@ CinnabarGymText_75969: ; 75969 (1d:5969) CinnabarGymText3: ; 7596e (1d:596e) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_29B + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_1 jr nz, .asm_4b406 ld hl, CinnabarGymText_75994 call PrintText @@ -314,7 +314,7 @@ CinnabarGymText_7599e: ; 7599e (1d:599e) CinnabarGymText4: ; 759a3 (1d:59a3) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_29C + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_2 jr nz, .asm_c0673 ld hl, CinnabarGymText_759c9 call PrintText @@ -342,7 +342,7 @@ CinnabarGymText_759d3: ; 759d3 (1d:59d3) CinnabarGymText5: ; 759d8 (1d:59d8) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_29D + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_3 jr nz, .asm_5cfd7 ld hl, CinnabarGymText_759fe call PrintText @@ -370,7 +370,7 @@ CinnabarGymText_75a08: ; 75a08 (1d:5a08) CinnabarGymText6: ; 75a0d (1d:5a0d) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_29E + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_4 jr nz, .asm_776b4 ld hl, CinnabarGymText_75a33 call PrintText @@ -398,7 +398,7 @@ CinnabarGymText_75a3d: ; 75a3d (1d:5a3d) CinnabarGymText7: ; 75a42 (1d:5a42) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_29F + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_5 jr nz, .asm_2f755 ld hl, CinnabarGymText_75a68 call PrintText @@ -426,7 +426,7 @@ CinnabarGymText_75a72: ; 75a72 (1d:5a72) CinnabarGymText8: ; 75a77 (1d:5a77) TX_ASM call CinnabarGymScript_757a0 - CheckEvent EVENT_2A0 + CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_6 jr nz, .asm_d87be ld hl, CinnabarGymText_75a9d call PrintText diff --git a/scripts/halloffameroom.asm b/scripts/halloffameroom.asm index 503327f3..9a5b595a 100755 --- a/scripts/halloffameroom.asm +++ b/scripts/halloffameroom.asm @@ -40,7 +40,7 @@ HallofFameRoomScript2: ; 5a4bb (16:64bb) ld [W_LANCECURSCRIPT], a ld [W_HALLOFFAMEROOMCURSCRIPT], a ; Elite 4 events - ResetEventRange EVENT_ELITE4_EVENTS_START, EVENT_907, 1 + ResetEventRange ELITE4_EVENTS_START, ELITE4_CHAMPION_EVENTS_END, 1 xor a ld [W_HALLOFFAMEROOMCURSCRIPT], a ld a, PALLET_TOWN diff --git a/scripts/indigoplateaulobby.asm b/scripts/indigoplateaulobby.asm index e4a64ce6..7655d8c7 100755 --- a/scripts/indigoplateaulobby.asm +++ b/scripts/indigoplateaulobby.asm @@ -6,12 +6,12 @@ IndigoPlateauLobbyScript: ; 19c5b (6:5c5b) res 6, [hl] ret z ResetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH - ld hl, wd734 + ld hl, wBeatLorelei bit 1, [hl] res 1, [hl] ret z ; Elite 4 events - ResetEventRange EVENT_ELITE4_EVENTS_START, EVENT_LANCES_ROOM_LOCK_DOOR + ResetEventRange ELITE4_EVENTS_START, EVENT_LANCES_ROOM_LOCK_DOOR ret IndigoPlateauLobbyTextPointers: ; 19c7f (6:5c7f) diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index fe136784..4a245d93 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -13,7 +13,7 @@ LoreleiScript_76191: ; 76191 (1d:6191) bit 5, [hl] res 5, [hl] ret z - ld hl, wd734 + ld hl, wBeatLorelei set 1, [hl] CheckEvent EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 jr z, .asm_761a9 diff --git a/wram.asm b/wram.asm index 767cc0d4..275ccc40 100755 --- a/wram.asm +++ b/wram.asm @@ -2547,7 +2547,10 @@ W_FLAGS_D733:: ; d733 ; bit 7: used fly out of battle ds 1 -wd734:: ds 2 ; flag for indigo plateau and lorelei (not sure what it's for) +wBeatLorelei:: ; d734 +; bit 1: set when you beat Lorelei and reset in Indigo Plateau lobby +; the game uses this to tell when Elite 4 events need to be reset + ds 2 wd736:: ; d736 ; bit 0: check if the player is standing on a door and make him walk down a step if so -- cgit v1.2.3