Core/Achievements: Implemented DefeatDungeonEncounter and DefeatDungeonEncounterWhileElegibleForLoot criteria types

Port From (https://github.com/TrinityCore/TrinityCore/commit/765f86fdc001ce352a706d2950197b1007d9afce)
This commit is contained in:
hondacrx
2024-02-03 11:09:53 -05:00
parent 52ea57d5cf
commit d0cd2aae8a
3 changed files with 19 additions and 4 deletions
@@ -384,6 +384,12 @@ namespace Game.Maps
dungeonEncounter = bossInfo.GetDungeonEncounterForDifficulty(instance.GetDifficultyID());
if (dungeonEncounter != null)
{
instance.DoOnPlayers(player =>
{
if (!player.IsLockedToDungeonEncounter(dungeonEncounter.Id))
player.UpdateCriteria(CriteriaType.DefeatDungeonEncounterWhileElegibleForLoot, dungeonEncounter.Id);
});
DoUpdateCriteria(CriteriaType.DefeatDungeonEncounter, dungeonEncounter.Id);
SendBossKillCredit(dungeonEncounter.Id);
if (dungeonEncounter.CompleteWorldStateID != 0)