diff options
Diffstat (limited to 'src/server/game/Loot/LootMgr.cpp')
-rw-r--r-- | src/server/game/Loot/LootMgr.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 9247d2efdc6..b37d22f10eb 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -87,7 +87,7 @@ class LootTemplate::LootGroup // A set of loot def bool HasQuestDrop() const; // True if group includes at least 1 quest drop entry bool HasQuestDropForPlayer(Player const* player) const; // The same for active quests of the player - void Process(Loot& loot, uint16 lootMode) const; // Rolls an item from the group (if any) and adds the item to the loot + void Process(Loot& loot, uint16 lootMode, Player const* player) const; // Rolls an item from the group (if any) and adds the item to the loot float RawTotalChance() const; // Overall chance for the group (without equal chanced items) float TotalChance() const; // Overall chance for the group @@ -443,10 +443,10 @@ void LootTemplate::LootGroup::CopyConditions(ConditionContainer /*conditions*/) } // Rolls an item from the group (if any takes its chance) and adds the item to the loot -void LootTemplate::LootGroup::Process(Loot& loot, uint16 lootMode) const +void LootTemplate::LootGroup::Process(Loot& loot, uint16 lootMode, Player const* player) const { if (LootStoreItem const* item = Roll(loot, lootMode)) - loot.AddItem(*item); + loot.AddItem(*item, player); } // Overall chance for the group without equal chanced items @@ -563,7 +563,7 @@ void LootTemplate::CopyConditions(LootItem* li) const } // Rolls for every item in the template and adds the rolled items the the loot -void LootTemplate::Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId) const +void LootTemplate::Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId, Player const* player) const { if (groupId) // Group reference uses own processing of the group { @@ -573,7 +573,7 @@ void LootTemplate::Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId if (!Groups[groupId - 1]) return; - Groups[groupId - 1]->Process(loot, lootMode); + Groups[groupId - 1]->Process(loot, lootMode, player); return; } @@ -587,7 +587,7 @@ void LootTemplate::Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId if (!item->Roll(rate)) continue; // Bad luck for the entry - if (item->reference > 0) // References processing + if (item->reference > 0) // References processing { LootTemplate const* Referenced = LootTemplates_Reference.GetLootFor(item->reference); if (!Referenced) @@ -595,16 +595,16 @@ void LootTemplate::Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId uint32 maxcount = uint32(float(item->maxcount) * sWorld->getRate(RATE_DROP_ITEM_REFERENCED_AMOUNT)); for (uint32 loop = 0; loop < maxcount; ++loop) // Ref multiplicator - Referenced->Process(loot, rate, lootMode, item->groupid); + Referenced->Process(loot, rate, lootMode, item->groupid, player); } else // Plain entries (not a reference, not grouped) - loot.AddItem(*item); // Chance is already checked, just add + loot.AddItem(*item, player); // Chance is already checked, just add } // Now processing groups for (LootGroups::const_iterator i = Groups.begin(); i != Groups.end(); ++i) if (LootGroup* group = *i) - group->Process(loot, lootMode); + group->Process(loot, lootMode, player); } // True if template includes at least 1 quest drop entry |