diff --git a/Source/Game/Achievements/CriteriaHandler.cs b/Source/Game/Achievements/CriteriaHandler.cs index bf0d62f91..63bea31ef 100644 --- a/Source/Game/Achievements/CriteriaHandler.cs +++ b/Source/Game/Achievements/CriteriaHandler.cs @@ -1812,7 +1812,7 @@ namespace Game.Achievements return false; break; case ModifierTreeType.PlayersRealmWorldState: // 108 - if (Global.WorldMgr.GetWorldState(reqValue) != secondaryAsset) + if (Global.WorldStateMgr.GetValue((int)reqValue, referencePlayer.GetMap()) != secondaryAsset) return false; break; case ModifierTreeType.TimeBetween: // 109 diff --git a/Source/Game/Conditions/Condition.cs b/Source/Game/Conditions/Condition.cs index 2a66a4e32..a46f6bb10 100644 --- a/Source/Game/Conditions/Condition.cs +++ b/Source/Game/Conditions/Condition.cs @@ -83,7 +83,7 @@ namespace Game.Conditions break; case ConditionTypes.WorldState: { - condMeets = ConditionValue2 == Global.WorldMgr.GetWorldState(ConditionValue1); + condMeets = Global.WorldStateMgr.GetValue((int)ConditionValue1, map) == ConditionValue2; break; } case ConditionTypes.RealmAchievement: diff --git a/Source/Game/Conditions/ConditionManager.cs b/Source/Game/Conditions/ConditionManager.cs index 523d4cad2..bc08c4176 100644 --- a/Source/Game/Conditions/ConditionManager.cs +++ b/Source/Game/Conditions/ConditionManager.cs @@ -1668,7 +1668,7 @@ namespace Game } case ConditionTypes.WorldState: { - if (Global.WorldMgr.GetWorldState((WorldStates)cond.ConditionValue1) == 0) + if (Global.WorldStateMgr.GetWorldStateTemplate((int)cond.ConditionValue1) == null) { Log.outError(LogFilter.Sql, "{0} has non existing world state in value1 ({1}), skipped.", cond.ToString(true), cond.ConditionValue1); return false; @@ -2772,7 +2772,7 @@ namespace Game case WorldStateExpressionValueType.WorldState: { uint worldStateId = buffer.ReadUInt32(); - value = (int)Global.WorldMgr.GetWorldState(worldStateId); + value = Global.WorldStateMgr.GetValue((int)worldStateId, player.GetMap()); break; } case WorldStateExpressionValueType.Function: diff --git a/Source/Game/Entities/Player/Player.Map.cs b/Source/Game/Entities/Player/Player.Map.cs index 11b11983b..7acd59c40 100644 --- a/Source/Game/Entities/Player/Player.Map.cs +++ b/Source/Game/Entities/Player/Player.Map.cs @@ -247,7 +247,7 @@ namespace Game.Entities { if (area != null) { - if (InBattleground() || area.HasFlag(AreaFlags.Combat) || (area.PvpCombatWorldStateID != -1 && Global.WorldMgr.GetWorldState((WorldStates)area.PvpCombatWorldStateID) != 0)) + if (InBattleground() || area.HasFlag(AreaFlags.Combat) || (area.PvpCombatWorldStateID != -1 && Global.WorldStateMgr.GetValue(area.PvpCombatWorldStateID, GetMap()) != 0)) pvpInfo.IsInHostileArea = true; else if (IsWarModeLocalActive() || area.HasFlag(AreaFlags.Unk3)) {