Skip to content

Commit

Permalink
Add OnExplore hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed Jan 29, 2024
1 parent c7a9d72 commit 89d4c1d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions LuaEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions PlayerHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion TrinityCore/GlobalMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 89d4c1d

Please sign in to comment.