shithub: pokecrystal

Download patch

ref: d1fbc077a71dc9d036a8ebf54d3ab886636533fb
parent: e118dfe727b6982f289bdd7ac0401ce796b3f223
author: IIMarckus <iimarckus@gmail.com>
date: Thu Jul 9 23:37:34 EDT 2015

Label fight counters for phone call rematches.

--- a/constants/event_flags.asm
+++ b/constants/event_flags.asm
@@ -128,6 +128,9 @@
 EVENT_FOUND_LEFTOVERS_IN_CELADON_CAFE                  EQU $0f9
 EVENT_FOUND_MACHINE_PART_IN_CERULEAN_GYM               EQU $0fb
 EVENT_SHOWED_BEVERLY_MARILL                            EQU $261
+EVENT_GOT_CARBOS_FROM_VANCE                            EQU $267
+EVENT_GOT_IRON_FROM_PARRY                              EQU $268
+EVENT_GOT_CALCIUM_FROM_ERIN                            EQU $269
 EVENT_SHOWED_DEREK_PIKACHU                             EQU $28d
 EVENT_SHOWED_TIFFANY_CLEFAIRY                          EQU $293
 EVENT_BUENA_OFFERED_HER_PHONE_NUMBER_NO_BLUE_CARD      EQU $29e
--- a/maps/Route35.asm
+++ b/maps/Route35.asm
@@ -261,57 +261,57 @@
 UnknownScript_0x19c9bb:
 	scall UnknownScript_0x19c91b
 	winlosstext Bug_catcherArnie1BeatenText, $0000
-	copybytetovar wda01
-	if_equal $4, UnknownScript_0x19c9da
-	if_equal $3, UnknownScript_0x19c9e0
-	if_equal $2, UnknownScript_0x19c9e6
-	if_equal $1, UnknownScript_0x19c9ec
-	if_equal $0, UnknownScript_0x19c9f2
-UnknownScript_0x19c9da:
+	copybytetovar ArnieFightCount
+	if_equal 4, .Fight4
+	if_equal 3, .Fight3
+	if_equal 2, .Fight2
+	if_equal 1, .Fight1
+	if_equal 0, .LoadFight0
+.Fight4
 	checkevent EVENT_RESTORED_POWER_TO_KANTO
-	iftrue UnknownScript_0x19ca26
-UnknownScript_0x19c9e0:
+	iftrue .LoadFight4
+.Fight3
 	checkevent EVENT_BEAT_ELITE_FOUR
-	iftrue UnknownScript_0x19ca19
-UnknownScript_0x19c9e6:
-	checkflag $004b
-	iftrue UnknownScript_0x19ca0c
-UnknownScript_0x19c9ec:
-	checkflag $004a
-	iftrue UnknownScript_0x19c9ff
-UnknownScript_0x19c9f2:
+	iftrue .LoadFight3
+.Fight2
+	checkflag ENGINE_FLYPOINT_BLACKTHORN
+	iftrue .LoadFight2
+.Fight1
+	checkflag ENGINE_FLYPOINT_LAKE_OF_RAGE
+	iftrue .LoadFight1
+.LoadFight0
 	loadtrainer BUG_CATCHER, ARNIE1
 	startbattle
 	returnafterbattle
-	loadvar wda01, $1
+	loadvar ArnieFightCount, 1
 	clearflag ENGINE_ARNIE
 	end
 
-UnknownScript_0x19c9ff:
+.LoadFight1
 	loadtrainer BUG_CATCHER, ARNIE2
 	startbattle
 	returnafterbattle
-	loadvar wda01, $2
+	loadvar ArnieFightCount, 2
 	clearflag ENGINE_ARNIE
 	end
 
-UnknownScript_0x19ca0c:
+.LoadFight2
 	loadtrainer BUG_CATCHER, ARNIE3
 	startbattle
 	returnafterbattle
-	loadvar wda01, $3
+	loadvar ArnieFightCount, 3
 	clearflag ENGINE_ARNIE
 	end
 
