mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-14 07:53:44 +00:00
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:
@@ -895,6 +895,21 @@ bool ScriptMgr::AnticheatCheckMovementInfo(Player* player, MovementInfo const& m
|
||||
CALL_ENABLED_BOOLEAN_HOOKS(PlayerScript, PLAYERHOOK_ANTICHEAT_CHECK_MOVEMENT_INFO, !script->AnticheatCheckMovementInfo(player, movementInfo, mover, jump));
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanPlayerUpdateSkill(Player* player, uint32 skillId)
|
||||
{
|
||||
CALL_ENABLED_BOOLEAN_HOOKS(PlayerScript, PLAYERHOOK_ON_CAN_UPDATE_SKILL, !script->CanPlayerUpdateSkill(player, skillId));
|
||||
}
|
||||
|
||||
void ScriptMgr::OnBeforePlayerUpdateSkill(Player* player, uint32 skillId, uint32& value, uint32 max, uint32 step)
|
||||
{
|
||||
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_BEFORE_UPDATE_SKILL, script->OnBeforePlayerUpdateSkill(player, skillId, value, max, step));
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerUpdateSkill(Player* player, uint32 skillId, uint32 value, uint32 max, uint32 step, uint32 newValue)
|
||||
{
|
||||
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_UPDATE_SKILL, script->OnPlayerUpdateSkill(player, skillId, value, max, step, newValue));
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanPlayerResurrect(Player* player)
|
||||
{
|
||||
CALL_ENABLED_BOOLEAN_HOOKS(PlayerScript, PLAYERHOOK_CAN_RESURRECT, !script->CanPlayerResurrect(player));
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user