summaryrefslogtreecommitdiff
path: root/Trainer-Scripts.md
diff options
context:
space:
mode:
Diffstat (limited to 'Trainer-Scripts.md')
-rw-r--r--Trainer-Scripts.md12
1 files changed, 11 insertions, 1 deletions
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)