feat(Core/PlayerScript): Add Unequip hook (#23248)

Co-authored-by: Munzeria <Munzeria@dontemailme.lol>
Co-authored-by: sudlud <sudlud@users.noreply.github.com>
This commit is contained in:
Munzeria
2025-12-27 00:09:56 +01:00
committed by GitHub
parent d54253310a
commit ae8dd49fd4
4 changed files with 16 additions and 0 deletions

View File

@@ -329,6 +329,11 @@ void ScriptMgr::OnPlayerEquip(Player* player, Item* it, uint8 bag, uint8 slot, b
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_EQUIP, script->OnPlayerEquip(player, it, bag, slot, update));
}
void ScriptMgr::OnPlayerUnequip(Player* player, Item* it)
{
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_UNEQUIP_ITEM, script->OnPlayerUnequip(player, it));
}
void ScriptMgr::OnPlayerJoinBG(Player* player)
{
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_PLAYER_JOIN_BG, script->OnPlayerJoinBG(player));

View File

@@ -88,6 +88,7 @@ enum PlayerHook
PLAYERHOOK_ON_AFTER_SET_VISIBLE_ITEM_SLOT,
PLAYERHOOK_ON_AFTER_MOVE_ITEM_FROM_INVENTORY,
PLAYERHOOK_ON_EQUIP,
PLAYERHOOK_ON_UNEQUIP_ITEM,
PLAYERHOOK_ON_PLAYER_JOIN_BG,
PLAYERHOOK_ON_PLAYER_JOIN_ARENA,
PLAYERHOOK_GET_CUSTOM_GET_ARENA_TEAM_ID,
@@ -395,6 +396,9 @@ public:
// After an item has been equipped
virtual void OnPlayerEquip(Player* /*player*/, Item* /*it*/, uint8 /*bag*/, uint8 /*slot*/, bool /*update*/) { }
// After an item has been unequipped
virtual void OnPlayerUnequip(Player* /*player*/, Item* /*it*/) { }
// After player enters queue for BG
virtual void OnPlayerJoinBG(Player* /*player*/) { }

View File

@@ -351,6 +351,7 @@ public: /* PlayerScript */
void OnPlayerAfterSetVisibleItemSlot(Player* player, uint8 slot, Item* item);
void OnPlayerAfterMoveItemFromInventory(Player* player, Item* it, uint8 bag, uint8 slot, bool update);
void OnPlayerEquip(Player* player, Item* it, uint8 bag, uint8 slot, bool update);
void OnPlayerUnequip(Player* player, Item* it);
void OnPlayerJoinBG(Player* player);
void OnPlayerJoinArena(Player* player);
void OnPlayerGetMaxPersonalArenaRatingRequirement(Player const* player, uint32 minSlot, uint32& maxArenaRating) const;