summaryrefslogtreecommitdiff
path: root/world/map/npc/commands/npctalk.txt
diff options
context:
space:
mode:
authorWushin <pasekei@gmail.com>2016-05-11 16:49:56 -0500
committerWushin <pasekei@gmail.com>2016-05-11 16:49:56 -0500
commitd0dc01460197e2ac35fe4b015a9ed9af6d4d6442 (patch)
tree450d6677545136f4c9bed090d2d9ac88331418b8 /world/map/npc/commands/npctalk.txt
parent74b1de6a5824ab657a338cb0adee0fbc0dcc01a0 (diff)
parent3b7d0dad8a3d84ff667d670fcbbe527ca3b5d92d (diff)
downloadserverdata-d0dc01460197e2ac35fe4b015a9ed9af6d4d6442.tar.gz
serverdata-d0dc01460197e2ac35fe4b015a9ed9af6d4d6442.tar.bz2
serverdata-d0dc01460197e2ac35fe4b015a9ed9af6d4d6442.tar.xz
serverdata-d0dc01460197e2ac35fe4b015a9ed9af6d4d6442.zip
Merge pull request #503 from mekolat/atcmd
atcommand modifications
Diffstat (limited to 'world/map/npc/commands/npctalk.txt')
-rw-r--r--world/map/npc/commands/npctalk.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/world/map/npc/commands/npctalk.txt b/world/map/npc/commands/npctalk.txt
new file mode 100644
index 00000000..215e91ca
--- /dev/null
+++ b/world/map/npc/commands/npctalk.txt
@@ -0,0 +1,23 @@
+-|script|@npctalk|32767
+{
+ callfunc "argv_splitter";
+ if (GM < CMD_NPCTALK && GM < G_SYSOP) goto L_GM;
+ if (@argv$[0] == "" || @argv$[1] == "") goto L_Failed;
+ if (getnpcid(@argv$[0]) < 1) goto L_Failed;
+
+ gmlog "@npctalk " + @args$;
+ npctalk @argv$[0], @argv$[1];
+ end;
+
+L_Failed:
+ message strcharinfo(0), "npctalk : Impossible to attach to the target npc. Did you try putting the name in \"quotation marks\"?";
+ end;
+
+L_GM:
+ message strcharinfo(0), "npctalk : GM command is level "+ CMD_NPCTALK +", but you are level " + GM;
+ end;
+
+OnInit:
+ registercmd chr(ATCMD_SYMBOL) + "npctalk", strnpcinfo(0);
+ end;
+}