Added more BG hooks, fixed a few issues

This commit is contained in:
Foereaper
2014-09-10 23:42:20 +02:00
parent 29385c63b1
commit 731682708f
4 changed files with 50 additions and 15 deletions

View File

@@ -1935,10 +1935,41 @@ CreatureAI* Eluna::GetAI(Creature* creature)
void Eluna::OnBGStart(BattleGround* bg, BattleGroundTypeId bgId, uint32 instanceId)
{
ENTRY_BEGIN(BGEventBindings, bg->GetTypeID(), BG_EVENT_ON_START, return);
EVENT_BEGIN(BGEventBindings, BG_EVENT_ON_START, return);
Push(L, bg);
Push(L, bgId);
Push(L, instanceId);
ENTRY_EXECUTE(0);
EVENT_EXECUTE(0);
ENDCALL();
}
void Eluna::OnBGEnd(BattleGround* bg, BattleGroundTypeId bgId, uint32 instanceId, Team winner)
{
EVENT_BEGIN(BGEventBindings, BG_EVENT_ON_END, return);
Push(L, bg);
Push(L, bgId);
Push(L, instanceId);
Push(L, winner);
EVENT_EXECUTE(0);
ENDCALL();
}
void Eluna::OnBGCreate(BattleGround* bg, BattleGroundTypeId bgId, uint32 instanceId)
{
EVENT_BEGIN(BGEventBindings, BG_EVENT_ON_CREATE, return);
Push(L, bg);
Push(L, bgId);
Push(L, instanceId);
EVENT_EXECUTE(0);
ENDCALL();
}
void Eluna::OnBGDestroy(BattleGround* bg, BattleGroundTypeId bgId, uint32 instanceId)
{
EVENT_BEGIN(BGEventBindings, BG_EVENT_ON_PRE_DESTROY, return);
Push(L, bg);
Push(L, bgId);
Push(L, instanceId);
EVENT_EXECUTE(0);
ENDCALL();
}