mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
feat(Core/Scripting): Create OnStoreNewItem() hook (#13725)
This commit is contained in:
@@ -2594,7 +2594,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update
|
|||||||
CharacterDatabase.Execute(stmt);
|
CharacterDatabase.Execute(stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
sScriptMgr->OnLootItem(this, pItem, count, ObjectGuid::Empty);
|
sScriptMgr->OnStoreNewItem(this, pItem, count);
|
||||||
}
|
}
|
||||||
return pItem;
|
return pItem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -582,6 +582,14 @@ void ScriptMgr::OnLootItem(Player* player, Item* item, uint32 count, ObjectGuid
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptMgr::OnStoreNewItem(Player* player, Item* item, uint32 count)
|
||||||
|
{
|
||||||
|
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
||||||
|
{
|
||||||
|
script->OnStoreNewItem(player, item, count);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void ScriptMgr::OnCreateItem(Player* player, Item* item, uint32 count)
|
void ScriptMgr::OnCreateItem(Player* player, Item* item, uint32 count)
|
||||||
{
|
{
|
||||||
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
||||||
|
|||||||
@@ -1180,6 +1180,9 @@ public:
|
|||||||
//After looting item
|
//After looting item
|
||||||
virtual void OnLootItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/, ObjectGuid /*lootguid*/) { }
|
virtual void OnLootItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/, ObjectGuid /*lootguid*/) { }
|
||||||
|
|
||||||
|
//After looting item (includes master loot).
|
||||||
|
virtual void OnStoreNewItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/) { }
|
||||||
|
|
||||||
//After creating item (eg profession item creation)
|
//After creating item (eg profession item creation)
|
||||||
virtual void OnCreateItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/) { }
|
virtual void OnCreateItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/) { }
|
||||||
|
|
||||||
@@ -2275,6 +2278,7 @@ public: /* PlayerScript */
|
|||||||
void GetCustomArenaPersonalRating(Player const* player, uint8 slot, uint32& rating) const;
|
void GetCustomArenaPersonalRating(Player const* player, uint8 slot, uint32& rating) const;
|
||||||
void OnGetMaxPersonalArenaRatingRequirement(Player const* player, uint32 minSlot, uint32& maxArenaRating) const;
|
void OnGetMaxPersonalArenaRatingRequirement(Player const* player, uint32 minSlot, uint32& maxArenaRating) const;
|
||||||
void OnLootItem(Player* player, Item* item, uint32 count, ObjectGuid lootguid);
|
void OnLootItem(Player* player, Item* item, uint32 count, ObjectGuid lootguid);
|
||||||
|
void OnStoreNewItem(Player* player, Item* item, uint32 count);
|
||||||
void OnCreateItem(Player* player, Item* item, uint32 count);
|
void OnCreateItem(Player* player, Item* item, uint32 count);
|
||||||
void OnQuestRewardItem(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);
|
void OnGroupRollRewardItem(Player* player, Item* item, uint32 count, RollVote voteType, Roll* roll);
|
||||||
|
|||||||
Reference in New Issue
Block a user