From 017b958b69160f52842280850b77a91672156413 Mon Sep 17 00:00:00 2001 From: phobos2077 Date: Sun, 25 Oct 2015 21:43:13 +0700 Subject: [PATCH] Updated hook script docs. --- artifacts/scripting/headers/sfall.h | 1 + artifacts/scripting/hookscripts.txt | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/artifacts/scripting/headers/sfall.h b/artifacts/scripting/headers/sfall.h index e7e2d265..afff00fe 100644 --- a/artifacts/scripting/headers/sfall.h +++ b/artifacts/scripting/headers/sfall.h @@ -41,6 +41,7 @@ #define HOOK_STEAL (22) #define HOOK_WITHINPERCEPTION (23) #define HOOK_INVENTORYMOVE (24) +#define HOOK_INVENWIELD (25) //Valid arguments to list_begin #define LIST_CRITTERS (0) diff --git a/artifacts/scripting/hookscripts.txt b/artifacts/scripting/hookscripts.txt index cefccdae..3fa3243f 100644 --- a/artifacts/scripting/hookscripts.txt +++ b/artifacts/scripting/hookscripts.txt @@ -255,12 +255,19 @@ int ret1 - the new ap cost ------------------------------------------- +(DEPRECATED) hs_hexmoveblocking.int -hs_hexshootblocking.int hs_hexaiblocking.int +hs_hexshootblocking.int +hs_hexsightblocking.int Runs when checking to see if a hex blocks movement or shooting. (or ai-ing, presumably...) +NOTE: these hook scripts can become very CPU-intensive and you should avoid using them. +For this reason, they may be removed in future versions. +If you want to check if some tile or path is blocked, use functions: obj_blocking_tile, obj_blocking_line, path_find_to. +If you want script to be called every time NPC moves by hex in combat, use hs_movecost hook. + Critter arg1 - the critter doing the moving int arg2 - the tile number being checked int arg3 - the elevation being checked @@ -388,3 +395,17 @@ Item arg2 - Item being moved Item arg3 - Item being replaced or weapon being reloaded (can be 0) int ret1 - Override setting (-1 - use engine handler, any other value - prevent relocation of item/reloading weapon) + +------------------------------------------- + +hs_invenwield.int + +Runs before wielding or unwielding an armor or a weapon by a critter (except when using inventory by PC). +An example usage would be to change critter art depending on armor being used or to dynamically customize weapon animations. + +Critter arg1 - critter +Obj arg2 - item being wielded or unwielded (weapon/armor), may be 0 when unwielding +int arg3 - slot (INVEN_TYPE_*) +int arg4 - 1 when wielding, 0 when unwielding + +int ret1 - overrides hard-coded handler (-1 - use engine handler, any other value - override) - NOT RECOMMENDED