Cleanup of some lua code, initial work on encounter_quests

This commit is contained in:
KimLS
2013-05-19 12:13:44 -07:00
parent 17954dd8fe
commit 69bad31019
34 changed files with 2714 additions and 450 deletions
+25
View File
@@ -6,6 +6,9 @@
#include "lua_client.h"
#include "lua_npc.h"
#include "lua.hpp"
#include <luabind/luabind.hpp>
bool Lua_Entity::IsClient() {
Lua_Safe_Call_Bool();
return self->IsClient();
@@ -84,4 +87,26 @@ Lua_Mob Lua_Entity::CastToMob() {
return Lua_Mob(m);
}
luabind::scope lua_register_entity() {
return luabind::class_<Lua_Entity>("Entity")
.def(luabind::constructor<>())
.property("null", &Lua_Entity::Null)
.property("valid", &Lua_Entity::Valid)
.def("IsClient", &Lua_Entity::IsClient)
.def("IsNPC", &Lua_Entity::IsNPC)
.def("IsMob", &Lua_Entity::IsMob)
.def("IsMerc", &Lua_Entity::IsMerc)
.def("IsCorpse", &Lua_Entity::IsCorpse)
.def("IsPlayerCorpse", &Lua_Entity::IsPlayerCorpse)
.def("IsNPCCorpse", &Lua_Entity::IsNPCCorpse)
.def("IsObject", &Lua_Entity::IsObject)
.def("IsDoor", &Lua_Entity::IsDoor)
.def("IsTrap", &Lua_Entity::IsTrap)
.def("IsBeacon", &Lua_Entity::IsBeacon)
.def("GetID", &Lua_Entity::GetID)
.def("CastToClient", &Lua_Entity::CastToClient)
.def("CastToNPC", &Lua_Entity::CastToNPC)
.def("CastToMob", &Lua_Entity::CastToMob);
}
#endif