-UnknownScript_0x19ca19:
+.LoadFight3
 	loadtrainer BUG_CATCHER, ARNIE4
 	startbattle
 	returnafterbattle
-	loadvar wda01, $4
+	loadvar ArnieFightCount, 4
 	clearflag ENGINE_ARNIE
 	end
 
-UnknownScript_0x19ca26:
+.LoadFight4
 	loadtrainer BUG_CATCHER, ARNIE5
 	startbattle
 	returnafterbattle
--- a/maps/Route36.asm
+++ b/maps/Route36.asm
@@ -211,57 +211,57 @@
 UnknownScript_0x194140:
 	scall UnknownScript_0x1941e1
 	winlosstext SchoolboyAlan1BeatenText, $0000
-	copybytetovar wda02
-	if_equal $4, UnknownScript_0x19415f
-	if_equal $3, UnknownScript_0x194165
-	if_equal $2, UnknownScript_0x19416b
-	if_equal $1, UnknownScript_0x194171
-	if_equal $0, UnknownScript_0x194177
-UnknownScript_0x19415f:
+	copybytetovar AlanFightCount
+	if_equal 4, .Fight4
+	if_equal 3, .Fight3
+	if_equal 2, .Fight2
+	if_equal 1, .Fight1
+	if_equal 0, .LoadFight0
+.Fight4
 	checkevent EVENT_RESTORED_POWER_TO_KANTO
-	iftrue UnknownScript_0x1941ab
-UnknownScript_0x194165:
+	iftrue .LoadFight4
+.Fight3
 	checkevent EVENT_BEAT_ELITE_FOUR
-	iftrue UnknownScript_0x19419e
-UnknownScript_0x19416b:
-	checkflag $004b
-	iftrue UnknownScript_0x194191
-UnknownScript_0x194171:
-	checkflag $0047
-	iftrue UnknownScript_0x194184
-UnknownScript_0x194177:
+	iftrue .LoadFight3
+.Fight2
+	checkflag ENGINE_FLYPOINT_BLACKTHORN
+	iftrue .LoadFight2
+.Fight1
+	checkflag ENGINE_FLYPOINT_OLIVINE
+	iftrue .LoadFight1
+.LoadFight0
 	loadtrainer SCHOOLBOY, ALAN1
 	startbattle
 	returnafterbattle
-	loadvar wda02, $1
+	loadvar AlanFightCount, 1
 	clearflag ENGINE_ALAN
 	end
 
-UnknownScript_0x194184:
+.LoadFight1
 	loadtrainer SCHOOLBOY, ALAN2
 	startbattle
 	returnafterbattle
-	loadvar wda02, $2
+	loadvar AlanFightCount, 2
 	clearflag ENGINE_ALAN
 	end
 
-UnknownScript_0x194191:
+.LoadFight2
 	loadtrainer SCHOOLBOY, ALAN3
 	startbattle
 	returnafterbattle
-	loadvar wda02, $3
+	loadvar AlanFightCount, 3
 	clearflag ENGINE_ALAN
 	end
 
-UnknownScript_0x19419e:
+.LoadFight3
 	loadtrainer SCHOOLBOY, ALAN4
 	startbattle
 	returnafterbattle
-	loadvar wda02, $4
+	loadvar AlanFightCount, 4
 	clearflag ENGINE_ALAN
 	end
 
-UnknownScript_0x1941ab:
+.LoadFight4
 	loadtrainer SCHOOLBOY, ALAN5
 	startbattle
 	returnafterbattle
--- a/maps/Route38.asm
+++ b/maps/Route38.asm
@@ -109,57 +109,57 @@
 UnknownScript_0x1a1d82:
 	scall UnknownScript_0x1a1e23
 	winlosstext LassDana1BeatenText, $0000
