diff options
| author | Nyeriah <sarah.trysan@live.com> | 2014-08-29 02:53:30 -0300 |
|---|---|---|
| committer | Nyeriah <sarah.trysan@live.com> | 2014-08-29 02:53:30 -0300 |
| commit | 9f606f74a3e10a275d59765312679eda9e58af99 (patch) | |
| tree | 0a3443f13b36520bad30e6a342d1b00a7f25e737 /src/server/game/Groups/Group.cpp | |
| parent | b20b6dedf9b7de13a35f60c6f72f8a80ceed94e6 (diff) | |
Core/Player: Implement a method to send out the Postmaster's item retrieval mails as it seems to be used in multiple places and also send disenchant roll result as a mail if the player's inventory is full
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
| -rw-r--r-- | src/server/game/Groups/Group.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 8068e82f676..88a83ab6fde 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1420,8 +1420,25 @@ void Group::CountTheRoll(Rolls::iterator rollI) 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 // If the player's inventory is full, send the disenchant result in a mail. + { + 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, NULL, NULL, lootItem->itemid); + player->SendItemRetrievalMail(lootItem->itemid, lootItem->count); + } + } } } } |
