diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index c229fcc77..5ce3026e1 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -2655,6 +2655,8 @@ namespace Game.Entities void AddLootMode(LootModes lootMode) { m_LootMode |= lootMode; } void RemoveLootMode(LootModes lootMode) { m_LootMode &= ~lootMode; } void ResetLootMode() { m_LootMode = LootModes.Default; } + public void SetLootGenerationTime() { m_lootGenerationTime = (uint)Time.UnixTime; } + public uint GetLootGenerationTime() { return m_lootGenerationTime; } public void AddToSkillupList(ObjectGuid PlayerGuid) { m_SkillupList.Add(PlayerGuid); } public bool IsInSkillupList(ObjectGuid PlayerGuid) @@ -2741,6 +2743,7 @@ namespace Game.Entities ObjectGuid m_lootRecipient; ObjectGuid m_lootRecipientGroup; LootModes m_LootMode; // bitmask, default LOOT_MODE_DEFAULT, determines what loot will be lootable + uint m_lootGenerationTime; public uint m_groupLootTimer; // (msecs)timer used for group loot public ObjectGuid lootingGroupLowGUID; // used to find group which is looting long m_packedRotation; diff --git a/Source/Game/Entities/Player/Player.Items.cs b/Source/Game/Entities/Player/Player.Items.cs index 9bfde73cb..b3871ce88 100644 --- a/Source/Game/Entities/Player/Player.Items.cs +++ b/Source/Game/Entities/Player/Player.Items.cs @@ -6233,6 +6233,11 @@ namespace Game.Entities loot = go.loot; + // loot was generated and respawntime has passed since then, allow to recreate loot + // to avoid bugs, this rule covers spawned gameobjects only + if (go.isSpawnedByDefault() && go.getLootState() == LootState.Activated && !go.loot.isLooted() && go.GetLootGenerationTime() + go.GetRespawnDelay() < Time.UnixTime) + go.SetLootState(LootState.Ready); + if (go.getLootState() == LootState.Ready) { uint lootid = go.GetGoInfo().GetLootId(); @@ -6258,6 +6263,7 @@ namespace Game.Entities group.UpdateLooterGuid(go, true); loot.FillLoot(lootid, LootStorage.Gameobject, this, !groupRules, false, go.GetLootMode()); + go.SetLootGenerationTime(); // get next RR player (for next loot) if (groupRules)