Core/WorldStates: Implemented setting dungeon encounter world states
Port From (https://github.com/TrinityCore/TrinityCore/commit/3598d280ff67d1653d9e1d61cbd32d12d41bc1d7)
This commit is contained in:
@@ -790,6 +790,9 @@ namespace Game.Maps
|
||||
if (encounter.creditType == type && encounter.creditEntry == creditEntry)
|
||||
{
|
||||
completedEncounters |= (1u << encounter.dbcEntry.Bit);
|
||||
if (encounter.dbcEntry.CompleteWorldStateID != 0)
|
||||
DoUpdateWorldState((uint)encounter.dbcEntry.CompleteWorldStateID, 1);
|
||||
|
||||
if (encounter.lastEncounterDungeon != 0)
|
||||
{
|
||||
dungeonId = encounter.lastEncounterDungeon;
|
||||
@@ -816,6 +819,19 @@ namespace Game.Maps
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCompletedEncountersMask(uint newMask)
|
||||
{
|
||||
completedEncounters = newMask;
|
||||
|
||||
var encounters = Global.ObjectMgr.GetDungeonEncounterList(instance.GetId(), instance.GetDifficultyID());
|
||||
if (encounters != null)
|
||||
{
|
||||
foreach (DungeonEncounter encounter in encounters)
|
||||
if ((completedEncounters & (1 << encounter.dbcEntry.Bit)) != 0 && encounter.dbcEntry.CompleteWorldStateID != 0)
|
||||
DoUpdateWorldState((uint)encounter.dbcEntry.CompleteWorldStateID, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdatePhasing()
|
||||
{
|
||||
instance.DoOnPlayers(player => PhasingHandler.SendToPlayer(player));
|
||||
@@ -903,8 +919,6 @@ namespace Game.Maps
|
||||
|
||||
public virtual bool CheckRequiredBosses(uint bossId, Player player = null) { return true; }
|
||||
|
||||
public void SetCompletedEncountersMask(uint newMask) { completedEncounters = newMask; }
|
||||
|
||||
public uint GetCompletedEncounterMask() { return completedEncounters; }
|
||||
|
||||
// Sets a temporary entrance that does not get saved to db
|
||||
|
||||
Reference in New Issue
Block a user