summaryrefslogtreecommitdiff
path: root/src/scripting/lua.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-10-22 12:19:59 +0000
committerDavid Athay <ko2fan@gmail.com>2008-10-22 12:19:59 +0000
commitf598952da95395759d6725bfa5778a66695f1d73 (patch)
tree850c42e4611decf0aea7479c89b78be2abde6d86 /src/scripting/lua.cpp
parenta9ba502b2856b4125ffc99cafee429c00a7ea958 (diff)
downloadmanaserv-f598952da95395759d6725bfa5778a66695f1d73.tar.gz
manaserv-f598952da95395759d6725bfa5778a66695f1d73.tar.bz2
manaserv-f598952da95395759d6725bfa5778a66695f1d73.tar.xz
manaserv-f598952da95395759d6725bfa5778a66695f1d73.zip
Fixed NPC id bug. Changed time between server reconnection attempts.
Diffstat (limited to 'src/scripting/lua.cpp')
-rw-r--r--src/scripting/lua.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index 330e8198..09ac134e 100644
--- a/src/scripting/lua.cpp
+++ b/src/scripting/lua.cpp
@@ -29,6 +29,7 @@ extern "C" {
}
#include "defines.h"
+#include "game-server/accountconnection.hpp"
#include "game-server/buysell.hpp"
#include "game-server/character.hpp"
#include "game-server/collisiondetection.hpp"
@@ -724,6 +725,24 @@ static int LuaGetBeingsInCircle(lua_State *s)
}
/**
+ * Gets the post for the character
+ */
+static int LuaGetPost(lua_State *s)
+{
+ if (lua_isuserdata(s, 1))
+ {
+ Character *c = getCharacter(s, 1);
+
+ if (c)
+ {
+ accountHandler->getPost(c);
+ }
+ }
+
+ return 0;
+}
+
+/**
* Makes the server call the lua function deathEvent
* with the being ID when the being dies.
* tmw.note_on_death (being)
@@ -776,6 +795,7 @@ LuaScript::LuaScript():
{ "trigger_create", &LuaTrigger_Create },
{ "chatmessage", &LuaChatmessage },
{ "get_beings_in_circle", &LuaGetBeingsInCircle},
+ { "get_post", &LuaGetPost },
{ "note_on_death", &LuaNoteOnDeath },
{ NULL, NULL }
};