summaryrefslogtreecommitdiff
path: root/world/map/npc
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-05-07 19:51:26 -0400
committermekolat <mekolat@users.noreply.github.com>2016-05-07 19:51:26 -0400
commit29e5e55df71dd3badd4036792fd43772c3cff005 (patch)
tree9efb5dac2a292bcde4f13bdf9424d62c25ed2e30 /world/map/npc
parent63bd5a4c8d36bf57d36ea112f7f33f4fd4261c1e (diff)
downloadserverdata-29e5e55df71dd3badd4036792fd43772c3cff005.tar.gz
serverdata-29e5e55df71dd3badd4036792fd43772c3cff005.tar.bz2
serverdata-29e5e55df71dd3badd4036792fd43772c3cff005.tar.xz
serverdata-29e5e55df71dd3badd4036792fd43772c3cff005.zip
add @npctalk command
Diffstat (limited to 'world/map/npc')
-rw-r--r--world/map/npc/commands/_import.txt1
-rw-r--r--world/map/npc/commands/npctalk.txt23
2 files changed, 24 insertions, 0 deletions
diff --git a/world/map/npc/commands/_import.txt b/world/map/npc/commands/_import.txt
index 4585c052..90cdb5b5 100644
--- a/world/map/npc/commands/_import.txt
+++ b/world/map/npc/commands/_import.txt
@@ -11,3 +11,4 @@ npc: npc/commands/remotecmd.txt
npc: npc/commands/hug.txt
npc: npc/commands/warp.txt
npc: npc/commands/mute.txt
+npc: npc/commands/npctalk.txt
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;
+}