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:
@@ -555,6 +555,9 @@ public:
|
||||
// Called from End of Creature Update.
|
||||
virtual void OnAllCreatureUpdate(Creature* /*creature*/, uint32 /*diff*/) { }
|
||||
|
||||
// Called just before the level of the creature is set.
|
||||
virtual void OnBeforeCreatureSelectLevel(const CreatureTemplate* /*cinfo*/, Creature* /*creature*/, uint8& /*level*/) { }
|
||||
|
||||
// Called from End of Creature SelectLevel.
|
||||
virtual void Creature_SelectLevel(const CreatureTemplate* /*cinfo*/, Creature* /*creature*/) { }
|
||||
|
||||
@@ -2555,6 +2558,7 @@ public: /* MovementHandlerScript */
|
||||
public: /* AllCreatureScript */
|
||||
//listener function (OnAllCreatureUpdate) is called by OnCreatureUpdate
|
||||
//void OnAllCreatureUpdate(Creature* creature, uint32 diff);
|
||||
void OnBeforeCreatureSelectLevel(const CreatureTemplate* cinfo, Creature* creature, uint8& level);
|
||||
void Creature_SelectLevel(const CreatureTemplate* cinfo, Creature* creature);
|
||||
void OnCreatureSaveToDB(Creature* creature);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user