summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-20 15:48:42 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-20 15:48:42 +0300
commit72dbae9ff75d62d5c6406169515b8054e1d84362 (patch)
tree136f4954f01973cb87c491e9cb144e2948ca60aa /src/map/script.c
parent8c7713fd898900e7afe936e647c051f0a92e07e1 (diff)
downloadplugin-72dbae9ff75d62d5c6406169515b8054e1d84362.tar.gz
plugin-72dbae9ff75d62d5c6406169515b8054e1d84362.tar.bz2
plugin-72dbae9ff75d62d5c6406169515b8054e1d84362.tar.xz
plugin-72dbae9ff75d62d5c6406169515b8054e1d84362.zip
Use translation in implimented script commands.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 932a3f0..3b09e88 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -18,6 +18,7 @@
#include "../../../map/quest.h"
#include "map/script.h"
+#include "map/lang.h"
#include "map/scriptdefines.h"
#include "map/send.h"
#include "map/session.h"
@@ -113,14 +114,10 @@ BUILDIN(npcTalk3)
if (!nd)
return false;
- 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 false;
@@ -179,9 +176,7 @@ BUILDIN(getItemLink)
if (sd)
{
if (i_data)
-// +++ after restore lang support need translate here
-// sprintf(item_name, "[@@%u|%s@@]", (unsigned)i_data->nameid, lang_pctrans (i_data->jname, sd));
- sprintf(item_name, "[@@%u|%s@@]", (unsigned)i_data->nameid, i_data->jname);
+ sprintf(item_name, "[@@%u|%s@@]", (unsigned)i_data->nameid, lang_pctrans (i_data->jname, sd));
else if (item_id > 0)
sprintf(item_name, "[@@%u|Unknown Item@@]", (unsigned)item_id);
else
@@ -190,9 +185,7 @@ BUILDIN(getItemLink)
else
{
if (i_data)
-// +++ after restore lang support need translate here
-// sprintf(item_name, "[%s]", lang_pctrans (i_data->jname, sd));
- sprintf(item_name, "[%s]", i_data->jname);
+ sprintf(item_name, "[%s]", lang_pctrans (i_data->jname, sd));
else
sprintf(item_name, "[Unknown Item]");
}
@@ -241,9 +234,7 @@ BUILDIN(requestLang)
int lng = -1;
if (*sd->npc_str)
{
- lng = 3;
-// +++ after restore lang support need translate here
-// lng = lang_getId(sd->npc_str);
+ lng = lang_getId(sd->npc_str);
}
script->set_reg(st, sd, uid, name, (void*)h64BPTRSIZE(lng), script_getref(st,2));
st->state = RUN;