Added a new hook: HOOK_ENCOUNTER

Added procedure and macros for unsigned integer comparison to lib.math.h.
This commit is contained in:
NovaRain
2020-01-19 12:18:14 +08:00
parent bf4c47d1c0
commit 957ed92498
8 changed files with 130 additions and 0 deletions
+14
View File
@@ -669,3 +669,17 @@ int arg2 - 1 when the target object is valid to attack, 0 otherwise
Obj arg3 - the target object
mixed ret1 - overrides the target object, or pass -1 to prevent the player from attacking the object
-------------------------------------------
HOOK_ENCOUNTER (hs_encounter.int)
Runs whenever a random encounter occurs (except the Horrigan meeting and scripted encounters), or when the player enters a local map from the world map.
You can override the map for loading or the encounter.
int arg1 - event type: 0 - when a random encounter occurs, 1 - when the player enters from the world map
int arg2 - the map ID that the encounter will load (see MAPS.h or Maps.txt)
int arg3 - 1 when the encounter occurs is a special encounter, 0 otherwise
int ret1 - overrides the map ID, or pass -1 to cancel the encounter and continue traveling (only for event type 0)
int ret2 - pass 1 to cancel the encounter and load the specified map from the ret1 (only for event type 0)