Core/Loot: Implemented personal loot and tag sharing for non-boss loot

Port From (https://github.com/TrinityCore/TrinityCore/commit/133334a902b705dae6f7e92bb1009b84cf1c51d2)
This commit is contained in:
hondacrx
2022-10-18 16:07:00 -04:00
parent e78c71784c
commit 9b62b83984
23 changed files with 298 additions and 340 deletions
-23
View File
@@ -659,7 +659,6 @@ namespace Game.Loots
public Loot(Map map, ObjectGuid owner, LootType type, Group group)
{
loot_type = type;
maxDuplicates = 1;
_guid = map ? ObjectGuid.Create(HighGuid.LootObject, map.GetId(), 0, map.GenerateLowGuid(HighGuid.LootObject)) : ObjectGuid.Empty;
_owner = owner;
_itemContext = ItemContext.None;
@@ -1052,26 +1051,6 @@ namespace Game.Loots
}
}
public void Clear()
{
PlayerFFAItems.Clear();
foreach (ObjectGuid playerGuid in PlayersLooting)
{
Player player = Global.ObjAccessor.FindConnectedPlayer(playerGuid);
if (player != null)
player.GetSession().DoLootRelease(this);
}
PlayersLooting.Clear();
items.Clear();
gold = 0;
unlootedCount = 0;
roundRobinPlayer = ObjectGuid.Empty;
_itemContext = 0;
_rolls.Clear();
}
public void NotifyLootList(Map map)
{
LootList lootList = new();
@@ -1095,7 +1074,6 @@ namespace Game.Loots
}
}
public bool Empty() { return items.Empty() && gold == 0; }
public bool IsLooted() { return gold == 0 && unlootedCount == 0; }
public void AddLooter(ObjectGuid guid) { PlayersLooting.Add(guid); }
@@ -1117,7 +1095,6 @@ namespace Game.Loots
public byte unlootedCount;
public ObjectGuid roundRobinPlayer; // GUID of the player having the Round-Robin ownership for the loot. If 0, round robin owner has released.
public LootType loot_type; // required for achievement system
public byte maxDuplicates; // Max amount of items with the same entry that can drop (default is 1; on 25 man raid mode 3)
List<ObjectGuid> PlayersLooting = new();
MultiMap<ObjectGuid, NotNormalLootItem> PlayerFFAItems = new();
-6
View File
@@ -1100,12 +1100,6 @@ namespace Game.Loots
if (!Convert.ToBoolean(item.lootmode & _lootMode))
return true;
byte foundDuplicates = 0;
foreach (var lootItem in _loot.items)
if (lootItem.itemid == item.itemid)
if (++foundDuplicates == _loot.maxDuplicates)
return true;
return false;
}