mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
feat: add PLAYER_EVENT_ON_CAN_GROUP_INVITE (#100)
This commit is contained in:
@@ -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` `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` `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:GetXP()`: https://github.com/azerothcore/mod-eluna/pull/77
|
||||
- Added `Player:GetAchievementCriteriaProgress()`: https://github.com/azerothcore/mod-eluna/pull/78
|
||||
|
||||
@@ -791,6 +791,11 @@ public:
|
||||
{
|
||||
sEluna->OnPlayerCompleteQuest(player, quest);
|
||||
}
|
||||
|
||||
bool CanGroupInvite(Player* player, std::string& memberName) override
|
||||
{
|
||||
return sEluna->OnCanGroupInvite(player, memberName);
|
||||
}
|
||||
};
|
||||
|
||||
class Eluna_ServerScript : public ServerScript
|
||||
|
||||
@@ -727,6 +727,7 @@ namespace LuaGlobalFunctions
|
||||
* PLAYER_EVENT_ON_CREATE_ITEM = 52, // (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_CAN_GROUP_INVITE = 55, // (event, player, memberName) - Can return false to prevent inviting
|
||||
* };
|
||||
* </pre>
|
||||
*
|
||||
|
||||
@@ -216,6 +216,7 @@ namespace Hooks
|
||||
PLAYER_EVENT_ON_CREATE_ITEM = 52, // (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_CAN_GROUP_INVITE = 55, // (event, player, memberName) - Can return false to prevent inviting
|
||||
|
||||
PLAYER_EVENT_COUNT
|
||||
};
|
||||
|
||||
@@ -484,6 +484,7 @@ public:
|
||||
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 OnCanJoinLfg(Player* player, uint8 roles, lfg::LfgDungeonSet& dungeons, const std::string& comment);
|
||||
bool OnCanGroupInvite(Player* player, std::string& memberName);
|
||||
|
||||
#ifndef CLASSIC
|
||||
#ifndef TBC
|
||||
|
||||
@@ -670,3 +670,11 @@ void Eluna::OnPlayerCompleteQuest(Player* player, Quest const* quest)
|
||||
Push(quest);
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user