Core/Objects: Implement FindNearestCreatureWithOptions helper function

Port From (https://github.com/TrinityCore/TrinityCore/commit/9ab0679781ba65bc278203ee01d1169114c64033)
This commit is contained in:
hondacrx
2023-01-05 03:02:26 -05:00
parent 40db25f49c
commit 23c3084f00
3 changed files with 109 additions and 34 deletions
+12
View File
@@ -33,6 +33,13 @@ namespace Game
public class PhasingHandler
{
public static PhaseShift EmptyPhaseShift = new();
public static PhaseShift AlwaysVisible;
static PhasingHandler()
{
AlwaysVisible = new();
InitDbPhaseShift(AlwaysVisible, PhaseUseFlagsValues.AlwaysVisible, 0, 0);
}
public static PhaseFlags GetPhaseFlags(uint phaseId)
{
@@ -500,6 +507,11 @@ namespace Game
partyMemberPhases.List.Add(new PartyMemberPhase((uint)pair.Value.Flags, pair.Key));
}
public static PhaseShift GetAlwaysVisiblePhaseShift()
{
return AlwaysVisible;
}
public static void InitDbPhaseShift(PhaseShift phaseShift, PhaseUseFlagsValues phaseUseFlags, uint phaseId, uint phaseGroupId)
{
phaseShift.ClearPhases();