From abcf13b475a31a397c5f8de582e1ee9c52d9a993 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 18 Feb 2016 23:22:24 +0300 Subject: Copy npc vars docs from wiki. --- server/scripts/npc_vars.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 server/scripts/npc_vars.txt (limited to 'server/scripts/npc_vars.txt') diff --git a/server/scripts/npc_vars.txt b/server/scripts/npc_vars.txt new file mode 100644 index 0000000..5957d84 --- /dev/null +++ b/server/scripts/npc_vars.txt @@ -0,0 +1,40 @@ +====== Special NPC variables. ====== + +The following NPC variables have special meaning. They exist to simplify access to internal NPC settings. + +You can access these variables even outside NPC. If you use them in external functions, they are applied to current NPC. + + +====== List of special NPC variables. ====== +^ Variable ^ Access ^ Affects ^ Alias ^ +| .dir | r/w | direction | getnpcdir/setnpcdir | +| .class | r/w | class | getnpcclass/? | +| .map$ | r/o | current map name | getmapxy | +| .x | r/o | X coordinate | getmapxy | +| .y | r/o | Y coordinate | getmapxy | +| .speed | r/w | speed | npcspeed | +| .sex | r/w | gender | setnpcsex | +| .distance | r/w | minimal distance from player to activate it | setnpcdistance | +| .chat | r/o | chat ID | ? | +| .name$ | r/w | name | strnpcinfo(0) | +| .extname$ | r/o | extended name | strnpcinfo(3) | +| .sit | r/w | sit flag | npcsit | +| .stand | r/w | stand flag | npcstand | +| .walkmask | r/w | walk mask (see WALK_* in const.txt) | | +| .lang | r/w | default language | ? | +| .alwaysVisible| r/w | allow see npc from any distance | | + + +====== Example ====== + +functionscripttestFunc{ + .class = 100; // will change class of the NPC + return; +} + + { + .dir = 2; // turn to left; + mes "NPC current coordinates: " + .x + "," + .y; + testFunc(); +} + -- cgit v1.2.3-70-g09d2