feat(Core/Hooks): added collection of hooks to extends AC (#3047)

This collection of hooks comes from the Maelstrom project. It allows to release modules such as :
- 3v3-soloqueue
- 1v1 arena
- pvestats

and many others
This commit is contained in:
Kargatum
2021-04-13 18:26:39 +07:00
committed by GitHub
parent 911fbb377e
commit 2b3d46bd4f
46 changed files with 2053 additions and 278 deletions

View File

@@ -59,10 +59,13 @@ Group::Group() : m_leaderGuid(0), m_leaderName(""), m_groupType(GROUPTYPE_NORMAL
{
for (uint8 i = 0; i < TARGETICONCOUNT; ++i)
m_targetIcons[i] = 0;
sScriptMgr->OnConstructGroup(this);
}
Group::~Group()
{
sScriptMgr->OnDestructGroup(this);
if (m_bgGroup)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
@@ -142,6 +145,8 @@ bool Group::Create(Player* leader)
CharacterDatabase.Execute(stmt);
ASSERT(AddMember(leader)); // If the leader can't be added to a new group because it appears full, something is clearly wrong.
sScriptMgr->OnCreate(this, leader);
}
else if (!AddMember(leader))
return false;
@@ -1840,6 +1845,9 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
if (!member)
return ERR_BATTLEGROUND_JOIN_FAILED;
if (!sScriptMgr->CanGroupJoinBattlegroundQueue(this, member, bgTemplate, MinPlayerCount, isRated, arenaSlot))
return ERR_BATTLEGROUND_JOIN_FAILED;
// don't allow cross-faction groups to join queue
if (member->GetTeamId() != teamId)
return ERR_BATTLEGROUND_JOIN_TIMED_OUT;