-	copybytetovar wda03
-	if_equal $4, UnknownScript_0x1a1da1
-	if_equal $3, UnknownScript_0x1a1da7
-	if_equal $2, UnknownScript_0x1a1dad
-	if_equal $1, UnknownScript_0x1a1db3
-	if_equal $0, UnknownScript_0x1a1db9
-UnknownScript_0x1a1da1:
+	copybytetovar DanaFightCount
+	if_equal 4, .Fight4
+	if_equal 3, .Fight3
+	if_equal 2, .Fight2
+	if_equal 1, .Fight1
+	if_equal 0, .LoadFight0
+.Fight4
 	checkevent EVENT_RESTORED_POWER_TO_KANTO
-	iftrue UnknownScript_0x1a1ded
-UnknownScript_0x1a1da7:
+	iftrue .LoadFight4
+.Fight3
 	checkevent EVENT_BEAT_ELITE_FOUR
-	iftrue UnknownScript_0x1a1de0
-UnknownScript_0x1a1dad:
+	iftrue .LoadFight3
+.Fight2
 	checkevent EVENT_CLEARED_RADIO_TOWER
-	iftrue UnknownScript_0x1a1dd3
-UnknownScript_0x1a1db3:
-	checkflag $0045
-	iftrue UnknownScript_0x1a1dc6
-UnknownScript_0x1a1db9:
+	iftrue .LoadFight2
+.Fight1
+	checkflag ENGINE_FLYPOINT_CIANWOOD
+	iftrue .LoadFight1
+.LoadFight0
 	loadtrainer LASS, DANA1
 	startbattle
 	returnafterbattle
-	loadvar wda03, $1
+	loadvar DanaFightCount, 1
 	clearflag ENGINE_DANA
 	end
 
-UnknownScript_0x1a1dc6:
+.LoadFight1
 	loadtrainer LASS, DANA2
 	startbattle
 	returnafterbattle
-	loadvar wda03, $2
+	loadvar DanaFightCount, 2
 	clearflag ENGINE_DANA
 	end
 
-UnknownScript_0x1a1dd3:
+.LoadFight2
 	loadtrainer LASS, DANA3
 	startbattle
 	returnafterbattle
-	loadvar wda03, $3
+	loadvar DanaFightCount, 3
 	clearflag ENGINE_DANA
 	end
 
-UnknownScript_0x1a1de0:
+.LoadFight3
 	loadtrainer LASS, DANA4
 	startbattle
 	returnafterbattle
-	loadvar wda03, $4
+	loadvar DanaFightCount, 4
 	clearflag ENGINE_DANA
 	end
 
-UnknownScript_0x1a1ded:
+.LoadFight4
 	loadtrainer LASS, DANA5
 	startbattle
 	returnafterbattle
@@ -261,57 +261,57 @@
 UnknownScript_0x1a1e75:
 	scall UnknownScript_0x1a1f01
 	winlosstext SchoolboyChad1BeatenText, $0000
-	copybytetovar wda04
-	if_equal $4, UnknownScript_0x1a1e94
-	if_equal $3, UnknownScript_0x1a1e9a
-	if_equal $2, UnknownScript_0x1a1ea0
-	if_equal $1, UnknownScript_0x1a1ea6
-	if_equal $0, UnknownScript_0x1a1eac
-UnknownScript_0x1a1e94:
+	copybytetovar ChadFightCount
+	if_equal 4, .Fight4
+	if_equal 3, .Fight3
+	if_equal 2, .Fight2
+	if_equal 1, .Fight1
+	if_equal 0, .LoadFight0
+.Fight4
 	checkevent EVENT_RESTORED_POWER_TO_KANTO
-	iftrue UnknownScript_0x1a1ee0
-UnknownScript_0x1a1e9a:
+	iftrue .LoadFight4
+.Fight3
 	checkevent EVENT_BEAT_ELITE_FOUR
-	iftrue UnknownScript_0x1a1ed3
-UnknownScript_0x1a1ea0:
+	iftrue .LoadFight3
+.Fight2
 	checkevent EVENT_CLEARED_RADIO_TOWER
