summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-15 17:43:49 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-15 17:43:49 +0300
commit77db5d34b091c366750410281369ff4ce926b9b6 (patch)
tree3aaa39b3f2442fa42e248293b39e74e5fc40f23a /src/map/script.c
parentd8d87bbaf74bf6b013b5cdcd2e9602f1892bbd71 (diff)
downloadevol-hercules-77db5d34b091c366750410281369ff4ce926b9b6.tar.gz
evol-hercules-77db5d34b091c366750410281369ff4ce926b9b6.tar.bz2
evol-hercules-77db5d34b091c366750410281369ff4ce926b9b6.tar.xz
evol-hercules-77db5d34b091c366750410281369ff4ce926b9b6.zip
Impliment script function npctalk3.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index fffaa70..54bf82c 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -85,3 +85,46 @@ BUILDIN(restoreCam)
send_npccommand(sd, st->oid, 3);
return 0;
}
+
+BUILDIN(npcTalk3)
+{
+ getSD();
+
+ char *str;
+ char *msg;
+ struct npc_data *nd = NULL;
+
+ if (script_hasdata(st, 3))
+ {
+ nd = npc->name2id (script_getstr(st, 2));
+ str = script_getstr(st, 3);
+ }
+ else
+ {
+ nd = (struct npc_data *) map->id2bl (st->oid);
+ str = script_getstr(st, 2);
+ }
+
+ if (!nd)
+ return 0;
+
+ msg = nd->name;
+// +++ after restore lang support need translate here
+/*
+ if (sd)
+ msg = (char*)lang_pctrans (nd->name, sd);
+ else
+ msg = nd->name;
+*/
+ if (strlen(str) + strlen(msg) > 450)
+ return 0;
+
+ if (nd)
+ {
+ char message[500];
+ strcpy (message, msg);
+ strcat (message, " : ");
+ strcat (message, str);
+ send_local_message (sd, &(nd->bl), message);
+ }
+}