mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Add GAMEOBJECT_EVENT_ON_USE.
This commit is contained in:
11
HookMgr.cpp
11
HookMgr.cpp
@@ -2577,6 +2577,17 @@ void Eluna::OnRemoveFromWorld(GameObject* gameobject)
|
|||||||
CallAllFunctions(GameObjectEventBindings, GAMEOBJECT_EVENT_ON_REMOVE, gameobject->GetEntry());
|
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)
|
CreatureAI* Eluna::GetAI(Creature* creature)
|
||||||
{
|
{
|
||||||
if (!CreatureEventBindings->HasEvents(creature->GetEntry()) && !CreatureUniqueBindings->HasEvents(creature->GET_GUID(), creature->GetInstanceId()))
|
if (!CreatureEventBindings->HasEvents(creature->GetEntry()) && !CreatureUniqueBindings->HasEvents(creature->GET_GUID(), creature->GetInstanceId()))
|
||||||
|
|||||||
@@ -252,6 +252,7 @@ namespace HookMgr
|
|||||||
// UNUSED = 11, // (event, gameobject)
|
// UNUSED = 11, // (event, gameobject)
|
||||||
GAMEOBJECT_EVENT_ON_ADD = 12, // (event, gameobject)
|
GAMEOBJECT_EVENT_ON_ADD = 12, // (event, gameobject)
|
||||||
GAMEOBJECT_EVENT_ON_REMOVE = 13, // (event, gameobject)
|
GAMEOBJECT_EVENT_ON_REMOVE = 13, // (event, gameobject)
|
||||||
|
GAMEOBJECT_EVENT_ON_USE = 14, // (event, go, player)
|
||||||
GAMEOBJECT_EVENT_COUNT
|
GAMEOBJECT_EVENT_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -339,6 +339,7 @@ public:
|
|||||||
|
|
||||||
/* GameObject */
|
/* GameObject */
|
||||||
bool OnDummyEffect(Unit* pCaster, uint32 spellId, SpellEffIndex effIndex, GameObject* pTarget);
|
bool OnDummyEffect(Unit* pCaster, uint32 spellId, SpellEffIndex effIndex, GameObject* pTarget);
|
||||||
|
bool OnGameObjectUse(Player* pPlayer, GameObject* pGameObject);
|
||||||
bool OnGossipHello(Player* pPlayer, GameObject* pGameObject);
|
bool OnGossipHello(Player* pPlayer, GameObject* pGameObject);
|
||||||
bool OnGossipSelect(Player* pPlayer, GameObject* pGameObject, uint32 sender, uint32 action);
|
bool OnGossipSelect(Player* pPlayer, GameObject* pGameObject, uint32 sender, uint32 action);
|
||||||
bool OnGossipSelectCode(Player* pPlayer, GameObject* pGameObject, uint32 sender, uint32 action, const char* code);
|
bool OnGossipSelectCode(Player* pPlayer, GameObject* pGameObject, uint32 sender, uint32 action, const char* code);
|
||||||
|
|||||||
Reference in New Issue
Block a user