summaryrefslogtreecommitdiff
path: root/src/scripting
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripting')
-rw-r--r--src/scripting/lua.cpp14
-rw-r--r--src/scripting/luautil.h5
2 files changed, 19 insertions, 0 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index 0c27788c..fb6990e5 100644
--- a/src/scripting/lua.cpp
+++ b/src/scripting/lua.cpp
@@ -2958,6 +2958,19 @@ static int get_monster_class(lua_State *s)
return 1;
}
+/** LUA get_monster_classes (monsterclass)
+ * get_monster_classes()
+ **
+ * **Return value:** A Table with all monster classes. The id of the monster
+ * is the key. The monster class itself the value. See below for the usage of
+ * this object.
+ */
+static int get_monster_classes(lua_State *s)
+{
+ pushSTLContainer(s, monsterManager->getMonsterClasses());
+ return 1;
+}
+
/** LUA monsterclass:on_update (monsterclass)
* monsterclass:on_update(function callback)
**
@@ -3265,6 +3278,7 @@ LuaScript::LuaScript():
{ "on_mapupdate", on_mapupdate },
{ "get_item_class", get_item_class },
{ "get_monster_class", get_monster_class },
+ { "get_monster_classes", get_monster_classes },
{ "get_status_effect", get_status_effect },
{ "npc_create", npc_create },
{ "say", say },
diff --git a/src/scripting/luautil.h b/src/scripting/luautil.h
index e7cbc754..653bf24a 100644
--- a/src/scripting/luautil.h
+++ b/src/scripting/luautil.h
@@ -212,6 +212,11 @@ inline void push(lua_State *s, MapObject *val)
LuaMapObject::push(s, val);
}
+inline void push(lua_State *s, MonsterClass *val)
+{
+ LuaMonsterClass::push(s, val);
+}
+
/* Pushes an STL LIST */
template <typename T>