mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
feat(Scripting/Hooks): Implement OnGameEventCheck() hook (#10761)
This commit is contained in:
@@ -1136,6 +1136,9 @@ uint32 GameEventMgr::Update() // return the next e
|
||||
// must do the activating first, and after that the deactivating
|
||||
// so first queue it
|
||||
//LOG_ERROR("sql.sql", "Checking event {}", itr);
|
||||
|
||||
sScriptMgr->OnGameEventCheck(itr);
|
||||
|
||||
if (CheckOneGameEvent(itr))
|
||||
{
|
||||
// if the world event is in NEXTPHASE state, and the time has passed to finish this event, then do so
|
||||
|
||||
@@ -33,3 +33,11 @@ void ScriptMgr::OnGameEventStop(uint16 EventID)
|
||||
script->OnStop(EventID);
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGameEventCheck(uint16 EventID)
|
||||
{
|
||||
ExecuteScript<GameEventScript>([&](GameEventScript* script)
|
||||
{
|
||||
script->OnEventCheck(EventID);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1717,6 +1717,9 @@ public:
|
||||
|
||||
// Runs on stop event
|
||||
virtual void OnStop(uint16 /*EventID*/) { }
|
||||
|
||||
// Runs on event check
|
||||
virtual void OnEventCheck(uint16 /*EventID*/) { }
|
||||
};
|
||||
|
||||
class MailScript : public ScriptObject
|
||||
@@ -2437,6 +2440,7 @@ public: /* SpellSC */
|
||||
public: /* GameEventScript */
|
||||
void OnGameEventStart(uint16 EventID);
|
||||
void OnGameEventStop(uint16 EventID);
|
||||
void OnGameEventCheck(uint16 EventID);
|
||||
|
||||
public: /* MailScript */
|
||||
void OnBeforeMailDraftSendMailTo(MailDraft* mailDraft, MailReceiver const& receiver, MailSender const& sender, MailCheckMask& checked, uint32& deliver_delay, uint32& custom_expiration, bool& deleteMailItemsFromDB, bool& sendMail);
|
||||
|
||||
Reference in New Issue
Block a user