shithub: pokered

Download patch

ref: 5c0f33cb5350d3e11bd75cc04d943549667ecd4c
parent: be326c65652d5e87e353172a4471458822ffd3da
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Tue Jul 14 11:45:36 EDT 2020

Use a 'trainer' macro for trainers in scripts/

--- a/home/trainers.asm
+++ b/home/trainers.asm
@@ -263,7 +263,7 @@
 	ld a, [de]
 	ld [wSpriteIndex], a                     ; store trainer flag's bit
 	ld [wTrainerHeaderFlagBit], a
-	cp $ff
+	cp -1
 	ret z
 	ld a, $2
 	call ReadTrainerHeaderInfo       ; read trainer flag's byte ptr
--- a/macros/scripts/maps.asm
+++ b/macros/scripts/maps.asm
@@ -47,6 +47,27 @@
 	event_displacement \3, \1, \2
 ENDM
 
+
+;\1 event flag
+;\2 view range
+;\3 TextBeforeBattle
+;\4 TextAfterBattle
+;\5 TextEndBattle
+trainer: MACRO
+	IF _NARG > 5
+		dbEventFlagBit \1, \2
+		db (\3 << 4)
+		dwEventFlagAddress \1, \2
+		SHIFT
+	ELSE
+		dbEventFlagBit \1
+		db (\2 << 4)
+		dwEventFlagAddress \1
+	ENDC
+	dw \3, \5, \4, \4
+ENDM
+
+
 ;\1 map name
 ;\2 map id
 ;\3 tileset
--- a/scripts/AgathasRoom.asm
+++ b/scripts/AgathasRoom.asm
@@ -121,15 +121,8 @@
 	dw AgathaDontRunAwayText
 
 AgathaTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_AGATHAS_ROOM_TRAINER_0
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_AGATHAS_ROOM_TRAINER_0
-	dw AgathaBeforeBattleText ; TextBeforeBattle
-	dw AgathaAfterBattleText ; TextAfterBattle
-	dw AgathaEndBattleText ; TextEndBattle
-	dw AgathaEndBattleText ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_AGATHAS_ROOM_TRAINER_0, 0, AgathaBeforeBattleText, AgathaEndBattleText, AgathaAfterBattleText
+	db -1 ; end
 
 AgathaText1:
 	text_asm
--- a/scripts/BrunosRoom.asm
+++ b/scripts/BrunosRoom.asm
@@ -118,15 +118,8 @@
 	dw BrunoDontRunAwayText
 
 BrunoTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_BRUNOS_ROOM_TRAINER_0
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_BRUNOS_ROOM_TRAINER_0
-	dw BrunoBeforeBattleText ; TextBeforeBattle
-	dw BrunoAfterBattleText ; TextAfterBattle
-	dw BrunoEndBattleText ; TextEndBattle
-	dw BrunoEndBattleText ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_BRUNOS_ROOM_TRAINER_0, 0, BrunoBeforeBattleText, BrunoEndBattleText, BrunoAfterBattleText
+	db -1 ; end
 
 BrunoText1:
 	text_asm
--- a/scripts/CeladonGym.asm
+++ b/scripts/CeladonGym.asm
@@ -84,69 +84,20 @@
 	dw TM21NoRoomText
 
 CeladonGymTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_0
-	dw CeladonGymBattleText2 ; TextBeforeBattle
-	dw CeladonGymAfterBattleText2 ; TextAfterBattle
-	dw CeladonGymEndBattleText2 ; TextEndBattle
-	dw CeladonGymEndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_CELADON_GYM_TRAINER_0, 2, CeladonGymBattleText2, CeladonGymEndBattleText2, CeladonGymAfterBattleText2
 CeladonGymTrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_1
-	dw CeladonGymBattleText3 ; TextBeforeBattle
-	dw CeladonGymAfterBattleText3 ; TextAfterBattle
-	dw CeladonGymEndBattleText3 ; TextEndBattle
-	dw CeladonGymEndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_CELADON_GYM_TRAINER_1, 2, CeladonGymBattleText3, CeladonGymEndBattleText3, CeladonGymAfterBattleText3
 CeladonGymTrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_2
-	dw CeladonGymBattleText4 ; TextBeforeBattle
-	dw CeladonGymAfterBattleText4 ; TextAfterBattle
-	dw CeladonGymEndBattleText4 ; TextEndBattle
-	dw CeladonGymEndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_CELADON_GYM_TRAINER_2, 4, CeladonGymBattleText4, CeladonGymEndBattleText4, CeladonGymAfterBattleText4
 CeladonGymTrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_3
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_3
-	dw CeladonGymBattleText5 ; TextBeforeBattle
-	dw CeladonGymAfterBattleText5 ; TextAfterBattle
-	dw CeladonGymEndBattleText5 ; TextEndBattle
-	dw CeladonGymEndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_CELADON_GYM_TRAINER_3, 4, CeladonGymBattleText5, CeladonGymEndBattleText5, CeladonGymAfterBattleText5
 CeladonGymTrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_4
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_4
-	dw CeladonGymBattleText6 ; TextBeforeBattle
-	dw CeladonGymAfterBattleText6 ; TextAfterBattle
-	dw CeladonGymEndBattleText6 ; TextEndBattle
-	dw CeladonGymEndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_CELADON_GYM_TRAINER_4, 2, CeladonGymBattleText6, CeladonGymEndBattleText6, CeladonGymAfterBattleText6
 CeladonGymTrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_5
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_5
-	dw CeladonGymBattleText7 ; TextBeforeBattle
-	dw CeladonGymAfterBattleText7 ; TextAfterBattle
-	dw CeladonGymEndBattleText7 ; TextEndBattle
-	dw CeladonGymEndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_CELADON_GYM_TRAINER_5, 2, CeladonGymBattleText7, CeladonGymEndBattleText7, CeladonGymAfterBattleText7
 CeladonGymTrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_6, 1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_6, 1
-	dw CeladonGymBattleText8 ; TextBeforeBattle
-	dw CeladonGymAfterBattleText8 ; TextAfterBattle
-	dw CeladonGymEndBattleText8 ; TextEndBattle
-	dw CeladonGymEndBattleText8 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_CELADON_GYM_TRAINER_6, 1, 3, CeladonGymBattleText8, CeladonGymEndBattleText8, CeladonGymAfterBattleText8
+	db -1 ; end
 
 CeladonGymText1:
 	text_asm
--- a/scripts/CeruleanCaveB1F.asm
+++ b/scripts/CeruleanCaveB1F.asm
@@ -18,15 +18,8 @@
 	dw PickUpItemText
 
 MewtwoTrainerHeader:
-	dbEventFlagBit EVENT_BEAT_MEWTWO
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MEWTWO
-	dw MewtwoBattleText ; TextBeforeBattle
-	dw MewtwoBattleText ; TextAfterBattle
-	dw MewtwoBattleText ; TextEndBattle
-	dw MewtwoBattleText ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_MEWTWO, 0, MewtwoBattleText, MewtwoBattleText, MewtwoBattleText
+	db -1 ; end
 
 MewtwoText:
 	text_asm
--- a/scripts/CeruleanGym.asm
+++ b/scripts/CeruleanGym.asm
@@ -80,24 +80,10 @@
 	dw CeruleanGymText7
 
 CeruleanGymTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_CERULEAN_GYM_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_CERULEAN_GYM_TRAINER_0
-	dw CeruleanGymBattleText1 ; TextBeforeBattle
-	dw CeruleanGymAfterBattleText1 ; TextAfterBattle
-	dw CeruleanGymEndBattleText1 ; TextEndBattle
-	dw CeruleanGymEndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_CERULEAN_GYM_TRAINER_0, 3, CeruleanGymBattleText1, CeruleanGymEndBattleText1, CeruleanGymAfterBattleText1
 CeruleanGymTrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_CERULEAN_GYM_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_CERULEAN_GYM_TRAINER_1
-	dw CeruleanGymBattleText2 ; TextBeforeBattle
-	dw CeruleanGymAfterBattleText2 ; TextAfterBattle
-	dw CeruleanGymEndBattleText2 ; TextEndBattle
-	dw CeruleanGymEndBattleText2 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_CERULEAN_GYM_TRAINER_1, 3, CeruleanGymBattleText2, CeruleanGymEndBattleText2, CeruleanGymAfterBattleText2
+	db -1 ; end
 
 CeruleanGymText1:
 	text_asm
--- a/scripts/FightingDojo.asm
+++ b/scripts/FightingDojo.asm
@@ -91,42 +91,14 @@
 	dw FightingDojoText8
 
 FightingDojoTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_0
-	dw FightingDojoBattleText1 ; TextBeforeBattle
-	dw FightingDojoAfterBattleText1 ; TextAfterBattle
-	dw FightingDojoEndBattleText1 ; TextEndBattle
-	dw FightingDojoEndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_FIGHTING_DOJO_TRAINER_0, 4, FightingDojoBattleText1, FightingDojoEndBattleText1, FightingDojoAfterBattleText1
 FightingDojoTrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_1
-	dw FightingDojoBattleText2 ; TextBeforeBattle
-	dw FightingDojoAfterBattleText2 ; TextAfterBattle
-	dw FightingDojoEndBattleText2 ; TextEndBattle
-	dw FightingDojoEndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_FIGHTING_DOJO_TRAINER_1, 4, FightingDojoBattleText2, FightingDojoEndBattleText2, FightingDojoAfterBattleText2
 FightingDojoTrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_2
-	dw FightingDojoBattleText3 ; TextBeforeBattle
-	dw FightingDojoAfterBattleText3 ; TextAfterBattle
-	dw FightingDojoEndBattleText3 ; TextEndBattle
-	dw FightingDojoEndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_FIGHTING_DOJO_TRAINER_2, 3, FightingDojoBattleText3, FightingDojoEndBattleText3, FightingDojoAfterBattleText3
 FightingDojoTrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_3
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_3
-	dw FightingDojoBattleText4 ; TextBeforeBattle
-	dw FightingDojoAfterBattleText4 ; TextAfterBattle
-	dw FightingDojoEndBattleText4 ; TextEndBattle
-	dw FightingDojoEndBattleText4 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_FIGHTING_DOJO_TRAINER_3, 3, FightingDojoBattleText4, FightingDojoEndBattleText4, FightingDojoAfterBattleText4
+	db -1 ; end
 
 FightingDojoText1:
 	text_asm
--- a/scripts/FuchsiaGym.asm
+++ b/scripts/FuchsiaGym.asm
@@ -84,60 +84,18 @@
 	dw FuchsiaGymText11
 
 FuchsiaGymTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_0
-	dw FuchsiaGymBattleText1 ; TextBeforeBattle
-	dw FuchsiaGymAfterBattleText1 ; TextAfterBattle
-	dw FuchsiaGymEndBattleText1 ; TextEndBattle
-	dw FuchsiaGymEndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_0, 2, FuchsiaGymBattleText1, FuchsiaGymEndBattleText1, FuchsiaGymAfterBattleText1
 FuchsiaGymTrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_1
-	dw FuchsiaGymBattleText2 ; TextBeforeBattle
-	dw FuchsiaGymAfterBattleText2 ; TextAfterBattle
-	dw FuchsiaGymEndBattleText2 ; TextEndBattle
-	dw FuchsiaGymEndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_1, 2, FuchsiaGymBattleText2, FuchsiaGymEndBattleText2, FuchsiaGymAfterBattleText2
 FuchsiaGymTrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_2
-	dw FuchsiaGymBattleText3 ; TextBeforeBattle
-	dw FuchsiaGymAfterBattleText3 ; TextAfterBattle
-	dw FuchsiaGymEndBattleText3 ; TextEndBattle
-	dw FuchsiaGymEndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_2, 4, FuchsiaGymBattleText3, FuchsiaGymEndBattleText3, FuchsiaGymAfterBattleText3
 FuchsiaGymTrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_3
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_3
-	dw FuchsiaGymBattleText4 ; TextBeforeBattle
-	dw FuchsiaGymAfterBattleText4 ; TextAfterBattle
-	dw FuchsiaGymEndBattleText4 ; TextEndBattle
-	dw FuchsiaGymEndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_3, 2, FuchsiaGymBattleText4, FuchsiaGymEndBattleText4, FuchsiaGymAfterBattleText4
 FuchsiaGymTrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_4
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_4
-	dw FuchsiaGymBattleText5 ; TextBeforeBattle
-	dw FuchsiaGymAfterBattleText5 ; TextAfterBattle
-	dw FuchsiaGymEndBattleText5 ; TextEndBattle
-	dw FuchsiaGymEndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_4, 2, FuchsiaGymBattleText5, FuchsiaGymEndBattleText5, FuchsiaGymAfterBattleText5
 FuchsiaGymTrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_5
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_5
-	dw FuchsiaGymBattleText6 ; TextBeforeBattle
-	dw FuchsiaGymAfterBattleText6 ; TextAfterBattle
-	dw FuchsiaGymEndBattleText6 ; TextEndBattle
-	dw FuchsiaGymEndBattleText6 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_FUCHSIA_GYM_TRAINER_5, 2, FuchsiaGymBattleText6, FuchsiaGymEndBattleText6, FuchsiaGymAfterBattleText6
+	db -1 ; end
 
 FuchsiaGymText1:
 	text_asm
--- a/scripts/LancesRoom.asm
+++ b/scripts/LancesRoom.asm
@@ -131,15 +131,8 @@
 	dw LanceText1
 
 LanceTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_LANCES_ROOM_TRAINER_0
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_LANCES_ROOM_TRAINER_0
-	dw LanceBeforeBattleText ; TextBeforeBattle
-	dw LanceAfterBattleText ; TextAfterBattle
-	dw LanceEndBattleText ; TextEndBattle
-	dw LanceEndBattleText ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_LANCES_ROOM_TRAINER_0, 0, LanceBeforeBattleText, LanceEndBattleText, LanceAfterBattleText
+	db -1 ; end
 
 LanceText1:
 	text_asm
--- a/scripts/LoreleisRoom.asm
+++ b/scripts/LoreleisRoom.asm
@@ -120,15 +120,8 @@
 	dw LoreleiDontRunAwayText
 
 LoreleiTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_LORELEIS_ROOM_TRAINER_0
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_LORELEIS_ROOM_TRAINER_0
-	dw LoreleiBeforeBattleText ; TextBeforeBattle
-	dw LoreleiAfterBattleText ; TextAfterBattle
-	dw LoreleiEndBattleText ; TextEndBattle
-	dw LoreleiEndBattleText ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_LORELEIS_ROOM_TRAINER_0, 0, LoreleiBeforeBattleText, LoreleiEndBattleText, LoreleiAfterBattleText
+	db -1 ; end
 
 LoreleiText1:
 	text_asm
--- a/scripts/MtMoon1F.asm
+++ b/scripts/MtMoon1F.asm
@@ -29,69 +29,20 @@
 	dw MtMoon1Text14
 
 MtMoon1TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_0
-	dw MtMoon1BattleText2 ; TextBeforeBattle
-	dw MtMoon1AfterBattleText2 ; TextAfterBattle
-	dw MtMoon1EndBattleText2 ; TextEndBattle
-	dw MtMoon1EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_MT_MOON_1_TRAINER_0, 2, MtMoon1BattleText2, MtMoon1EndBattleText2, MtMoon1AfterBattleText2
 MtMoon1TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_1
-	dw MtMoon1BattleText3 ; TextBeforeBattle
-	dw MtMoon1AfterBattleText3 ; TextAfterBattle
-	dw MtMoon1EndBattleText3 ; TextEndBattle
-	dw MtMoon1EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_MT_MOON_1_TRAINER_1, 3, MtMoon1BattleText3, MtMoon1EndBattleText3, MtMoon1AfterBattleText3
 MtMoon1TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_2
-	dw MtMoon1BattleText4 ; TextBeforeBattle
-	dw MtMoon1AfterBattleText4 ; TextAfterBattle
-	dw MtMoon1EndBattleText4 ; TextEndBattle
-	dw MtMoon1EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_MT_MOON_1_TRAINER_2, 3, MtMoon1BattleText4, MtMoon1EndBattleText4, MtMoon1AfterBattleText4
 MtMoon1TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_3
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_3
-	dw MtMoon1BattleText5 ; TextBeforeBattle
-	dw MtMoon1AfterBattleText5 ; TextAfterBattle
-	dw MtMoon1EndBattleText5 ; TextEndBattle
-	dw MtMoon1EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_MT_MOON_1_TRAINER_3, 3, MtMoon1BattleText5, MtMoon1EndBattleText5, MtMoon1AfterBattleText5
 MtMoon1TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_4
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_4
-	dw MtMoon1BattleText6 ; TextBeforeBattle
-	dw MtMoon1AfterBattleText6 ; TextAfterBattle
-	dw MtMoon1EndBattleText6 ; TextEndBattle
-	dw MtMoon1EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_MT_MOON_1_TRAINER_4, 3, MtMoon1BattleText6, MtMoon1EndBattleText6, MtMoon1AfterBattleText6
 MtMoon1TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_5
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_5
-	dw MtMoon1BattleText7 ; TextBeforeBattle
-	dw MtMoon1AfterBattleText7 ; TextAfterBattle
-	dw MtMoon1EndBattleText7 ; TextEndBattle
-	dw MtMoon1EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_MT_MOON_1_TRAINER_5, 3, MtMoon1BattleText7, MtMoon1EndBattleText7, MtMoon1AfterBattleText7
 MtMoon1TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_6
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_6
-	dw MtMoon1BattleText8 ; TextBeforeBattle
-	dw MtMoon1AfterBattleText8 ; TextAfterBattle
-	dw MtMoon1EndBattleText8 ; TextEndBattle
-	dw MtMoon1EndBattleText8 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_MT_MOON_1_TRAINER_6, 3, MtMoon1BattleText8, MtMoon1EndBattleText8, MtMoon1AfterBattleText8
+	db -1 ; end
 
 MtMoon1Text1:
 	text_asm
--- a/scripts/MtMoonB2F.asm
+++ b/scripts/MtMoonB2F.asm
@@ -167,42 +167,14 @@
 	dw MtMoon3Text_49f99
 
 MtMoon3TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_0
-	dw MtMoon3BattleText2 ; TextBeforeBattle
-	dw MtMoon3AfterBattleText2 ; TextAfterBattle
-	dw MtMoon3EndBattleText2 ; TextEndBattle
-	dw MtMoon3EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_MT_MOON_3_TRAINER_0, 4, MtMoon3BattleText2, MtMoon3EndBattleText2, MtMoon3AfterBattleText2
 MtMoon3TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_1
-	dw MtMoon3BattleText3 ; TextBeforeBattle
-	dw MtMoon3AfterBattleText3 ; TextAfterBattle
-	dw MtMoon3EndBattleText3 ; TextEndBattle
-	dw MtMoon3EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_MT_MOON_3_TRAINER_1, 4, MtMoon3BattleText3, MtMoon3EndBattleText3, MtMoon3AfterBattleText3
 MtMoon3TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_2