-	iftrue UnknownScript_0x1a1ec6
-UnknownScript_0x1a1ea6:
-	checkflag $0049
-	iftrue UnknownScript_0x1a1eb9
-UnknownScript_0x1a1eac:
+	iftrue .LoadFight2
+.Fight1
+	checkflag ENGINE_FLYPOINT_MAHOGANY
+	iftrue .LoadFight1
+.LoadFight0
 	loadtrainer SCHOOLBOY, CHAD1
 	startbattle
 	returnafterbattle
-	loadvar wda04, $1
+	loadvar ChadFightCount, 1
 	clearflag ENGINE_CHAD
 	end
 
-UnknownScript_0x1a1eb9:
+.LoadFight1
 	loadtrainer SCHOOLBOY, CHAD2
 	startbattle
 	returnafterbattle
-	loadvar wda04, $2
+	loadvar ChadFightCount, 2
 	clearflag ENGINE_CHAD
 	end
 
-UnknownScript_0x1a1ec6:
+.LoadFight2
 	loadtrainer SCHOOLBOY, CHAD3
 	startbattle
 	returnafterbattle
-	loadvar wda04, $3
+	loadvar ChadFightCount, 3
 	clearflag ENGINE_CHAD
 	end
 
-UnknownScript_0x1a1ed3:
+.LoadFight3
 	loadtrainer SCHOOLBOY, CHAD4
 	startbattle
 	returnafterbattle
-	loadvar wda04, $4
+	loadvar ChadFightCount, 4
 	clearflag ENGINE_CHAD
 	end
 
-UnknownScript_0x1a1ee0:
+.LoadFight4
 	loadtrainer SCHOOLBOY, CHAD5
 	startbattle
 	returnafterbattle
--- a/maps/Route42.asm
+++ b/maps/Route42.asm
@@ -77,45 +77,45 @@
 UnknownScript_0x1a927f:
 	scall UnknownScript_0x1a9309
 	winlosstext FisherTully1BeatenText, $0000
-	copybytetovar wda06
-	if_equal $3, UnknownScript_0x1a929a
-	if_equal $2, UnknownScript_0x1a92a0
-	if_equal $1, UnknownScript_0x1a92a6
-	if_equal $0, UnknownScript_0x1a92ac
-UnknownScript_0x1a929a:
+	copybytetovar TullyFightCount
+	if_equal 3, .Fight3
+	if_equal 2, .Fight2
+	if_equal 1, .Fight1
+	if_equal 0, .LoadFight0
+.Fight3
 	checkevent EVENT_RESTORED_POWER_TO_KANTO
-	iftrue UnknownScript_0x1a92d3
-UnknownScript_0x1a92a0:
+	iftrue .LoadFight3
+.Fight2
 	checkevent EVENT_BEAT_ELITE_FOUR
-	iftrue UnknownScript_0x1a92c6
-UnknownScript_0x1a92a6:
+	iftrue .LoadFight2
+.Fight1
 	checkevent EVENT_CLEARED_ROCKET_HIDEOUT
-	iftrue UnknownScript_0x1a92b9
-UnknownScript_0x1a92ac:
+	iftrue .LoadFight1
+.LoadFight0
 	loadtrainer FISHER, TULLY1
 	startbattle
 	returnafterbattle
-	loadvar wda06, $1
+	loadvar TullyFightCount, 1
 	clearflag ENGINE_TULLY
 	end
 
-UnknownScript_0x1a92b9:
+.LoadFight1
 	loadtrainer FISHER, TULLY2
 	startbattle
 	returnafterbattle
-	loadvar wda06, $2
+	loadvar TullyFightCount, 2
 	clearflag ENGINE_TULLY
 	end
 
-UnknownScript_0x1a92c6:
+.LoadFight2
 	loadtrainer FISHER, TULLY3
 	startbattle
 	returnafterbattle
-	loadvar wda06, $3
+	loadvar TullyFightCount, 3
 	clearflag ENGINE_TULLY
 	end
 
-UnknownScript_0x1a92d3:
+.LoadFight3
 	loadtrainer FISHER, TULLY4
 	startbattle
 	returnafterbattle
