feat: add OnBattlegroundDesertion hook (#146)

This commit is contained in:
Kevin
2023-06-11 10:28:56 -03:00
committed by GitHub
parent 7ea0b975c2
commit 1abf24490e
6 changed files with 17 additions and 0 deletions

View File

@@ -91,6 +91,7 @@ Eluna API for AC:
- 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 `RegisterPlayerEvent` `56` (`PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM`): https://github.com/azerothcore/mod-eluna/pull/119
- Added `RegisterPlayerEvent` `57` (`PLAYER_EVENT_ON_BG_DESERTION`): https://github.com/azerothcore/mod-eluna/pull/146
- 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

View File

@@ -801,6 +801,11 @@ public:
{
return sEluna->OnCanGroupInvite(player, memberName);
}
void OnBattlegroundDesertion(Player* player, const BattlegroundDesertionType type) override
{
sEluna->OnBattlegroundDesertion(player, type);
}
};
class Eluna_ServerScript : public ServerScript

View File

@@ -729,6 +729,7 @@ namespace LuaGlobalFunctions
* 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_ON_GROUP_ROLL_REWARD_ITEM = 56, // (event, player, item, count, voteType, roll)
* PLAYER_EVENT_ON_BG_DESERTION = 57, // (event, player, type)
* };
* </pre>
*

View File

@@ -218,6 +218,7 @@ namespace Hooks
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_ON_GROUP_ROLL_REWARD_ITEM = 56, // (event, player, item, count, voteType, roll)
PLAYER_EVENT_ON_BG_DESERTION = 57, // (event, player, type)
PLAYER_EVENT_COUNT
};

View File

@@ -489,6 +489,7 @@ public:
bool OnCanJoinLfg(Player* player, uint8 roles, lfg::LfgDungeonSet& dungeons, const std::string& comment);
bool OnCanGroupInvite(Player* player, std::string& memberName);
void OnGroupRollRewardItem(Player* player, Item* item, uint32 count, RollVote voteType, Roll* roll);
void OnBattlegroundDesertion(Player* player, const BattlegroundDesertionType type);
#ifndef CLASSIC
#ifndef TBC

View File

@@ -690,3 +690,11 @@ void Eluna::OnGroupRollRewardItem(Player* player, Item* item, uint32 count, Roll
Push(roll);
CallAllFunctions(PlayerEventBindings, key);
}
void Eluna::OnBattlegroundDesertion(Player* player, const BattlegroundDesertionType type)
{
START_HOOK(PLAYER_EVENT_ON_BG_DESERTION);
Push(player);
Push(type);
CallAllFunctions(PlayerEventBindings, key);
}