Add GAMEOBJECT_EVENT_ON_USE.

This commit is contained in:
Patman64
2015-01-15 00:08:48 -05:00
parent 54c82280cd
commit 5492a68e7b
3 changed files with 13 additions and 0 deletions

View File

@@ -2577,6 +2577,17 @@ void Eluna::OnRemoveFromWorld(GameObject* gameobject)
CallAllFunctions(GameObjectEventBindings, GAMEOBJECT_EVENT_ON_REMOVE, gameobject->GetEntry());
}
bool Eluna::OnGameObjectUse(Player* pPlayer, GameObject* pGameObject)
{
if (!GameObjectEventBindings->HasEvents(GAMEOBJECT_EVENT_ON_USE, pGameObject->GetEntry()))
return false;
LOCK_ELUNA;
Push(pGameObject);
Push(pPlayer);
return CallAllFunctionsBool(GameObjectEventBindings, GAMEOBJECT_EVENT_ON_USE, pGameObject->GetEntry());
}
CreatureAI* Eluna::GetAI(Creature* creature)
{
if (!CreatureEventBindings->HasEvents(creature->GetEntry()) && !CreatureUniqueBindings->HasEvents(creature->GET_GUID(), creature->GetInstanceId()))