mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
feat(Core/Quest): Quest item reward (#1733)
- Instead of sending two same messages about item receive, send one.
This commit is contained in:
@@ -14804,7 +14804,7 @@ void Player::SendItemDurations()
|
||||
}
|
||||
}
|
||||
|
||||
void Player::SendNewItem(Item* item, uint32 count, bool received, bool created, bool broadcast)
|
||||
void Player::SendNewItem(Item* item, uint32 count, bool received, bool created, bool broadcast, bool sendChatMessage)
|
||||
{
|
||||
if (!item) // prevent crash
|
||||
return;
|
||||
@@ -14814,7 +14814,7 @@ void Player::SendNewItem(Item* item, uint32 count, bool received, bool created,
|
||||
data << uint64(GetGUID()); // player GUID
|
||||
data << uint32(received); // 0=looted, 1=from npc
|
||||
data << uint32(created); // 0=received, 1=created
|
||||
data << uint32(1); // bool print error to chat
|
||||
data << uint32(sendChatMessage); // bool print message to chat
|
||||
data << uint8(item->GetBagSlot()); // bagslot
|
||||
// item slot, but when added to stack: 0xFFFFFFFF
|
||||
data << uint32((item->GetCount() == count) ? item->GetSlot() : -1);
|
||||
@@ -15848,7 +15848,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, quest->RewardChoiceItemCount[reward]) == EQUIP_ERR_OK)
|
||||
{
|
||||
Item* item = StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
|
||||
SendNewItem(item, quest->RewardChoiceItemCount[reward], true, false);
|
||||
SendNewItem(item, quest->RewardChoiceItemCount[reward], true, false, false, false);
|
||||
|
||||
sScriptMgr->OnQuestRewardItem(this, item, quest->RewardChoiceItemCount[reward]);
|
||||
}
|
||||
@@ -15867,7 +15867,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, quest->RewardItemIdCount[i]) == EQUIP_ERR_OK)
|
||||
{
|
||||
Item* item = StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
|
||||
SendNewItem(item, quest->RewardItemIdCount[i], true, false);
|
||||
SendNewItem(item, quest->RewardItemIdCount[i], true, false, false, false);
|
||||
|
||||
sScriptMgr->OnQuestRewardItem(this, item, quest->RewardItemIdCount[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user