mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
feat: add OnBattlegroundDesertion hook (#146)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
*
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user