var area = player.CurrentArea; // get the area where the player is currently located var chatPacket = new ChatPacket(ChatMessageType.Say, player.EntityId, "Hello, everyone!"); // create a packet with a message worldObject.SendPacketToArea(chatPacket, area); // send the packet to everyone in the area
var area = new SphereArea(player.Position, 10); // create a sphere area with a radius of 10 around the player's position var damagePacket = new SMSG_ATTACKERSTATEUPDATE(player, target, damage); // create a packet with damage information worldObject.SendPacketToArea(damagePacket, area); // send the packet to everyone within the areaThis example sends an attack packet containing damage information to everyone within a 10-unit radius of the player's current position. It uses the SMSG_ATTACKERSTATEUPDATE class from the WCell.RealmServer.Packets package library.