feat(Scripting/Hooks): Add OnBeforeOpenItem Hook (#12576)

This commit is contained in:
AnchyDev
2022-09-07 08:43:32 +10:00
committed by GitHub
parent ffd409eb01
commit 9b6a3ee4f9
3 changed files with 31 additions and 9 deletions

View File

@@ -1176,6 +1176,9 @@ public:
// After receiving item as a group roll reward
virtual void OnGroupRollRewardItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/, RollVote /*voteType*/, Roll* /*roll*/) { }
//Before opening an item
[[nodiscard]] virtual bool OnBeforeOpenItem(Player* /*player*/, Item* /*item*/) { return true; }
// After completed a quest
[[nodiscard]] virtual bool OnBeforeQuestComplete(Player* /*player*/, uint32 /*quest_id*/) { return true; }
@@ -2252,6 +2255,7 @@ public: /* PlayerScript */
void OnCreateItem(Player* player, Item* item, uint32 count);
void OnQuestRewardItem(Player* player, Item* item, uint32 count);
void OnGroupRollRewardItem(Player* player, Item* item, uint32 count, RollVote voteType, Roll* roll);
bool OnBeforeOpenItem(Player* player, Item* item);
bool OnBeforePlayerQuestComplete(Player* player, uint32 quest_id);
void OnQuestComputeXP(Player* player, Quest const* quest, uint32& xpValue);
void OnBeforePlayerDurabilityRepair(Player* player, ObjectGuid npcGUID, ObjectGuid itemGUID, float& discountMod, uint8 guildBank);