mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Instances: Spawn defeated bosses in instances using loot based locks if their preceding bosses are not killed
This commit is contained in:
@@ -477,6 +477,12 @@ void InstanceScript::Load(char const* data)
|
||||
InstanceScriptDataReader reader(*this);
|
||||
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 (uint32 i = 0; i < bosses.size(); ++i)
|
||||
if (bosses[i].state == DONE && !CheckRequiredBosses(i))
|
||||
bosses[i].state = NOT_STARTED;
|
||||
|
||||
UpdateSpawnGroups();
|
||||
AfterDataLoad();
|
||||
}
|
||||
@@ -740,6 +746,15 @@ bool InstanceScript::IsEncounterCompleted(uint32 dungeonEncounterId) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool InstanceScript::IsEncounterCompletedInMaskByBossId(uint32 completedEncountersMask, uint32 bossId) const
|
||||
{
|
||||
if (DungeonEncounterEntry const* dungeonEncounter = GetBossDungeonEncounter(bossId))
|
||||
if (completedEncountersMask & (1 << dungeonEncounter->Bit))
|
||||
return bosses[bossId].state == DONE;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void InstanceScript::SetEntranceLocation(uint32 worldSafeLocationId)
|
||||
{
|
||||
_entranceId = worldSafeLocationId;
|
||||
|
||||
Reference in New Issue
Block a user