mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
New player event: PLAYER_EVENT_ON_PET_ADDED_TO_WORLD (#3)
Co-authored-by: UltraNix <ultranix@gmail.com>
This commit is contained in:
@@ -700,6 +700,7 @@ namespace LuaGlobalFunctions
|
||||
* // UNUSED = 40, // (event, player)
|
||||
* // UNUSED = 41, // (event, player)
|
||||
* PLAYER_EVENT_ON_COMMAND = 42, // (event, player, command) - player is nil if command used from console. Can return false
|
||||
* PLAYER_EVENT_ON_PET_ADDED_TO_WORLD = 43, // (event, player, pet)
|
||||
* };
|
||||
* </pre>
|
||||
*
|
||||
|
||||
1
Hooks.h
1
Hooks.h
@@ -204,6 +204,7 @@ namespace Hooks
|
||||
// UNUSED = 40, // (event, player)
|
||||
// UNUSED = 41, // (event, player)
|
||||
PLAYER_EVENT_ON_COMMAND = 42, // (event, player, command) - player is nil if command used from console. Can return false
|
||||
PLAYER_EVENT_ON_PET_ADDED_TO_WORLD = 43, // (event, player, pet)
|
||||
|
||||
PLAYER_EVENT_COUNT
|
||||
};
|
||||
|
||||
@@ -364,6 +364,7 @@ public:
|
||||
void OnLuaStateClose();
|
||||
void OnLuaStateOpen();
|
||||
bool OnAddonMessage(Player* sender, uint32 type, std::string& msg, Player* receiver, Guild* guild, Group* group, Channel* channel);
|
||||
void OnPetAddedToWorld(Player* player, Creature* pet);
|
||||
|
||||
/* Item */
|
||||
void OnDummyEffect(WorldObject* pCaster, uint32 spellId, SpellEffIndex effIndex, Item* pTarget);
|
||||
|
||||
@@ -544,3 +544,11 @@ bool Eluna::OnChat(Player* pPlayer, uint32 type, uint32 lang, std::string& msg,
|
||||
CleanUpStack(5);
|
||||
return result;
|
||||
}
|
||||
|
||||
void Eluna::OnPetAddedToWorld(Player* player, Creature* pet)
|
||||
{
|
||||
START_HOOK(PLAYER_EVENT_ON_PET_ADDED_TO_WORLD);
|
||||
Push(player);
|
||||
Push(pet);
|
||||
CallAllFunctions(PlayerEventBindings, key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user