summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-10-19 22:13:09 -0300
committerJesusaves <cpntb1@ymail.com>2019-10-19 22:13:09 -0300
commit2b1948fb9004a66450192405f3ebd258d0b22837 (patch)
tree327292900df6a664783cc14e8b8d642bae5f8593
parent50ee9e848cb9b87ea42580783051e6c883ed8f73 (diff)
downloadevol-hercules-2b1948fb9004a66450192405f3ebd258d0b22837.tar.gz
evol-hercules-2b1948fb9004a66450192405f3ebd258d0b22837.tar.bz2
evol-hercules-2b1948fb9004a66450192405f3ebd258d0b22837.tar.xz
evol-hercules-2b1948fb9004a66450192405f3ebd258d0b22837.zip
New CMD Command: doevent
This allows me to fire NPC events from CPC which is convenient to me. But we're using a dummy SD and I've removed some checks, so it is fragile.
-rw-r--r--src/emap/console.c13
-rw-r--r--src/emap/console.h1
-rw-r--r--src/emap/init.c1
3 files changed, 15 insertions, 0 deletions
diff --git a/src/emap/console.c b/src/emap/console.c
index 80dbab3..687da46 100644
--- a/src/emap/console.c
+++ b/src/emap/console.c
@@ -11,6 +11,9 @@
#include "common/memmgr.h"
#include "common/socket.h"
#include "map/map.h"
+#include "map/npc.h"
+#include "map/pc.h"
+#include "map/script.h"
#include "emap/console.h"
#include "emap/inter.h"
@@ -29,3 +32,13 @@ CPCMD(serverExit)
map->retval = code;
map->do_shutdown();
}
+
+CPCMD(C_doevent)
+{
+ struct map_session_data* sd;
+ sd = pc->get_dummy_sd();
+
+ //script->check_event(st, line); // Dangerous but not needed
+ npc->event(sd, line, 0);
+ return;
+}
diff --git a/src/emap/console.h b/src/emap/console.h
index 012b0af..44b47dc 100644
--- a/src/emap/console.h
+++ b/src/emap/console.h
@@ -7,5 +7,6 @@
#include "common/console.h"
CPCMD(serverExit);
+CPCMD(C_doevent);
#endif // EVOL_MAP_CONSOLE
diff --git a/src/emap/init.c b/src/emap/init.c
index 0fc168b..1d21149 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -115,6 +115,7 @@ HPExport void plugin_init (void)
addAtcommand("item", tmw2item);
addCPCommand("serverexit", serverExit);
+ addCPCommand("doevent", C_doevent);
addScriptCommand("chatjoin", "i*", chatJoin);
addScriptCommand("setcamnpc", "*", setCamNpc);