--- a/maps/Route43.asm
+++ b/maps/Route43.asm
@@ -121,45 +121,45 @@
 UnknownScript_0x19d0cf:
 	scall UnknownScript_0x19d144
 	winlosstext PokemaniacBrent1BeatenText, $0000
-	copybytetovar wda07
-	if_equal $3, UnknownScript_0x19d0ea
-	if_equal $2, UnknownScript_0x19d0f0
-	if_equal $1, UnknownScript_0x19d0f6
-	if_equal $0, UnknownScript_0x19d0fc
-UnknownScript_0x19d0ea:
+	copybytetovar BrentFightCount
+	if_equal 3, .Fight3
+	if_equal 2, .Fight2
+	if_equal 1, .Fight1
+	if_equal 0, .LoadFight0
+.Fight3
 	checkevent EVENT_RESTORED_POWER_TO_KANTO
-	iftrue UnknownScript_0x19d123
-UnknownScript_0x19d0f0:
+	iftrue .LoadFight3
+.Fight2
 	checkevent EVENT_BEAT_ELITE_FOUR
-	iftrue UnknownScript_0x19d116
-UnknownScript_0x19d0f6:
+	iftrue .LoadFight2
+.Fight1
 	checkevent EVENT_CLEARED_ROCKET_HIDEOUT
-	iftrue UnknownScript_0x19d109
-UnknownScript_0x19d0fc:
+	iftrue .LoadFight1
+.LoadFight0
 	loadtrainer POKEMANIAC, BRENT1
 	startbattle
 	returnafterbattle
-	loadvar wda07, $1
+	loadvar BrentFightCount, 1
 	clearflag ENGINE_BRENT
 	end
 
-UnknownScript_0x19d109:
+.LoadFight1
 	loadtrainer POKEMANIAC, BRENT2
 	startbattle
 	returnafterbattle
-	loadvar wda07, $2
+	loadvar BrentFightCount, 2
 	clearflag ENGINE_BRENT
 	end
 
-UnknownScript_0x19d116:
+.LoadFight2
 	loadtrainer POKEMANIAC, BRENT3
 	startbattle
 	returnafterbattle
-	loadvar wda07, $3
+	loadvar BrentFightCount, 3
 	clearflag ENGINE_BRENT
 	end
 
-UnknownScript_0x19d123:
+.LoadFight3
 	loadtrainer POKEMANIAC, BRENT4
 	startbattle
 	returnafterbattle
@@ -300,45 +300,45 @@
 UnknownScript_0x19d1c1:
 	scall UnknownScript_0x19d251
 	winlosstext PicnickerTiffany3BeatenText, $0000
-	copybytetovar wda08
-	if_equal $3, UnknownScript_0x19d1dc
-	if_equal $2, UnknownScript_0x19d1e2
-	if_equal $1, UnknownScript_0x19d1e8
-	if_equal $0, UnknownScript_0x19d1ee
-UnknownScript_0x19d1dc:
+	copybytetovar TiffanyFightCount
+	if_equal 3, .Fight3
+	if_equal 2, .Fight2
+	if_equal 1, .Fight1
+	if_equal 0, .LoadFight0
+.Fight3
 	checkevent EVENT_RESTORED_POWER_TO_KANTO
-	iftrue UnknownScript_0x19d215
-UnknownScript_0x19d1e2:
+	iftrue .LoadFight3
+.Fight2
 	checkevent EVENT_BEAT_ELITE_FOUR
-	iftrue UnknownScript_0x19d208
-UnknownScript_0x19d1e8:
+	iftrue .LoadFight2
+.Fight1
 	checkevent EVENT_CLEARED_RADIO_TOWER
-	iftrue UnknownScript_0x19d1fb
-UnknownScript_0x19d1ee:
+	iftrue .LoadFight1
+.LoadFight0
 	loadtrainer PICNICKER, TIFFANY3
 	startbattle
 	returnafterbattle
-	loadvar wda08, $1
+	loadvar TiffanyFightCount, 1
 	clearflag ENGINE_TIFFANY
 	end
 
