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
+9
View File
@@ -757,6 +757,7 @@ namespace Game.Entities
UnsummonPetTemporaryIfAny();
ClearComboPoints();
GetSession().DoLootReleaseAll();
m_lootRolls.Clear();
Global.OutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
Global.BattleFieldMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
}
@@ -3140,7 +3141,15 @@ namespace Game.Entities
case LootMethod.MasterLoot:
case LootMethod.FreeForAll:
return true;
case LootMethod.RoundRobin:
// may only loot if the player is the loot roundrobin player
// or if there are free/quest/conditional item for the player
if (loot.roundRobinPlayer.IsEmpty() || loot.roundRobinPlayer == GetGUID())
return true;
return loot.HasItemFor(this);
case LootMethod.GroupLoot:
case LootMethod.NeedBeforeGreed:
// may only loot if the player is the loot roundrobin player
// or item over threshold (so roll(s) can be launched)
// or if there are free/quest/conditional item for the player