summaryrefslogtreecommitdiff
path: root/server/scripts/npc_vars.txt
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-18 23:22:24 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-18 23:22:24 +0300
commitabcf13b475a31a397c5f8de582e1ee9c52d9a993 (patch)
tree51cf8bd073fbff72473f89e11754237afb0614fa /server/scripts/npc_vars.txt
parentcc9b372778cb9d16a80b442ae0e2bb6813024fef (diff)
downloaddocs-abcf13b475a31a397c5f8de582e1ee9c52d9a993.tar.gz
docs-abcf13b475a31a397c5f8de582e1ee9c52d9a993.tar.bz2
docs-abcf13b475a31a397c5f8de582e1ee9c52d9a993.tar.xz
docs-abcf13b475a31a397c5f8de582e1ee9c52d9a993.zip
Copy npc vars docs from wiki.
Diffstat (limited to 'server/scripts/npc_vars.txt')
-rw-r--r--server/scripts/npc_vars.txt40
1 files changed, 40 insertions, 0 deletions
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 ======
+<code>
+function<tab>script<tab>testFunc<tab>{
+ .class = 100; // will change class of the NPC
+ return;
+}
+
+<NPC header> {
+ .dir = 2; // turn to left;
+ mes "NPC current coordinates: " + .x + "," + .y;
+ testFunc();
+}
+</code>