mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
feat(ScriptMgr): add OnArenaStart hook (#19922)
This commit is contained in:
@@ -39,6 +39,11 @@ bool ScriptMgr::OnBeforeArenaCheckWinConditions(Battleground* const bg)
|
||||
CALL_ENABLED_BOOLEAN_HOOKS(ArenaScript, ARENAHOOK_ON_BEFORE_CHECK_WIN_CONDITION, !script->OnBeforeArenaCheckWinConditions(bg));
|
||||
}
|
||||
|
||||
void ScriptMgr::OnArenaStart(Battleground* bg)
|
||||
{
|
||||
CALL_ENABLED_HOOKS(ArenaScript, ARENAHOOK_ON_ARENA_START, script->OnArenaStart(bg));
|
||||
}
|
||||
|
||||
ArenaScript::ArenaScript(const char* name, std::vector<uint16> enabledHooks)
|
||||
: ScriptObject(name, ARENAHOOK_END)
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@ enum ArenaHook
|
||||
ARENAHOOK_ON_GET_POINTS,
|
||||
ARENAHOOK_CAN_SAVE_TO_DB,
|
||||
ARENAHOOK_ON_BEFORE_CHECK_WIN_CONDITION,
|
||||
ARENAHOOK_ON_ARENA_START,
|
||||
ARENAHOOK_END
|
||||
};
|
||||
|
||||
@@ -48,6 +49,8 @@ public:
|
||||
[[nodiscard]] virtual bool OnBeforeArenaCheckWinConditions(Battleground* const /* bg */) { return true; }
|
||||
|
||||
[[nodiscard]] virtual bool CanSaveToDB(ArenaTeam* /*team*/) { return true; }
|
||||
|
||||
virtual void OnArenaStart(Battleground* /* bg */) { };
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -648,6 +648,7 @@ public: /* ArenaScript */
|
||||
void OnGetPoints(ArenaTeam* team, uint32 memberRating, float& points);
|
||||
bool CanSaveToDB(ArenaTeam* team);
|
||||
bool OnBeforeArenaCheckWinConditions(Battleground* const bg);
|
||||
void OnArenaStart(Battleground* const bg);
|
||||
|
||||
public: /* MiscScript */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user