-UnknownScript_0x19d1fb:
+.LoadFight1
 	loadtrainer PICNICKER, TIFFANY1
 	startbattle
 	returnafterbattle
-	loadvar wda08, $2
+	loadvar TiffanyFightCount, 2
 	clearflag ENGINE_TIFFANY
 	end
 
-UnknownScript_0x19d208:
+.LoadFight2
 	loadtrainer PICNICKER, TIFFANY2
 	startbattle
 	returnafterbattle
-	loadvar wda08, $3
+	loadvar TiffanyFightCount, 3
 	clearflag ENGINE_TIFFANY
 	end
 
-UnknownScript_0x19d215:
+.LoadFight3
 	loadtrainer PICNICKER, TIFFANY4
 	startbattle
 	returnafterbattle
--- a/maps/Route44.asm
+++ b/maps/Route44.asm
@@ -53,33 +53,33 @@
 UnknownScript_0x19d86a:
 	scall UnknownScript_0x19d8f7
 	winlosstext Bird_keeperVance1BeatenText, $0000
-	copybytetovar wda09
-	if_equal $2, UnknownScript_0x19d881
-	if_equal $1, UnknownScript_0x19d887
-	if_equal $0, UnknownScript_0x19d88d
-UnknownScript_0x19d881:
+	copybytetovar VanceFightCount
+	if_equal 2, .Fight2
+	if_equal 1, .Fight1
+	if_equal 0, .LoadFight0
+.Fight2
 	checkevent EVENT_RESTORED_POWER_TO_KANTO
-	iftrue UnknownScript_0x19d8a7
-UnknownScript_0x19d887:
+	iftrue .LoadFight2
+.Fight1
 	checkevent EVENT_BEAT_ELITE_FOUR
-	iftrue UnknownScript_0x19d89a
-UnknownScript_0x19d88d:
+	iftrue .LoadFight1
+.LoadFight0
 	loadtrainer BIRD_KEEPER, VANCE1
 	startbattle
 	returnafterbattle
-	loadvar wda09, $1
+	loadvar VanceFightCount, 1
 	clearflag ENGINE_VANCE
 	end
 
-UnknownScript_0x19d89a:
+.LoadFight1
 	loadtrainer BIRD_KEEPER, VANCE2
 	startbattle
 	returnafterbattle
-	loadvar wda09, $2
+	loadvar VanceFightCount, 2
 	clearflag ENGINE_VANCE
 	end
 
-UnknownScript_0x19d8a7:
+.LoadFight2
 	loadtrainer BIRD_KEEPER, VANCE3
 	startbattle
 	returnafterbattle
@@ -86,12 +86,12 @@
 	clearflag ENGINE_VANCE
 	checkevent EVENT_VANCE_CARBOS
 	iftrue UnknownScript_0x19d8cb
-	checkevent $0267
+	checkevent EVENT_GOT_CARBOS_FROM_VANCE
 	iftrue UnknownScript_0x19d8ca
 	scall UnknownScript_0x19d90a
 	verbosegiveitem CARBOS, 1
 	iffalse UnknownScript_0x19d903
-	setevent $0267
+	setevent EVENT_GOT_CARBOS_FROM_VANCE
 	jump UnknownScript_0x19d8eb
 
 UnknownScript_0x19d8ca:
@@ -104,7 +104,7 @@
 	verbosegiveitem CARBOS, 1
 	iffalse UnknownScript_0x19d903
 	clearevent EVENT_VANCE_CARBOS
-	setevent $0267
+	setevent EVENT_GOT_CARBOS_FROM_VANCE
 	jump UnknownScript_0x19d8eb
 
 UnknownScript_0x19d8df:
@@ -229,33 +229,33 @@
 UnknownScript_0x19d96e:
 	scall UnknownScript_0x19d8f7
 	winlosstext FisherWilton1BeatenText, $0000
