feat: add PLAYER_EVENT_ON_CAN_GROUP_INVITE (#100)

This commit is contained in:
Axel Cocat
2023-03-01 10:33:12 +01:00
committed by GitHub
parent 53514a228b
commit 85714c1123
6 changed files with 18 additions and 1 deletions

View File

@@ -89,6 +89,7 @@ Eluna API for AC:
- Added `RegisterPlayerEvent` `52` (`PLAYER_EVENT_ON_CREATE_ITEM`): https://github.com/azerothcore/mod-eluna/pull/88 - Added `RegisterPlayerEvent` `52` (`PLAYER_EVENT_ON_CREATE_ITEM`): https://github.com/azerothcore/mod-eluna/pull/88
- Added `RegisterPlayerEvent` `53` (`PLAYER_EVENT_ON_STORE_NEW_ITEM`): https://github.com/azerothcore/mod-eluna/pull/88 - Added `RegisterPlayerEvent` `53` (`PLAYER_EVENT_ON_STORE_NEW_ITEM`): https://github.com/azerothcore/mod-eluna/pull/88
- Added `RegisterPlayerEvent` `54` (`PLAYER_EVENT_ON_COMPLETE_QUEST`): https://github.com/azerothcore/mod-eluna/pull/90 - Added `RegisterPlayerEvent` `54` (`PLAYER_EVENT_ON_COMPLETE_QUEST`): https://github.com/azerothcore/mod-eluna/pull/90
- Added `RegisterPlayerEvent` `55` (`PLAYER_EVENT_ON_CAN_GROUP_INVITE`): https://github.com/azerothcore/mod-eluna/pull/100
- Added `Player:GetMailCount()`: https://github.com/azerothcore/mod-eluna/pull/76 - Added `Player:GetMailCount()`: https://github.com/azerothcore/mod-eluna/pull/76
- Added `Player:GetXP()`: https://github.com/azerothcore/mod-eluna/pull/77 - Added `Player:GetXP()`: https://github.com/azerothcore/mod-eluna/pull/77
- Added `Player:GetAchievementCriteriaProgress()`: https://github.com/azerothcore/mod-eluna/pull/78 - Added `Player:GetAchievementCriteriaProgress()`: https://github.com/azerothcore/mod-eluna/pull/78

View File

@@ -791,6 +791,11 @@ public:
{ {
sEluna->OnPlayerCompleteQuest(player, quest); sEluna->OnPlayerCompleteQuest(player, quest);
} }
bool CanGroupInvite(Player* player, std::string& memberName) override
{
return sEluna->OnCanGroupInvite(player, memberName);
}
}; };
class Eluna_ServerScript : public ServerScript class Eluna_ServerScript : public ServerScript

View File

@@ -727,6 +727,7 @@ namespace LuaGlobalFunctions
* PLAYER_EVENT_ON_CREATE_ITEM = 52, // (event, player, item, count) * PLAYER_EVENT_ON_CREATE_ITEM = 52, // (event, player, item, count)
* PLAYER_EVENT_ON_STORE_NEW_ITEM = 53, // (event, player, item, count) * PLAYER_EVENT_ON_STORE_NEW_ITEM = 53, // (event, player, item, count)
* PLAYER_EVENT_ON_COMPLETE_QUEST = 54, // (event, player, quest) * PLAYER_EVENT_ON_COMPLETE_QUEST = 54, // (event, player, quest)
* PLAYER_EVENT_ON_CAN_GROUP_INVITE = 55, // (event, player, memberName) - Can return false to prevent inviting
* }; * };
* </pre> * </pre>
* *

View File

@@ -215,7 +215,8 @@ namespace Hooks
PLAYER_EVENT_ON_QUEST_REWARD_ITEM = 51, // (event, player, item, count) PLAYER_EVENT_ON_QUEST_REWARD_ITEM = 51, // (event, player, item, count)
PLAYER_EVENT_ON_CREATE_ITEM = 52, // (event, player, item, count) PLAYER_EVENT_ON_CREATE_ITEM = 52, // (event, player, item, count)
PLAYER_EVENT_ON_STORE_NEW_ITEM = 53, // (event, player, item, count) PLAYER_EVENT_ON_STORE_NEW_ITEM = 53, // (event, player, item, count)
PLAYER_EVENT_ON_COMPLETE_QUEST = 54, // (event, player, quest) PLAYER_EVENT_ON_COMPLETE_QUEST = 54, // (event, player, quest)
PLAYER_EVENT_ON_CAN_GROUP_INVITE = 55, // (event, player, memberName) - Can return false to prevent inviting
PLAYER_EVENT_COUNT PLAYER_EVENT_COUNT
}; };

View File

@@ -484,6 +484,7 @@ public:
bool OnCanInitTrade(Player* player, Player* target); bool OnCanInitTrade(Player* player, Player* target);
bool OnCanSendMail(Player* player, ObjectGuid receiverGuid, ObjectGuid mailbox, std::string& subject, std::string& body, uint32 money, uint32 cod, Item* item); bool OnCanSendMail(Player* player, ObjectGuid receiverGuid, ObjectGuid mailbox, std::string& subject, std::string& body, uint32 money, uint32 cod, Item* item);
bool OnCanJoinLfg(Player* player, uint8 roles, lfg::LfgDungeonSet& dungeons, const std::string& comment); bool OnCanJoinLfg(Player* player, uint8 roles, lfg::LfgDungeonSet& dungeons, const std::string& comment);
bool OnCanGroupInvite(Player* player, std::string& memberName);
#ifndef CLASSIC #ifndef CLASSIC
#ifndef TBC #ifndef TBC

View File

@@ -670,3 +670,11 @@ void Eluna::OnPlayerCompleteQuest(Player* player, Quest const* quest)
Push(quest); Push(quest);
CallAllFunctions(PlayerEventBindings, key); CallAllFunctions(PlayerEventBindings, key);
} }
bool Eluna::OnCanGroupInvite(Player* player, std::string& memberName)
{
START_HOOK_WITH_RETVAL(PLAYER_EVENT_ON_CAN_GROUP_INVITE, true);
Push(player);
Push(memberName);
return CallAllFunctionsBool(PlayerEventBindings, key);
}