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:
@@ -71,16 +71,30 @@ public:
|
||||
{
|
||||
if (LootItem* item = loot->LootItemInSlot(i, player))
|
||||
{
|
||||
if (player->AddItem(item->itemid, item->count))
|
||||
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(item->itemid);
|
||||
|
||||
if (itemTemplate->MaxCount != 1)
|
||||
{
|
||||
if (player->AddItem(item->itemid, item->count))
|
||||
{
|
||||
player->SendNotifyLootItemRemoved(lootSlot);
|
||||
player->SendLootRelease(player->GetLootGUID());
|
||||
}
|
||||
else if (sConfigMgr->GetOption<bool>("AOELoot.MailEnable", true))
|
||||
{
|
||||
player->SendItemRetrievalMail(item->itemid, item->count);
|
||||
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());
|
||||
}
|
||||
else if (sConfigMgr->GetOption<bool>("AOELoot.MailEnable", true))
|
||||
{
|
||||
player->SendItemRetrievalMail(item->itemid, item->count);
|
||||
ChatHandler(player->GetSession()).SendSysMessage(AOE_ITEM_IN_THE_MAIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user