Core/Loot: Move loot rolls from Group to Loot

Port From (https://github.com/TrinityCore/TrinityCore/commit/3ef5079feeedfdafc9d3c1d9f865e96dbc77ecc8)
This commit is contained in:
hondacrx
2022-09-18 17:57:08 -04:00
parent 0f77a9b27d
commit b76c9571d2
19 changed files with 803 additions and 932 deletions
@@ -91,8 +91,6 @@ namespace Game.Entities
List<VendorItemCount> m_vendorItemCounts = new();
public Loot loot;
public uint m_groupLootTimer; // (msecs)timer used for group loot
public ObjectGuid lootingGroupLowGUID; // used to find group which is looting corpse
ObjectGuid m_lootRecipient;
ObjectGuid m_lootRecipientGroup;
}
+2 -13
View File
@@ -507,20 +507,9 @@ namespace Game.Entities
if (IsEngaged())
AIUpdateTick(diff);
if (loot != null && m_groupLootTimer != 0 && !lootingGroupLowGUID.IsEmpty())
{
if (m_groupLootTimer <= diff)
{
Group group = Global.GroupMgr.GetGroupByGUID(lootingGroupLowGUID);
if (group)
group.EndRoll(loot, GetMap());
loot?.Update();
m_groupLootTimer = 0;
lootingGroupLowGUID.Clear();
}
else m_groupLootTimer -= diff;
}
else if (m_corpseRemoveTime <= GameTime.GetGameTime())
if (m_corpseRemoveTime <= GameTime.GetGameTime())
{
RemoveCorpse(false);
Log.outDebug(LogFilter.Unit, "Removing corpse... {0} ", GetEntry());