mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/WorldStates: Implemented setting dungeon encounter world states
This commit is contained in:
@@ -810,6 +810,9 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi
|
||||
if (encounter.creditType == type && encounter.creditEntry == creditEntry)
|
||||
{
|
||||
completedEncounters |= 1 << encounter.dbcEntry->Bit;
|
||||
if (encounter.dbcEntry->CompleteWorldStateID)
|
||||
DoUpdateWorldState(encounter.dbcEntry->CompleteWorldStateID, 1);
|
||||
|
||||
if (encounter.lastEncounterDungeon)
|
||||
{
|
||||
dungeonId = encounter.lastEncounterDungeon;
|
||||
@@ -850,6 +853,16 @@ void InstanceScript::UpdateEncounterStateForSpellCast(uint32 spellId, Unit* sour
|
||||
UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, spellId, source);
|
||||
}
|
||||
|
||||
void InstanceScript::SetCompletedEncountersMask(uint32 newMask)
|
||||
{
|
||||
completedEncounters = newMask;
|
||||
|
||||
if (DungeonEncounterList const* encounters = sObjectMgr->GetDungeonEncounterList(instance->GetId(), instance->GetDifficultyID()))
|
||||
for (DungeonEncounter const& encounter : *encounters)
|
||||
if (completedEncounters & (1 << encounter.dbcEntry->Bit) && encounter.dbcEntry->CompleteWorldStateID)
|
||||
DoUpdateWorldState(encounter.dbcEntry->CompleteWorldStateID, 1);
|
||||
}
|
||||
|
||||
void InstanceScript::UpdatePhasing()
|
||||
{
|
||||
instance->DoOnPlayers([](Player const* player)
|
||||
|
||||
Reference in New Issue
Block a user