Eluna improve object variable extension

This commit is contained in:
Rochet2
2014-07-11 00:20:25 +03:00
parent dc8afa45b2
commit 1447e0da57
6 changed files with 138 additions and 70 deletions

View File

@@ -1272,20 +1272,18 @@ void Eluna::OnUpdate(Map* map, uint32 diff)
EVENT_EXECUTE(0);
ENDCALL();
}
void Eluna::OnRemove(Map* map, Creature* creature)
void Eluna::OnRemove(GameObject* gameobject)
{
EVENT_BEGIN(ServerEventBindings, MAP_EVENT_ON_REMOVE_CREATURE, return);
Push(L, map);
Push(L, creature);
ENTRY_EXECUTE(0);
EVENT_BEGIN(ServerEventBindings, WORLD_EVENT_ON_DELETE_GAMEOBJECT, return);
Push(L, gameobject);
EVENT_EXECUTE(0);
ENDCALL();
}
void Eluna::OnRemove(Map* map, GameObject* gameobject)
void Eluna::OnRemove(Creature* creature)
{
EVENT_BEGIN(ServerEventBindings, MAP_EVENT_ON_REMOVE_GAMEOBJECT, return);
Push(L, map);
Push(L, gameobject);
ENTRY_EXECUTE(0);
EVENT_BEGIN(ServerEventBindings, WORLD_EVENT_ON_DELETE_CREATURE, return);
Push(L, creature);
EVENT_EXECUTE(0);
ENDCALL();
}
@@ -1392,6 +1390,22 @@ void Eluna::OnSummoned(Creature* pCreature, Unit* pSummoner)
ENDCALL();
}
void Eluna::OnAddToWorld(Creature* creature)
{
ENTRY_BEGIN(CreatureEventBindings, creature->GetEntry(), CREATURE_EVENT_ON_ADD, return);
Push(L, creature);
ENTRY_EXECUTE(0);
ENDCALL();
}
void Eluna::OnRemoveFromWorld(Creature* creature)
{
ENTRY_BEGIN(CreatureEventBindings, creature->GetEntry(), CREATURE_EVENT_ON_REMOVE, return);
Push(L, creature);
ENTRY_EXECUTE(0);
ENDCALL();
}
struct ElunaCreatureAI : ScriptedAI
{
#ifndef TRINITY
@@ -1845,6 +1859,22 @@ void Eluna::OnSpawn(GameObject* gameobject)
ENDCALL();
}
void Eluna::OnAddToWorld(GameObject* gameobject)
{
ENTRY_BEGIN(GameObjectEventBindings, gameobject->GetEntry(), GAMEOBJECT_EVENT_ON_ADD, return);
Push(L, gameobject);
ENTRY_EXECUTE(0);
ENDCALL();
}
void Eluna::OnRemoveFromWorld(GameObject* gameobject)
{
ENTRY_BEGIN(GameObjectEventBindings, gameobject->GetEntry(), GAMEOBJECT_EVENT_ON_REMOVE, return);
Push(L, gameobject);
ENTRY_EXECUTE(0);
ENDCALL();
}
CreatureAI* Eluna::GetAI(Creature* creature)
{
if (!CreatureEventBindings->GetBindMap(creature->GetEntry()))