mirror of
https://github.com/azerothcore/mod-aoe-loot
synced 2025-11-29 21:38:16 +08:00
Feat. Preventing the procurement of multiple unique items (#16)
This commit is contained in:
@@ -70,6 +70,10 @@ public:
|
||||
for (uint32 i = 0; i < maxSlot; ++i)
|
||||
{
|
||||
if (LootItem* item = loot->LootItemInSlot(i, player))
|
||||
{
|
||||
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(item->itemid);
|
||||
|
||||
if (itemTemplate->MaxCount != 1)
|
||||
{
|
||||
if (player->AddItem(item->itemid, item->count))
|
||||
{
|
||||
@@ -82,6 +86,16 @@ public:
|
||||
ChatHandler(player->GetSession()).SendSysMessage(AOE_ITEM_IN_THE_MAIL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!player->HasItemCount(item->itemid, 1))
|
||||
{
|
||||
player->AddItem(item->itemid, item->count);
|
||||
}
|
||||
player->SendNotifyLootItemRemoved(lootSlot);
|
||||
player->SendLootRelease(player->GetLootGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!loot->empty())
|
||||
|
||||
Reference in New Issue
Block a user