Core/Auras: Implemented SPELL_AURA_PHASE_ALWAYS_VISIBLE
Port From (https://github.com/TrinityCore/TrinityCore/commit/c9344c145ad1f981492c35d4aad7ca7a60e9f8f2)
This commit is contained in:
@@ -348,7 +348,7 @@ namespace Framework.Constants
|
|||||||
OverrideUnlockedAzeriteEssenceRank = 324, // testing aura
|
OverrideUnlockedAzeriteEssenceRank = 324, // testing aura
|
||||||
LearnPvpTalent = 325, // NYI
|
LearnPvpTalent = 325, // NYI
|
||||||
PhaseGroup = 326, // Phase Related
|
PhaseGroup = 326, // Phase Related
|
||||||
PhaseAlwaysVisible = 327, // NYI - sets PhaseShiftFlags::AlwaysVisible
|
PhaseAlwaysVisible = 327, // Sets PhaseShiftFlags::AlwaysVisible
|
||||||
TriggerSpellOnPowerPct = 328,
|
TriggerSpellOnPowerPct = 328,
|
||||||
ModPowerGainPct = 329,
|
ModPowerGainPct = 329,
|
||||||
CastWhileWalking = 330,
|
CastWhileWalking = 330,
|
||||||
|
|||||||
@@ -2160,12 +2160,12 @@ namespace Game.Entities
|
|||||||
GetHostileRefManager().SetOnlineOfflineState(false);
|
GetHostileRefManager().SetOnlineOfflineState(false);
|
||||||
CombatStopWithPets();
|
CombatStopWithPets();
|
||||||
|
|
||||||
PhasingHandler.SetAlwaysVisible(GetPhaseShift(), true);
|
PhasingHandler.SetAlwaysVisible(this, true, false);
|
||||||
m_serverSideVisibilityDetect.SetValue(ServerSideVisibilityType.GM, GetSession().GetSecurity());
|
m_serverSideVisibilityDetect.SetValue(ServerSideVisibilityType.GM, GetSession().GetSecurity());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PhasingHandler.SetAlwaysVisible(GetPhaseShift(), false);
|
PhasingHandler.SetAlwaysVisible(this, !HasAuraType(AuraType.PhaseAlwaysVisible), false);
|
||||||
|
|
||||||
m_ExtraFlags &= ~PlayerExtraFlags.GMOn;
|
m_ExtraFlags &= ~PlayerExtraFlags.GMOn;
|
||||||
SetFactionForRace(GetRace());
|
SetFactionForRace(GetRace());
|
||||||
|
|||||||
@@ -481,22 +481,26 @@ namespace Game
|
|||||||
return map.GetId();
|
return map.GetId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetAlwaysVisible(PhaseShift phaseShift, bool apply)
|
public static void SetAlwaysVisible(WorldObject obj, bool apply, bool updateVisibility)
|
||||||
{
|
{
|
||||||
if (apply)
|
if (apply)
|
||||||
phaseShift.Flags |= PhaseShiftFlags.AlwaysVisible;
|
obj.GetPhaseShift().Flags |= PhaseShiftFlags.AlwaysVisible;
|
||||||
else
|
else
|
||||||
phaseShift.Flags &= ~PhaseShiftFlags.AlwaysVisible;
|
obj.GetPhaseShift().Flags &= ~PhaseShiftFlags.AlwaysVisible;
|
||||||
|
|
||||||
|
UpdateVisibilityIfNeeded(obj, updateVisibility, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetInversed(PhaseShift phaseShift, bool apply)
|
public static void SetInversed(WorldObject obj, bool apply, bool updateVisibility)
|
||||||
{
|
{
|
||||||
if (apply)
|
if (apply)
|
||||||
phaseShift.Flags |= PhaseShiftFlags.Inverse;
|
obj.GetPhaseShift().Flags |= PhaseShiftFlags.Inverse;
|
||||||
else
|
else
|
||||||
phaseShift.Flags &= ~PhaseShiftFlags.Inverse;
|
obj.GetPhaseShift().Flags &= ~PhaseShiftFlags.Inverse;
|
||||||
|
|
||||||
phaseShift.UpdateUnphasedFlag();
|
obj.GetPhaseShift().UpdateUnphasedFlag();
|
||||||
|
|
||||||
|
UpdateVisibilityIfNeeded(obj, updateVisibility, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void PrintToChat(CommandHandler chat, PhaseShift phaseShift)
|
public static void PrintToChat(CommandHandler chat, PhaseShift phaseShift)
|
||||||
|
|||||||
@@ -1273,6 +1273,25 @@ namespace Game.Spells
|
|||||||
PhasingHandler.RemovePhaseGroup(target, (uint)GetMiscValueB(), true);
|
PhasingHandler.RemovePhaseGroup(target, (uint)GetMiscValueB(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AuraEffectHandler(AuraType.PhaseAlwaysVisible)]
|
||||||
|
void HandlePhaseAlwaysVisible(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
|
{
|
||||||
|
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Unit target = aurApp.GetTarget();
|
||||||
|
|
||||||
|
if (!apply)
|
||||||
|
PhasingHandler.SetAlwaysVisible(target, true, true);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (target.HasAuraType(AuraType.PhaseAlwaysVisible) || (target.IsPlayer() && target.ToPlayer().IsGameMaster()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
PhasingHandler.SetAlwaysVisible(target, false, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**********************/
|
/**********************/
|
||||||
/*** UNIT MODEL ***/
|
/*** UNIT MODEL ***/
|
||||||
/**********************/
|
/**********************/
|
||||||
|
|||||||
Reference in New Issue
Block a user