feat(Core/Scripting): Add Player skill based hook (#21273)

Co-authored-by: IntelligentQuantum <IntelligentQuantum@ProtonMail.Com>
Co-authored-by: Ludwig <sudlud@users.noreply.github.com>
This commit is contained in:
iThorgrim 2025-02-15 23:10:38 +01:00 committed by GitHub
parent c96ff8a6dc
commit 971ebcae31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 4 deletions

View file

@ -204,6 +204,9 @@ enum PlayerHook
PLAYERHOOK_CAN_SEND_ERROR_ALREADY_LOOTED,
PLAYERHOOK_ON_AFTER_CREATURE_LOOT,
PLAYERHOOK_ON_AFTER_CREATURE_LOOT_MONEY,
PLAYERHOOK_ON_CAN_UPDATE_SKILL,
PLAYERHOOK_ON_BEFORE_UPDATE_SKILL,
PLAYERHOOK_ON_UPDATE_SKILL,
PLAYERHOOK_CAN_RESURRECT,
PLAYERHOOK_END
};
@ -767,6 +770,10 @@ public:
*/
virtual void OnAfterCreatureLootMoney(Player* /*player*/) { }
virtual bool CanPlayerUpdateSkill(Player* /*player*/, uint32 /*skillId*/) { return true; }
virtual void OnBeforePlayerUpdateSkill(Player* /*player*/, uint32 /*skillId*/, uint32& /*value*/, uint32 /*max*/, uint32 /*step*/) { }
virtual void OnPlayerUpdateSkill(Player* /*player*/, uint32 /*skillId*/, uint32 /*value*/, uint32 /*max*/, uint32 /*step*/, uint32 /*newValue*/) { }
/**
* @brief This hook is called, to avoid player resurrect
*