SoundArea

class SoundArea : ZoneProt

Sound area packed is sent to play a sound effect at a specific coord. Any players within range tiles of the destination coord will hear this sound effect played, if they have sound effects enabled. The volume will change according to the player's distance to the origin coord of the sound effect itself. It is worth noting there is a maximum quantity of 50 area sound effects that can play concurrently in the client across all the zones. Therefore, a potential optimization one can do is prevent appending any more area sound effects once the quantity has reached 50 in a zone.

Constructors

Link copied to clipboard
constructor(id: Int, delay: Int, loops: Int, radius: Int, size: Int, xInZone: Int, zInZone: Int)

Properties

Link copied to clipboard
open override val category: ServerProtCategory
Link copied to clipboard
Link copied to clipboard
val delay: Int

the delay in client cycles (20ms/cc) until the sound effect starts playing

Link copied to clipboard

the size of the origin. In most cases, this should be a value of 1. However, if a larger value is provided, it means the client will treat the south-western coord provided here as the south-western corner of the 'box' that is made with this size in mind, for the purpose of having an evenly-spreading volume around this element. This size property is primarily used for larger NPCs, to make their sound effects flow out smoothly from all sides.

Link copied to clipboard
val id: Int

the id of the sound effect to play

Link copied to clipboard
val loops: Int

how many loops the sound effect should do. If the loops property is 0, the sound effect will not play.

Link copied to clipboard
open override val protId: Int
Link copied to clipboard
val range: Int

the radius from the originating coord how far the sound effect can be heard. Note that the client ignores the 4 higher bits of this value, meaning the maximum radius is 31 tiles - anything above has no effect.

Link copied to clipboard

the x coordinate of the sound effect within the zone it is in, a value in range of 0 to 7 (inclusive) is expected. Any bits outside that are ignored.

Link copied to clipboard

the z coordinate of the sound effect within the zone it is in, a value in range of 0 to 7 (inclusive) is expected. Any bits outside that are ignored.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open fun estimateSize(): Int
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String