summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/battle.h18
-rw-r--r--include/battle_setup.h87
-rw-r--r--include/battle_transition.h63
-rwxr-xr-xinclude/event_scripts.h8
-rwxr-xr-xinclude/field_map_obj.h2
-rw-r--r--include/flags.h5
-rw-r--r--include/global.h23
-rw-r--r--include/pokemon.h1
-rw-r--r--include/pokemon_3.h2
-rw-r--r--include/safari_zone.h2
-rw-r--r--include/secret_base.h1
-rw-r--r--include/songs.h42
-rw-r--r--include/strings.h1
-rw-r--r--include/trainer.h19
-rw-r--r--include/trainer_ids.h5
-rw-r--r--include/trainer_see.h15
-rw-r--r--include/vars.h4
17 files changed, 254 insertions, 44 deletions
diff --git a/include/battle.h b/include/battle.h
index 3f39db374..72124e0d6 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -53,7 +53,7 @@
#define BATTLE_TYPE_PALACE 0x20000
#define BATTLE_TYPE_ARENA 0x40000
#define BATTLE_TYPE_FACTORY 0x80000
-#define BATTLE_TYPE_x100000 0x100000
+#define BATTLE_TYPE_PIKE 0x100000
#define BATTLE_TYPE_PYRAMID 0x200000
#define BATTLE_TYPE_INGAME_PARTNER 0x400000
#define BATTLE_TYPE_x800000 0x800000
@@ -72,8 +72,8 @@
#define STEVEN_PARTNER_ID 0xC03
#define SECRET_BASE_OPPONENT 0x400
-#define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_x100000 | BATTLE_TYPE_PYRAMID)
-#define BATTLE_TYPE_FRONTIER_NO_PYRAMID (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_x100000)
+#define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE | BATTLE_TYPE_PYRAMID)
+#define BATTLE_TYPE_FRONTIER_NO_PYRAMID (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE)
#define BATTLE_WON 0x1
#define BATTLE_LOST 0x2
@@ -229,9 +229,9 @@
#define BATTLE_TERRAIN_UNDERWATER 3
#define BATTLE_TERRAIN_WATER 4
#define BATTLE_TERRAIN_POND 5
-#define BATTLE_TERRAIN_ROCK 6
+#define BATTLE_TERRAIN_MOUNTAIN 6
#define BATTLE_TERRAIN_CAVE 7
-#define BATTLE_TERRAIN_INSIDE 8
+#define BATTLE_TERRAIN_BUILDING 8
#define BATTLE_TERRAIN_PLAIN 9
// array entries for battle communication
@@ -328,10 +328,10 @@ struct TrainerMonItemCustomMoves
union TrainerMonPtr
{
- struct TrainerMonNoItemDefaultMoves* NoItemDefaultMoves;
- struct TrainerMonNoItemCustomMoves* NoItemCustomMoves;
- struct TrainerMonItemDefaultMoves* ItemDefaultMoves;
- struct TrainerMonItemCustomMoves* ItemCustomMoves;
+ struct TrainerMonNoItemDefaultMoves *NoItemDefaultMoves;
+ struct TrainerMonNoItemCustomMoves *NoItemCustomMoves;
+ struct TrainerMonItemDefaultMoves *ItemDefaultMoves;
+ struct TrainerMonItemCustomMoves *ItemCustomMoves;
};
struct Trainer
diff --git a/include/battle_setup.h b/include/battle_setup.h
index 0168022cc..e4bae6fdb 100644
--- a/include/battle_setup.h
+++ b/include/battle_setup.h
@@ -1,18 +1,85 @@
#ifndef GUARD_BATTLE_SETUP_H
#define GUARD_BATTLE_SETUP_H
-void BattleSetup_StartScriptedWildBattle(void);
-u8 BattleSetup_GetTerrainId(void);
-u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data);
-void BattleSetup_StartBattlePikeWildBattle(void);
+enum
+{
+ TRAINER_BATTLE_NORMAL,
+ TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC,
+ TRAINER_BATTLE_CONTINUE_SCRIPT,
+ TRAINER_BATTLE_NORMAL_NO_INTRO_TEXT,
+ TRAINER_BATTLE_DOUBLE,
+ TRAINER_BATTLE_REMATCH,
+ TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE,
+ TRAINER_BATTLE_REMATCH_DOUBLE,
+ TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC,
+ TRAINER_BATTLE_9,
+ TRAINER_BATTLE_SET_TRAINER_A,
+ TRAINER_BATTLE_SET_TRAINER_B,
+ TRAINER_BATTLE_12,
+};
+
+#define REMATCHES_COUNT 5
+#define REMATCH_TABLE_ENTRIES 78
+#define REMATCH_WALLY_ENTRY 64
+#define REMATCH_ELITE_FOUR_ENTRIES 73
+
+struct RematchTrainer
+{
+ u16 trainerIds[REMATCHES_COUNT];
+ u16 mapGroup;
+ u16 mapNum;
+};
+
+extern const struct RematchTrainer gRematchTable[REMATCH_TABLE_ENTRIES];
+
+extern u16 gTrainerBattleOpponent_A;
+extern u16 gTrainerBattleOpponent_B;
+extern u16 gPartnerTrainerId;
+
void BattleSetup_StartWildBattle(void);
+void BattleSetup_StartBattlePikeWildBattle(void);
void BattleSetup_StartRoamerBattle(void);
-
-u8 HasTrainerAlreadyBeenFought(u16);
-void trainer_flag_set(u16);
-void trainer_flag_clear(u16);
+void StartWallyTutorialBattle(void);
+void BattleSetup_StartScriptedWildBattle(void);
+void BattleSetup_StartLatiBattle(void);
+void BattleSetup_StartLegendaryBattle(void);
+void StartGroudonKyogreBattle(void);
+void StartRegiBattle(void);
+u8 BattleSetup_GetTerrainId(void);
+u8 sub_80B100C(s32 arg0);
+void ChooseStarter(void);
+void ResetTrainerOpponentIds(void);
+void SetMapVarsToTrainer(void);
+const u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data);
+void ConfigureAndSetUpOneTrainerBattle(u8 trainerMapObjId, const u8 *trainerScript);
+void ConfigureTwoTrainersBattle(u8 trainerMapObjId, const u8 *trainerScript);
+void SetUpTwoTrainersBattle(void);
+bool32 GetTrainerFlagFromScriptPointer(const u8 *data);
+void sub_80B16D8(void);
+u8 GetTrainerBattleMode(void);
+bool8 GetTrainerFlag(void);
+bool8 HasTrainerBeenFought(u16 trainerId);
+void SetTrainerFlag(u16 trainerId);
+void ClearTrainerFlag(u16 trainerId);
void BattleSetup_StartTrainerBattle(void);
-u8 *BattleSetup_GetScriptAddrAfterBattle(void);
-u8 *BattleSetup_GetTrainerPostBattleScript(void);
+void BattleSetup_StartRematchBattle(void);
+void ShowTrainerIntroSpeech(void);
+const u8 *BattleSetup_GetScriptAddrAfterBattle(void);
+const u8 *BattleSetup_GetTrainerPostBattleScript(void);
+void ShowTrainerCantBattleSpeech(void);
+void SetUpTrainerEncounterMusic(void);
+const u8 *GetTrainerALoseText(void);
+const u8 *GetTrainerBLoseText(void);
+const u8 *GetTrainerWonSpeech(void);
+void UpdateRematchIfDefeated(s32 rematchTableId);
+void IncrementRematchStepCounter(void);
+void TryUpdateRandomTrainerRematches(u16 mapGroup, u16 mapNum);
+bool32 DoesSomeoneWantRematchIn(u16 mapGroup, u16 mapNum);
+bool32 IsRematchTrainerIn(u16 mapGroup, u16 mapNum);
+u16 GetLastBeatenRematchTrainerId(u16 trainerId);
+bool8 ShouldTryRematchBattle(void);
+bool8 IsTrainerReadyForRematch(void);
+void ShouldTryGetTrainerScript(void);
+u16 CountBattledRematchTeams(u16 trainerId);
#endif // GUARD_BATTLE_SETUP_H
diff --git a/include/battle_transition.h b/include/battle_transition.h
index 1603f5c93..b160f3e02 100644
--- a/include/battle_transition.h
+++ b/include/battle_transition.h
@@ -2,5 +2,68 @@
#define GUARD_BATTLE_TRANSITION_H
void sub_8149DFC(u8 a1);
+void BattleTransition_StartOnField(u8 transitionID);
+void BattleTransition_Start(u8 transitionID);
+bool8 IsBattleTransitionDone(void);
+
+#define TRANSITIONS_NO 25
+
+enum // TRANSITION_MUGSHOT
+{
+ MUGSHOT_SYDNEY,
+ MUGSHOT_PHOEBE,
+ MUGSHOT_GLACIA,
+ MUGSHOT_DRAKE,
+ MUGSHOT_CHAMPION,
+};
+
+#define MUGSHOTS_NO 5
+
+// credits for the names go to Dyskinesia and Tetrable
+// names are naturally subject to change
+
+#define B_TRANSITION_BLUR 0
+#define B_TRANSITION_SWIRL 1
+#define B_TRANSITION_SHUFFLE 2
+#define B_TRANSITION_BIG_POKEBALL 3
+#define B_TRANSITION_POKEBALLS_TRAIL 4
+#define B_TRANSITION_CLOCKWISE_BLACKFADE 5
+#define B_TRANSITION_RIPPLE 6
+#define B_TRANSITION_WAVE 7
+#define B_TRANSITION_SLICE 8
+#define B_TRANSITION_WHITEFADE 9
+#define B_TRANSITION_GRID_SQUARES 10
+#define B_TRANSITION_SHARDS 11
+#define B_TRANSITION_SYDNEY 12
+#define B_TRANSITION_PHOEBE 13
+#define B_TRANSITION_GLACIA 14
+#define B_TRANSITION_DRAKE 15
+#define B_TRANSITION_CHAMPION 16
+// added in Emerald
+#define B_TRANSITION_AQUA 17
+#define B_TRANSITION_MAGMA 18
+#define B_TRANSITION_REGICE 19
+#define B_TRANSITION_REGISTEEL 20
+#define B_TRANSITION_REGIROCK 21
+#define B_TRANSITION_KYORGE 22
+#define B_TRANSITION_GROUDON 23
+#define B_TRANSITION_RAYQUAZA 24
+#define B_TRANSITION_25 25
+#define B_TRANSITION_26 26
+#define B_TRANSITION_27 27
+#define B_TRANSITION_28 28
+#define B_TRANSITION_29 29
+#define B_TRANSITION_30 30
+#define B_TRANSITION_31 31
+#define B_TRANSITION_32 32
+#define B_TRANSITION_33 33
+#define B_TRANSITION_34 34
+#define B_TRANSITION_35 35
+#define B_TRANSITION_36 36
+#define B_TRANSITION_37 37
+#define B_TRANSITION_38 38
+#define B_TRANSITION_39 39
+#define B_TRANSITION_40 40
+#define B_TRANSITION_41 41
#endif // GUARD_BATTLE_TRANSITION_H
diff --git a/include/event_scripts.h b/include/event_scripts.h
index 844f1052a..a54e0e463 100755
--- a/include/event_scripts.h
+++ b/include/event_scripts.h
@@ -7,10 +7,18 @@
extern const u8 gUnknown_0823B4E8[];
extern const u8 gUnknown_0823B5E9[];
+extern const u8 EventScript_TestSignpostMsg[];
+extern const u8 EventScript_TryGetTrainerScript[];
extern const u8 EventScript_275BB7[];
extern const u8 EventScript_275D0C[];
extern const u8 EventScript_275D1F[];
extern const u8 EventScript_275D2E[];
+extern const u8 EventScript_271354[];
+extern const u8 EventScript_2713C2[];
+extern const u8 EventScript_TryDoDoubleTrainerBattle[];
+extern const u8 EventScript_271362[];
+extern const u8 EventScript_TryDoDoubleRematchBattle[];
+extern const u8 EventScript_2713D1[];
extern const u8 EventScript_2766A2[];
extern const u8 EventScript_2766A6[];
diff --git a/include/field_map_obj.h b/include/field_map_obj.h
index 0107fa10f..696d1c2e2 100755
--- a/include/field_map_obj.h
+++ b/include/field_map_obj.h
@@ -76,6 +76,8 @@ void MoveCoords(u8, s16 *, s16 *);
bool8 FieldObjectIsSpecialAnimActive(struct MapObject *);
u8 FieldObjectClearAnimIfSpecialAnimFinished(struct MapObject *);
u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z);
+void npc_set_running_behaviour_etc(struct MapObject *mapObject, u8 animPattern);
+u8 npc_running_behaviour_by_direction(u8 direction);
// Exported data declarations
diff --git a/include/flags.h b/include/flags.h
index 31d634c59..cf5e67576 100644
--- a/include/flags.h
+++ b/include/flags.h
@@ -1,9 +1,12 @@
#ifndef GUARD_FLAGS_H
#define GUARD_FLAGS_H
-#define FLAG_340 0x340
#define FLAG_LEGENDARIES_IN_SOOTOPOLIS 0x53
#define FLAG_PENDING_DAYCARE_EGG 0x86
+#define FLAG_7E 0x7E
+#define FLAG_HAS_MATCH_CALL 0x12F
+#define FLAG_MATCH_CALL_REGISTERED 0x15C
+#define FLAG_340 0x340
#define FLAG_TRAINER_FLAG_START 0x500
diff --git a/include/global.h b/include/global.h
index f3ec9ce33..8e936aa8c 100644
--- a/include/global.h
+++ b/include/global.h
@@ -36,6 +36,24 @@ extern u8 gStringVar2[];
extern u8 gStringVar3[];
extern u8 gStringVar4[];
+// There are many quirks in the source code which have overarching behavioral differences from
+// a number of other files. For example, diploma.c seems to declare rodata before each use while
+// other files declare out of order and must be at the beginning. There are also a number of
+// macros which differ from one file to the next due to the method of obtaining the result, such
+// as these below. Because of this, there is a theory (Two Team Theory) that states that these
+// programming projects had more than 1 "programming team" which utilized different macros for
+// each of the files that were worked on.
+#define T1_READ_8(ptr) ((ptr)[0])
+#define T1_READ_16(ptr) ((ptr)[0] | ((ptr)[1] << 8))
+#define T1_READ_32(ptr) ((ptr)[0] | ((ptr)[1] << 8) | ((ptr)[2] << 16) | ((ptr)[3] << 24))
+#define T1_READ_PTR(ptr) (u8*) T1_READ_32(ptr)
+
+// T2_READ_8 is a duplicate to remain consistent with each group.
+#define T2_READ_8(ptr) ((ptr)[0])
+#define T2_READ_16(ptr) ((ptr)[0] + ((ptr)[1] << 8))
+#define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24))
+#define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr)
+
enum
{
VERSION_SAPPHIRE = 1,
@@ -45,7 +63,8 @@ enum
VERSION_LEAF_GREEN = 5,
};
-enum LanguageId {
+enum LanguageId
+{
LANGUAGE_JAPANESE = 1,
LANGUAGE_ENGLISH = 2,
LANGUAGE_GERMAN = 5,
@@ -240,7 +259,7 @@ struct SaveBlock2
/*0xCA9*/ u8 field_CA9_f : 1; // 0x80
/*0xCAA*/ u16 field_CAA[4];
/*0xCB2*/ u16 battlePyramidWildHeaderId;
- /*0xCB4*/ u8 field_CB4[82];
+ /*0xCB4*/ u16 field_CB4[82];
/*0xD06*/ u8 field_D06;
/*0xD07*/ u8 field_D07;
/*0xD08*/ u8 filler_D08[0x112];
diff --git a/include/pokemon.h b/include/pokemon.h
index 480c8d9b9..cdab96687 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -653,6 +653,7 @@ u8 GetSecretBaseTrainerPicIndex(void);
bool8 TryIncrementMonLevel(struct Pokemon *mon);
void BoxMonToMon(struct BoxPokemon *srcMon, struct Pokemon *dstMon);
u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves);
+u8 GetMonsStateToDoubles_2(void);
#include "sprite.h"
diff --git a/include/pokemon_3.h b/include/pokemon_3.h
index 5c9862d57..82dfacf48 100644
--- a/include/pokemon_3.h
+++ b/include/pokemon_3.h
@@ -3,5 +3,7 @@
const u8* GetTrainerClassNameFromId(u16 trainerId);
const u8* GetTrainerNameFromId(u16 trainerId);
+void PlayMapChosenOrBattleBGM(u16 song);
+u8 GetTrainerEncounterMusicId(u16 trainerOpponentId);
#endif // GUARD_POKEMON_3_H
diff --git a/include/safari_zone.h b/include/safari_zone.h
index 9a81894b8..39ee3ccb3 100644
--- a/include/safari_zone.h
+++ b/include/safari_zone.h
@@ -13,6 +13,8 @@ void ExitSafariMode(void);
bool8 SafariZoneTakeStep(void);
void SafariZoneRetirePrompt(void);
+void CB2_EndSafariBattle(void);
+
struct Pokeblock *SafariZoneGetActivePokeblock(void);
void SafariZoneActivatePokeblockFeeder(u8 pokeblock_index);
diff --git a/include/secret_base.h b/include/secret_base.h
index 630a36773..b2502889c 100644
--- a/include/secret_base.h
+++ b/include/secret_base.h
@@ -9,5 +9,6 @@
void sub_80E9578(void);
void sub_80E980C(void);
u8 *GetSecretBaseMapName(u8 *dest);
+const u8 *GetSecretBaseTrainerLoseText(void);
#endif //GUARD_SECRET_BASE_H
diff --git a/include/songs.h b/include/songs.h
index 5a1fff00c..37c4f16b4 100644
--- a/include/songs.h
+++ b/include/songs.h
@@ -372,20 +372,20 @@ enum
BGM_BATTLE_DOME_TOURNAMENT,
BGM_BATTLE_PIKE,
BGM_BATTLE_FACTORY,
- BGM_BATTLE_LEGENDARY,
- BGM_BATTLE_FRONTIER_BRAIN,
- BGM_BATTLE_MEW,
- BGM_BATTLE_DOME, // end of the human-readable names
+ /*0x1D6*/ BGM_BATTLE_LEGENDARY,
+ /*0x1D7*/ BGM_BATTLE_FRONTIER_BRAIN,
+ /*0x1D8*/ BGM_BATTLE_MEW,
+ /*0x1D9*/ BGM_BATTLE_DOME, // end of the human-readable names
/*0x1DA*/ BGM_BATTLE27, // wild
- BGM_BATTLE31, // aqua/magma grunt
- BGM_BATTLE20, // trainer
- BGM_BATTLE32, // gym leader
- BGM_BATTLE33, // champion
- BGM_BATTLE36, // regi
- BGM_BATTLE34, // weather trio
- BGM_BATTLE35, // rival
- BGM_BATTLE38, // elite four
- BGM_BATTLE30, // aqua/magma leader
+ /*0x1DB*/ BGM_BATTLE31, // aqua/magma grunt
+ /*0x1DC*/ BGM_BATTLE20, // trainer
+ /*0x1DD*/ BGM_BATTLE32, // gym leader
+ /*0x1DE*/ BGM_BATTLE33, // champion
+ /*0x1DF*/ BGM_BATTLE36, // regi
+ /*0x1E0*/ BGM_BATTLE34, // weather trio
+ /*0x1E1*/ BGM_BATTLE35, // rival
+ /*0x1E2*/ BGM_BATTLE38, // elite four
+ /*0x1E3*/ BGM_BATTLE30, // aqua/magma leader
/*0x1E4*/ BGM_FRLG_FOLLOW_ME, // FR/LG names not known, human-readable again!
BGM_FRLG_GAMECORNER,
BGM_FRLG_ROCKET_HIDEOUT,
@@ -453,14 +453,14 @@ enum
BGM_FRLG_ISLAND_FOUR,
BGM_FRLG_ISLAND_SIX,
BGM_FRLG_FLUTE,
- BGM_FRLG_BATTLE_DEOXYS,
- BGM_FRLG_BATTLE_MEWTWO,
- BGM_FRLG_BATTLE_LEGENDARY,
- BGM_FRLG_LEADER_EYE,
- BGM_FRLG_DEOXYS_EYE,
- BGM_FRLG_TRAINER_TOWER,
- BGM_FRLG_HALL_OF_FAME_PALLET_TOWN,
- /*0x22E*/BGM_FRLG_TEACHY_TV,
+ /*0x227*/ BGM_FRLG_BATTLE_DEOXYS,
+ /*0x228*/ BGM_FRLG_BATTLE_MEWTWO,
+ /*0x229*/ BGM_FRLG_BATTLE_LEGENDARY,
+ /*0x22A*/ BGM_FRLG_LEADER_EYE,
+ /*0x22B*/ BGM_FRLG_DEOXYS_EYE,
+ /*0x22C*/ BGM_FRLG_TRAINER_TOWER,
+ /*0x22D*/ BGM_FRLG_HALL_OF_FAME_PALLET_TOWN,
+ /*0x22E*/ BGM_FRLG_TEACHY_TV,
};
#endif // GUARD_SONGS_H
diff --git a/include/strings.h b/include/strings.h
index a2745d382..eb0d7e166 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -82,6 +82,7 @@ extern const u8 gText_NoRegistry[];
extern const u8 gText_OkayToDeleteFromRegistry[];
extern const u8 gText_RegisteredDataDeleted[];
extern const u8 gUnknown_085EA79D[];
+extern const u8 gText_EmptyString2[];
extern const u8 gText_PkmnFainted3[];
extern const u8 gText_Coins[];
diff --git a/include/trainer.h b/include/trainer.h
new file mode 100644
index 000000000..232cde608
--- /dev/null
+++ b/include/trainer.h
@@ -0,0 +1,19 @@
+#ifndef GUARD_TRAINER_H
+#define GUARD_TRAINER_H
+
+#define TRAINER_ENCOUNTER_MUSIC_MALE 0 // standard male encounter music
+#define TRAINER_ENCOUNTER_MUSIC_FEMALE 1 // standard female encounter music
+#define TRAINER_ENCOUNTER_MUSIC_GIRL 2 // used for male Tubers and Young Couples too
+#define TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS 3
+#define TRAINER_ENCOUNTER_MUSIC_INTENSE 4
+#define TRAINER_ENCOUNTER_MUSIC_COOL 5
+#define TRAINER_ENCOUNTER_MUSIC_AQUA 6
+#define TRAINER_ENCOUNTER_MUSIC_MAGMA 7
+#define TRAINER_ENCOUNTER_MUSIC_SWIMMER 8
+#define TRAINER_ENCOUNTER_MUSIC_TWINS 9 // used for other trainer classes too
+#define TRAINER_ENCOUNTER_MUSIC_ELITE_FOUR 10
+#define TRAINER_ENCOUNTER_MUSIC_HIKER 11 // used for other trainer classes too
+#define TRAINER_ENCOUNTER_MUSIC_INTERVIEWER 12
+#define TRAINER_ENCOUNTER_MUSIC_RICH 13 // Rich Boys and Gentlemen
+
+#endif // GUARD_TRAINER_H
diff --git a/include/trainer_ids.h b/include/trainer_ids.h
index 65c80187f..5d807789b 100644
--- a/include/trainer_ids.h
+++ b/include/trainer_ids.h
@@ -2,6 +2,11 @@
#define GUARD_TRAINER_IDS_H
#define NO_OF_TRAINERS 854
+
+#define TRAINER_ID_SIDNEY 261
+#define TRAINER_ID_PHOEBE 262
+#define TRAINER_ID_GLACIA 263
+#define TRAINER_ID_DRAKE 264
#define TRAINER_ID_STEVEN 804
#endif // GUARD_TRAINER_IDS_H
diff --git a/include/trainer_see.h b/include/trainer_see.h
index ab035d9f8..5da50cfa1 100644
--- a/include/trainer_see.h
+++ b/include/trainer_see.h
@@ -1,6 +1,21 @@
#ifndef GUARD_TRAINER_SEE_H
#define GUARD_TRAINER_SEE_H
+struct ApproachingTrainer
+{
+ u8 mapObjectId;
+ u8 radius;
+ u8 field_2;
+ u8 field_3;
+ const u8 *trainerScriptPtr;
+ u8 field_8;
+ u8 field_9;
+ u8 field_A;
+ u8 field_B;
+};
+
+extern struct ApproachingTrainer gApproachingTrainers[];
+
void sub_80B4578(struct MapObject *);
u8 sub_80B47BC(void);
void sub_8155D78(struct MapObject *);
diff --git a/include/vars.h b/include/vars.h
index 763b7379d..bc3f2ab1f 100644
--- a/include/vars.h
+++ b/include/vars.h
@@ -14,13 +14,14 @@
#define VAR_0x4008 0x4008
#define VAR_0x4009 0x4009
#define VAR_0x400A 0x400A
+#define VAR_0x400E 0x400E
#define VAR_0x4010 0x4010
#define VAR_0x4011 0x4011
#define VAR_0x401F 0x401F
#define VAR_RECYCLE_GOODS 0x4020
#define VAR_REPEL_STEP_COUNT 0x4021
#define VAR_ICE_STEP_COUNT 0x4022
-#define VAR_FIRST_POKE 0x4023
+#define VAR_STARTER_ID 0x4023
#define VAR_MIRAGE_RND_H 0x4024
#define VAR_MIRAGE_RND_L 0x4025
#define VAR_SECRET_BASE_MAP 0x4026
@@ -57,6 +58,7 @@
#define VAR_0x40BC 0x40BC
#define VAR_0x40C2 0x40C2
+#define VAR_0x40CE 0x40CE
#define VAR_FRONTIER_FACILITY 0x40CF
#define VAR_DAILY_SLOTS 0x40E6