-	dw MtMoon3BattleText4 ; TextBeforeBattle
-	dw MtMoon3AfterBattleText4 ; TextAfterBattle
-	dw MtMoon3EndBattleText4 ; TextEndBattle
-	dw MtMoon3EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_MT_MOON_3_TRAINER_2, 4, MtMoon3BattleText4, MtMoon3EndBattleText4, MtMoon3AfterBattleText4
 MtMoon3TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_MT_MOON_3_TRAINER_3
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MT_MOON_3_TRAINER_3
-	dw MtMoon3BattleText5 ; TextBeforeBattle
-	dw MtMoon3AfterBattleText5 ; TextAfterBattle
-	dw MtMoon3EndBattleText5 ; TextEndBattle
-	dw MtMoon3EndBattleText5 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_MT_MOON_3_TRAINER_3, 4, MtMoon3BattleText5, MtMoon3EndBattleText5, MtMoon3AfterBattleText5
+	db -1 ; end
 
 MtMoon3Text1:
 	text_asm
--- a/scripts/PewterGym.asm
+++ b/scripts/PewterGym.asm
@@ -88,15 +88,8 @@
 	dw PewterGymText6
 
 PewterGymTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_PEWTER_GYM_TRAINER_0
-	db ($5 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_PEWTER_GYM_TRAINER_0
-	dw PewterGymBattleText1 ; TextBeforeBattle
-	dw PewterGymAfterBattleText1 ; TextAfterBattle
-	dw PewterGymEndBattleText1 ; TextEndBattle
-	dw PewterGymEndBattleText1 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_PEWTER_GYM_TRAINER_0, 5, PewterGymBattleText1, PewterGymEndBattleText1, PewterGymAfterBattleText1
+	db -1 ; end
 
 PewterGymText1:
 	text_asm
--- a/scripts/PokemonMansion1F.asm
+++ b/scripts/PokemonMansion1F.asm
@@ -67,15 +67,8 @@
 	dw Mansion1Text4
 
 Mansion1TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_MANSION_1_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MANSION_1_TRAINER_0
-	dw Mansion1BattleText2 ; TextBeforeBattle
-	dw Mansion1AfterBattleText2 ; TextAfterBattle
-	dw Mansion1EndBattleText2 ; TextEndBattle
-	dw Mansion1EndBattleText2 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_MANSION_1_TRAINER_0, 3, Mansion1BattleText2, Mansion1EndBattleText2, Mansion1AfterBattleText2
+	db -1 ; end
 
 Mansion1Text1:
 	text_asm
--- a/scripts/PokemonMansion2F.asm
+++ b/scripts/PokemonMansion2F.asm
@@ -64,15 +64,8 @@
 	dw Mansion2Text5
 
 Mansion2TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_MANSION_2_TRAINER_0
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MANSION_2_TRAINER_0
-	dw Mansion2BattleText1 ; TextBeforeBattle
-	dw Mansion2AfterBattleText1 ; TextAfterBattle
-	dw Mansion2EndBattleText1 ; TextEndBattle
-	dw Mansion2EndBattleText1 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_MANSION_2_TRAINER_0, 0, Mansion2BattleText1, Mansion2EndBattleText1, Mansion2AfterBattleText1
+	db -1 ; end
 
 Mansion2Text1:
 	text_asm
--- a/scripts/PokemonMansion3F.asm
+++ b/scripts/PokemonMansion3F.asm
@@ -91,24 +91,10 @@
 	dw Mansion3Text6
 
 Mansion3TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_MANSION_3_TRAINER_0
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MANSION_3_TRAINER_0
-	dw Mansion3BattleText1 ; TextBeforeBattle
-	dw Mansion3AfterBattleText1 ; TextAfterBattle
-	dw Mansion3EndBattleText1 ; TextEndBattle
-	dw Mansion3EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_MANSION_3_TRAINER_0, 0, Mansion3BattleText1, Mansion3EndBattleText1, Mansion3AfterBattleText1
 Mansion3TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_MANSION_3_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MANSION_3_TRAINER_1
-	dw Mansion3BattleText2 ; TextBeforeBattle
-	dw Mansion3AfterBattleText2 ; TextAfterBattle
-	dw Mansion3EndBattleText2 ; TextEndBattle
-	dw Mansion3EndBattleText2 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_MANSION_3_TRAINER_1, 2, Mansion3BattleText2, Mansion3EndBattleText2, Mansion3AfterBattleText2
+	db -1 ; end
 
 Mansion3Text1:
 	text_asm
--- a/scripts/PokemonMansionB1F.asm
+++ b/scripts/PokemonMansionB1F.asm
@@ -70,24 +70,10 @@
 	dw Mansion3Text6
 
 Mansion4TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_MANSION_4_TRAINER_0
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MANSION_4_TRAINER_0
-	dw Mansion4BattleText1 ; TextBeforeBattle
-	dw Mansion4AfterBattleText1 ; TextAfterBattle
-	dw Mansion4EndBattleText1 ; TextEndBattle
-	dw Mansion4EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_MANSION_4_TRAINER_0, 0, Mansion4BattleText1, Mansion4EndBattleText1, Mansion4AfterBattleText1
 Mansion4TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_MANSION_4_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MANSION_4_TRAINER_1
-	dw Mansion4BattleText2 ; TextBeforeBattle
-	dw Mansion4AfterBattleText2 ; TextAfterBattle
-	dw Mansion4EndBattleText2 ; TextEndBattle
-	dw Mansion4EndBattleText2 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_MANSION_4_TRAINER_1, 3, Mansion4BattleText2, Mansion4EndBattleText2, Mansion4AfterBattleText2
+	db -1 ; end
 
 Mansion4Text1:
 	text_asm
--- a/scripts/PokemonTower3F.asm
+++ b/scripts/PokemonTower3F.asm
@@ -19,32 +19,12 @@
 	dw PickUpItemText
 
 PokemonTower3TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_3_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_3_TRAINER_0
-	dw PokemonTower3BattleText1 ; TextBeforeBattle
-	dw PokemonTower3AfterBattleText1 ; TextAfterBattle
-	dw PokemonTower3EndBattleText1 ; TextEndBattle
-	dw PokemonTower3EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_POKEMONTOWER_3_TRAINER_0, 2, PokemonTower3BattleText1, PokemonTower3EndBattleText1, PokemonTower3AfterBattleText1
 PokemonTower3TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_3_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_3_TRAINER_1
-	dw PokemonTower3BattleText2 ; TextBeforeBattle
-	dw PokemonTower3AfterBattleText2 ; TextAfterBattle
-	dw PokemonTower3EndBattleText2 ; TextEndBattle
-	dw PokemonTower3EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_POKEMONTOWER_3_TRAINER_1, 3, PokemonTower3BattleText2, PokemonTower3EndBattleText2, PokemonTower3AfterBattleText2
 PokemonTower3TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_3_TRAINER_2
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_3_TRAINER_2
-	dw PokemonTower3BattleText3 ; TextBeforeBattle
-	dw PokemonTower3AfterBattleText3 ; TextAfterBattle
-	dw PokemonTower3EndBattleText3 ; TextEndBattle
-	dw PokemonTower3EndBattleText3 ; TextEndBattle
-	db $ff
+	trainer EVENT_BEAT_POKEMONTOWER_3_TRAINER_2, 2, PokemonTower3BattleText3, PokemonTower3EndBattleText3, PokemonTower3AfterBattleText3
+	db -1 ; end
 
 PokemonTower3Text1:
 	text_asm
--- a/scripts/PokemonTower4F.asm
+++ b/scripts/PokemonTower4F.asm
@@ -21,33 +21,12 @@
 	dw PickUpItemText
 
 PokemonTower4TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_4_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_4_TRAINER_0
-	dw PokemonTower4BattleText1 ; TextBeforeBattle
-	dw PokemonTower4AfterBattleText1 ; TextAfterBattle
-	dw PokemonTower4EndBattleText1 ; TextEndBattle
-	dw PokemonTower4EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_POKEMONTOWER_4_TRAINER_0, 2, PokemonTower4BattleText1, PokemonTower4EndBattleText1, PokemonTower4AfterBattleText1
 PokemonTower4TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_4_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_4_TRAINER_1
-	dw PokemonTower4BattleText2 ; TextBeforeBattle
-	dw PokemonTower4AfterBattleText2 ; TextAfterBattle
-	dw PokemonTower4EndBattleText2 ; TextEndBattle
-	dw PokemonTower4EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_POKEMONTOWER_4_TRAINER_1, 2, PokemonTower4BattleText2, PokemonTower4EndBattleText2, PokemonTower4AfterBattleText2
 PokemonTower4TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_4_TRAINER_2
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_4_TRAINER_2
-	dw PokemonTower4BattleText3 ; TextBeforeBattle
-	dw PokemonTower4AfterBattleText3 ; TextAfterBattle
-	dw PokemonTower4EndBattleText3 ; TextEndBattle
-	dw PokemonTower4EndBattleText3 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_POKEMONTOWER_4_TRAINER_2, 2, PokemonTower4BattleText3, PokemonTower4EndBattleText3, PokemonTower4AfterBattleText3
+	db -1 ; end
 
 PokemonTower4Text1:
 	text_asm
--- a/scripts/PokemonTower5F.asm
+++ b/scripts/PokemonTower5F.asm
@@ -58,42 +58,14 @@
 	dw PokemonTower5Text7
 
 PokemonTower5TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_0
-	dw PokemonTower5BattleText1 ; TextBeforeBattle
-	dw PokemonTower5AfterBattleText1 ; TextAfterBattle
-	dw PokemonTower5EndBattleText1 ; TextEndBattle
-	dw PokemonTower5EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_POKEMONTOWER_5_TRAINER_0, 2, PokemonTower5BattleText1, PokemonTower5EndBattleText1, PokemonTower5AfterBattleText1
 PokemonTower5TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_1
-	dw PokemonTower5BattleText2 ; TextBeforeBattle
-	dw PokemonTower5AfterBattleText2 ; TextAfterBattle
-	dw PokemonTower5EndBattleText2 ; TextEndBattle
-	dw PokemonTower5EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_POKEMONTOWER_5_TRAINER_1, 3, PokemonTower5BattleText2, PokemonTower5EndBattleText2, PokemonTower5AfterBattleText2
 PokemonTower5TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_2
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_2
-	dw PokemonTower5BattleText3 ; TextBeforeBattle
-	dw PokemonTower5AfterBattleText3 ; TextAfterBattle
-	dw PokemonTower5EndBattleText3 ; TextEndBattle
-	dw PokemonTower5EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_POKEMONTOWER_5_TRAINER_2, 2, PokemonTower5BattleText3, PokemonTower5EndBattleText3, PokemonTower5AfterBattleText3
 PokemonTower5TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_3
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_3
-	dw PokemonTower5BattleText4 ; TextBeforeBattle
-	dw PokemonTower5AfterBattleText4 ; TextAfterBattle
-	dw PokemonTower5EndBattleText4 ; TextEndBattle
-	dw PokemonTower5EndBattleText4 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_POKEMONTOWER_5_TRAINER_3, 2, PokemonTower5BattleText4, PokemonTower5EndBattleText4, PokemonTower5AfterBattleText4
+	db -1 ; end
 
 PokemonTower5Text1:
 	text_far _PokemonTower5Text1
--- a/scripts/PokemonTower6F.asm
+++ b/scripts/PokemonTower6F.asm
@@ -104,33 +104,12 @@
 	dw PokemonTower6Text7
 
 PokemonTower6TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_0
-	dw PokemonTower6BattleText1 ; TextBeforeBattle
-	dw PokemonTower6AfterBattleText1 ; TextAfterBattle
-	dw PokemonTower6EndBattleText1 ; TextEndBattle
-	dw PokemonTower6EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_POKEMONTOWER_6_TRAINER_0, 3, PokemonTower6BattleText1, PokemonTower6EndBattleText1, PokemonTower6AfterBattleText1
 PokemonTower6TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_1
-	dw PokemonTower6BattleText2 ; TextBeforeBattle
-	dw PokemonTower6AfterBattleText2 ; TextAfterBattle
-	dw PokemonTower6EndBattleText2 ; TextEndBattle
-	dw PokemonTower6EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_POKEMONTOWER_6_TRAINER_1, 3, PokemonTower6BattleText2, PokemonTower6EndBattleText2, PokemonTower6AfterBattleText2
 PokemonTower6TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_2
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_2
-	dw PokemonTower6BattleText3 ; TextBeforeBattle
-	dw PokemonTower6AfterBattleText3 ; TextAfterBattle
-	dw PokemonTower6EndBattleText3 ; TextEndBattle
-	dw PokemonTower6EndBattleText3 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_POKEMONTOWER_6_TRAINER_2, 2, PokemonTower6BattleText3, PokemonTower6EndBattleText3, PokemonTower6AfterBattleText3
+	db -1 ; end
 
 PokemonTower6Text1:
 	text_asm
--- a/scripts/PokemonTower7F.asm
+++ b/scripts/PokemonTower7F.asm
@@ -205,33 +205,12 @@
 	dw PokemonTower7FujiText
 
 PokemonTower7TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_7_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_7_TRAINER_0
-	dw PokemonTower7BattleText1 ; TextBeforeBattle
-	dw PokemonTower7AfterBattleText1 ; TextAfterBattle
-	dw PokemonTower7EndBattleText1 ; TextEndBattle
-	dw PokemonTower7EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_POKEMONTOWER_7_TRAINER_0, 3, PokemonTower7BattleText1, PokemonTower7EndBattleText1, PokemonTower7AfterBattleText1
 PokemonTower7TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
-	dw PokemonTower7BattleText2 ; TextBeforeBattle
-	dw PokemonTower7AfterBattleText2 ; TextAfterBattle
-	dw PokemonTower7EndBattleText2 ; TextEndBattle
-	dw PokemonTower7EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_POKEMONTOWER_7_TRAINER_1, 3, PokemonTower7BattleText2, PokemonTower7EndBattleText2, PokemonTower7AfterBattleText2
 PokemonTower7TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_POKEMONTOWER_7_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_7_TRAINER_2
-	dw PokemonTower7BattleText3 ; TextBeforeBattle
-	dw PokemonTower7AfterBattleText3 ; TextAfterBattle
-	dw PokemonTower7EndBattleText3 ; TextEndBattle
-	dw PokemonTower7EndBattleText3 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_POKEMONTOWER_7_TRAINER_2, 3, PokemonTower7BattleText3, PokemonTower7EndBattleText3, PokemonTower7AfterBattleText3
+	db -1 ; end
 
 PokemonTower7Text1:
 	text_asm
--- a/scripts/PowerPlant.asm
+++ b/scripts/PowerPlant.asm
@@ -29,87 +29,24 @@
 	dw PickUpItemText
 
 Voltorb0TrainerHeader:
-	dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_0
-	db 0 ; view range
-	dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_0
-	dw VoltorbBattleText ; TextBeforeBattle
-	dw VoltorbBattleText ; TextAfterBattle
-	dw VoltorbBattleText ; TextEndBattle
-	dw VoltorbBattleText ; TextEndBattle
-
+	trainer EVENT_BEAT_POWER_PLANT_VOLTORB_0, 0, VoltorbBattleText, VoltorbBattleText, VoltorbBattleText
 Voltorb1TrainerHeader:
-	dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_1
-	db 0 ; view range
-	dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_1
-	dw VoltorbBattleText ; TextBeforeBattle
-	dw VoltorbBattleText ; TextAfterBattle
-	dw VoltorbBattleText ; TextEndBattle
-	dw VoltorbBattleText ; TextEndBattle
-
+	trainer EVENT_BEAT_POWER_PLANT_VOLTORB_1, 0, VoltorbBattleText, VoltorbBattleText, VoltorbBattleText
 Voltorb2TrainerHeader:
-	dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_2
-	db 0 ; view range
-	dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_2
-	dw VoltorbBattleText ; TextBeforeBattle
-	dw VoltorbBattleText ; TextAfterBattle
-	dw VoltorbBattleText ; TextEndBattle
-	dw VoltorbBattleText ; TextEndBattle
-
+	trainer EVENT_BEAT_POWER_PLANT_VOLTORB_2, 0, VoltorbBattleText, VoltorbBattleText, VoltorbBattleText
 Voltorb3TrainerHeader:
-	dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_3
-	db 0 ; view range
-	dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_3
-	dw VoltorbBattleText ; TextBeforeBattle
-	dw VoltorbBattleText ; TextAfterBattle
-	dw VoltorbBattleText ; TextEndBattle
-	dw VoltorbBattleText ; TextEndBattle
-
+	trainer EVENT_BEAT_POWER_PLANT_VOLTORB_3, 0, VoltorbBattleText, VoltorbBattleText, VoltorbBattleText
 Voltorb4TrainerHeader:
-	dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_4
-	db 0 ; view range
-	dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_4
-	dw VoltorbBattleText ; TextBeforeBattle
-	dw VoltorbBattleText ; TextAfterBattle
-	dw VoltorbBattleText ; TextEndBattle
-	dw VoltorbBattleText ; TextEndBattle
-
+	trainer EVENT_BEAT_POWER_PLANT_VOLTORB_4, 0, VoltorbBattleText, VoltorbBattleText, VoltorbBattleText
 Voltorb5TrainerHeader:
-	dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_5
-	db 0 ; view range
-	dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_5
-	dw VoltorbBattleText ; TextBeforeBattle
-	dw VoltorbBattleText ; TextAfterBattle
-	dw VoltorbBattleText ; TextEndBattle
-	dw VoltorbBattleText ; TextEndBattle
-
+	trainer EVENT_BEAT_POWER_PLANT_VOLTORB_5, 0, VoltorbBattleText, VoltorbBattleText, VoltorbBattleText
 Voltorb6TrainerHeader:
-	dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_6
-	db 0 ; view range
-	dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_6
-	dw VoltorbBattleText ; TextBeforeBattle
-	dw VoltorbBattleText ; TextAfterBattle
-	dw VoltorbBattleText ; TextEndBattle
-	dw VoltorbBattleText ; TextEndBattle
-
+	trainer EVENT_BEAT_POWER_PLANT_VOLTORB_6, 0, VoltorbBattleText, VoltorbBattleText, VoltorbBattleText
 Voltorb7TrainerHeader:
-	dbEventFlagBit EVENT_BEAT_POWER_PLANT_VOLTORB_7, 1
-	db 0 ; view range
-	dwEventFlagAddress EVENT_BEAT_POWER_PLANT_VOLTORB_7, 1
-	dw VoltorbBattleText ; TextBeforeBattle
-	dw VoltorbBattleText ; TextAfterBattle
-	dw VoltorbBattleText ; TextEndBattle
-	dw VoltorbBattleText ; TextEndBattle
-
+	trainer EVENT_BEAT_POWER_PLANT_VOLTORB_7, 1, 0, VoltorbBattleText, VoltorbBattleText, VoltorbBattleText
 ZapdosTrainerHeader:
-	dbEventFlagBit EVENT_BEAT_ZAPDOS, 1
-	db 0 ; view range
-	dwEventFlagAddress EVENT_BEAT_ZAPDOS, 1
-	dw ZapdosBattleText ; TextBeforeBattle
-	dw ZapdosBattleText ; TextAfterBattle
-	dw ZapdosBattleText ; TextEndBattle
-	dw ZapdosBattleText ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ZAPDOS, 1, 0, ZapdosBattleText, ZapdosBattleText, ZapdosBattleText
+	db -1 ; end
 
 InitVoltorbBattle:
 	call TalkToTrainer
--- a/scripts/RockTunnel1F.asm
+++ b/scripts/RockTunnel1F.asm
@@ -23,69 +23,20 @@
 	dw RockTunnel1Text8
 
 RockTunnel1TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_0
-	dw RockTunnel1BattleText1 ; TextBeforeBattle
-	dw RockTunnel1AfterBattleText1 ; TextAfterBattle
-	dw RockTunnel1EndBattleText1 ; TextEndBattle
-	dw RockTunnel1EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_0, 4, RockTunnel1BattleText1, RockTunnel1EndBattleText1, RockTunnel1AfterBattleText1
 RockTunnel1TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1
-	dw RockTunnel1BattleText2 ; TextBeforeBattle
-	dw RockTunnel1AfterBattleText2 ; TextAfterBattle
-	dw RockTunnel1EndBattleText2 ; TextEndBattle
-	dw RockTunnel1EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1, 4, RockTunnel1BattleText2, RockTunnel1EndBattleText2, RockTunnel1AfterBattleText2
 RockTunnel1TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2
-	dw RockTunnel1BattleText3 ; TextBeforeBattle
-	dw RockTunnel1AfterBattleText3 ; TextAfterBattle
-	dw RockTunnel1EndBattleText3 ; TextEndBattle
-	dw RockTunnel1EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2, 3, RockTunnel1BattleText3, RockTunnel1EndBattleText3, RockTunnel1AfterBattleText3
 RockTunnel1TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3
-	dw RockTunnel1BattleText4 ; TextBeforeBattle
-	dw RockTunnel1AfterBattleText4 ; TextAfterBattle
-	dw RockTunnel1EndBattleText4 ; TextEndBattle
-	dw RockTunnel1EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3, 3, RockTunnel1BattleText4, RockTunnel1EndBattleText4, RockTunnel1AfterBattleText4
 RockTunnel1TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4
-	dw RockTunnel1BattleText5 ; TextBeforeBattle
-	dw RockTunnel1AfterBattleText5 ; TextAfterBattle
-	dw RockTunnel1EndBattleText5 ; TextEndBattle
-	dw RockTunnel1EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4, 4, RockTunnel1BattleText5, RockTunnel1EndBattleText5, RockTunnel1AfterBattleText5
 RockTunnel1TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5
-	dw RockTunnel1BattleText6 ; TextBeforeBattle
-	dw RockTunnel1AfterBattleText6 ; TextAfterBattle
-	dw RockTunnel1EndBattleText6 ; TextEndBattle
-	dw RockTunnel1EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5, 4, RockTunnel1BattleText6, RockTunnel1EndBattleText6, RockTunnel1AfterBattleText6
 RockTunnel1TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6
-	dw RockTunnel1BattleText7 ; TextBeforeBattle
-	dw RockTunnel1AfterBattleText7 ; TextAfterBattle
-	dw RockTunnel1EndBattleText7 ; TextEndBattle
-	dw RockTunnel1EndBattleText7 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6, 4, RockTunnel1BattleText7, RockTunnel1EndBattleText7, RockTunnel1AfterBattleText7
+	db -1 ; end
 
 RockTunnel1Text1:
 	text_asm
--- a/scripts/RockTunnelB1F.asm
+++ b/scripts/RockTunnelB1F.asm
@@ -23,78 +23,22 @@
 	dw RockTunnel2Text8
 
 RockTunnel2TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0
-	dw RockTunnel2BattleText2 ; TextBeforeBattle
-	dw RockTunnel2AfterBattleText2 ; TextAfterBattle
-	dw RockTunnel2EndBattleText2 ; TextEndBattle
-	dw RockTunnel2EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0, 4, RockTunnel2BattleText2, RockTunnel2EndBattleText2, RockTunnel2AfterBattleText2
 RockTunnel2TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_1
-	dw RockTunnel2BattleText3 ; TextBeforeBattle
-	dw RockTunnel2AfterBattleText3 ; TextAfterBattle
-	dw RockTunnel2EndBattleText3 ; TextEndBattle
-	dw RockTunnel2EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_1, 3, RockTunnel2BattleText3, RockTunnel2EndBattleText3, RockTunnel2AfterBattleText3
 RockTunnel2TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2
-	dw RockTunnel2BattleText4 ; TextBeforeBattle
-	dw RockTunnel2AfterBattleText4 ; TextAfterBattle
-	dw RockTunnel2EndBattleText4 ; TextEndBattle
-	dw RockTunnel2EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2, 3, RockTunnel2BattleText4, RockTunnel2EndBattleText4, RockTunnel2AfterBattleText4
 RockTunnel2TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3
-	dw RockTunnel2BattleText5 ; TextBeforeBattle
-	dw RockTunnel2AfterBattleText5 ; TextAfterBattle
-	dw RockTunnel2EndBattleText5 ; TextEndBattle
-	dw RockTunnel2EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3, 4, RockTunnel2BattleText5, RockTunnel2EndBattleText5, RockTunnel2AfterBattleText5
 RockTunnel2TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4
-	dw RockTunnel2BattleText6 ; TextBeforeBattle
-	dw RockTunnel2AfterBattleText6 ; TextAfterBattle
-	dw RockTunnel2EndBattleText6 ; TextEndBattle
-	dw RockTunnel2EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4, 3, RockTunnel2BattleText6, RockTunnel2EndBattleText6, RockTunnel2AfterBattleText6
 RockTunnel2TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5
-	dw RockTunnel2BattleText7 ; TextBeforeBattle
-	dw RockTunnel2AfterBattleText7 ; TextAfterBattle
-	dw RockTunnel2EndBattleText7 ; TextEndBattle
-	dw RockTunnel2EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5, 4, RockTunnel2BattleText7, RockTunnel2EndBattleText7, RockTunnel2AfterBattleText7
 RockTunnel2TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6
-	dw RockTunnel2BattleText8 ; TextBeforeBattle
-	dw RockTunnel2AfterBattleText8 ; TextAfterBattle
-	dw RockTunnel2EndBattleText8 ; TextEndBattle
-	dw RockTunnel2EndBattleText8 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6, 3, RockTunnel2BattleText8, RockTunnel2EndBattleText8, RockTunnel2AfterBattleText8
 RockTunnel2TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7, 1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7, 1
-	dw RockTunnel2BattleText9 ; TextBeforeBattle
-	dw RockTunnel2AfterBattleText9 ; TextAfterBattle
-	dw RockTunnel2EndBattleText9 ; TextEndBattle
-	dw RockTunnel2EndBattleText9 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7, 1, 3, RockTunnel2BattleText9, RockTunnel2EndBattleText9, RockTunnel2AfterBattleText9
+	db -1 ; end
 
 RockTunnel2Text1:
 	text_asm
--- a/scripts/RocketHideoutB1F.asm
+++ b/scripts/RocketHideoutB1F.asm
@@ -45,51 +45,16 @@
 	dw PickUpItemText
 
 RocketHideout1TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0
-	dw RocketHideout1BattleText2 ; TextBeforeBattle
-	dw RocketHideout1AfterBattleTxt2 ; TextAfterBattle
-	dw RocketHideout1EndBattleText2 ; TextEndBattle
-	dw RocketHideout1EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0, 3, RocketHideout1BattleText2, RocketHideout1EndBattleText2, RocketHideout1AfterBattleTxt2
 RocketHideout1TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_1
-	dw RocketHideout1BattleText3 ; TextBeforeBattle
-	dw RocketHideout1AfterBattleTxt3 ; TextAfterBattle
-	dw RocketHideout1EndBattleText3 ; TextEndBattle
-	dw RocketHideout1EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_1, 2, RocketHideout1BattleText3, RocketHideout1EndBattleText3, RocketHideout1AfterBattleTxt3
 RocketHideout1TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2
-	dw RocketHideout1BattleText4 ; TextBeforeBattle
-	dw RocketHideout1AfterBattleTxt4 ; TextAfterBattle
-	dw RocketHideout1EndBattleText4 ; TextEndBattle
-	dw RocketHideout1EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2, 2, RocketHideout1BattleText4, RocketHideout1EndBattleText4, RocketHideout1AfterBattleTxt4
 RocketHideout1TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3
-	dw RocketHideout1BattleText5 ; TextBeforeBattle
-	dw RocketHideout1AfterBattleTxt5 ; TextAfterBattle
-	dw RocketHideout1EndBattleText5 ; TextEndBattle
-	dw RocketHideout1EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3, 3, RocketHideout1BattleText5, RocketHideout1EndBattleText5, RocketHideout1AfterBattleTxt5
 RocketHideout1TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4
-	dw RocketHideout1BattleText6 ; TextBeforeBattle
-	dw RocketHideout1AfterBattleTxt6 ; TextAfterBattle
-	dw RocketHideout1EndBattleText6 ; TextEndBattle
-	dw RocketHideout1EndBattleText6 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4, 3, RocketHideout1BattleText6, RocketHideout1EndBattleText6, RocketHideout1AfterBattleTxt6
+	db -1 ; end
 
 RocketHideout1Text1:
 	text_asm
--- a/scripts/RocketHideoutB2F.asm
+++ b/scripts/RocketHideoutB2F.asm
@@ -323,15 +323,8 @@
 	dw PickUpItemText
 
 RocketHideout2TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0
-	dw RocketHideout2BattleText2 ; TextBeforeBattle
-	dw RocketHideout2AfterBattleTxt2 ; TextAfterBattle
-	dw RocketHideout2EndBattleText2 ; TextEndBattle
-	dw RocketHideout2EndBattleText2 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0, 4, RocketHideout2BattleText2, RocketHideout2EndBattleText2, RocketHideout2AfterBattleTxt2
+	db -1 ; end
 
 RocketHideout2Text1:
 	text_asm
--- a/scripts/RocketHideoutB3F.asm
+++ b/scripts/RocketHideoutB3F.asm
@@ -150,24 +150,10 @@
 	dw PickUpItemText
 
 RocketHideout3TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0
-	dw RocketHideout3BattleText2 ; TextBeforeBattle
-	dw RocketHideout3AfterBattleTxt2 ; TextAfterBattle
-	dw RocketHideout3EndBattleText2 ; TextEndBattle
-	dw RocketHideout3EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0, 2, RocketHideout3BattleText2, RocketHideout3EndBattleText2, RocketHideout3AfterBattleTxt2
 RocketHideout3TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_1
-	dw RocketHideout3BattleTxt ; TextBeforeBattle
-	dw RocketHideout3AfterBattleText3 ; TextAfterBattle
-	dw RocketHideout3EndBattleText3 ; TextEndBattle
-	dw RocketHideout3EndBattleText3 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_1, 4, RocketHideout3BattleTxt, RocketHideout3EndBattleText3, RocketHideout3AfterBattleText3
+	db -1 ; end
 
 RocketHideout3Text1:
 	text_asm
--- a/scripts/RocketHideoutB4F.asm
+++ b/scripts/RocketHideoutB4F.asm
@@ -85,33 +85,12 @@
 	dw RocketHideout4Text10
 
 RocketHideout4TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0
-	dw RocketHideout4BattleText2 ; TextBeforeBattle
-	dw RocketHideout4AfterBattleText2 ; TextAfterBattle
-	dw RocketHideout4EndBattleText2 ; TextEndBattle
-	dw RocketHideout4EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0, 0, RocketHideout4BattleText2, RocketHideout4EndBattleText2, RocketHideout4AfterBattleText2
 RocketHideout4TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
-	dw RocketHideout4BattleText3 ; TextBeforeBattle
-	dw RocketHideout4AfterBattleText3 ; TextAfterBattle
-	dw RocketHideout4EndBattleText3 ; TextEndBattle
-	dw RocketHideout4EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1, 0, RocketHideout4BattleText3, RocketHideout4EndBattleText3, RocketHideout4AfterBattleText3
 RocketHideout4TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2
-	db ($1 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2
-	dw RocketHideout4BattleText4 ; TextBeforeBattle
-	dw RocketHideout4AfterBattleText4 ; TextAfterBattle
-	dw RocketHideout4EndBattleText4 ; TextEndBattle
-	dw RocketHideout4EndBattleText4 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2, 1, RocketHideout4BattleText4, RocketHideout4EndBattleText4, RocketHideout4AfterBattleText4
+	db -1 ; end
 
 RocketHideout4Text1:
 	text_asm
--- a/scripts/Route10.asm
+++ b/scripts/Route10.asm
@@ -25,60 +25,18 @@
 	dw Route10Text10
 
 Route10TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_0
-	dw Route10BattleText1 ; TextBeforeBattle
-	dw Route10AfterBattleText1 ; TextAfterBattle
-	dw Route10EndBattleText1 ; TextEndBattle
-	dw Route10EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_10_TRAINER_0, 4, Route10BattleText1, Route10EndBattleText1, Route10AfterBattleText1
 Route10TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_1
-	dw Route10BattleText2 ; TextBeforeBattle
-	dw Route10AfterBattleText2 ; TextAfterBattle
-	dw Route10EndBattleText2 ; TextEndBattle
-	dw Route10EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_10_TRAINER_1, 3, Route10BattleText2, Route10EndBattleText2, Route10AfterBattleText2
 Route10TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_2
-	dw Route10BattleText3 ; TextBeforeBattle
-	dw Route10AfterBattleText3 ; TextAfterBattle
-	dw Route10EndBattleText3 ; TextEndBattle
-	dw Route10EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_10_TRAINER_2, 4, Route10BattleText3, Route10EndBattleText3, Route10AfterBattleText3
 Route10TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_3
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_3
-	dw Route10BattleText4 ; TextBeforeBattle
-	dw Route10AfterBattleText4 ; TextAfterBattle
-	dw Route10EndBattleText4 ; TextEndBattle
-	dw Route10EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_10_TRAINER_3, 3, Route10BattleText4, Route10EndBattleText4, Route10AfterBattleText4
 Route10TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_4
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_4
-	dw Route10BattleText5 ; TextBeforeBattle
-	dw Route10AfterBattleText5 ; TextAfterBattle
-	dw Route10EndBattleText5 ; TextEndBattle
-	dw Route10EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_10_TRAINER_4, 2, Route10BattleText5, Route10EndBattleText5, Route10AfterBattleText5
 Route10TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_5
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_5
-	dw Route10BattleText6 ; TextBeforeBattle
-	dw Route10AfterBattleText6 ; TextAfterBattle
-	dw Route10EndBattleText6 ; TextEndBattle
-	dw Route10EndBattleText6 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_10_TRAINER_5, 2, Route10BattleText6, Route10EndBattleText6, Route10AfterBattleText6
+	db -1 ; end
 
 Route10Text1:
 	text_asm
--- a/scripts/Route11.asm
+++ b/scripts/Route11.asm
@@ -26,96 +26,26 @@
 	dw Route11Text11
 
 Route11TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_0
-	dw Route11BattleText1 ; TextBeforeBattle
-	dw Route11AfterBattleText1 ; TextAfterBattle
-	dw Route11EndBattleText1 ; TextEndBattle
-	dw Route11EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_11_TRAINER_0, 3, Route11BattleText1, Route11EndBattleText1, Route11AfterBattleText1
 Route11TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_1
-	dw Route11BattleText2 ; TextBeforeBattle
-	dw Route11AfterBattleText2 ; TextAfterBattle
-	dw Route11EndBattleText2 ; TextEndBattle
-	dw Route11EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_11_TRAINER_1, 2, Route11BattleText2, Route11EndBattleText2, Route11AfterBattleText2
 Route11TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_2
-	dw Route11BattleText3 ; TextBeforeBattle
-	dw Route11AfterBattleText3 ; TextAfterBattle
-	dw Route11EndBattleText3 ; TextEndBattle
-	dw Route11EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_11_TRAINER_2, 3, Route11BattleText3, Route11EndBattleText3, Route11AfterBattleText3
 Route11TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_3
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_3
-	dw Route11BattleText4 ; TextBeforeBattle
-	dw Route11AfterBattleText4 ; TextAfterBattle
-	dw Route11EndBattleText4 ; TextEndBattle
-	dw Route11EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_11_TRAINER_3, 3, Route11BattleText4, Route11EndBattleText4, Route11AfterBattleText4
 Route11TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_4
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_4
-	dw Route11BattleText5 ; TextBeforeBattle
-	dw Route11AfterBattleText5 ; TextAfterBattle
-	dw Route11EndBattleText5 ; TextEndBattle
-	dw Route11EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_11_TRAINER_4, 4, Route11BattleText5, Route11EndBattleText5, Route11AfterBattleText5
 Route11TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_5
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_5
-	dw Route11BattleText6 ; TextBeforeBattle
-	dw Route11AfterBattleText6 ; TextAfterBattle
-	dw Route11EndBattleText6 ; TextEndBattle
-	dw Route11EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_11_TRAINER_5, 3, Route11BattleText6, Route11EndBattleText6, Route11AfterBattleText6
 Route11TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_6
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_6
-	dw Route11BattleText7 ; TextBeforeBattle
-	dw Route11AfterBattleText7 ; TextAfterBattle
-	dw Route11EndBattleText7 ; TextEndBattle
-	dw Route11EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_11_TRAINER_6, 3, Route11BattleText7, Route11EndBattleText7, Route11AfterBattleText7
 Route11TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_7, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_7, 1
-	dw Route11BattleText8 ; TextBeforeBattle
-	dw Route11AfterBattleText8 ; TextAfterBattle
-	dw Route11EndBattleText8 ; TextEndBattle
-	dw Route11EndBattleText8 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_11_TRAINER_7, 1, 4, Route11BattleText8, Route11EndBattleText8, Route11AfterBattleText8
 Route11TrainerHeader8:
-	dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_8, 1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_8, 1
-	dw Route11BattleText9 ; TextBeforeBattle
-	dw Route11AfterBattleText9 ; TextAfterBattle
-	dw Route11EndBattleText9 ; TextEndBattle
-	dw Route11EndBattleText9 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_11_TRAINER_8, 1, 3, Route11BattleText9, Route11EndBattleText9, Route11AfterBattleText9
 Route11TrainerHeader9:
-	dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_9, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_9, 1
-	dw Route11BattleText10 ; TextBeforeBattle
-	dw Route11AfterBattleText10 ; TextAfterBattle
-	dw Route11EndBattleText10 ; TextEndBattle
-	dw Route11EndBattleText10 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_11_TRAINER_9, 1, 4, Route11BattleText10, Route11EndBattleText10, Route11AfterBattleText10
+	db -1 ; end
 
 Route11Text1:
 	text_asm
--- a/scripts/Route12.asm
+++ b/scripts/Route12.asm
@@ -77,69 +77,20 @@
 	dw Route12Text14
 
 Route12TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_0
-	dw Route12BattleText1 ; TextBeforeBattle
-	dw Route12AfterBattleText1 ; TextAfterBattle
-	dw Route12EndBattleText1 ; TextEndBattle
-	dw Route12EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_12_TRAINER_0, 4, Route12BattleText1, Route12EndBattleText1, Route12AfterBattleText1
 Route12TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_1
-	dw Route12BattleText2 ; TextBeforeBattle
-	dw Route12AfterBattleText2 ; TextAfterBattle
-	dw Route12EndBattleText2 ; TextEndBattle
-	dw Route12EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_12_TRAINER_1, 4, Route12BattleText2, Route12EndBattleText2, Route12AfterBattleText2
 Route12TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_2
-	dw Route12BattleText3 ; TextBeforeBattle
-	dw Route12AfterBattleText3 ; TextAfterBattle
-	dw Route12EndBattleText3 ; TextEndBattle
-	dw Route12EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_12_TRAINER_2, 4, Route12BattleText3, Route12EndBattleText3, Route12AfterBattleText3
 Route12TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_3
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_3
-	dw Route12BattleText4 ; TextBeforeBattle
-	dw Route12AfterBattleText4 ; TextAfterBattle
-	dw Route12EndBattleText4 ; TextEndBattle
-	dw Route12EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_12_TRAINER_3, 4, Route12BattleText4, Route12EndBattleText4, Route12AfterBattleText4
 Route12TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_4
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_4
-	dw Route12BattleText5 ; TextBeforeBattle
-	dw Route12AfterBattleText5 ; TextAfterBattle
-	dw Route12EndBattleText5 ; TextEndBattle
-	dw Route12EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_12_TRAINER_4, 4, Route12BattleText5, Route12EndBattleText5, Route12AfterBattleText5
 Route12TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_5
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_5
-	dw Route12BattleText6 ; TextBeforeBattle
-	dw Route12AfterBattleText6 ; TextAfterBattle
-	dw Route12EndBattleText6 ; TextEndBattle
-	dw Route12EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_12_TRAINER_5, 4, Route12BattleText6, Route12EndBattleText6, Route12AfterBattleText6
 Route12TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_6, 1
-	db ($1 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_6, 1
-	dw Route12BattleText7 ; TextBeforeBattle
-	dw Route12AfterBattleText7 ; TextAfterBattle
-	dw Route12EndBattleText7 ; TextEndBattle
-	dw Route12EndBattleText7 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_12_TRAINER_6, 1, 1, Route12BattleText7, Route12EndBattleText7, Route12AfterBattleText7
+	db -1 ; end
 
 Route12Text1:
 	text_far _Route12Text1
--- a/scripts/Route13.asm
+++ b/scripts/Route13.asm
@@ -28,96 +28,26 @@
 	dw Route13Text13
 
 Route13TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_0
-	dw Route13BattleText2 ; TextBeforeBattle
-	dw Route13AfterBattleText2 ; TextAfterBattle
-	dw Route13EndBattleText2 ; TextEndBattle
-	dw Route13EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_13_TRAINER_0, 2, Route13BattleText2, Route13EndBattleText2, Route13AfterBattleText2
 Route13TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_1
-	dw Route13BattleText3 ; TextBeforeBattle
-	dw Route13AfterBattleText3 ; TextAfterBattle
-	dw Route13EndBattleText3 ; TextEndBattle
-	dw Route13EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_13_TRAINER_1, 2, Route13BattleText3, Route13EndBattleText3, Route13AfterBattleText3
 Route13TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_2
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_2
-	dw Route13BattleText4 ; TextBeforeBattle
-	dw Route13AfterBattleText4 ; TextAfterBattle
-	dw Route13EndBattleText4 ; TextEndBattle
-	dw Route13EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_13_TRAINER_2, 2, Route13BattleText4, Route13EndBattleText4, Route13AfterBattleText4
 Route13TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_3
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_3
-	dw Route13BattleText5 ; TextBeforeBattle
-	dw Route13AfterBattleText5 ; TextAfterBattle
-	dw Route13EndBattleText5 ; TextEndBattle
-	dw Route13EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_13_TRAINER_3, 2, Route13BattleText5, Route13EndBattleText5, Route13AfterBattleText5
 Route13TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_4
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_4
-	dw Route13BattleText6 ; TextBeforeBattle
-	dw Route13AfterBattleText6 ; TextAfterBattle
-	dw Route13EndBattleText6 ; TextEndBattle
-	dw Route13EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_13_TRAINER_4, 4, Route13BattleText6, Route13EndBattleText6, Route13AfterBattleText6
 Route13TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_5
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_5
-	dw Route13BattleText7 ; TextBeforeBattle
-	dw Route13AfterBattleText7 ; TextAfterBattle
-	dw Route13EndBattleText7 ; TextEndBattle
-	dw Route13EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_13_TRAINER_5, 2, Route13BattleText7, Route13EndBattleText7, Route13AfterBattleText7
 Route13TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_6
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_6
-	dw Route13BattleText8 ; TextBeforeBattle
-	dw Route13AfterBattleText8 ; TextAfterBattle
-	dw Route13EndBattleText8 ; TextEndBattle
-	dw Route13EndBattleText8 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_13_TRAINER_6, 4, Route13BattleText8, Route13EndBattleText8, Route13AfterBattleText8
 Route13TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_7, 1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_7, 1
-	dw Route13BattleText9 ; TextBeforeBattle
-	dw Route13AfterBattleText9 ; TextAfterBattle
-	dw Route13EndBattleText9 ; TextEndBattle
-	dw Route13EndBattleText9 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_13_TRAINER_7, 1, 2, Route13BattleText9, Route13EndBattleText9, Route13AfterBattleText9
 Route13TrainerHeader8:
-	dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_8, 1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_8, 1
-	dw Route13BattleText10 ; TextBeforeBattle
-	dw Route13AfterBattleText10 ; TextAfterBattle
-	dw Route13EndBattleText10 ; TextEndBattle
-	dw Route13EndBattleText10 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_13_TRAINER_8, 1, 2, Route13BattleText10, Route13EndBattleText10, Route13AfterBattleText10
 Route13TrainerHeader9:
-	dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_9, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_9, 1
-	dw Route13BattleText11 ; TextBeforeBattle
-	dw Route13AfterBattleText11 ; TextAfterBattle
-	dw Route13EndBattleText11 ; TextEndBattle
-	dw Route13EndBattleText11 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_13_TRAINER_9, 1, 4, Route13BattleText11, Route13EndBattleText11, Route13AfterBattleText11
+	db -1 ; end
 
 Route13Text1:
 	text_asm
--- a/scripts/Route14.asm
+++ b/scripts/Route14.asm
@@ -26,96 +26,26 @@
 	dw Route14Text11
 
 Route14TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_0
-	dw Route14BattleText1 ; TextBeforeBattle
-	dw Route14AfterBattleText1 ; TextAfterBattle
-	dw Route14EndBattleText1 ; TextEndBattle
-	dw Route14EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_14_TRAINER_0, 2, Route14BattleText1, Route14EndBattleText1, Route14AfterBattleText1
 Route14TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_1
-	dw Route14BattleText2 ; TextBeforeBattle
-	dw Route14AfterBattleText2 ; TextAfterBattle
-	dw Route14EndBattleText2 ; TextEndBattle
-	dw Route14EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_14_TRAINER_1, 2, Route14BattleText2, Route14EndBattleText2, Route14AfterBattleText2
 Route14TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_2
-	dw Route14BattleText3 ; TextBeforeBattle
-	dw Route14AfterBattleText3 ; TextAfterBattle
-	dw Route14EndBattleText3 ; TextEndBattle
-	dw Route14EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_14_TRAINER_2, 4, Route14BattleText3, Route14EndBattleText3, Route14AfterBattleText3
 Route14TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_3
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_3
-	dw Route14BattleText4 ; TextBeforeBattle
-	dw Route14AfterBattleText4 ; TextAfterBattle
-	dw Route14EndBattleText4 ; TextEndBattle
-	dw Route14EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_14_TRAINER_3, 3, Route14BattleText4, Route14EndBattleText4, Route14AfterBattleText4
 Route14TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_4
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_4
-	dw Route14BattleText5 ; TextBeforeBattle
-	dw Route14AfterBattleText5 ; TextAfterBattle
-	dw Route14EndBattleText5 ; TextEndBattle
-	dw Route14EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_14_TRAINER_4, 3, Route14BattleText5, Route14EndBattleText5, Route14AfterBattleText5
 Route14TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_5
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_5
-	dw Route14BattleText6 ; TextBeforeBattle
-	dw Route14AfterBattleText6 ; TextAfterBattle
-	dw Route14EndBattleText6 ; TextEndBattle
-	dw Route14EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_14_TRAINER_5, 4, Route14BattleText6, Route14EndBattleText6, Route14AfterBattleText6
 Route14TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_6
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_6
-	dw Route14BattleText7 ; TextBeforeBattle
-	dw Route14AfterBattleText7 ; TextAfterBattle
-	dw Route14EndBattleText7 ; TextEndBattle
-	dw Route14EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_14_TRAINER_6, 4, Route14BattleText7, Route14EndBattleText7, Route14AfterBattleText7
 Route14TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_7, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_7, 1
-	dw Route14BattleText8 ; TextBeforeBattle
-	dw Route14AfterBattleText8 ; TextAfterBattle
-	dw Route14EndBattleText8 ; TextEndBattle
-	dw Route14EndBattleText8 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_14_TRAINER_7, 1, 4, Route14BattleText8, Route14EndBattleText8, Route14AfterBattleText8
 Route14TrainerHeader8:
-	dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_8, 1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_8, 1
-	dw Route14BattleText9 ; TextBeforeBattle
-	dw Route14AfterBattleText9 ; TextAfterBattle
-	dw Route14EndBattleText9 ; TextEndBattle
-	dw Route14EndBattleText9 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_14_TRAINER_8, 1, 3, Route14BattleText9, Route14EndBattleText9, Route14AfterBattleText9
 Route14TrainerHeader9:
-	dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_9, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_9, 1
-	dw Route14BattleText10 ; TextBeforeBattle
-	dw Route14AfterBattleText10 ; TextAfterBattle
-	dw Route14EndBattleText10 ; TextEndBattle
-	dw Route14EndBattleText10 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_14_TRAINER_9, 1, 4, Route14BattleText10, Route14EndBattleText10, Route14AfterBattleText10
+	db -1 ; end
 
 Route14Text1:
 	text_asm
--- a/scripts/Route15.asm
+++ b/scripts/Route15.asm
@@ -27,96 +27,26 @@
 	dw Route15Text12
 
 Route15TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_0
-	dw Route15BattleText1 ; TextBeforeBattle
-	dw Route15AfterBattleText1 ; TextAfterBattle
-	dw Route15EndBattleText1 ; TextEndBattle
-	dw Route15EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_15_TRAINER_0, 2, Route15BattleText1, Route15EndBattleText1, Route15AfterBattleText1
 Route15TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_1
-	dw Route15BattleText2 ; TextBeforeBattle
-	dw Route15AfterBattleText2 ; TextAfterBattle
-	dw Route15EndBattleText2 ; TextEndBattle
-	dw Route15EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_15_TRAINER_1, 3, Route15BattleText2, Route15EndBattleText2, Route15AfterBattleText2
 Route15TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_2
-	dw Route15BattleText3 ; TextBeforeBattle
-	dw Route15AfterBattleText3 ; TextAfterBattle
-	dw Route15EndBattleText3 ; TextEndBattle
-	dw Route15EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_15_TRAINER_2, 3, Route15BattleText3, Route15EndBattleText3, Route15AfterBattleText3
 Route15TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_3
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_3
-	dw Route15BattleText4 ; TextBeforeBattle
-	dw Route15AfterBattleText4 ; TextAfterBattle
-	dw Route15EndBattleText4 ; TextEndBattle
-	dw Route15EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_15_TRAINER_3, 3, Route15BattleText4, Route15EndBattleText4, Route15AfterBattleText4
 Route15TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_4
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_4
-	dw Route15BattleText5 ; TextBeforeBattle
-	dw Route15AfterBattleText5 ; TextAfterBattle
-	dw Route15EndBattleText5 ; TextEndBattle
-	dw Route15EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_15_TRAINER_4, 2, Route15BattleText5, Route15EndBattleText5, Route15AfterBattleText5
 Route15TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_5
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_5
-	dw Route15BattleText6 ; TextBeforeBattle
-	dw Route15AfterBattleText6 ; TextAfterBattle
-	dw Route15EndBattleText6 ; TextEndBattle
-	dw Route15EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_15_TRAINER_5, 3, Route15BattleText6, Route15EndBattleText6, Route15AfterBattleText6
 Route15TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_6
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_6
-	dw Route15BattleText7 ; TextBeforeBattle
-	dw Route15AfterBattleText7 ; TextAfterBattle
-	dw Route15EndBattleText7 ; TextEndBattle
-	dw Route15EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_15_TRAINER_6, 3, Route15BattleText7, Route15EndBattleText7, Route15AfterBattleText7
 Route15TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_7, 1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_7, 1
-	dw Route15BattleText8 ; TextBeforeBattle
-	dw Route15AfterBattleText8 ; TextAfterBattle
-	dw Route15EndBattleText8 ; TextEndBattle
-	dw Route15EndBattleText8 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_15_TRAINER_7, 1, 3, Route15BattleText8, Route15EndBattleText8, Route15AfterBattleText8
 Route15TrainerHeader8:
-	dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_8, 1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_8, 1
-	dw Route15BattleText9 ; TextBeforeBattle
-	dw Route15AfterBattleText9 ; TextAfterBattle
-	dw Route15EndBattleText9 ; TextEndBattle
-	dw Route15EndBattleText9 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_15_TRAINER_8, 1, 3, Route15BattleText9, Route15EndBattleText9, Route15AfterBattleText9
 Route15TrainerHeader9:
-	dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_9, 1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_9, 1
-	dw Route15BattleText10 ; TextBeforeBattle
-	dw Route15AfterBattleText10 ; TextAfterBattle
-	dw Route15EndBattleText10 ; TextEndBattle
-	dw Route15EndBattleText10 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_15_TRAINER_9, 1, 3, Route15BattleText10, Route15EndBattleText10, Route15AfterBattleText10
+	db -1 ; end
 
 Route15Text1:
 	text_asm
--- a/scripts/Route16.asm
+++ b/scripts/Route16.asm
@@ -75,60 +75,18 @@
 	dw Route16Text11
 
 Route16TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_0
-	dw Route16BattleText1 ; TextBeforeBattle
-	dw Route16AfterBattleText1 ; TextAfterBattle
-	dw Route16EndBattleText1 ; TextEndBattle
-	dw Route16EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_16_TRAINER_0, 3, Route16BattleText1, Route16EndBattleText1, Route16AfterBattleText1
 Route16TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_1
-	dw Route16BattleText2 ; TextBeforeBattle
-	dw Route16AfterBattleText2 ; TextAfterBattle
-	dw Route16EndBattleText2 ; TextEndBattle
-	dw Route16EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_16_TRAINER_1, 2, Route16BattleText2, Route16EndBattleText2, Route16AfterBattleText2
 Route16TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_2
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_2
-	dw Route16BattleText3 ; TextBeforeBattle
-	dw Route16AfterBattleText3 ; TextAfterBattle
-	dw Route16EndBattleText3 ; TextEndBattle
-	dw Route16EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_16_TRAINER_2, 2, Route16BattleText3, Route16EndBattleText3, Route16AfterBattleText3
 Route16TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_3
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_3
-	dw Route16BattleText4 ; TextBeforeBattle
-	dw Route16AfterBattleText4 ; TextAfterBattle
-	dw Route16EndBattleText4 ; TextEndBattle
-	dw Route16EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_16_TRAINER_3, 2, Route16BattleText4, Route16EndBattleText4, Route16AfterBattleText4
 Route16TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_4
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_4
-	dw Route16BattleText5 ; TextBeforeBattle
-	dw Route16AfterBattleText5 ; TextAfterBattle
-	dw Route16EndBattleText5 ; TextEndBattle
-	dw Route16EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_16_TRAINER_4, 2, Route16BattleText5, Route16EndBattleText5, Route16AfterBattleText5
 Route16TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_5
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_5
-	dw Route16BattleText6 ; TextBeforeBattle
-	dw Route16AfterBattleText6 ; TextAfterBattle
-	dw Route16EndBattleText6 ; TextEndBattle
-	dw Route16EndBattleText6 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_16_TRAINER_5, 4, Route16BattleText6, Route16EndBattleText6, Route16AfterBattleText6
+	db -1 ; end
 
 Route16Text1:
 	text_asm
--- a/scripts/Route17.asm
+++ b/scripts/Route17.asm
@@ -31,96 +31,26 @@
 	dw Route17Text16
 
 Route17TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_0
-	dw Route17BattleText1 ; TextBeforeBattle
-	dw Route17AfterBattleText1 ; TextAfterBattle
-	dw Route17EndBattleText1 ; TextEndBattle
-	dw Route17EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_17_TRAINER_0, 3, Route17BattleText1, Route17EndBattleText1, Route17AfterBattleText1
 Route17TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_1
-	dw Route17BattleText2 ; TextBeforeBattle
-	dw Route17AfterBattleText2 ; TextAfterBattle
-	dw Route17EndBattleText2 ; TextEndBattle
-	dw Route17EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_17_TRAINER_1, 4, Route17BattleText2, Route17EndBattleText2, Route17AfterBattleText2
 Route17TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_2
-	dw Route17BattleText3 ; TextBeforeBattle
-	dw Route17AfterBattleText3 ; TextAfterBattle
-	dw Route17EndBattleText3 ; TextEndBattle
-	dw Route17EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_17_TRAINER_2, 4, Route17BattleText3, Route17EndBattleText3, Route17AfterBattleText3
 Route17TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_3
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_3
-	dw Route17BattleText4 ; TextBeforeBattle
-	dw Route17AfterBattleText4 ; TextAfterBattle
-	dw Route17EndBattleText4 ; TextEndBattle
-	dw Route17EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_17_TRAINER_3, 4, Route17BattleText4, Route17EndBattleText4, Route17AfterBattleText4
 Route17TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_4
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_4
-	dw Route17BattleText5 ; TextBeforeBattle
-	dw Route17AfterBattleText5 ; TextAfterBattle
-	dw Route17EndBattleText5 ; TextEndBattle
-	dw Route17EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_17_TRAINER_4, 3, Route17BattleText5, Route17EndBattleText5, Route17AfterBattleText5
 Route17TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_5
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_5
-	dw Route17BattleText6 ; TextBeforeBattle
-	dw Route17AfterBattleText6 ; TextAfterBattle
-	dw Route17EndBattleText6 ; TextEndBattle
-	dw Route17EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_17_TRAINER_5, 2, Route17BattleText6, Route17EndBattleText6, Route17AfterBattleText6
 Route17TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_6
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_6
-	dw Route17BattleText7 ; TextBeforeBattle
-	dw Route17AfterBattleText7 ; TextAfterBattle
-	dw Route17EndBattleText7 ; TextEndBattle
-	dw Route17EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_17_TRAINER_6, 4, Route17BattleText7, Route17EndBattleText7, Route17AfterBattleText7
 Route17TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_7, 1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_7, 1
-	dw Route17BattleText8 ; TextBeforeBattle
-	dw Route17AfterBattleText8 ; TextAfterBattle
-	dw Route17EndBattleText8 ; TextEndBattle
-	dw Route17EndBattleText8 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_17_TRAINER_7, 1, 2, Route17BattleText8, Route17EndBattleText8, Route17AfterBattleText8
 Route17TrainerHeader8:
-	dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_8, 1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_8, 1
-	dw Route17BattleText9 ; TextBeforeBattle
-	dw Route17AfterBattleText9 ; TextAfterBattle
-	dw Route17EndBattleText9 ; TextEndBattle
-	dw Route17EndBattleText9 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_17_TRAINER_8, 1, 3, Route17BattleText9, Route17EndBattleText9, Route17AfterBattleText9
 Route17TrainerHeader9:
-	dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_9, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_9, 1
-	dw Route17BattleText10 ; TextBeforeBattle
-	dw Route17AfterBattleText10 ; TextAfterBattle
-	dw Route17EndBattleText10 ; TextEndBattle
-	dw Route17EndBattleText10 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_17_TRAINER_9, 1, 4, Route17BattleText10, Route17EndBattleText10, Route17AfterBattleText10
+	db -1 ; end
 
 Route17Text1:
 	text_asm
--- a/scripts/Route18.asm
+++ b/scripts/Route18.asm
@@ -20,33 +20,12 @@
 	dw Route18Text5
 
 Route18TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_18_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_18_TRAINER_0
-	dw Route18BattleText1 ; TextBeforeBattle
-	dw Route18AfterBattleText1 ; TextAfterBattle
-	dw Route18EndBattleText1 ; TextEndBattle
-	dw Route18EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_18_TRAINER_0, 3, Route18BattleText1, Route18EndBattleText1, Route18AfterBattleText1
 Route18TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_18_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_18_TRAINER_1
-	dw Route18BattleText2 ; TextBeforeBattle
-	dw Route18AfterBattleText2 ; TextAfterBattle
-	dw Route18EndBattleText2 ; TextEndBattle
-	dw Route18EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_18_TRAINER_1, 3, Route18BattleText2, Route18EndBattleText2, Route18AfterBattleText2
 Route18TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_18_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_18_TRAINER_2
-	dw Route18BattleText3 ; TextBeforeBattle
-	dw Route18AfterBattleText3 ; TextAfterBattle
-	dw Route18EndBattleText3 ; TextEndBattle
-	dw Route18EndBattleText3 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_18_TRAINER_2, 4, Route18BattleText3, Route18EndBattleText3, Route18AfterBattleText3
+	db -1 ; end
 
 Route18Text1:
 	text_asm
--- a/scripts/Route19.asm
+++ b/scripts/Route19.asm
@@ -26,96 +26,26 @@
 	dw Route19Text11
 
 Route19TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_0
-	dw Route19BattleText1 ; TextBeforeBattle
-	dw Route19AfterBattleText1 ; TextAfterBattle
-	dw Route19EndBattleText1 ; TextEndBattle
-	dw Route19EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_19_TRAINER_0, 4, Route19BattleText1, Route19EndBattleText1, Route19AfterBattleText1
 Route19TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_1
-	dw Route19BattleText2 ; TextBeforeBattle
-	dw Route19AfterBattleText2 ; TextAfterBattle
-	dw Route19EndBattleText2 ; TextEndBattle
-	dw Route19EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_19_TRAINER_1, 3, Route19BattleText2, Route19EndBattleText2, Route19AfterBattleText2
 Route19TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_2
-	dw Route19BattleText3 ; TextBeforeBattle
-	dw Route19AfterBattleText3 ; TextAfterBattle
-	dw Route19EndBattleText3 ; TextEndBattle
-	dw Route19EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_19_TRAINER_2, 3, Route19BattleText3, Route19EndBattleText3, Route19AfterBattleText3
 Route19TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_3
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_3
-	dw Route19BattleText4 ; TextBeforeBattle
-	dw Route19AfterBattleText4 ; TextAfterBattle
-	dw Route19EndBattleText4 ; TextEndBattle
-	dw Route19EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_19_TRAINER_3, 4, Route19BattleText4, Route19EndBattleText4, Route19AfterBattleText4
 Route19TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_4
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_4
-	dw Route19BattleText5 ; TextBeforeBattle
-	dw Route19AfterBattleText5 ; TextAfterBattle
-	dw Route19EndBattleText5 ; TextEndBattle
-	dw Route19EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_19_TRAINER_4, 4, Route19BattleText5, Route19EndBattleText5, Route19AfterBattleText5
 Route19TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_5
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_5
-	dw Route19BattleText6 ; TextBeforeBattle
-	dw Route19AfterBattleText6 ; TextAfterBattle
-	dw Route19EndBattleText6 ; TextEndBattle
-	dw Route19EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_19_TRAINER_5, 4, Route19BattleText6, Route19EndBattleText6, Route19AfterBattleText6
 Route19TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_6
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_6
-	dw Route19BattleText7 ; TextBeforeBattle
-	dw Route19AfterBattleText7 ; TextAfterBattle
-	dw Route19EndBattleText7 ; TextEndBattle
-	dw Route19EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_19_TRAINER_6, 3, Route19BattleText7, Route19EndBattleText7, Route19AfterBattleText7
 Route19TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_7, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_7, 1
-	dw Route19BattleText8 ; TextBeforeBattle
-	dw Route19AfterBattleText8 ; TextAfterBattle
-	dw Route19EndBattleText8 ; TextEndBattle
-	dw Route19EndBattleText8 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_19_TRAINER_7, 1, 4, Route19BattleText8, Route19EndBattleText8, Route19AfterBattleText8
 Route19TrainerHeader8:
-	dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_8, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_8, 1
-	dw Route19BattleText9 ; TextBeforeBattle
-	dw Route19AfterBattleText9 ; TextAfterBattle
-	dw Route19EndBattleText9 ; TextEndBattle
-	dw Route19EndBattleText9 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_19_TRAINER_8, 1, 4, Route19BattleText9, Route19EndBattleText9, Route19AfterBattleText9
 Route19TrainerHeader9:
-	dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_9, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_9, 1
-	dw Route19BattleText10 ; TextBeforeBattle
-	dw Route19AfterBattleText10 ; TextAfterBattle
-	dw Route19EndBattleText10 ; TextEndBattle
-	dw Route19EndBattleText10 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_19_TRAINER_9, 1, 4, Route19BattleText10, Route19EndBattleText10, Route19AfterBattleText10
+	db -1 ; end
 
 Route19Text1:
 	text_asm
--- a/scripts/Route20.asm
+++ b/scripts/Route20.asm
@@ -76,96 +76,26 @@
 	dw Route20Text12
 
 Route20TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_0
-	dw Route20BattleText1 ; TextBeforeBattle
-	dw Route20AfterBattleText1 ; TextAfterBattle
-	dw Route20EndBattleText1 ; TextEndBattle
-	dw Route20EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_20_TRAINER_0, 4, Route20BattleText1, Route20EndBattleText1, Route20AfterBattleText1
 Route20TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_1
-	dw Route20BattleText2 ; TextBeforeBattle
-	dw Route20AfterBattleText2 ; TextAfterBattle
-	dw Route20EndBattleText2 ; TextEndBattle
-	dw Route20EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_20_TRAINER_1, 4, Route20BattleText2, Route20EndBattleText2, Route20AfterBattleText2
 Route20TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_2
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_2
-	dw Route20BattleText3 ; TextBeforeBattle
-	dw Route20AfterBattleText3 ; TextAfterBattle
-	dw Route20EndBattleText3 ; TextEndBattle
-	dw Route20EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_20_TRAINER_2, 2, Route20BattleText3, Route20EndBattleText3, Route20AfterBattleText3
 Route20TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_3
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_3
-	dw Route20BattleText4 ; TextBeforeBattle
-	dw Route20AfterBattleText4 ; TextAfterBattle
-	dw Route20EndBattleText4 ; TextEndBattle
-	dw Route20EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_20_TRAINER_3, 4, Route20BattleText4, Route20EndBattleText4, Route20AfterBattleText4
 Route20TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_4
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_4
-	dw Route20BattleText5 ; TextBeforeBattle
-	dw Route20AfterBattleText5 ; TextAfterBattle
-	dw Route20EndBattleText5 ; TextEndBattle
-	dw Route20EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_20_TRAINER_4, 3, Route20BattleText5, Route20EndBattleText5, Route20AfterBattleText5
 Route20TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_5
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_5
-	dw Route20BattleText6 ; TextBeforeBattle
-	dw Route20AfterBattleText6 ; TextAfterBattle
-	dw Route20EndBattleText6 ; TextEndBattle
-	dw Route20EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_20_TRAINER_5, 4, Route20BattleText6, Route20EndBattleText6, Route20AfterBattleText6
 Route20TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_6
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_6
-	dw Route20BattleText7 ; TextBeforeBattle
-	dw Route20AfterBattleText7 ; TextAfterBattle
-	dw Route20EndBattleText7 ; TextEndBattle
-	dw Route20EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_20_TRAINER_6, 2, Route20BattleText7, Route20EndBattleText7, Route20AfterBattleText7
 Route20TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_7, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_7, 1
-	dw Route20BattleText8 ; TextBeforeBattle
-	dw Route20AfterBattleText8 ; TextAfterBattle
-	dw Route20EndBattleText8 ; TextEndBattle
-	dw Route20EndBattleText8 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_20_TRAINER_7, 1, 4, Route20BattleText8, Route20EndBattleText8, Route20AfterBattleText8
 Route20TrainerHeader8:
-	dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_8, 1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_8, 1
-	dw Route20BattleText9 ; TextBeforeBattle
-	dw Route20AfterBattleText9 ; TextAfterBattle
-	dw Route20EndBattleText9 ; TextEndBattle
-	dw Route20EndBattleText9 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_20_TRAINER_8, 1, 3, Route20BattleText9, Route20EndBattleText9, Route20AfterBattleText9
 Route20TrainerHeader9:
-	dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_9, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_9, 1
-	dw Route20BattleText10 ; TextBeforeBattle
-	dw Route20AfterBattleText10 ; TextAfterBattle
-	dw Route20EndBattleText10 ; TextEndBattle
-	dw Route20EndBattleText10 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_20_TRAINER_9, 1, 4, Route20BattleText10, Route20EndBattleText10, Route20AfterBattleText10
+	db -1 ; end
 
 Route20Text1:
 	text_asm
--- a/scripts/Route21.asm
+++ b/scripts/Route21.asm
@@ -24,87 +24,24 @@
 	dw Route21Text9
 
 Route21TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_0
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_0
-	dw Route21BattleText1 ; TextBeforeBattle
-	dw Route21AfterBattleText1 ; TextAfterBattle
-	dw Route21EndBattleText1 ; TextEndBattle
-	dw Route21EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_21_TRAINER_0, 0, Route21BattleText1, Route21EndBattleText1, Route21AfterBattleText1
 Route21TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_1
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_1
-	dw Route21BattleText2 ; TextBeforeBattle
-	dw Route21AfterBattleText2 ; TextAfterBattle
-	dw Route21EndBattleText2 ; TextEndBattle
-	dw Route21EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_21_TRAINER_1, 0, Route21BattleText2, Route21EndBattleText2, Route21AfterBattleText2
 Route21TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_2
-	dw Route21BattleText3 ; TextBeforeBattle
-	dw Route21AfterBattleText3 ; TextAfterBattle
-	dw Route21EndBattleText3 ; TextEndBattle
-	dw Route21EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_21_TRAINER_2, 4, Route21BattleText3, Route21EndBattleText3, Route21AfterBattleText3
 Route21TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_3
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_3
-	dw Route21BattleText4 ; TextBeforeBattle
-	dw Route21AfterBattleText4 ; TextAfterBattle
-	dw Route21EndBattleText4 ; TextEndBattle
-	dw Route21EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_21_TRAINER_3, 4, Route21BattleText4, Route21EndBattleText4, Route21AfterBattleText4
 Route21TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_4
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_4
-	dw Route21BattleText5 ; TextBeforeBattle
-	dw Route21AfterBattleText5 ; TextAfterBattle
-	dw Route21EndBattleText5 ; TextEndBattle
-	dw Route21EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_21_TRAINER_4, 4, Route21BattleText5, Route21EndBattleText5, Route21AfterBattleText5
 Route21TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_5
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_5
-	dw Route21BattleText6 ; TextBeforeBattle
-	dw Route21AfterBattleText6 ; TextAfterBattle
-	dw Route21EndBattleText6 ; TextEndBattle
-	dw Route21EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_21_TRAINER_5, 4, Route21BattleText6, Route21EndBattleText6, Route21AfterBattleText6
 Route21TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_6
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_6
-	dw Route21BattleText7 ; TextBeforeBattle
-	dw Route21AfterBattleText7 ; TextAfterBattle
-	dw Route21EndBattleText7 ; TextEndBattle
-	dw Route21EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_21_TRAINER_6, 3, Route21BattleText7, Route21EndBattleText7, Route21AfterBattleText7
 Route21TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_7, 1
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_7, 1
-	dw Route21BattleText8 ; TextBeforeBattle
-	dw Route21AfterBattleText8 ; TextAfterBattle
-	dw Route21EndBattleText8 ; TextEndBattle
-	dw Route21EndBattleText8 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_21_TRAINER_7, 1, 0, Route21BattleText8, Route21EndBattleText8, Route21AfterBattleText8
 Route21TrainerHeader8:
-	dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_8, 1
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_8, 1
-	dw Route21BattleText9 ; TextBeforeBattle
-	dw Route21AfterBattleText9 ; TextAfterBattle
-	dw Route21EndBattleText9 ; TextEndBattle
-	dw Route21EndBattleText9 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_21_TRAINER_8, 1, 0, Route21BattleText9, Route21EndBattleText9, Route21AfterBattleText9
+	db -1 ; end
 
 Route21Text1:
 	text_asm
--- a/scripts/Route24.asm
+++ b/scripts/Route24.asm
@@ -86,60 +86,18 @@
 	dw PickUpItemText
 
 Route24TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_0
-	dw Route24BattleText1 ; TextBeforeBattle
-	dw Route24AfterBattleText1 ; TextAfterBattle
-	dw Route24EndBattleText1 ; TextEndBattle
-	dw Route24EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_24_TRAINER_0, 4, Route24BattleText1, Route24EndBattleText1, Route24AfterBattleText1
 Route24TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_1
-	db ($1 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_1
-	dw Route24BattleText2 ; TextBeforeBattle
-	dw Route24AfterBattleText2 ; TextAfterBattle
-	dw Route24EndBattleText2 ; TextEndBattle
-	dw Route24EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_24_TRAINER_1, 1, Route24BattleText2, Route24EndBattleText2, Route24AfterBattleText2
 Route24TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_2
-	db ($1 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_2
-	dw Route24BattleText3 ; TextBeforeBattle
-	dw Route24AfterBattleText3 ; TextAfterBattle
-	dw Route24EndBattleText3 ; TextEndBattle
-	dw Route24EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_24_TRAINER_2, 1, Route24BattleText3, Route24EndBattleText3, Route24AfterBattleText3
 Route24TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_3
-	db ($1 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_3
-	dw Route24BattleText4 ; TextBeforeBattle
-	dw Route24AfterBattleText4 ; TextAfterBattle
-	dw Route24EndBattleText4 ; TextEndBattle
-	dw Route24EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_24_TRAINER_3, 1, Route24BattleText4, Route24EndBattleText4, Route24AfterBattleText4
 Route24TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_4
-	db ($1 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_4
-	dw Route24BattleText5 ; TextBeforeBattle
-	dw Route24AfterBattleText5 ; TextAfterBattle
-	dw Route24EndBattleText5 ; TextEndBattle
-	dw Route24EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_24_TRAINER_4, 1, Route24BattleText5, Route24EndBattleText5, Route24AfterBattleText5
 Route24TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_5
-	db ($1 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_5
-	dw Route24BattleText6 ; TextBeforeBattle
-	dw Route24AfterBattleText6 ; TextAfterBattle
-	dw Route24EndBattleText6 ; TextEndBattle
-	dw Route24EndBattleText6 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_24_TRAINER_5, 1, Route24BattleText6, Route24EndBattleText6, Route24AfterBattleText6
+	db -1 ; end
 
 Route24Text1:
 	text_asm
--- a/scripts/Route25.asm
+++ b/scripts/Route25.asm
@@ -54,87 +54,24 @@
 	dw Route25Text11
 
 Route25TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_0
-	dw Route25BattleText1 ; TextBeforeBattle
-	dw Route25AfterBattleText1 ; TextAfterBattle
-	dw Route25EndBattleText1 ; TextEndBattle
-	dw Route25EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_25_TRAINER_0, 2, Route25BattleText1, Route25EndBattleText1, Route25AfterBattleText1
 Route25TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_1
-	dw Route25BattleText2 ; TextBeforeBattle
-	dw Route25AfterBattleText2 ; TextAfterBattle
-	dw Route25EndBattleText2 ; TextEndBattle
-	dw Route25EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_25_TRAINER_1, 3, Route25BattleText2, Route25EndBattleText2, Route25AfterBattleText2
 Route25TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_2
-	dw Route25BattleText3 ; TextBeforeBattle
-	dw Route25AfterBattleText3 ; TextAfterBattle
-	dw Route25EndBattleText3 ; TextEndBattle
-	dw Route25EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_25_TRAINER_2, 3, Route25BattleText3, Route25EndBattleText3, Route25AfterBattleText3
 Route25TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_3
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_3
-	dw Route25BattleText4 ; TextBeforeBattle
-	dw Route25AfterBattleText4 ; TextAfterBattle
-	dw Route25EndBattleText4 ; TextEndBattle
-	dw Route25EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_25_TRAINER_3, 2, Route25BattleText4, Route25EndBattleText4, Route25AfterBattleText4
 Route25TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_4
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_4
-	dw Route25BattleText5 ; TextBeforeBattle
-	dw Route25AfterBattleText5 ; TextAfterBattle
-	dw Route25EndBattleText5 ; TextEndBattle
-	dw Route25EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_25_TRAINER_4, 4, Route25BattleText5, Route25EndBattleText5, Route25AfterBattleText5
 Route25TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_5
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_5
-	dw Route25BattleText6 ; TextBeforeBattle
-	dw Route25AfterBattleText6 ; TextAfterBattle
-	dw Route25EndBattleText6 ; TextEndBattle
-	dw Route25EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_25_TRAINER_5, 4, Route25BattleText6, Route25EndBattleText6, Route25AfterBattleText6
 Route25TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_6
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_6
-	dw Route25BattleText7 ; TextBeforeBattle
-	dw Route25AfterBattleText7 ; TextAfterBattle
-	dw Route25EndBattleText7 ; TextEndBattle
-	dw Route25EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_25_TRAINER_6, 3, Route25BattleText7, Route25EndBattleText7, Route25AfterBattleText7
 Route25TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_7, 1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_7, 1
-	dw Route25BattleText8 ; TextBeforeBattle
-	dw Route25AfterBattleText8 ; TextAfterBattle
-	dw Route25EndBattleText8 ; TextEndBattle
-	dw Route25EndBattleText8 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_25_TRAINER_7, 1, 2, Route25BattleText8, Route25EndBattleText8, Route25AfterBattleText8
 Route25TrainerHeader8:
-	dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_8, 1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_8, 1
-	dw Route25BattleText9 ; TextBeforeBattle
-	dw Route25AfterBattleText9 ; TextAfterBattle
-	dw Route25EndBattleText9 ; TextEndBattle
-	dw Route25EndBattleText9 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_25_TRAINER_8, 1, 2, Route25BattleText9, Route25EndBattleText9, Route25AfterBattleText9
+	db -1 ; end
 
 Route25Text1:
 	text_asm
--- a/scripts/Route3.asm
+++ b/scripts/Route3.asm
@@ -25,78 +25,22 @@
 	dw Route3Text10
 
 Route3TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_0
-	dw Route3BattleText1 ; TextBeforeBattle
-	dw Route3AfterBattleText1 ; TextAfterBattle
-	dw Route3EndBattleText1 ; TextEndBattle
-	dw Route3EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_3_TRAINER_0, 2, Route3BattleText1, Route3EndBattleText1, Route3AfterBattleText1
 Route3TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_1
-	dw Route3BattleText2 ; TextBeforeBattle
-	dw Route3AfterBattleText2 ; TextAfterBattle
-	dw Route3EndBattleText2 ; TextEndBattle
-	dw Route3EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_3_TRAINER_1, 3, Route3BattleText2, Route3EndBattleText2, Route3AfterBattleText2
 Route3TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_2
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_2
-	dw Route3BattleText3 ; TextBeforeBattle
-	dw Route3AfterBattleText3 ; TextAfterBattle
-	dw Route3EndBattleText3 ; TextEndBattle
-	dw Route3EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_3_TRAINER_2, 2, Route3BattleText3, Route3EndBattleText3, Route3AfterBattleText3
 Route3TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_3
-	db ($1 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_3
-	dw Route3BattleText4 ; TextBeforeBattle
-	dw Route3AfterBattleText4 ; TextAfterBattle
-	dw Route3EndBattleText4 ; TextEndBattle
-	dw Route3EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_3_TRAINER_3, 1, Route3BattleText4, Route3EndBattleText4, Route3AfterBattleText4
 Route3TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_4
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_4
-	dw Route3BattleText5 ; TextBeforeBattle
-	dw Route3AfterBattleText5 ; TextAfterBattle
-	dw Route3EndBattleText5 ; TextEndBattle
-	dw Route3EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_3_TRAINER_4, 4, Route3BattleText5, Route3EndBattleText5, Route3AfterBattleText5
 Route3TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_5
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_5
-	dw Route3BattleText6 ; TextBeforeBattle
-	dw Route3AfterBattleText6 ; TextAfterBattle
-	dw Route3EndBattleText6 ; TextEndBattle
-	dw Route3EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_3_TRAINER_5, 3, Route3BattleText6, Route3EndBattleText6, Route3AfterBattleText6
 Route3TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_6, 1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_6, 1
-	dw Route3BattleText7 ; TextBeforeBattle
-	dw Route3AfterBattleText7 ; TextAfterBattle
-	dw Route3EndBattleText7 ; TextEndBattle
-	dw Route3EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_3_TRAINER_6, 1, 3, Route3BattleText7, Route3EndBattleText7, Route3AfterBattleText7
 Route3TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_7, 1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_7, 1
-	dw Route3BattleText8 ; TextBeforeBattle
-	dw Route3AfterBattleText8 ; TextAfterBattle
-	dw Route3EndBattleText8 ; TextEndBattle
-	dw Route3EndBattleText8 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_3_TRAINER_7, 1, 2, Route3BattleText8, Route3EndBattleText8, Route3AfterBattleText8
+	db -1 ; end
 
 Route3Text1:
 	text_far _Route3Text1
--- a/scripts/Route4.asm
+++ b/scripts/Route4.asm
@@ -21,15 +21,8 @@
 	dw Route4Text6
 
 Route4TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_4_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_4_TRAINER_0
-	dw Route4BattleText1 ; TextBeforeBattle
-	dw Route4AfterBattleText1 ; TextAfterBattle
-	dw Route4EndBattleText1 ; TextEndBattle
-	dw Route4EndBattleText1 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_4_TRAINER_0, 3, Route4BattleText1, Route4EndBattleText1, Route4AfterBattleText1
+	db -1 ; end
 
 Route4Text1:
 	text_far _Route4Text1
--- a/scripts/Route6.asm
+++ b/scripts/Route6.asm
@@ -22,60 +22,18 @@
 	dw Route6Text7
 
 Route6TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_0
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_0
-	dw Route6BattleText1 ; TextBeforeBattle
-	dw Route6AfterBattleText1 ; TextAfterBattle
-	dw Route6EndBattleText1 ; TextEndBattle
-	dw Route6EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_6_TRAINER_0, 0, Route6BattleText1, Route6EndBattleText1, Route6AfterBattleText1
 Route6TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_1
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_1
-	dw Route6BattleText2 ; TextBeforeBattle
-	dw Route6AfterBattleText1 ; TextAfterBattle
-	dw Route6EndBattleText2 ; TextEndBattle
-	dw Route6EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_6_TRAINER_1, 0, Route6BattleText2, Route6EndBattleText2, Route6AfterBattleText1
 Route6TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_2
-	dw Route6BattleText3 ; TextBeforeBattle
-	dw Route6AfterBattleText3 ; TextAfterBattle
-	dw Route6EndBattleText3 ; TextEndBattle
-	dw Route6EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_6_TRAINER_2, 4, Route6BattleText3, Route6EndBattleText3, Route6AfterBattleText3
 Route6TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_3
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_3
-	dw Route6BattleText4 ; TextBeforeBattle
-	dw Route6AfterBattleText4 ; TextAfterBattle
-	dw Route6EndBattleText4 ; TextEndBattle
-	dw Route6EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_6_TRAINER_3, 3, Route6BattleText4, Route6EndBattleText4, Route6AfterBattleText4
 Route6TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_4
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_4
-	dw Route6BattleText5 ; TextBeforeBattle
-	dw Route6AfterBattleText5 ; TextAfterBattle
-	dw Route6EndBattleText5 ; TextEndBattle
-	dw Route6EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_6_TRAINER_4, 3, Route6BattleText5, Route6EndBattleText5, Route6AfterBattleText5
 Route6TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_5
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_5
-	dw Route6BattleText6 ; TextBeforeBattle
-	dw Route6AfterBattleText6 ; TextAfterBattle
-	dw Route6EndBattleText6 ; TextEndBattle
-	dw Route6EndBattleText6 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_6_TRAINER_5, 3, Route6BattleText6, Route6EndBattleText6, Route6AfterBattleText6
+	db -1 ; end
 
 Route6Text1:
 	text_asm
--- a/scripts/Route8.asm
+++ b/scripts/Route8.asm
@@ -25,87 +25,24 @@
 	dw Route8Text10
 
 Route8TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_0
-	dw Route8BattleText1 ; TextBeforeBattle
-	dw Route8AfterBattleText1 ; TextAfterBattle
-	dw Route8EndBattleText1 ; TextEndBattle
-	dw Route8EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_8_TRAINER_0, 4, Route8BattleText1, Route8EndBattleText1, Route8AfterBattleText1
 Route8TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_1
-	dw Route8BattleText2 ; TextBeforeBattle
-	dw Route8AfterBattleText2 ; TextAfterBattle
-	dw Route8EndBattleText2 ; TextEndBattle
-	dw Route8EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_8_TRAINER_1, 4, Route8BattleText2, Route8EndBattleText2, Route8AfterBattleText2
 Route8TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_2
-	dw Route8BattleText3 ; TextBeforeBattle
-	dw Route8AfterBattleText3 ; TextAfterBattle
-	dw Route8EndBattleText3 ; TextEndBattle
-	dw Route8EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_8_TRAINER_2, 4, Route8BattleText3, Route8EndBattleText3, Route8AfterBattleText3
 Route8TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_3
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_3
-	dw Route8BattleText4 ; TextBeforeBattle
-	dw Route8AfterBattleText4 ; TextAfterBattle
-	dw Route8EndBattleText4 ; TextEndBattle
-	dw Route8EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_8_TRAINER_3, 2, Route8BattleText4, Route8EndBattleText4, Route8AfterBattleText4
 Route8TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_4
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_4
-	dw Route8BattleText5 ; TextBeforeBattle
-	dw Route8AfterBattleText5 ; TextAfterBattle
-	dw Route8EndBattleText5 ; TextEndBattle
-	dw Route8EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_8_TRAINER_4, 3, Route8BattleText5, Route8EndBattleText5, Route8AfterBattleText5
 Route8TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_5
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_5
-	dw Route8BattleText6 ; TextBeforeBattle
-	dw Route8AfterBattleText6 ; TextAfterBattle
-	dw Route8EndBattleText6 ; TextEndBattle
-	dw Route8EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_8_TRAINER_5, 3, Route8BattleText6, Route8EndBattleText6, Route8AfterBattleText6
 Route8TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_6
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_6
-	dw Route8BattleText7 ; TextBeforeBattle
-	dw Route8AfterBattleText7 ; TextAfterBattle
-	dw Route8EndBattleText7 ; TextEndBattle
-	dw Route8EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_8_TRAINER_6, 2, Route8BattleText7, Route8EndBattleText7, Route8AfterBattleText7
 Route8TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_7, 1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_7, 1
-	dw Route8BattleText8 ; TextBeforeBattle
-	dw Route8AfterBattleText8 ; TextAfterBattle
-	dw Route8EndBattleText8 ; TextEndBattle
-	dw Route8EndBattleText8 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_8_TRAINER_7, 1, 2, Route8BattleText8, Route8EndBattleText8, Route8AfterBattleText8
 Route8TrainerHeader8:
-	dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_8, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_8, 1
-	dw Route8BattleText9 ; TextBeforeBattle
-	dw Route8AfterBattleText9 ; TextAfterBattle
-	dw Route8EndBattleText9 ; TextEndBattle
-	dw Route8EndBattleText9 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_8_TRAINER_8, 1, 4, Route8BattleText9, Route8EndBattleText9, Route8AfterBattleText9
+	db -1 ; end
 
 Route8Text1:
 	text_asm
--- a/scripts/Route9.asm
+++ b/scripts/Route9.asm
@@ -26,87 +26,24 @@
 	dw Route9Text11
 
 Route9TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_0
-	dw Route9BattleText1 ; TextBeforeBattle
-	dw Route9AfterBattleText1 ; TextAfterBattle
-	dw Route9EndBattleText1 ; TextEndBattle
-	dw Route9EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_9_TRAINER_0, 3, Route9BattleText1, Route9EndBattleText1, Route9AfterBattleText1
 Route9TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_1
-	dw Route9BattleText2 ; TextBeforeBattle
-	dw Route9AfterBattleText2 ; TextAfterBattle
-	dw Route9EndBattleText2 ; TextEndBattle
-	dw Route9EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_9_TRAINER_1, 2, Route9BattleText2, Route9EndBattleText2, Route9AfterBattleText2
 Route9TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_2
-	dw Route9BattleText3 ; TextBeforeBattle
-	dw Route9AfterBattleText3 ; TextAfterBattle
-	dw Route9EndBattleText3 ; TextEndBattle
-	dw Route9EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_9_TRAINER_2, 4, Route9BattleText3, Route9EndBattleText3, Route9AfterBattleText3
 Route9TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_3
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_3
-	dw Route9BattleText4 ; TextBeforeBattle
-	dw Route9AfterBattleText4 ; TextAfterBattle
-	dw Route9EndBattleText4 ; TextEndBattle
-	dw Route9EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_9_TRAINER_3, 2, Route9BattleText4, Route9EndBattleText4, Route9AfterBattleText4
 Route9TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_4
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_4
-	dw Route9BattleText5 ; TextBeforeBattle
-	dw Route9AfterBattleText5 ; TextAfterBattle
-	dw Route9EndBattleText5 ; TextEndBattle
-	dw Route9EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_9_TRAINER_4, 2, Route9BattleText5, Route9EndBattleText5, Route9AfterBattleText5
 Route9TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_5
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_5
-	dw Route9BattleText6 ; TextBeforeBattle
-	dw Route9AfterBattleText6 ; TextAfterBattle
-	dw Route9EndBattleText6 ; TextEndBattle
-	dw Route9EndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_9_TRAINER_5, 3, Route9BattleText6, Route9EndBattleText6, Route9AfterBattleText6
 Route9TrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_6
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_6
-	dw Route9BattleText7 ; TextBeforeBattle
-	dw Route9AfterBattleText7 ; TextAfterBattle
-	dw Route9EndBattleText7 ; TextEndBattle
-	dw Route9EndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_9_TRAINER_6, 4, Route9BattleText7, Route9EndBattleText7, Route9AfterBattleText7
 Route9TrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_7, 1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_7, 1
-	dw Route9BattleText8 ; TextBeforeBattle
-	dw Route9AfterBattleText8 ; TextAfterBattle
-	dw Route9EndBattleText8 ; TextEndBattle
-	dw Route9EndBattleText8 ; TextEndBattle
-
+	trainer EVENT_BEAT_ROUTE_9_TRAINER_7, 1, 2, Route9BattleText8, Route9EndBattleText8, Route9AfterBattleText8
 Route9TrainerHeader8:
-	dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_8, 1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_8, 1
-	dw Route9BattleText9 ; TextBeforeBattle
-	dw Route9AfterBattleText9 ; TextAfterBattle
-	dw Route9EndBattleText9 ; TextEndBattle
-	dw Route9EndBattleText9 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ROUTE_9_TRAINER_8, 1, 2, Route9BattleText9, Route9EndBattleText9, Route9AfterBattleText9
+	db -1 ; end
 
 Route9Text1:
 	text_asm
--- a/scripts/SSAnne1FRooms.asm
+++ b/scripts/SSAnne1FRooms.asm
@@ -26,42 +26,14 @@
 	dw SSAnne8Text11
 
 SSAnne8TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_0
-	dw SSAnne8BattleText1 ; TextBeforeBattle
-	dw SSAnne8AfterBattleText1 ; TextAfterBattle
-	dw SSAnne8EndBattleText1 ; TextEndBattle
-	dw SSAnne8EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_SS_ANNE_8_TRAINER_0, 2, SSAnne8BattleText1, SSAnne8EndBattleText1, SSAnne8AfterBattleText1
 SSAnne8TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_1
-	dw SSAnne8BattleText2 ; TextBeforeBattle
-	dw SSAnne8AfterBattleText2 ; TextAfterBattle
-	dw SSAnne8EndBattleText2 ; TextEndBattle
-	dw SSAnne8EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_SS_ANNE_8_TRAINER_1, 3, SSAnne8BattleText2, SSAnne8EndBattleText2, SSAnne8AfterBattleText2
 SSAnne8TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_2
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_2
-	dw SSAnne8BattleText3 ; TextBeforeBattle
-	dw SSAnne8AfterBattleText3 ; TextAfterBattle
-	dw SSAnne8EndBattleText3 ; TextEndBattle
-	dw SSAnne8EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_SS_ANNE_8_TRAINER_2, 2, SSAnne8BattleText3, SSAnne8EndBattleText3, SSAnne8AfterBattleText3
 SSAnne8TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_3
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_3
-	dw SSAnne8BattleText4 ; TextBeforeBattle
-	dw SSAnne8AfterBattleText4 ; TextAfterBattle
-	dw SSAnne8EndBattleText4 ; TextEndBattle
-	dw SSAnne8EndBattleText4 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SS_ANNE_8_TRAINER_3, 2, SSAnne8BattleText4, SSAnne8EndBattleText4, SSAnne8AfterBattleText4
+	db -1 ; end
 
 SSAnne8Text1:
 	text_asm
--- a/scripts/SSAnne2FRooms.asm
+++ b/scripts/SSAnne2FRooms.asm
@@ -31,42 +31,14 @@
 	dw SSAnne9Text13
 
 SSAnne9TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_0
-	dw SSAnne9BattleText1 ; TextBeforeBattle
-	dw SSAnne9AfterBattleText1 ; TextAfterBattle
-	dw SSAnne9EndBattleText1 ; TextEndBattle
-	dw SSAnne9EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_SS_ANNE_9_TRAINER_0, 2, SSAnne9BattleText1, SSAnne9EndBattleText1, SSAnne9AfterBattleText1
 SSAnne9TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_1
-	dw SSAnne9BattleText2 ; TextBeforeBattle
-	dw SSAnne9AfterBattleText2 ; TextAfterBattle
-	dw SSAnne9EndBattleText2 ; TextEndBattle
-	dw SSAnne9EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_SS_ANNE_9_TRAINER_1, 3, SSAnne9BattleText2, SSAnne9EndBattleText2, SSAnne9AfterBattleText2
 SSAnne9TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_2
-	dw SSAnne9BattleText3 ; TextBeforeBattle
-	dw SSAnne9AfterBattleText3 ; TextAfterBattle
-	dw SSAnne9EndBattleText3 ; TextEndBattle
-	dw SSAnne9EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_SS_ANNE_9_TRAINER_2, 3, SSAnne9BattleText3, SSAnne9EndBattleText3, SSAnne9AfterBattleText3
 SSAnne9TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_3
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_3
-	dw SSAnne9BattleText4 ; TextBeforeBattle
-	dw SSAnne9AfterBattleText4 ; TextAfterBattle
-	dw SSAnne9EndBattleText4 ; TextEndBattle
-	dw SSAnne9EndBattleText4 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SS_ANNE_9_TRAINER_3, 2, SSAnne9BattleText4, SSAnne9EndBattleText4, SSAnne9AfterBattleText4
+	db -1 ; end
 
 SSAnne9Text1:
 	text_asm
--- a/scripts/SSAnneB1FRooms.asm
+++ b/scripts/SSAnneB1FRooms.asm
@@ -26,60 +26,18 @@
 	dw PickUpItemText
 
 SSAnne10TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_0
-	dw SSAnne10BattleText1 ; TextBeforeBattle
-	dw SSAnne10AfterBattleText1 ; TextAfterBattle
-	dw SSAnne10EndBattleText1 ; TextEndBattle
-	dw SSAnne10EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_SS_ANNE_10_TRAINER_0, 2, SSAnne10BattleText1, SSAnne10EndBattleText1, SSAnne10AfterBattleText1
 SSAnne10TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_1
-	dw SSAnne10BattleText2 ; TextBeforeBattle
-	dw SSAnne10AfterBattleText2 ; TextAfterBattle
-	dw SSAnne10EndBattleText2 ; TextEndBattle
-	dw SSAnne10EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_SS_ANNE_10_TRAINER_1, 3, SSAnne10BattleText2, SSAnne10EndBattleText2, SSAnne10AfterBattleText2
 SSAnne10TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_2
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_2
-	dw SSAnne10BattleText3 ; TextBeforeBattle
-	dw SSAnne10AfterBattleText3 ; TextAfterBattle
-	dw SSAnne10EndBattleText3 ; TextEndBattle
-	dw SSAnne10EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_SS_ANNE_10_TRAINER_2, 2, SSAnne10BattleText3, SSAnne10EndBattleText3, SSAnne10AfterBattleText3
 SSAnne10TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_3
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_3
-	dw SSAnne10BattleText4 ; TextBeforeBattle
-	dw SSAnne10AfterBattleText4 ; TextAfterBattle
-	dw SSAnne10EndBattleText4 ; TextEndBattle
-	dw SSAnne10EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_SS_ANNE_10_TRAINER_3, 2, SSAnne10BattleText4, SSAnne10EndBattleText4, SSAnne10AfterBattleText4
 SSAnne10TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_4
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_4
-	dw SSAnne10BattleText5 ; TextBeforeBattle
-	dw SSAnne10AfterBattleText5 ; TextAfterBattle
-	dw SSAnne10EndBattleText5 ; TextEndBattle
-	dw SSAnne10EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_SS_ANNE_10_TRAINER_4, 2, SSAnne10BattleText5, SSAnne10EndBattleText5, SSAnne10AfterBattleText5
 SSAnne10TrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_5
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_5
-	dw SSAnne10BattleText6 ; TextBeforeBattle
-	dw SSAnne10AfterBattleText6 ; TextAfterBattle
-	dw SSAnne10EndBattleText6 ; TextEndBattle
-	dw SSAnne10EndBattleText6 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SS_ANNE_10_TRAINER_5, 3, SSAnne10BattleText6, SSAnne10EndBattleText6, SSAnne10AfterBattleText6
+	db -1 ; end
 
 SSAnne10Text1:
 	text_asm
--- a/scripts/SSAnneBow.asm
+++ b/scripts/SSAnneBow.asm
@@ -20,24 +20,10 @@
 	dw SSAnne5Text5
 
 SSAnne5TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_5_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_5_TRAINER_0
-	dw SSAnne5BattleText1 ; TextBeforeBattle
-	dw SSAnne5AfterBattleText1 ; TextAfterBattle
-	dw SSAnne5EndBattleText1 ; TextEndBattle
-	dw SSAnne5EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_SS_ANNE_5_TRAINER_0, 3, SSAnne5BattleText1, SSAnne5EndBattleText1, SSAnne5AfterBattleText1
 SSAnne5TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SS_ANNE_5_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SS_ANNE_5_TRAINER_1
-	dw SSAnne5BattleText2 ; TextBeforeBattle
-	dw SSAnne5AfterBattleText2 ; TextAfterBattle
-	dw SSAnne5EndBattleText2 ; TextEndBattle
-	dw SSAnne5EndBattleText2 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SS_ANNE_5_TRAINER_1, 3, SSAnne5BattleText2, SSAnne5EndBattleText2, SSAnne5AfterBattleText2
+	db -1 ; end
 
 SSAnne5Text1:
 	text_far _SSAnne5Text1
--- a/scripts/SaffronGym.asm
+++ b/scripts/SaffronGym.asm
@@ -85,69 +85,20 @@
 	dw SaffronGymText12
 
 SaffronGymTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_0
-	dw SaffronGymBattleText1 ; TextBeforeBattle
-	dw SaffronGymAfterBattleText1 ; TextAfterBattle
-	dw SaffronGymEndBattleText1 ; TextEndBattle
-	dw SaffronGymEndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_SAFFRON_GYM_TRAINER_0, 3, SaffronGymBattleText1, SaffronGymEndBattleText1, SaffronGymAfterBattleText1
 SaffronGymTrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_1
-	dw SaffronGymBattleText2 ; TextBeforeBattle
-	dw SaffronGymAfterBattleText2 ; TextAfterBattle
-	dw SaffronGymEndBattleText2 ; TextEndBattle
-	dw SaffronGymEndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_SAFFRON_GYM_TRAINER_1, 3, SaffronGymBattleText2, SaffronGymEndBattleText2, SaffronGymAfterBattleText2
 SaffronGymTrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_2
-	dw SaffronGymBattleText3 ; TextBeforeBattle
-	dw SaffronGymAfterBattleText3 ; TextAfterBattle
-	dw SaffronGymEndBattleText3 ; TextEndBattle
-	dw SaffronGymEndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_SAFFRON_GYM_TRAINER_2, 3, SaffronGymBattleText3, SaffronGymEndBattleText3, SaffronGymAfterBattleText3
 SaffronGymTrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_3
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_3
-	dw SaffronGymBattleText4 ; TextBeforeBattle
-	dw SaffronGymAfterBattleText4 ; TextAfterBattle
-	dw SaffronGymEndBattleText4 ; TextEndBattle
-	dw SaffronGymEndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_SAFFRON_GYM_TRAINER_3, 3, SaffronGymBattleText4, SaffronGymEndBattleText4, SaffronGymAfterBattleText4
 SaffronGymTrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_4
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_4
-	dw SaffronGymBattleText5 ; TextBeforeBattle
-	dw SaffronGymAfterBattleText5 ; TextAfterBattle
-	dw SaffronGymEndBattleText5 ; TextEndBattle
-	dw SaffronGymEndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_SAFFRON_GYM_TRAINER_4, 3, SaffronGymBattleText5, SaffronGymEndBattleText5, SaffronGymAfterBattleText5
 SaffronGymTrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_5
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_5
-	dw SaffronGymBattleText6 ; TextBeforeBattle
-	dw SaffronGymAfterBattleText6 ; TextAfterBattle
-	dw SaffronGymEndBattleText6 ; TextEndBattle
-	dw SaffronGymEndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_SAFFRON_GYM_TRAINER_5, 3, SaffronGymBattleText6, SaffronGymEndBattleText6, SaffronGymAfterBattleText6
 SaffronGymTrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_6, 1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_6, 1
-	dw SaffronGymBattleText7 ; TextBeforeBattle
-	dw SaffronGymAfterBattleText7 ; TextAfterBattle
-	dw SaffronGymEndBattleText7 ; TextEndBattle
-	dw SaffronGymEndBattleText7 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SAFFRON_GYM_TRAINER_6, 1, 3, SaffronGymBattleText7, SaffronGymEndBattleText7, SaffronGymAfterBattleText7
+	db -1 ; end
 
 SaffronGymText1:
 	text_asm
--- a/scripts/SeafoamIslandsB4F.asm
+++ b/scripts/SeafoamIslandsB4F.asm
@@ -138,15 +138,8 @@
 	dw SeafoamIslands5Text5
 
 ArticunoTrainerHeader:
-	dbEventFlagBit EVENT_BEAT_ARTICUNO
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_ARTICUNO
-	dw ArticunoBattleText ; TextBeforeBattle
-	dw ArticunoBattleText ; TextAfterBattle
-	dw ArticunoBattleText ; TextEndBattle
-	dw ArticunoBattleText ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_ARTICUNO, 0, ArticunoBattleText, ArticunoBattleText, ArticunoBattleText
+	db -1 ; end
 
 ArticunoText:
 	text_asm
--- a/scripts/SilphCo10F.asm
+++ b/scripts/SilphCo10F.asm
@@ -48,24 +48,10 @@
 	dw PickUpItemText
 
 SilphCo10TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_10F_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_10F_TRAINER_0
-	dw SilphCo10BattleText1 ; TextBeforeBattle
-	dw SilphCo10AfterBattleText1 ; TextAfterBattle
-	dw SilphCo10EndBattleText1 ; TextEndBattle
-	dw SilphCo10EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_10F_TRAINER_0, 3, SilphCo10BattleText1, SilphCo10EndBattleText1, SilphCo10AfterBattleText1
 SilphCo10TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_10F_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_10F_TRAINER_1
-	dw SilphCo10BattleText2 ; TextBeforeBattle
-	dw SilphCo10AfterBattleText2 ; TextAfterBattle
-	dw SilphCo10EndBattleText2 ; TextEndBattle
-	dw SilphCo10EndBattleText2 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SILPH_CO_10F_TRAINER_1, 4, SilphCo10BattleText2, SilphCo10EndBattleText2, SilphCo10AfterBattleText2
+	db -1 ; end
 
 SilphCo10Text1:
 	text_asm
--- a/scripts/SilphCo11F.asm
+++ b/scripts/SilphCo11F.asm
@@ -281,24 +281,10 @@
 	dw SilphCo11Text6
 
 SilphCo11TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_11F_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_11F_TRAINER_0
-	dw SilphCo11BattleText1 ; TextBeforeBattle
-	dw SilphCo11AfterBattleText1 ; TextAfterBattle
-	dw SilphCo11EndBattleText1 ; TextEndBattle
-	dw SilphCo11EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_11F_TRAINER_0, 4, SilphCo11BattleText1, SilphCo11EndBattleText1, SilphCo11AfterBattleText1
 SilphCo11TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_11F_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_11F_TRAINER_1
-	dw SilphCo11BattleText2 ; TextBeforeBattle
-	dw SilphCo11AfterBattleText2 ; TextAfterBattle
-	dw SilphCo11EndBattleText2 ; TextEndBattle
-	dw SilphCo11EndBattleText2 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SILPH_CO_11F_TRAINER_1, 3, SilphCo11BattleText2, SilphCo11EndBattleText2, SilphCo11AfterBattleText2
+	db -1 ; end
 
 SilphCo11Text1:
 	text_asm
--- a/scripts/SilphCo2F.asm
+++ b/scripts/SilphCo2F.asm
@@ -99,42 +99,14 @@
 	dw SilphCo2Text5
 
 SilphCo2TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_0
-	dw SilphCo2BattleText1 ; TextBeforeBattle
-	dw SilphCo2AfterBattleText1 ; TextAfterBattle
-	dw SilphCo2EndBattleText1 ; TextEndBattle
-	dw SilphCo2EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_2F_TRAINER_0, 3, SilphCo2BattleText1, SilphCo2EndBattleText1, SilphCo2AfterBattleText1
 SilphCo2TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_1
-	dw SilphCo2BattleText2 ; TextBeforeBattle
-	dw SilphCo2AfterBattleText2 ; TextAfterBattle
-	dw SilphCo2EndBattleText2 ; TextEndBattle
-	dw SilphCo2EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_2F_TRAINER_1, 4, SilphCo2BattleText2, SilphCo2EndBattleText2, SilphCo2AfterBattleText2
 SilphCo2TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_2
-	dw SilphCo2BattleText3 ; TextBeforeBattle
-	dw SilphCo2AfterBattleText3 ; TextAfterBattle
-	dw SilphCo2EndBattleText3 ; TextEndBattle
-	dw SilphCo2EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_2F_TRAINER_2, 3, SilphCo2BattleText3, SilphCo2EndBattleText3, SilphCo2AfterBattleText3
 SilphCo2TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_3
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_3
-	dw SilphCo2BattleText4 ; TextBeforeBattle
-	dw SilphCo2AfterBattleText4 ; TextAfterBattle
-	dw SilphCo2EndBattleText4 ; TextEndBattle
-	dw SilphCo2EndBattleText4 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SILPH_CO_2F_TRAINER_3, 3, SilphCo2BattleText4, SilphCo2EndBattleText4, SilphCo2AfterBattleText4
+	db -1 ; end
 
 SilphCo2Text1:
 	text_asm
--- a/scripts/SilphCo3F.asm
+++ b/scripts/SilphCo3F.asm
@@ -62,24 +62,10 @@
 	dw PickUpItemText
 
 SilphCo3TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_3F_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_3F_TRAINER_0
-	dw SilphCo3BattleText1 ; TextBeforeBattle
-	dw SilphCo3AfterBattleText1 ; TextAfterBattle
-	dw SilphCo3EndBattleText1 ; TextEndBattle
-	dw SilphCo3EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_3F_TRAINER_0, 2, SilphCo3BattleText1, SilphCo3EndBattleText1, SilphCo3AfterBattleText1
 SilphCo3TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_3F_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_3F_TRAINER_1
-	dw SilphCo3BattleText2 ; TextBeforeBattle
-	dw SilphCo3AfterBattleText2 ; TextAfterBattle
-	dw SilphCo3EndBattleText2 ; TextEndBattle
-	dw SilphCo3EndBattleText2 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SILPH_CO_3F_TRAINER_1, 3, SilphCo3BattleText2, SilphCo3EndBattleText2, SilphCo3AfterBattleText2
+	db -1 ; end
 
 SilphCo3Text1:
 	text_asm
--- a/scripts/SilphCo4F.asm
+++ b/scripts/SilphCo4F.asm
@@ -101,33 +101,12 @@
 	dw PickUpItemText
 
 SilphCo4TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_0
-	dw SilphCo4BattleText2 ; TextBeforeBattle
-	dw SilphCo4AfterBattleText2 ; TextAfterBattle
-	dw SilphCo4EndBattleText2 ; TextEndBattle
-	dw SilphCo4EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_4F_TRAINER_0, 4, SilphCo4BattleText2, SilphCo4EndBattleText2, SilphCo4AfterBattleText2
 SilphCo4TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_1
-	dw SilphCo4BattleText3 ; TextBeforeBattle
-	dw SilphCo4AfterBattleText3 ; TextAfterBattle
-	dw SilphCo4EndBattleText3 ; TextEndBattle
-	dw SilphCo4EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_4F_TRAINER_1, 3, SilphCo4BattleText3, SilphCo4EndBattleText3, SilphCo4AfterBattleText3
 SilphCo4TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_2
-	dw SilphCo4BattleText4 ; TextBeforeBattle
-	dw SilphCo4AfterBattleText4 ; TextAfterBattle
-	dw SilphCo4EndBattleText4 ; TextEndBattle
-	dw SilphCo4EndBattleText4 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SILPH_CO_4F_TRAINER_2, 4, SilphCo4BattleText4, SilphCo4EndBattleText4, SilphCo4AfterBattleText4
+	db -1 ; end
 
 SilphCo4Text1:
 	text_asm
--- a/scripts/SilphCo5F.asm
+++ b/scripts/SilphCo5F.asm
@@ -84,42 +84,14 @@
 	dw SilphCo5Text11
 
 SilphCo5TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_0
-	db ($1 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_0
-	dw SilphCo5BattleText2 ; TextBeforeBattle
-	dw SilphCo5AfterBattleText2 ; TextAfterBattle
-	dw SilphCo5EndBattleText2 ; TextEndBattle
-	dw SilphCo5EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_5F_TRAINER_0, 1, SilphCo5BattleText2, SilphCo5EndBattleText2, SilphCo5AfterBattleText2
 SilphCo5TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_1
-	dw SilphCo5BattleText3 ; TextBeforeBattle
-	dw SilphCo5AfterBattleText3 ; TextAfterBattle
-	dw SilphCo5EndBattleText3 ; TextEndBattle
-	dw SilphCo5EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_5F_TRAINER_1, 2, SilphCo5BattleText3, SilphCo5EndBattleText3, SilphCo5AfterBattleText3
 SilphCo5TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_2
-	dw SilphCo5BattleText4 ; TextBeforeBattle
-	dw SilphCo5AfterBattleText4 ; TextAfterBattle
-	dw SilphCo5EndBattleText4 ; TextEndBattle
-	dw SilphCo5EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_5F_TRAINER_2, 4, SilphCo5BattleText4, SilphCo5EndBattleText4, SilphCo5AfterBattleText4
 SilphCo5TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_3
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_3
-	dw SilphCo5BattleText5 ; TextBeforeBattle
-	dw SilphCo5AfterBattleText5 ; TextAfterBattle
-	dw SilphCo5EndBattleText5 ; TextEndBattle
-	dw SilphCo5EndBattleText5 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SILPH_CO_5F_TRAINER_3, 3, SilphCo5BattleText5, SilphCo5EndBattleText5, SilphCo5AfterBattleText5
+	db -1 ; end
 
 SilphCo5Text1:
 	text_asm
--- a/scripts/SilphCo6F.asm
+++ b/scripts/SilphCo6F.asm
@@ -52,33 +52,12 @@
 	dw PickUpItemText
 
 SilphCo6TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_6F_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_6F_TRAINER_0
-	dw SilphCo6BattleText2 ; TextBeforeBattle
-	dw SilphCo6AfterBattleText2 ; TextAfterBattle
-	dw SilphCo6EndBattleText2 ; TextEndBattle
-	dw SilphCo6EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_6F_TRAINER_0, 2, SilphCo6BattleText2, SilphCo6EndBattleText2, SilphCo6AfterBattleText2
 SilphCo6TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_6F_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_6F_TRAINER_1
-	dw SilphCo6BattleText3 ; TextBeforeBattle
-	dw SilphCo6AfterBattleText3 ; TextAfterBattle
-	dw SilphCo6EndBattleText3 ; TextEndBattle
-	dw SilphCo6EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_6F_TRAINER_1, 3, SilphCo6BattleText3, SilphCo6EndBattleText3, SilphCo6AfterBattleText3
 SilphCo6TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_6F_TRAINER_2, 1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_6F_TRAINER_2, 1
-	dw SilphCo6BattleText4 ; TextBeforeBattle
-	dw SilphCo6AfterBattleText4 ; TextAfterBattle
-	dw SilphCo6EndBattleText4 ; TextEndBattle
-	dw SilphCo6EndBattleText4 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SILPH_CO_6F_TRAINER_2, 1, 2, SilphCo6BattleText4, SilphCo6EndBattleText4, SilphCo6AfterBattleText4
+	db -1 ; end
 
 SilphCo6Script_1a22f:
 	CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
--- a/scripts/SilphCo7F.asm
+++ b/scripts/SilphCo7F.asm
@@ -280,42 +280,14 @@
 	dw SilphCo7Text15
 
 SilphCo7TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_0
-	dw SilphCo7BattleText1 ; TextBeforeBattle
-	dw SilphCo7AfterBattleText1 ; TextAfterBattle
-	dw SilphCo7EndBattleText1 ; TextEndBattle
-	dw SilphCo7EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_7F_TRAINER_0, 2, SilphCo7BattleText1, SilphCo7EndBattleText1, SilphCo7AfterBattleText1
 SilphCo7TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_1
-	dw SilphCo7BattleText2 ; TextBeforeBattle
-	dw SilphCo7AfterBattleText2 ; TextAfterBattle
-	dw SilphCo7EndBattleText2 ; TextEndBattle
-	dw SilphCo7EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_7F_TRAINER_1, 3, SilphCo7BattleText2, SilphCo7EndBattleText2, SilphCo7AfterBattleText2
 SilphCo7TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_2
-	dw SilphCo7BattleText3 ; TextBeforeBattle
-	dw SilphCo7AfterBattleText3 ; TextAfterBattle
-	dw SilphCo7EndBattleText3 ; TextEndBattle
-	dw SilphCo7EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_7F_TRAINER_2, 3, SilphCo7BattleText3, SilphCo7EndBattleText3, SilphCo7AfterBattleText3
 SilphCo7TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_3, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_3, 1
-	dw SilphCo7BattleText4 ; TextBeforeBattle
-	dw SilphCo7AfterBattleText4 ; TextAfterBattle
-	dw SilphCo7EndBattleText4 ; TextEndBattle
-	dw SilphCo7EndBattleText4 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SILPH_CO_7F_TRAINER_3, 1, 4, SilphCo7BattleText4, SilphCo7EndBattleText4, SilphCo7AfterBattleText4
+	db -1 ; end
 
 SilphCo7Text1:
 ; lapras guy
--- a/scripts/SilphCo8F.asm
+++ b/scripts/SilphCo8F.asm
@@ -82,33 +82,12 @@
 	dw SilphCo8Text4
 
 SilphCo8TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_8F_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_8F_TRAINER_0
-	dw SilphCo8BattleText1 ; TextBeforeBattle
-	dw SilphCo8AfterBattleText1 ; TextAfterBattle
-	dw SilphCo8EndBattleText1 ; TextEndBattle
-	dw SilphCo8EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_8F_TRAINER_0, 4, SilphCo8BattleText1, SilphCo8EndBattleText1, SilphCo8AfterBattleText1
 SilphCo8TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_8F_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_8F_TRAINER_1
-	dw SilphCo8BattleText2 ; TextBeforeBattle
-	dw SilphCo8AfterBattleText2 ; TextAfterBattle
-	dw SilphCo8EndBattleText2 ; TextEndBattle
-	dw SilphCo8EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_8F_TRAINER_1, 4, SilphCo8BattleText2, SilphCo8EndBattleText2, SilphCo8AfterBattleText2
 SilphCo8TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_8F_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_8F_TRAINER_2
-	dw SilphCo8BattleText3 ; TextBeforeBattle
-	dw SilphCo8AfterBattleText3 ; TextAfterBattle
-	dw SilphCo8EndBattleText3 ; TextEndBattle
-	dw SilphCo8EndBattleText3 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SILPH_CO_8F_TRAINER_2, 4, SilphCo8BattleText3, SilphCo8EndBattleText3, SilphCo8AfterBattleText3
+	db -1 ; end
 
 SilphCo8Text1:
 	text_asm
--- a/scripts/SilphCo9F.asm
+++ b/scripts/SilphCo9F.asm
@@ -130,33 +130,12 @@
 	dw SilphCo9Text4
 
 SilphCo9TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_0
-	dw SilphCo9BattleText1 ; TextBeforeBattle
-	dw SilphCo9AfterBattleText1 ; TextAfterBattle
-	dw SilphCo9EndBattleText1 ; TextEndBattle
-	dw SilphCo9EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_9F_TRAINER_0, 4, SilphCo9BattleText1, SilphCo9EndBattleText1, SilphCo9AfterBattleText1
 SilphCo9TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_1
-	dw SilphCo9BattleText2 ; TextBeforeBattle
-	dw SilphCo9AfterBattleText2 ; TextAfterBattle
-	dw SilphCo9EndBattleText2 ; TextEndBattle
-	dw SilphCo9EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_SILPH_CO_9F_TRAINER_1, 2, SilphCo9BattleText2, SilphCo9EndBattleText2, SilphCo9AfterBattleText2
 SilphCo9TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_2
-	dw SilphCo9BattleText3 ; TextBeforeBattle
-	dw SilphCo9AfterBattleText3 ; TextAfterBattle
-	dw SilphCo9EndBattleText3 ; TextEndBattle
-	dw SilphCo9EndBattleText3 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_SILPH_CO_9F_TRAINER_2, 4, SilphCo9BattleText3, SilphCo9EndBattleText3, SilphCo9AfterBattleText3
+	db -1 ; end
 
 SilphCo9Text1:
 	text_asm
--- a/scripts/VermilionGym.asm
+++ b/scripts/VermilionGym.asm
@@ -100,33 +100,12 @@
 	dw TM24NoRoomText
 
 VermilionGymTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_0
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_0
-	dw VermilionGymBattleText1 ; TextBeforeBattle
-	dw VermilionGymAfterBattleText1 ; TextAfterBattle
-	dw VermilionGymEndBattleText1 ; TextEndBattle
-	dw VermilionGymEndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_VERMILION_GYM_TRAINER_0, 3, VermilionGymBattleText1, VermilionGymEndBattleText1, VermilionGymAfterBattleText1
 VermilionGymTrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_1
-	dw VermilionGymBattleText2 ; TextBeforeBattle
-	dw VermilionGymAfterBattleText2 ; TextAfterBattle
-	dw VermilionGymEndBattleText2 ; TextEndBattle
-	dw VermilionGymEndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_VERMILION_GYM_TRAINER_1, 2, VermilionGymBattleText2, VermilionGymEndBattleText2, VermilionGymAfterBattleText2
 VermilionGymTrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_2
-	dw VermilionGymBattleText3 ; TextBeforeBattle
-	dw VermilionGymAfterBattleText3 ; TextAfterBattle
-	dw VermilionGymEndBattleText3 ; TextEndBattle
-	dw VermilionGymEndBattleText3 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_VERMILION_GYM_TRAINER_2, 3, VermilionGymBattleText3, VermilionGymEndBattleText3, VermilionGymAfterBattleText3
+	db -1 ; end
 
 LTSurgeText:
 	text_asm
--- a/scripts/VictoryRoad1F.asm
+++ b/scripts/VictoryRoad1F.asm
@@ -47,24 +47,10 @@
 	dw BoulderText
 
 VictoryRoad1TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_1_TRAINER_0
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_1_TRAINER_0
-	dw VictoryRoad1BattleText1 ; TextBeforeBattle
-	dw VictoryRoad1AfterBattleText1 ; TextAfterBattle
-	dw VictoryRoad1EndBattleText1 ; TextEndBattle
-	dw VictoryRoad1EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_VICTORY_ROAD_1_TRAINER_0, 2, VictoryRoad1BattleText1, VictoryRoad1EndBattleText1, VictoryRoad1AfterBattleText1
 VictoryRoad1TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_1_TRAINER_1
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_1_TRAINER_1
-	dw VictoryRoad1BattleText2 ; TextBeforeBattle
-	dw VictoryRoad1AfterBattleText2 ; TextAfterBattle
-	dw VictoryRoad1EndBattleText2 ; TextEndBattle
-	dw VictoryRoad1EndBattleText2 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_VICTORY_ROAD_1_TRAINER_1, 2, VictoryRoad1BattleText2, VictoryRoad1EndBattleText2, VictoryRoad1AfterBattleText2
+	db -1 ; end
 
 VictoryRoad1Text1:
 	text_asm
--- a/scripts/VictoryRoad2F.asm
+++ b/scripts/VictoryRoad2F.asm
@@ -84,60 +84,18 @@
 	dw BoulderText
 
 VictoryRoad2TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0
-	dw VictoryRoad2BattleText1 ; TextBeforeBattle
-	dw VictoryRoad2AfterBattleText1 ; TextAfterBattle
-	dw VictoryRoad2EndBattleText1 ; TextEndBattle
-	dw VictoryRoad2EndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_0, 4, VictoryRoad2BattleText1, VictoryRoad2EndBattleText1, VictoryRoad2AfterBattleText1
 VictoryRoad2TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_1
-	dw VictoryRoad2BattleText2 ; TextBeforeBattle
-	dw VictoryRoad2AfterBattleText2 ; TextAfterBattle
-	dw VictoryRoad2EndBattleText2 ; TextEndBattle
-	dw VictoryRoad2EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_1, 3, VictoryRoad2BattleText2, VictoryRoad2EndBattleText2, VictoryRoad2AfterBattleText2
 VictoryRoad2TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2
-	dw VictoryRoad2BattleText3 ; TextBeforeBattle
-	dw VictoryRoad2AfterBattleText3 ; TextAfterBattle
-	dw VictoryRoad2EndBattleText3 ; TextEndBattle
-	dw VictoryRoad2EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_2, 3, VictoryRoad2BattleText3, VictoryRoad2EndBattleText3, VictoryRoad2AfterBattleText3
 VictoryRoad2TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3
-	db ($1 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3
-	dw VictoryRoad2BattleText4 ; TextBeforeBattle
-	dw VictoryRoad2AfterBattleText4 ; TextAfterBattle
-	dw VictoryRoad2EndBattleText4 ; TextEndBattle
-	dw VictoryRoad2EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_3, 1, VictoryRoad2BattleText4, VictoryRoad2EndBattleText4, VictoryRoad2AfterBattleText4
 VictoryRoad2TrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4
-	dw VictoryRoad2BattleText5 ; TextBeforeBattle
-	dw VictoryRoad2AfterBattleText5 ; TextAfterBattle
-	dw VictoryRoad2EndBattleText5 ; TextEndBattle
-	dw VictoryRoad2EndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_VICTORY_ROAD_2_TRAINER_4, 3, VictoryRoad2BattleText5, VictoryRoad2EndBattleText5, VictoryRoad2AfterBattleText5
 MoltresTrainerHeader:
-	dbEventFlagBit EVENT_BEAT_MOLTRES
-	db ($0 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_MOLTRES
-	dw MoltresBattleText ; TextBeforeBattle
-	dw MoltresBattleText ; TextAfterBattle
-	dw MoltresBattleText ; TextEndBattle
-	dw MoltresBattleText ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_MOLTRES, 0, MoltresBattleText, MoltresBattleText, MoltresBattleText
+	db -1 ; end
 
 VictoryRoad2Text1:
 	text_asm
--- a/scripts/VictoryRoad3F.asm
+++ b/scripts/VictoryRoad3F.asm
@@ -87,42 +87,14 @@
 	dw BoulderText
 
 VictoryRoad3TrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0
-	db ($1 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0
-	dw VictoryRoad3BattleText2 ; TextBeforeBattle
-	dw VictoryRoad3AfterBattleText2 ; TextAfterBattle
-	dw VictoryRoad3EndBattleText2 ; TextEndBattle
-	dw VictoryRoad3EndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_VICTORY_ROAD_3_TRAINER_0, 1, VictoryRoad3BattleText2, VictoryRoad3EndBattleText2, VictoryRoad3AfterBattleText2
 VictoryRoad3TrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_1
-	dw VictoryRoad3BattleText3 ; TextBeforeBattle
-	dw VictoryRoad3AfterBattleText3 ; TextAfterBattle
-	dw VictoryRoad3EndBattleText3 ; TextEndBattle
-	dw VictoryRoad3EndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_VICTORY_ROAD_3_TRAINER_1, 4, VictoryRoad3BattleText3, VictoryRoad3EndBattleText3, VictoryRoad3AfterBattleText3
 VictoryRoad3TrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2
-	dw VictoryRoad3BattleText4 ; TextBeforeBattle
-	dw VictoryRoad3AfterBattleText4 ; TextAfterBattle
-	dw VictoryRoad3EndBattleText4 ; TextEndBattle
-	dw VictoryRoad3EndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_VICTORY_ROAD_3_TRAINER_2, 4, VictoryRoad3BattleText4, VictoryRoad3EndBattleText4, VictoryRoad3AfterBattleText4
 VictoryRoad3TrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3
-	dw VictoryRoad3BattleText5 ; TextBeforeBattle
-	dw VictoryRoad3AfterBattleText5 ; TextAfterBattle
-	dw VictoryRoad3EndBattleText5 ; TextEndBattle
-	dw VictoryRoad3EndBattleText5 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_VICTORY_ROAD_3_TRAINER_3, 4, VictoryRoad3BattleText5, VictoryRoad3EndBattleText5, VictoryRoad3AfterBattleText5
+	db -1 ; end
 
 VictoryRoad3Text1:
 	text_asm
--- a/scripts/ViridianForest.asm
+++ b/scripts/ViridianForest.asm
@@ -29,33 +29,12 @@
 	dw ViridianForestText14
 
 ViridianForestTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0
-	dw ViridianForestBattleText1 ; TextBeforeBattle
-	dw ViridianForestAfterBattleText1 ; TextAfterBattle
-	dw ViridianForestEndBattleText1 ; TextEndBattle
-	dw ViridianForestEndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0, 4, ViridianForestBattleText1, ViridianForestEndBattleText1, ViridianForestAfterBattleText1
 ViridianForestTrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1
-	dw ViridianForestBattleText2 ; TextBeforeBattle
-	dw ViridianForestAfterBattleText2 ; TextAfterBattle
-	dw ViridianForestEndBattleText2 ; TextEndBattle
-	dw ViridianForestEndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1, 4, ViridianForestBattleText2, ViridianForestEndBattleText2, ViridianForestAfterBattleText2
 ViridianForestTrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2
-	db ($1 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2
-	dw ViridianForestBattleText3 ; TextBeforeBattle
-	dw ViridianForestAfterBattleText3 ; TextAfterBattle
-	dw ViridianForestEndBattleText3 ; TextEndBattle
-	dw ViridianForestEndBattleText3 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2, 1, ViridianForestBattleText3, ViridianForestEndBattleText3, ViridianForestAfterBattleText3
+	db -1 ; end
 
 ViridianForestText1:
 	text_far _ViridianForestText1
--- a/scripts/ViridianGym.asm
+++ b/scripts/ViridianGym.asm
@@ -185,78 +185,22 @@
 	dw ViridianGymText14
 
 ViridianGymTrainerHeader0:
-	dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0
-	dw ViridianGymBattleText1 ; TextBeforeBattle
-	dw ViridianGymAfterBattleText1 ; TextAfterBattle
-	dw ViridianGymEndBattleText1 ; TextEndBattle
-	dw ViridianGymEndBattleText1 ; TextEndBattle
-
+	trainer EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0, 4, ViridianGymBattleText1, ViridianGymEndBattleText1, ViridianGymAfterBattleText1
 ViridianGymTrainerHeader1:
-	dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1
-	dw ViridianGymBattleText2 ; TextBeforeBattle
-	dw ViridianGymAfterBattleText2 ; TextAfterBattle
-	dw ViridianGymEndBattleText2 ; TextEndBattle
-	dw ViridianGymEndBattleText2 ; TextEndBattle
-
+	trainer EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1, 4, ViridianGymBattleText2, ViridianGymEndBattleText2, ViridianGymAfterBattleText2
 ViridianGymTrainerHeader2:
-	dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2
-	dw ViridianGymBattleText3 ; TextBeforeBattle
-	dw ViridianGymAfterBattleText3 ; TextAfterBattle
-	dw ViridianGymEndBattleText3 ; TextEndBattle
-	dw ViridianGymEndBattleText3 ; TextEndBattle
-
+	trainer EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2, 4, ViridianGymBattleText3, ViridianGymEndBattleText3, ViridianGymAfterBattleText3
 ViridianGymTrainerHeader3:
-	dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3
-	db ($2 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3
-	dw ViridianGymBattleText4 ; TextBeforeBattle
-	dw ViridianGymAfterBattleText4 ; TextAfterBattle
-	dw ViridianGymEndBattleText4 ; TextEndBattle
-	dw ViridianGymEndBattleText4 ; TextEndBattle
-
+	trainer EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3, 2, ViridianGymBattleText4, ViridianGymEndBattleText4, ViridianGymAfterBattleText4
 ViridianGymTrainerHeader4:
-	dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4
-	dw ViridianGymBattleText5 ; TextBeforeBattle
-	dw ViridianGymAfterBattleText5 ; TextAfterBattle
-	dw ViridianGymEndBattleText5 ; TextEndBattle
-	dw ViridianGymEndBattleText5 ; TextEndBattle
-
+	trainer EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4, 3, ViridianGymBattleText5, ViridianGymEndBattleText5, ViridianGymAfterBattleText5
 ViridianGymTrainerHeader5:
-	dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5
-	dw ViridianGymBattleText6 ; TextBeforeBattle
-	dw ViridianGymAfterBattleText6 ; TextAfterBattle
-	dw ViridianGymEndBattleText6 ; TextEndBattle
-	dw ViridianGymEndBattleText6 ; TextEndBattle
-
+	trainer EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5, 4, ViridianGymBattleText6, ViridianGymEndBattleText6, ViridianGymAfterBattleText6
 ViridianGymTrainerHeader6:
-	dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6, 1
-	db ($3 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6, 1
-	dw ViridianGymBattleText7 ; TextBeforeBattle
-	dw ViridianGymAfterBattleText7 ; TextAfterBattle
-	dw ViridianGymEndBattleText7 ; TextEndBattle
-	dw ViridianGymEndBattleText7 ; TextEndBattle
-
+	trainer EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6, 1, 3, ViridianGymBattleText7, ViridianGymEndBattleText7, ViridianGymAfterBattleText7
 ViridianGymTrainerHeader7:
-	dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7, 1
-	db ($4 << 4) ; trainer's view range
-	dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7, 1
-	dw ViridianGymBattleText8 ; TextBeforeBattle
-	dw ViridianGymAfterBattleText8 ; TextAfterBattle
-	dw ViridianGymEndBattleText8 ; TextEndBattle
-	dw ViridianGymEndBattleText8 ; TextEndBattle
-
-	db $ff
+	trainer EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7, 1, 4, ViridianGymBattleText8, ViridianGymEndBattleText8, ViridianGymAfterBattleText8
+	db -1 ; end
 
 ViridianGymText1:
 	text_asm