diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/script_commands.txt | 135 |
1 files changed, 58 insertions, 77 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 3467a5366..13ddb868f 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -259,7 +259,8 @@ direction across Y. Walking into that area will trigger the NPC. If no 'OnTouch:' special label is present in the NPC code, the execution will start from the beginning of the script, otherwise, it will start from the 'OnTouch:' label. Monsters can also trigger the NPC, though the label -'OnTouchNPC:' is used in this case. +'OnTouchNPC:' is used in this case. If player left area npc will called +if present label 'OnUnTouch'. The code part is the script code that will execute whenever the NPC is triggered. It may contain commands and function calls, descriptions of @@ -1040,6 +1041,12 @@ OnTouch_: Similar to OnTouch, but will only run one instance. Another character is chosen once the triggering character leaves the area. +OnUnTouch: + +This label will be executed if plater leave trigger area is defined for the NPC +object it's in. If it isn't present, nothing will happend. +The RID of the triggering character object will be attached. + OnPCLoginEvent: OnPCLogoutEvent: OnPCBaseLvUpEvent: @@ -3226,15 +3233,22 @@ let you enter. --------------------------------------- -*getareausers("<map name>",<x1>,<y1>,<x2>,<y2>) +*getareausers({"<map name>",}{<x1>,<y1>,<x2>,<y2>}) +*getareausers({"<map name>",}{<radius>}) This function will return the count of connected characters which are -located within the specified area - an x1/y1-x2/y2 square - on the -specified map. +located within the specified area. Area can be x1/y1-x2/y2 square, +or radius from npc position. If map name missing, used attached player map. This is useful for maps that are split into many buildings, such as all the "*_in" maps, due to all the shops and houses. +Examples: + // return players in area npc area on current map. + .@num = getareausers(); + // return players in square (1, 1) - (10, 10) + .@num = "players: " + getareausers(1, 1, 10, 10); + --------------------------------------- *getusersname; @@ -3890,79 +3904,6 @@ regardless of color. --------------------------------------- -*setriding {<flag>}; -*checkriding() - - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - @ /!\ This command is deprecated @ - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -This command is deprecated and it should not be used in new scripts, as it -is scheduled to be removed on or after November 30th, 2014. Please consider -using setmount and checkmount() instead. - -If <flag> is 0 this command will remove the mount from the character. -Otherwise it gives the invoking character a PecoPeco (if they are a Knight -series class), a GrandPeco (if they are a Crusader series class), or -a Gryphon (if they are a Royal Guard). Unlike 'setfalcon' and 'setcart' -this will not work at all if they aren't of a class which can ride. -Note: the character needs to have the skill KN_RIDING to gain a mount. - -The accompanying function will return 1 if the invoking character is -riding a bird and 0 if they aren't. - - if (checkriding()) mes "PLEASE leave your bird outside! No riding birds on the floor here!"; - ---------------------------------------- - -*setdragon {<color>}; -*checkdragon() - - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - @ /!\ This command is deprecated @ - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -This command is deprecated and it should not be used in new scripts, as it -is scheduled to be removed on or after November 30th, 2014. Please consider -using setmount and checkmount() instead. - -The 'setdragon' function toggles mounting a dragon for the invoking -character. It will return 1 if successful, 0 otherwise. - -If the character can mount a dragon, the <color> options are: - 1 - Green Dragon (default when omitted) - 2 - Brown Dragon - 3 - Gray Dragon - 4 - Blue Dragon - 5 - Red Dragon - -Note: the character must be a Rune Knight and have the skill - RK_DRAGONTRAINING to gain a mount. - -The accompanying function will return 1 if the invoking character is -riding a dragon and 0 if they aren't. - ---------------------------------------- - -*setmadogear {<flag>}; -*checkmadogear() - - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - @ /!\ This command is deprecated @ - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -This command is deprecated and it should not be used in new scripts, as it -is scheduled to be removed on or after November 30th, 2014. Please consider -using setmount and checkmount() instead. - -If <flag> is 0 this command will remove the mount from the character. -Otherwise it gives the invoking character a Mado (if they are a Mechanic). - -The accompanying function will return 1 if the invoking character has a -Mado and 0 if they don't. - ---------------------------------------- - *setcashmount; *hascashmount() @@ -7558,6 +7499,46 @@ config, and will not work properly if the NPC has a mob sprite. --------------------------------------- +*setnpcdistance <distance> + +This command can reduce distance from where npc can be clicked. +Usefull to use from OnInit event. + + // Set distance to one tile on server load + OnInit: + setnpcdistance 1; + +--------------------------------------- + +*getnpcdir {<name>}; + +Return current npc direction for parameter "name" or for attached npc +if it missing. If name missing and not attached npc, return -1. + +Example: + .@dir = getnpcdir(); + +--------------------------------------- + +*setnpcdir {<name>,} <direction>; + +Set npc direction. If npc name missing, will be used attached npc. + +Example: + setnpcdir 2; + +--------------------------------------- + +*getnpcclass {<name>}; + +Return npc class/sprite id for npc with given name or for attached npc. +If name missing and no attached npc, return -1. + +Example: + .@class = getnpcclass(); + +--------------------------------------- + *day; *night; |