/// <summary> /// Plays a sound to all mobiles within 20 tiles of the NPC emitting it /// </summary> /// <param name="m">The NPC producing the sound</param> /// <param name="sound">The sound to play</param> public void PlaySound(ChessMobile m, int sound) { if (m == null) { return; } Server.Network.Packet p = new Server.Network.PlaySound(sound, m.Location); foreach (Server.Network.NetState state in m.GetClientsInRange(20)) { if (state.Mobile.CanSee(m)) { state.Send(p); } } }
/// <summary> /// Plays a sound to all mobiles within 20 tiles of the NPC emitting it /// </summary> /// <param name="m">The NPC producing the sound</param> /// <param name="sound">The sound to play</param> public void PlaySound( ChessMobile m, int sound ) { if ( m == null ) return; Server.Network.Packet p = new Server.Network.PlaySound( sound, m.Location ); foreach( Server.Network.NetState state in m.GetClientsInRange( 20 ) ) { if ( state.Mobile.CanSee( m ) ) state.Send( p ); } }