mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
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:
@@ -104,6 +104,7 @@ GameObjectEventBindings(new EntryBind<HookMgr::GameObjectEvents>("GameObjectEven
|
||||
GameObjectGossipBindings(new EntryBind<HookMgr::GossipEvents>("GossipEvents (gameobject)", *this)),
|
||||
ItemEventBindings(new EntryBind<HookMgr::ItemEvents>("ItemEvents", *this)),
|
||||
ItemGossipBindings(new EntryBind<HookMgr::GossipEvents>("GossipEvents (item)", *this)),
|
||||
BGEventBindings(new EntryBind<HookMgr::BGEvents>("BGEvents", *this)),
|
||||
playerGossipBindings(new EntryBind<HookMgr::GossipEvents>("GossipEvents (player)", *this))
|
||||
{
|
||||
// open base lua
|
||||
@@ -151,6 +152,7 @@ Eluna::~Eluna()
|
||||
delete ItemEventBindings;
|
||||
delete ItemGossipBindings;
|
||||
delete playerGossipBindings;
|
||||
delete BGEventBindings;
|
||||
|
||||
// Must close lua state after deleting stores and mgr
|
||||
lua_close(L);
|
||||
@@ -769,6 +771,21 @@ void Eluna::Register(uint8 regtype, uint32 id, uint32 evt, int functionRef)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case HookMgr::REGTYPE_BG:
|
||||
if (evt < HookMgr::BG_EVENT_COUNT)
|
||||
{
|
||||
if (!BattleGroundTypeId(id))
|
||||
{
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, functionRef);
|
||||
luaL_error(L, "Couldn't find battleground with type (ID: %d)!", id);
|
||||
return;
|
||||
}
|
||||
|
||||
BGEventBindings->Insert(id, evt, functionRef);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, functionRef);
|
||||
luaL_error(L, "Unknown event type (regtype %d, id %d, event %d)", regtype, id, evt);
|
||||
|
||||
Reference in New Issue
Block a user