feat(Core): Add OnGroupRollRewardItem hook. (#12538)

Added OnGroupRollRewardItem hook.
This commit is contained in:
AnchyDev
2022-07-27 01:08:41 +01:00
committed by GitHub
parent f53b19dfd3
commit dcbf224392
3 changed files with 17 additions and 2 deletions

View File

@@ -1448,7 +1448,8 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
roll->getLoot()->NotifyItemRemoved(roll->itemSlot);
roll->getLoot()->unlootedCount--;
AllowedLooterSet looters = item->GetAllowedLooters();
player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), NEED, roll);
player->UpdateLootAchievements(item, roll->getLoot());
}
else
@@ -1516,7 +1517,8 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
roll->getLoot()->NotifyItemRemoved(roll->itemSlot);
roll->getLoot()->unlootedCount--;
AllowedLooterSet looters = item->GetAllowedLooters();
player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), GREED, roll);
player->UpdateLootAchievements(item, roll->getLoot());
}
else