-	copybytetovar wda0a
-	if_equal $2, UnknownScript_0x19d985
-	if_equal $1, UnknownScript_0x19d98b
-	if_equal $0, UnknownScript_0x19d991
-UnknownScript_0x19d985:
+	copybytetovar WiltonFightCount
+	if_equal 2, .Fight2
+	if_equal 1, .Fight1
+	if_equal 0, .LoadFight0
+.Fight2
 	checkevent EVENT_RESTORED_POWER_TO_KANTO
-	iftrue UnknownScript_0x19d9ab
-UnknownScript_0x19d98b:
+	iftrue .LoadFight2
+.Fight1
 	checkevent EVENT_BEAT_ELITE_FOUR
-	iftrue UnknownScript_0x19d99e
-UnknownScript_0x19d991:
+	iftrue .LoadFight1
+.LoadFight0
 	loadtrainer FISHER, WILTON1
 	startbattle
 	returnafterbattle
-	loadvar wda0a, $1
+	loadvar WiltonFightCount, 1
 	clearflag ENGINE_WILTON
 	end
 
-UnknownScript_0x19d99e:
+.LoadFight1
 	loadtrainer FISHER, WILTON2
 	startbattle
 	returnafterbattle
-	loadvar wda0a, $2
+	loadvar WiltonFightCount, 2
 	clearflag ENGINE_WILTON
 	end
 
-UnknownScript_0x19d9ab:
+.LoadFight2
 	loadtrainer FISHER, WILTON3
 	startbattle
 	returnafterbattle
--- a/maps/Route45.asm
+++ b/maps/Route45.asm
@@ -227,33 +227,33 @@
 UnknownScript_0x19e1b8:
 	scall UnknownScript_0x19e133
 	winlosstext HikerParry3BeatenText, $0000
-	copybytetovar wda0c
-	if_equal $2, UnknownScript_0x19e1cf
-	if_equal $1, UnknownScript_0x19e1d5
-	if_equal $0, UnknownScript_0x19e1db
-UnknownScript_0x19e1cf:
+	copybytetovar ParryFightCount
+	if_equal 2, .Fight2
+	if_equal 1, .Fight1
+	if_equal 0, .LoadFight0
+.Fight2
 	checkevent EVENT_RESTORED_POWER_TO_KANTO
-	iftrue UnknownScript_0x19e1f5
-UnknownScript_0x19e1d5:
+	iftrue .LoadFight2
+.Fight1
 	checkevent EVENT_BEAT_ELITE_FOUR
-	iftrue UnknownScript_0x19e1e8
-UnknownScript_0x19e1db:
+	iftrue .LoadFight1
+.LoadFight0
 	loadtrainer HIKER, PARRY3
 	startbattle
 	returnafterbattle
-	loadvar wda0c, $1
+	loadvar ParryFightCount, 1
 	clearflag ENGINE_PARRY
 	end
 
-UnknownScript_0x19e1e8:
+.LoadFight1
 	loadtrainer HIKER, PARRY1
 	startbattle
 	returnafterbattle
-	loadvar wda0c, $2
+	loadvar ParryFightCount, 2
 	clearflag ENGINE_PARRY
 	end
 
-UnknownScript_0x19e1f5:
+.LoadFight2
 	loadtrainer HIKER, PARRY2
 	startbattle
 	returnafterbattle
@@ -260,12 +260,12 @@
 	clearflag ENGINE_PARRY
 	checkevent EVENT_PARRY_IRON
 	iftrue UnknownScript_0x19e219
-	checkevent $0268
+	checkevent EVENT_GOT_IRON_FROM_PARRY
 	iftrue UnknownScript_0x19e218
 	scall UnknownScript_0x19e146
 	verbosegiveitem IRON, 1
 	iffalse UnknownScript_0x19e13f
-	setevent $0268
+	setevent EVENT_GOT_IRON_FROM_PARRY
 	jump UnknownScript_0x19e127
 
 UnknownScript_0x19e218:
@@ -278,7 +278,7 @@
 	verbosegiveitem IRON, 1
 	iffalse UnknownScript_0x19e13f
 	clearevent EVENT_PARRY_IRON
