Added base BG methods and hooks

This has only been tested on Mangos Zero and will definitely need tweaking on Trinity

More methods will be added SHORTLY
This commit is contained in:
Foereaper
2014-09-10 22:38:21 +02:00
parent f2a591b87b
commit 0bfdf632e7
8 changed files with 308 additions and 2 deletions

View File

@@ -601,6 +601,17 @@ namespace LuaGlobalFunctions
return 0;
}
int RegisterBGEvent(lua_State* L)
{
uint32 ev = Eluna::CHECKVAL<uint32>(L, 1);
luaL_checktype(L, 2, LUA_TFUNCTION);
lua_pushvalue(L, 2);
int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_BG, 0, ev, functionRef);
return 0;
}
int ReloadEluna(lua_State* /*L*/)
{
Eluna::reload = true;