mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
feat(Core/Entities): Add OnPlayerSendListInventory script hook (#21676)
This commit is contained in:
@@ -920,6 +920,11 @@ bool ScriptMgr::OnPlayerCanGiveLevel(Player* player, uint8 newLevel)
|
||||
CALL_ENABLED_BOOLEAN_HOOKS(PlayerScript, PLAYERHOOK_ON_CAN_GIVE_LEVEL, !script->OnPlayerCanGiveLevel(player, newLevel));
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerSendListInventory(Player* player, ObjectGuid vendorGuid, uint32& vendorEntry)
|
||||
{
|
||||
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_SEND_LIST_INVENTORY, script->OnPlayerSendListInventory(player, vendorGuid, vendorEntry));
|
||||
}
|
||||
|
||||
PlayerScript::PlayerScript(const char* name, std::vector<uint16> enabledHooks)
|
||||
: ScriptObject(name, PLAYERHOOK_END)
|
||||
{
|
||||
|
||||
@@ -209,6 +209,7 @@ enum PlayerHook
|
||||
PLAYERHOOK_ON_UPDATE_SKILL,
|
||||
PLAYERHOOK_CAN_RESURRECT,
|
||||
PLAYERHOOK_ON_CAN_GIVE_LEVEL,
|
||||
PLAYERHOOK_ON_SEND_LIST_INVENTORY,
|
||||
PLAYERHOOK_END
|
||||
};
|
||||
|
||||
@@ -793,6 +794,15 @@ public:
|
||||
* @return true if player is allowed to gain the new level
|
||||
*/
|
||||
virtual bool OnPlayerCanGiveLevel(Player* /*player*/, uint8 /*newLevel*/) { return true; }
|
||||
|
||||
/**
|
||||
* @brief This hook is called whenever a player interacts with a vendor, and is then shown the vendor list
|
||||
*
|
||||
* @param player Contains information about the Player
|
||||
* @param vendorGuid Guid of the vendor player is interacting with
|
||||
* @param vendorEntry Entry of the vendor player is interacting with
|
||||
*/
|
||||
virtual void OnPlayerSendListInventory(Player* /*player*/, ObjectGuid /*vendorGuid*/, uint32& /*vendorEntry*/) {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -464,6 +464,7 @@ public: /* PlayerScript */
|
||||
void OnPlayerUpdateSkill(Player* player, uint32 skillId, uint32 value, uint32 max, uint32 step, uint32 newValue);
|
||||
bool OnPlayerCanResurrect(Player* player);
|
||||
bool OnPlayerCanGiveLevel(Player* player, uint8 newLevel);
|
||||
void OnPlayerSendListInventory(Player* player, ObjectGuid vendorGuid, uint32& vendorEntry);
|
||||
|
||||
// Anti cheat
|
||||
void AnticheatSetCanFlybyServer(Player* player, bool apply);
|
||||
|
||||
Reference in New Issue
Block a user