-	setevent $0268
+	setevent EVENT_GOT_IRON_FROM_PARRY
 	jump UnknownScript_0x19e127
 
 TrainerHikerTimothy:
--- a/maps/Route46.asm
+++ b/maps/Route46.asm
@@ -80,33 +80,33 @@
 UnknownScript_0x1a96da:
 	scall UnknownScript_0x1a9767
 	winlosstext PicnickerErin1BeatenText, $0000
-	copybytetovar wda0d
-	if_equal $2, UnknownScript_0x1a96f1
-	if_equal $1, UnknownScript_0x1a96f7
-	if_equal $0, UnknownScript_0x1a96fd
-UnknownScript_0x1a96f1:
+	copybytetovar ErinFightCount
+	if_equal 2, .Fight2
+	if_equal 1, .Fight1
+	if_equal 0, .LoadFight0
+.Fight2
 	checkevent EVENT_RESTORED_POWER_TO_KANTO
-	iftrue UnknownScript_0x1a9717
-UnknownScript_0x1a96f7:
+	iftrue .LoadFight2
+.Fight1
 	checkevent EVENT_BEAT_ELITE_FOUR
-	iftrue UnknownScript_0x1a970a
-UnknownScript_0x1a96fd:
+	iftrue .LoadFight1
+.LoadFight0
 	loadtrainer PICNICKER, ERIN1
 	startbattle
 	returnafterbattle
-	loadvar wda0d, $1
+	loadvar ErinFightCount, 1
 	clearflag ENGINE_ERIN
 	end
 
-UnknownScript_0x1a970a:
+.LoadFight1
 	loadtrainer PICNICKER, ERIN2
 	startbattle
 	returnafterbattle
-	loadvar wda0d, $2
+	loadvar ErinFightCount, 2
 	clearflag ENGINE_ERIN
 	end
 
-UnknownScript_0x1a9717:
+.LoadFight2
 	loadtrainer PICNICKER, ERIN3
 	startbattle
 	returnafterbattle
@@ -113,12 +113,12 @@
 	clearflag ENGINE_ERIN
 	checkevent EVENT_ERIN_CALCIUM
 	iftrue UnknownScript_0x1a973b
-	checkevent $0269
+	checkevent EVENT_GOT_CALCIUM_FROM_ERIN
 	iftrue UnknownScript_0x1a973a
 	scall UnknownScript_0x1a9772
 	verbosegiveitem CALCIUM, 1
 	iffalse UnknownScript_0x1a976b
-	setevent $0269
+	setevent EVENT_GOT_CALCIUM_FROM_ERIN
 	jump UnknownScript_0x1a975b
 
 UnknownScript_0x1a973a:
@@ -131,7 +131,7 @@
 	verbosegiveitem CALCIUM, 1
 	iffalse UnknownScript_0x1a976b
 	clearevent EVENT_ERIN_CALCIUM
-	setevent $0269
+	setevent EVENT_GOT_CALCIUM_FROM_ERIN
 	jump UnknownScript_0x1a975b
 
 UnknownScript_0x1a974f:
--- a/wram.asm
+++ b/wram.asm
@@ -2232,19 +2232,19 @@
 wd9ff:: ds 1
 
 wda00:: ds 1
-wda01:: ds 1
-wda02:: ds 1
-wda03:: ds 1
-wda04:: ds 1
+ArnieFightCount:: ds 1
+AlanFightCount:: ds 1
+DanaFightCount:: ds 1
+ChadFightCount:: ds 1
 wda05:: ds 1
-wda06:: ds 1
-wda07:: ds 1
-wda08:: ds 1
-wda09:: ds 1
-wda0a:: ds 1
+TullyFightCount:: ds 1
+BrentFightCount:: ds 1
+TiffanyFightCount:: ds 1
+VanceFightCount:: ds 1
+WiltonFightCount:: ds 1
 wda0b:: ds 1
-wda0c:: ds 1
-wda0d:: ds 1
+ParryFightCount:: ds 1
+ErinFightCount:: ds 1
 	ds 100
 
 EventFlags:: ; da72