feat(Core/Scripting): Implement OnBeforeCreatureSelectLevel() hook (#17391)
* Add `OnBeforeCreatureSelectLevel()` hook
- allows modules to alter the level of a creature just before it is set
* Fix missing class name.
* Hook should catch even if the level isn't being changed.
* Trim whitespace.
* Revert "Trim whitespace."
This reverts commit 76768d85c0.
* Fix whitespace
This commit is contained in:
@@ -48,6 +48,15 @@ void ScriptMgr::OnCreatureSaveToDB(Creature* creature)
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnBeforeCreatureSelectLevel(const CreatureTemplate* cinfo, Creature* creature, uint8& level)
|
||||
{
|
||||
ExecuteScript<AllCreatureScript>([&](AllCreatureScript* script)
|
||||
{
|
||||
script->OnBeforeCreatureSelectLevel(cinfo, creature, level);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
void ScriptMgr::Creature_SelectLevel(const CreatureTemplate* cinfo, Creature* creature)
|
||||
{
|
||||
ExecuteScript<AllCreatureScript>([&](AllCreatureScript* script)
|
||||
|
||||
Reference in New Issue
Block a user