diff --git a/Hooks.h b/Hooks.h index 04133bf6df..5b3e45dc67 100644 --- a/Hooks.h +++ b/Hooks.h @@ -208,7 +208,7 @@ namespace Hooks PLAYER_EVENT_ON_SKILL_CHANGE = 43, // (event, player, skillId, skillValue) - Returns new skill level value PLAYER_EVENT_ON_LEARN_SPELL = 44, // (event, player, spellId) PLAYER_EVENT_ON_ACHIEVEMENT_COMPLETE = 45, // (event, player, achievementId) - // UNUSED = 46, // (event, player) + PLAYER_EVENT_ON_DISCOVER_AREA = 46, // (event, player, area) PLAYER_EVENT_ON_UPDATE_AREA = 47, // (event, player, oldArea, newArea) PLAYER_EVENT_ON_TRADE_INIT = 48, // (event, player, target) - Can return false to interrupt trade PLAYER_EVENT_ON_SEND_MAIL = 49, // (event, player, recipientGuid) - Can return false to interrupt sending diff --git a/LuaEngine.h b/LuaEngine.h index c8c2380747..2e44878a29 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -410,6 +410,7 @@ class ELUNA_GAME_API Eluna bool OnTradeInit(Player* trader, Player* tradee); bool OnTradeAccept(Player* trader, Player* tradee); bool OnSendMail(Player* sender, ObjectGuid recipientGuid); + void OnDiscoverArea(Player* player, uint32 area); /* Item */ void OnDummyEffect(WorldObject* pCaster, uint32 spellId, SpellEffIndex effIndex, Item* pTarget); diff --git a/PlayerHooks.cpp b/PlayerHooks.cpp index ff20219fb1..7f3bb0909f 100644 --- a/PlayerHooks.cpp +++ b/PlayerHooks.cpp @@ -544,6 +544,14 @@ bool Eluna::OnSendMail(Player* sender, ObjectGuid recipientGuid) return CallAllFunctionsBool(PlayerEventBindings, key, true); } +void Eluna::OnDiscoverArea(Player* player, uint32 area) +{ + START_HOOK(PLAYER_EVENT_ON_DISCOVER_AREA); + HookPush(player); + HookPush(area); + CallAllFunctions(PlayerEventBindings, key); +} + bool Eluna::OnChat(Player* pPlayer, uint32 type, uint32 lang, std::string& msg) { if (lang == LANG_ADDON) diff --git a/TrinityCore/GlobalMethods.h b/TrinityCore/GlobalMethods.h index ce9dd7b63e..17655bccc7 100644 --- a/TrinityCore/GlobalMethods.h +++ b/TrinityCore/GlobalMethods.h @@ -746,7 +746,7 @@ namespace LuaGlobalFunctions * PLAYER_EVENT_ON_SKILL_CHANGE = 43, // (event, player, skillId, skillValue) - Returns new skill level value * PLAYER_EVENT_ON_LEARN_SPELL = 44, // (event, player, spellId) * PLAYER_EVENT_ON_ACHIEVEMENT_COMPLETE = 45, // (event, player, achievementId) - * // UNUSED = 46, // (event, player) + * PLAYER_EVENT_ON_DISCOVER_AREA = 46, // (event, player, area) * PLAYER_EVENT_ON_UPDATE_AREA = 47, // (event, player, oldArea, newArea) * PLAYER_EVENT_ON_TRADE_INIT = 48, // (event, player, target) - Can return false to interrupt trade * PLAYER_EVENT_ON_SEND_MAIL = 49, // (event, player, recipientGuid) - Can return false to interrupt sending