mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
Core/Hooks: Adds hooks for start and stop game events (#1472)
This commit is contained in:
committed by
Kargatum
parent
23d78ce6bc
commit
3a39aaeed5
@@ -60,6 +60,7 @@ template class ScriptRegistry<MovementHandlerScript>;
|
||||
template class ScriptRegistry<BGScript>;
|
||||
template class ScriptRegistry<SpellSC>;
|
||||
template class ScriptRegistry<AccountScript>;
|
||||
template class ScriptRegistry<GameEventScript>;
|
||||
|
||||
#include "ScriptMgrMacros.h"
|
||||
|
||||
@@ -213,6 +214,7 @@ void ScriptMgr::Unload()
|
||||
SCR_CLEAR(ModuleScript);
|
||||
SCR_CLEAR(BGScript);
|
||||
SCR_CLEAR(SpellSC);
|
||||
SCR_CLEAR(GameEventScript);
|
||||
|
||||
#undef SCR_CLEAR
|
||||
}
|
||||
@@ -2058,6 +2060,22 @@ void ScriptMgr::OnCalcMaxDuration(Aura const* aura, int32& maxDuration)
|
||||
FOREACH_SCRIPT(SpellSC)->OnCalcMaxDuration(aura, maxDuration);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGameEventStart(uint16 EventID)
|
||||
{
|
||||
#ifdef ELUNA
|
||||
sEluna->OnGameEventStart(EventId);
|
||||
#endif
|
||||
FOREACH_SCRIPT(GameEventScript)->OnStart(EventID);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGameEventStop(uint16 EventID)
|
||||
{
|
||||
#ifdef ELUNA
|
||||
sEluna->OnGameEventStop(EventID);
|
||||
#endif
|
||||
FOREACH_SCRIPT(GameEventScript)->OnStop(EventID);
|
||||
}
|
||||
|
||||
AllMapScript::AllMapScript(const char* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
@@ -2257,3 +2275,9 @@ ModuleScript::ModuleScript(const char* name)
|
||||
ScriptRegistry<ModuleScript>::AddScript(this);
|
||||
}
|
||||
|
||||
GameEventScript::GameEventScript(const char* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<GameEventScript>::AddScript(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user