feat(Core/Entities): add OnPlayerCanGiveLevel script hook (#21666)

This commit is contained in:
Vincent Vanclef 2025-03-10 08:44:33 +01:00 committed by GitHub
parent 4cdb315db1
commit ffe03f6e14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 0 deletions

View file

@ -208,6 +208,7 @@ enum PlayerHook
PLAYERHOOK_ON_BEFORE_UPDATE_SKILL,
PLAYERHOOK_ON_UPDATE_SKILL,
PLAYERHOOK_CAN_RESURRECT,
PLAYERHOOK_ON_CAN_GIVE_LEVEL,
PLAYERHOOK_END
};
@ -782,6 +783,16 @@ public:
* @return true if player is authorized to resurect
*/
virtual bool OnPlayerCanResurrect(Player* /*player*/) { return true; }
/**
* @brief This hook is called, to cancel the normal level up flow
*
* @param player Contains information about the Player
* @param newLevel The new level the player is about to be given
*
* @return true if player is allowed to gain the new level
*/
virtual bool OnPlayerCanGiveLevel(Player* /*player*/, uint8 /*newLevel*/) { return true; }
};
#endif