1699{
1700 bool rate = store.IsRatesAllowed();
1701
1702 if (groupId)
1703 {
1704 if (groupId >
Groups.size())
1705 return;
1706
1707 if (!
Groups[groupId - 1])
1708 return;
1709
1710
1711 if (isTopLevel)
1712 {
1714 }
1715 else
1716 {
1717 Groups[groupId - 1]->Process(loot, player, store, lootMode, 0);
1718 }
1719 return;
1720 }
1721
1722
1723 for (LootStoreItemList::const_iterator i =
Entries.begin(); i !=
Entries.end(); ++i)
1724 {
1727 continue;
1728 if (!item->
Roll(rate, player, loot, store))
1729 continue;
1730
1732 {
1734 if (!Referenced)
1735 continue;
1736
1738 sScriptMgr->OnAfterRefCount(player, loot, rate, lootMode, item, maxcount, store);
1739 for (
uint32 loop = 0; loop < maxcount; ++loop)
1740
1741 Referenced->
Process(loot, store, lootMode, player, item->
groupid,
false);
1742 }
1743 else
1744 {
1745
1746 sScriptMgr->OnBeforeDropAddItem(player, loot, rate, lootMode, item, store);
1748 }
1749 }
1750
1751
1752 for (LootGroups::const_iterator i =
Groups.begin(); i !=
Groups.end(); ++i)
1753 if (LootGroup* group = *i)
1754 {
1755
1756 if (isTopLevel)
1757 {
1759 sScriptMgr->OnAfterCalculateLootGroupAmount(player, loot, lootMode, groupAmount, store);
1760 group->Process(loot, player, store, lootMode, groupAmount);
1761 }
1762 else
1763 {
1764 group->Process(loot, player, store, lootMode, 0);
1765 }
1766 }
1767}
@ RATE_DROP_ITEM_REFERENCED_AMOUNT
Definition: IWorld.h:447
@ RATE_DROP_ITEM_GROUP_AMOUNT
Definition: IWorld.h:448
#define sScriptMgr
Definition: ScriptMgr.h:709
#define sWorld
Definition: World.h:443
bool Roll(bool rate, Player const *player, Loot &loot, LootStore const &store) const
Definition: LootMgr.cpp:311
uint16 lootmode
Definition: LootMgr.h:133
void Process(Loot &loot, LootStore const &store, uint16 lootMode, Player const *player, uint8 groupId=0, bool isTopLevel=true) const
Definition: LootMgr.cpp:1698
void AddItem(LootStoreItem const &item)
Definition: LootMgr.cpp:511