1693{
1694 bool rate = store.IsRatesAllowed();
1695
1696 if (groupId)
1697 {
1698 if (groupId >
Groups.size())
1699 return;
1700
1701 if (!
Groups[groupId - 1])
1702 return;
1703
1704
1705 if (isTopLevel)
1706 {
1708 }
1709 else
1710 {
1711 Groups[groupId - 1]->Process(loot, player, store, lootMode, 0);
1712 }
1713 return;
1714 }
1715
1716
1717 for (LootStoreItemList::const_iterator i =
Entries.begin(); i !=
Entries.end(); ++i)
1718 {
1721 continue;
1722 if (!item->
Roll(rate, player, loot, store))
1723 continue;
1724
1726 {
1728 if (!Referenced)
1729 continue;
1730
1732 sScriptMgr->OnAfterRefCount(player, loot, rate, lootMode, item, maxcount, store);
1733 for (
uint32 loop = 0; loop < maxcount; ++loop)
1734
1735 Referenced->
Process(loot, store, lootMode, player, item->
groupid,
false);
1736 }
1737 else
1738 {
1739
1740 sScriptMgr->OnBeforeDropAddItem(player, loot, rate, lootMode, item, store);
1742 }
1743 }
1744
1745
1746 for (LootGroups::const_iterator i =
Groups.begin(); i !=
Groups.end(); ++i)
1747 if (LootGroup* group = *i)
1748 {
1749
1750 if (isTopLevel)
1751 {
1753 sScriptMgr->OnAfterCalculateLootGroupAmount(player, loot, lootMode, groupAmount, store);
1754 group->Process(loot, player, store, lootMode, groupAmount);
1755 }
1756 else
1757 {
1758 group->Process(loot, player, store, lootMode, 0);
1759 }
1760 }
1761}
#define sScriptMgr
Definition: ScriptMgr.h:708
@ RATE_DROP_ITEM_REFERENCED_AMOUNT
Definition: IWorld.h:449
@ RATE_DROP_ITEM_GROUP_AMOUNT
Definition: IWorld.h:450
#define sWorld
Definition: World.h:444
bool Roll(bool rate, Player const *player, Loot &loot, LootStore const &store) const
Definition: LootMgr.cpp:305
uint8 maxcount
Definition: LootMgr.h:137
uint16 lootmode
Definition: LootMgr.h:134
void Process(Loot &loot, LootStore const &store, uint16 lootMode, Player const *player, uint8 groupId=0, bool isTopLevel=true) const
Definition: LootMgr.cpp:1692
void AddItem(LootStoreItem const &item)
Definition: LootMgr.cpp:505