Core/Player: Vertical "Say" distance
Port From (https://github.com/TrinityCore/TrinityCore/commit/ab77b1d99254855d690670a4654cacec8b12daf6)
This commit is contained in:
@@ -5737,13 +5737,13 @@ namespace Game.Entities
|
|||||||
Cell.VisitWorldObjects(this, notifier, dist);
|
Cell.VisitWorldObjects(this, notifier, dist);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendMessageToSetInRange(ServerPacket data, float dist, bool self, bool own_team_only)
|
void SendMessageToSetInRange(ServerPacket data, float dist, bool self, bool own_team_only, bool required3dDist = false)
|
||||||
{
|
{
|
||||||
if (self)
|
if (self)
|
||||||
SendPacket(data);
|
SendPacket(data);
|
||||||
|
|
||||||
PacketSenderRef sender = new(data);
|
PacketSenderRef sender = new(data);
|
||||||
var notifier = new MessageDistDeliverer<PacketSenderRef>(this, sender, dist, own_team_only);
|
var notifier = new MessageDistDeliverer<PacketSenderRef>(this, sender, dist, own_team_only, null, required3dDist);
|
||||||
Cell.VisitWorldObjects(this, notifier, dist);
|
Cell.VisitWorldObjects(this, notifier, dist);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6000,7 +6000,7 @@ namespace Game.Entities
|
|||||||
localizer.Invoke(this);
|
localizer.Invoke(this);
|
||||||
|
|
||||||
// Send to players
|
// Send to players
|
||||||
MessageDistDeliverer<LocalizedDo> notifier = new(this, localizer, range);
|
MessageDistDeliverer<LocalizedDo> notifier = new(this, localizer, range, false, null, true);
|
||||||
Cell.VisitWorldObjects(this, notifier, range);
|
Cell.VisitWorldObjects(this, notifier, range);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6026,7 +6026,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
ChatPkt data = new();
|
ChatPkt data = new();
|
||||||
data.Initialize(ChatMsg.Emote, Language.Universal, this, this, text);
|
data.Initialize(ChatMsg.Emote, Language.Universal, this, this, text);
|
||||||
SendMessageToSetInRange(data, WorldConfig.GetFloatValue(WorldCfg.ListenRangeTextemote), !GetSession().HasPermission(RBACPermissions.TwoSideInteractionChat));
|
SendMessageToSetInRange(data, WorldConfig.GetFloatValue(WorldCfg.ListenRangeTextemote), true, !GetSession().HasPermission(RBACPermissions.TwoSideInteractionChat), true);
|
||||||
}
|
}
|
||||||
public override void TextEmote(uint textId, WorldObject target = null, bool isBossEmote = false)
|
public override void TextEmote(uint textId, WorldObject target = null, bool isBossEmote = false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using Bgs.Protocol.Notification.V1;
|
||||||
using Framework.Constants;
|
using Framework.Constants;
|
||||||
using Game.Chat;
|
using Game.Chat;
|
||||||
using Game.Entities;
|
using Game.Entities;
|
||||||
@@ -394,8 +395,9 @@ namespace Game.Maps
|
|||||||
float i_distSq;
|
float i_distSq;
|
||||||
Team team;
|
Team team;
|
||||||
Player skipped_receiver;
|
Player skipped_receiver;
|
||||||
|
bool required3dDist;
|
||||||
|
|
||||||
public MessageDistDeliverer(WorldObject src, T packetSender, float dist, bool own_team_only = false, Player skipped = null)
|
public MessageDistDeliverer(WorldObject src, T packetSender, float dist, bool own_team_only = false, Player skipped = null, bool req3dDist = false)
|
||||||
{
|
{
|
||||||
i_source = src;
|
i_source = src;
|
||||||
i_packetSender = packetSender;
|
i_packetSender = packetSender;
|
||||||
@@ -405,6 +407,7 @@ namespace Game.Maps
|
|||||||
team = src.ToPlayer().GetEffectiveTeam();
|
team = src.ToPlayer().GetEffectiveTeam();
|
||||||
|
|
||||||
skipped_receiver = skipped;
|
skipped_receiver = skipped;
|
||||||
|
required3dDist = req3dDist;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Visit(IList<Player> objs)
|
public override void Visit(IList<Player> objs)
|
||||||
@@ -415,7 +418,7 @@ namespace Game.Maps
|
|||||||
if (!player.InSamePhase(i_phaseShift))
|
if (!player.InSamePhase(i_phaseShift))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (player.GetExactDist2dSq(i_source.GetPosition()) > i_distSq)
|
if ((!required3dDist ? player.GetExactDist2dSq(i_source) : player.GetExactDistSq(i_source)) > i_distSq)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Send packet to all who are sharing the player's vision
|
// Send packet to all who are sharing the player's vision
|
||||||
@@ -439,7 +442,7 @@ namespace Game.Maps
|
|||||||
if (!creature.InSamePhase(i_phaseShift))
|
if (!creature.InSamePhase(i_phaseShift))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (creature.GetExactDist2dSq(i_source.GetPosition()) > i_distSq)
|
if ((!required3dDist ? creature.GetExactDist2dSq(i_source) : creature.GetExactDistSq(i_source)) > i_distSq)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Send packet to all who are sharing the creature's vision
|
// Send packet to all who are sharing the creature's vision
|
||||||
@@ -460,7 +463,7 @@ namespace Game.Maps
|
|||||||
if (!dynamicObject.InSamePhase(i_phaseShift))
|
if (!dynamicObject.InSamePhase(i_phaseShift))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (dynamicObject.GetExactDist2dSq(i_source.GetPosition()) > i_distSq)
|
if ((!required3dDist ? dynamicObject.GetExactDist2dSq(i_source) : dynamicObject.GetExactDistSq(i_source)) > i_distSq)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Send packet back to the caster if the caster has vision of dynamic object
|
// Send packet back to the caster if the caster has vision of dynamic object
|
||||||
|
|||||||
Reference in New Issue
Block a user