Core/Creatures: Implemented CREATURE_STATIC_FLAG_3_NO_THREAT_FEEDBACK
Port From (https://github.com/TrinityCore/TrinityCore/commit/3fd1a2b78c8791576679e93ce1d43038db2212c5)
This commit is contained in:
@@ -669,6 +669,10 @@ namespace Game.Combat
|
|||||||
|
|
||||||
void SendClearAllThreatToClients()
|
void SendClearAllThreatToClients()
|
||||||
{
|
{
|
||||||
|
Creature owner = _owner.ToCreature();
|
||||||
|
if (owner != null && owner.IsThreatFeedbackDisabled())
|
||||||
|
return;
|
||||||
|
|
||||||
ThreatClear threatClear = new();
|
ThreatClear threatClear = new();
|
||||||
threatClear.UnitGUID = _owner.GetGUID();
|
threatClear.UnitGUID = _owner.GetGUID();
|
||||||
_owner.SendMessageToSet(threatClear, false);
|
_owner.SendMessageToSet(threatClear, false);
|
||||||
@@ -676,6 +680,10 @@ namespace Game.Combat
|
|||||||
|
|
||||||
public void SendRemoveToClients(Unit victim)
|
public void SendRemoveToClients(Unit victim)
|
||||||
{
|
{
|
||||||
|
Creature owner = _owner.ToCreature();
|
||||||
|
if (owner != null && owner.IsThreatFeedbackDisabled())
|
||||||
|
return;
|
||||||
|
|
||||||
ThreatRemove threatRemove = new();
|
ThreatRemove threatRemove = new();
|
||||||
threatRemove.UnitGUID = _owner.GetGUID();
|
threatRemove.UnitGUID = _owner.GetGUID();
|
||||||
threatRemove.AboutGUID = victim.GetGUID();
|
threatRemove.AboutGUID = victim.GetGUID();
|
||||||
@@ -684,6 +692,10 @@ namespace Game.Combat
|
|||||||
|
|
||||||
void SendThreatListToClients(bool newHighest)
|
void SendThreatListToClients(bool newHighest)
|
||||||
{
|
{
|
||||||
|
Creature owner = _owner.ToCreature();
|
||||||
|
if (owner != null && owner.IsThreatFeedbackDisabled())
|
||||||
|
return;
|
||||||
|
|
||||||
void fillSharedPacketDataAndSend(dynamic packet)
|
void fillSharedPacketDataAndSend(dynamic packet)
|
||||||
{
|
{
|
||||||
packet.UnitGUID = _owner.GetGUID();
|
packet.UnitGUID = _owner.GetGUID();
|
||||||
@@ -970,7 +982,8 @@ namespace Game.Combat
|
|||||||
public void ModifyThreatByPercent(int percent)
|
public void ModifyThreatByPercent(int percent)
|
||||||
{
|
{
|
||||||
if (percent != 0)
|
if (percent != 0)
|
||||||
ScaleThreat(0.01f * (100f + percent)); }
|
ScaleThreat(0.01f * (100f + percent));
|
||||||
|
}
|
||||||
|
|
||||||
public void ListNotifyChanged() { _mgr.ListNotifyChanged(); }
|
public void ListNotifyChanged() { _mgr.ListNotifyChanged(); }
|
||||||
|
|
||||||
|
|||||||
@@ -3352,7 +3352,10 @@ namespace Game.Entities
|
|||||||
public override void SetImmuneToPC(bool apply) { SetImmuneToPC(apply, HasReactState(ReactStates.Passive)); }
|
public override void SetImmuneToPC(bool apply) { SetImmuneToPC(apply, HasReactState(ReactStates.Passive)); }
|
||||||
public override void SetImmuneToNPC(bool apply) { SetImmuneToNPC(apply, HasReactState(ReactStates.Passive)); }
|
public override void SetImmuneToNPC(bool apply) { SetImmuneToNPC(apply, HasReactState(ReactStates.Passive)); }
|
||||||
|
|
||||||
void SetUnkillable(bool unkillable) { _staticFlags.ApplyFlag(CreatureStaticFlags.Unkillable, unkillable); }
|
public bool IsThreatFeedbackDisabled() { return _staticFlags.HasFlag(CreatureStaticFlags3.NoThreatFeedback); }
|
||||||
|
public void SetNoThreatFeedback(bool noThreatFeedback) { _staticFlags.ApplyFlag(CreatureStaticFlags3.NoThreatFeedback, noThreatFeedback); }
|
||||||
|
|
||||||
|
public void SetUnkillable(bool unkillable) { _staticFlags.ApplyFlag(CreatureStaticFlags.Unkillable, unkillable); }
|
||||||
|
|
||||||
public bool IsInEvadeMode() { return HasUnitState(UnitState.Evade); }
|
public bool IsInEvadeMode() { return HasUnitState(UnitState.Evade); }
|
||||||
public bool IsEvadingAttacks() { return IsInEvadeMode() || CanNotReachTarget(); }
|
public bool IsEvadingAttacks() { return IsInEvadeMode() || CanNotReachTarget(); }
|
||||||
|
|||||||
Reference in New Issue
Block a user