From 7e88a973c00bd96af1288399a4e6dab207e8683c Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Sat, 4 May 2013 09:49:30 +0200 Subject: Added get_monster_classes() bind It returns all monster classes in a id->monsterclass table. --- src/scripting/lua.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/scripting/lua.cpp') diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index b3fe93c..9ffe1f2 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -2955,6 +2955,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) ** @@ -3260,6 +3273,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 }, -- cgit