Core/Instances: Spawn defeated bosses in instances using loot based locks if their preceding bosses are not killed
Port From (https://github.com/TrinityCore/TrinityCore/commit/ca5f7a15b9c2ca352f7f83ddc065d795f2294d98)
This commit is contained in:
@@ -462,6 +462,12 @@ namespace Game.Maps
|
|||||||
InstanceScriptDataReader reader = new(this);
|
InstanceScriptDataReader reader = new(this);
|
||||||
if (reader.Load(data) == InstanceScriptDataReader.Result.Ok)
|
if (reader.Load(data) == InstanceScriptDataReader.Result.Ok)
|
||||||
{
|
{
|
||||||
|
// in loot-based lockouts instance can be loaded with later boss marked as killed without preceding bosses
|
||||||
|
// but we still need to have them alive
|
||||||
|
for (uint i = 0; i < bosses.Count; ++i)
|
||||||
|
if (bosses[i].state == EncounterState.Done && !CheckRequiredBosses(i))
|
||||||
|
bosses[i].state = EncounterState.NotStarted;
|
||||||
|
|
||||||
UpdateSpawnGroups();
|
UpdateSpawnGroups();
|
||||||
AfterDataLoad();
|
AfterDataLoad();
|
||||||
}
|
}
|
||||||
@@ -715,6 +721,16 @@ namespace Game.Maps
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsEncounterCompletedInMaskByBossId(uint completedEncountersMask, uint bossId)
|
||||||
|
{
|
||||||
|
DungeonEncounterRecord dungeonEncounter = GetBossDungeonEncounter(bossId);
|
||||||
|
if (dungeonEncounter != null)
|
||||||
|
if ((completedEncountersMask & (1 << dungeonEncounter.Bit)) != 0)
|
||||||
|
return bosses[bossId].state == EncounterState.Done;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void SetEntranceLocation(uint worldSafeLocationId)
|
public void SetEntranceLocation(uint worldSafeLocationId)
|
||||||
{
|
{
|
||||||
_entranceId = worldSafeLocationId;
|
_entranceId = worldSafeLocationId;
|
||||||
|
|||||||
Reference in New Issue
Block a user