From 61205395749c082a9b5e607012504c98d9cdfbd4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Nov 2014 17:05:17 +0300 Subject: Impliment limited script function l. without translations for now. --- src/Makefile.am | 4 +++- src/map/dummy.c | 2 -- src/map/init.c | 6 +++--- src/map/script.c | 22 ++++++++++++++++++++++ src/map/script.h | 9 +++++++++ 5 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 src/map/script.c create mode 100644 src/map/script.h diff --git a/src/Makefile.am b/src/Makefile.am index 1bd1756..5582456 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,9 @@ AUTOMAKE_OPTIONS = subdir-objects MAP_SRC = map/dummy.c \ map/dummy.h \ - map/init.c + map/init.c \ + map/script.c \ + map/script.h lib_LTLIBRARIES = libevol_map.la libevol_map_la_SOURCES = ${MAP_SRC} diff --git a/src/map/dummy.c b/src/map/dummy.c index 0541d53..ae579b7 100644 --- a/src/map/dummy.c +++ b/src/map/dummy.c @@ -14,8 +14,6 @@ #include "../../../map/pc.h" #include "../../../map/script.h" -//#include "../../../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */ - void showNotImplimented() { ShowWarning("Not implimented\n"); diff --git a/src/map/init.c b/src/map/init.c index 9d840a4..8c65efe 100644 --- a/src/map/init.c +++ b/src/map/init.c @@ -15,12 +15,13 @@ #include "../../../map/script.h" #include "map/dummy.h" +#include "map/script.h" #include "../../../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */ HPExport struct hplugin_info pinfo = { - "evoldummy", + "evol_map", SERVER_TYPE_MAP, "0.1", HPM_VERSION @@ -48,8 +49,7 @@ HPExport void plugin_init (void) { // addScriptCommand("mesn", "*", dummy); // addScriptCommand("mesq", "s*", dummy); // addScriptCommand("g", "ss", dummyStr); - addScriptCommand("l", "s*", dummyStr); - // must be ss + addScriptCommand("l", "s*", l); addScriptCommand("lg", "s*", dummyStr); addScriptCommand("getlang", "*", dummyStr); addScriptCommand("setlang", "i", dummy); diff --git a/src/map/script.c b/src/map/script.c new file mode 100644 index 0000000..0ad7d48 --- /dev/null +++ b/src/map/script.c @@ -0,0 +1,22 @@ +// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// Copyright (c) 2014 Evol developers + +#include +#include +#include + +#include "../../../common/HPMi.h" +#include "../../../common/malloc.h" +#include "../../../common/mmo.h" +#include "../../../common/socket.h" +#include "../../../common/strlib.h" +#include "../../../map/clif.h" +#include "../../../map/pc.h" +#include "../../../map/script.h" + +BUILDIN(l) +{ + // for now not translate and not use format parameters + script_pushstr(st, strdup(script_getstr(st, 2))); + return true; +} diff --git a/src/map/script.h b/src/map/script.h new file mode 100644 index 0000000..e5c0bbd --- /dev/null +++ b/src/map/script.h @@ -0,0 +1,9 @@ +// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// Copyright (c) 2014 Evol developers + +#ifndef EVOL_MAP_SCRIPT +#define EVOL_MAP_SCRIPT + +BUILDIN(l); + +#endif // EVOL_MAP_SCRIPT -- cgit v1.2.3-70-g09d2