From cd703e5a0e294e33aea40ef1cd6b8d24c845945b Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Thu, 9 Jul 2020 12:11:08 -0600 Subject: Updated Trainer Scripts (markdown) --- Trainer-Scripts.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Trainer-Scripts.md b/Trainer-Scripts.md index 27f197e..161d316 100644 --- a/Trainer-Scripts.md +++ b/Trainer-Scripts.md @@ -154,7 +154,17 @@ static u8 CheckTrainer(u8 objectEventId) } ``` -**3. Create the function `GetObjectEventTrainerSightFlagByObjectEventId`** +**3. Make the trainers only see in 1 direction +Find the function `GetTrainerApproachDistance`. Replace the line: +```c +if (trainerObj->trainerType == TRAINER_TYPE_NORMAL) +``` +with: +```c +if (trainerObj->trainerType == TRAINER_TYPE_NORMAL || trainerObj->trainerType >= TRAINER_TYPE_RUN_SCRIPT) +``` + +**4. Create the function `GetObjectEventTrainerSightFlagByObjectEventId`** First, open [src/event_object_movement.c](../blob/master/src/event_object_movement.c). Somewhere, add the function `GetObjectEventTrainerSightFlagByObjectEventId`: ```c u16 GetObjectEventTrainerSightFlagByObjectEventId(u8 objEventId) -- cgit v1.2.3