feat(Core/Scripting): Implement hook OnAfterCalculateLootGroupAmount() (#17456)

Add hook 'OnAfterCalculateLootGroupAmount' to GlobalScript, similar to existing hook 'OnAfterRefCount'. Allows for dynamic modification of the group loot rate
This commit is contained in:
Hasn
2023-10-08 22:18:44 +02:00
committed by GitHub
parent 71312323a1
commit e644dd949f
3 changed files with 13 additions and 1 deletions

View File

@@ -1738,7 +1738,9 @@ void LootTemplate::Process(Loot& loot, LootStore const& store, uint16 lootMode,
// Rate.Drop.Item.GroupAmount is only in effect for the top loot template level
if (isTopLevel)
{
group->Process(loot, player, store, lootMode, sWorld->getRate(RATE_DROP_ITEM_GROUP_AMOUNT));
uint32 groupAmount = sWorld->getRate(RATE_DROP_ITEM_GROUP_AMOUNT);
sScriptMgr->OnAfterCalculateLootGroupAmount(player, loot, lootMode, groupAmount, store);
group->Process(loot, player, store, lootMode, groupAmount);
}
else
{