Core/Disables: Added DISABLE_TYPE_PHASE_AREA

Port From (https://github.com/TrinityCore/TrinityCore/commit/3aae692ec33fc1e66453442bf19a10983804c18b)
This commit is contained in:
Hondacrx
2024-08-25 21:11:28 -04:00
parent c98e58a7e1
commit 352ad25112
2 changed files with 20 additions and 2 deletions
+14 -1
View File
@@ -229,6 +229,17 @@ namespace Game
}
break;
}
case DisableType.PhaseArea:
{
if (!CliDB.PhaseStorage.HasRecord(entry))
{
Log.outError(LogFilter.Sql, $"Phase entry {entry} from `disables` doesn't exist in dbc, skipped.");
continue;
}
if (flags != 0)
Log.outError(LogFilter.Sql, $"Disable flags specified for phase {entry}, useless data.");
break;
}
default:
break;
}
@@ -371,6 +382,7 @@ namespace Game
case DisableType.OutdoorPVP:
case DisableType.Criteria:
case DisableType.MMAP:
case DisableType.PhaseArea:
return true;
case DisableType.VMAP:
return flags.HasAnyFlag((DisableFlags)data.flags);
@@ -401,7 +413,8 @@ namespace Game
VMAP = 6,
MMAP = 7,
LFGMap = 8,
Max = 9
PhaseArea = 9,
Max
}
[Flags]
+6 -1
View File
@@ -280,6 +280,9 @@ namespace Game
continue;
uint phaseId = phaseArea.PhaseInfo.Id;
if (Global.DisableMgr.IsDisabledFor(DisableType.PhaseArea, phaseId, obj))
continue;
if (Global.ConditionMgr.IsObjectMeetToConditions(srcInfo, phaseArea.Conditions))
phaseShift.AddPhase(phaseId, GetPhaseFlags(phaseId), phaseArea.Conditions);
else
@@ -348,7 +351,7 @@ namespace Game
foreach (var pair in suppressedPhaseShift.Phases.ToList())
{
if (Global.ConditionMgr.IsObjectMeetToConditions(srcInfo, pair.Value.AreaConditions))
if (!Global.DisableMgr.IsDisabledFor(DisableType.PhaseArea, pair.Key, obj) && Global.ConditionMgr.IsObjectMeetToConditions(srcInfo, pair.Value.AreaConditions))
{
changed = phaseShift.AddPhase(pair.Key, pair.Value.Flags, pair.Value.AreaConditions, pair.Value.References) || changed;
suppressedPhaseShift.ModifyPhasesReferences(pair.Key, pair.Value, -pair.Value.References);
@@ -592,6 +595,8 @@ namespace Game
phases.Append($" ({cosmetic})");
if (pair.Value.Flags.HasFlag(PhaseFlags.Personal))
phases.Append($" ({personal})");
if (Global.DisableMgr.IsDisabledFor(DisableType.PhaseArea, pair.Key, null))
phases.Append(" (Disabled)");
}
chat.SendSysMessage(CypherStrings.PhaseshiftPhases, phases.ToString());