Core/Loot: Prevent looting bosses by players that have already completed that encounter
Port From (https://github.com/TrinityCore/TrinityCore/commit/9ce47e6809eecc891904e272b368596fdc55e6a4)
This commit is contained in:
@@ -5973,7 +5973,7 @@ namespace Game.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
if (!item.AllowedForPlayer(this))
|
||||
if (!item.HasAllowedLooter(GetGUID()))
|
||||
{
|
||||
SendLootReleaseAll();
|
||||
return;
|
||||
|
||||
@@ -558,6 +558,19 @@ namespace Game.Entities
|
||||
SendPacket(transferAborted);
|
||||
}
|
||||
|
||||
public bool IsLockedToDungeonEncounter(uint dungeonEncounterId)
|
||||
{
|
||||
DungeonEncounterRecord dungeonEncounter = CliDB.DungeonEncounterStorage.LookupByKey(dungeonEncounterId);
|
||||
if (dungeonEncounter == null)
|
||||
return false;
|
||||
|
||||
InstanceLock instanceLock = Global.InstanceLockMgr.FindActiveInstanceLock(GetGUID(), new MapDb2Entries(GetMap().GetEntry(), GetMap().GetMapDifficulty()));
|
||||
if (instanceLock == null)
|
||||
return false;
|
||||
|
||||
return (instanceLock.GetData().CompletedEncountersMask & (1u << dungeonEncounter.Bit)) != 0;
|
||||
}
|
||||
|
||||
public override void ProcessTerrainStatusUpdate(ZLiquidStatus oldLiquidStatus, LiquidData newLiquidData)
|
||||
{
|
||||
// process liquid auras using generic unit code
|
||||
|
||||
@@ -3130,7 +3130,8 @@ namespace Game.Entities
|
||||
Loot loot = creature.GetLootForPlayer(this);
|
||||
if (loot == null || loot.IsLooted()) // nothing to loot or everything looted.
|
||||
return false;
|
||||
if (!loot.HasItemForAll() && !loot.HasItemFor(this)) // no loot in creature for this player
|
||||
|
||||
if (!loot.HasAllowedLooter(GetGUID()) || (!loot.HasItemForAll() && !loot.HasItemFor(this))) // no loot in creature for this player
|
||||
return false;
|
||||
|
||||
if (loot.loot_type == LootType.Skinning)
|
||||
|
||||
Reference in New Issue
Block a user