mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
fix(Core/Loot): Send Retrieval Mail for lost disenchant mats
This commit is contained in:
@@ -1510,8 +1510,28 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
||||
roll->getLoot()->NotifyItemRemoved(roll->itemSlot);
|
||||
roll->getLoot()->unlootedCount--;
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(roll->itemid);
|
||||
player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true);
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, 13262); // Disenchant
|
||||
|
||||
ItemPosCountVec dest;
|
||||
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count);
|
||||
|
||||
if(msg == EQUIP_ERR_OK)
|
||||
{
|
||||
player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Loot loot;
|
||||
loot.FillLoot(pProto->DisenchantID, LootTemplates_Disenchant, player, true);
|
||||
|
||||
uint32 max_slot = loot.GetMaxSlotInLootFor(player);
|
||||
for(uint32 i = 0; i < max_slot; i++)
|
||||
{
|
||||
LootItem* lootItem = loot.LootItemInSlot(i, player);
|
||||
player->SendEquipError(msg, nullptr, nullptr, lootItem->itemid);
|
||||
player->SendItemRetrievalMail(lootItem->itemid, lootItem->count);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user