NpcAvatarExtendedInfo

class NpcAvatarExtendedInfo(avatarIndex: Int, filter: ExtendedInfoFilter, extendedInfoWriters: List<NpcAvatarExtendedInfoWriter>, allocator: ByteBufAllocator, huffmanCodec: HuffmanCodecProvider)

Npc avatar extended info is a data structure used to keep track of all the extended info properties of the given avatar.

Parameters

extendedInfoWriters

the list of client-specific extended info writers.

Constructors

Link copied to clipboard
constructor(avatarIndex: Int, filter: ExtendedInfoFilter, extendedInfoWriters: List<NpcAvatarExtendedInfoWriter>, allocator: ByteBufAllocator, huffmanCodec: HuffmanCodecProvider)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun addHeadBar(sourceIndex: Int, selfType: Int, otherType: Int = selfType, startFill: Int, endFill: Int = startFill, startTime: Int = 0, endTime: Int = 0)

Adds a headbar onto the avatar. If a headbar by the same id already exists, updates the status of the old one. Up to four distinct headbars can be rendered simultaneously.

Link copied to clipboard
fun addHitMark(sourceIndex: Int, selfType: Int, otherType: Int = selfType, value: Int, delay: Int = 0)

Adds a simple hitmark on this avatar.

Link copied to clipboard
fun addSoakedHitMark(sourceIndex: Int, selfType: Int, otherType: Int = selfType, value: Int, selfSoakType: Int, otherSoakType: Int = selfSoakType, soakValue: Int, delay: Int = 0)

Adds a simple hitmark on this avatar.

Link copied to clipboard

Sets all the right-click options invisible on this NPC.

Link copied to clipboard

Sets all the right-click options as visible on this NPC.

Link copied to clipboard
fun baseAnimationSet(turnLeftAnim: Int = Int.MIN_VALUE, turnRightAnim: Int = Int.MIN_VALUE, walkAnim: Int = Int.MIN_VALUE, walkAnimBack: Int = Int.MIN_VALUE, walkAnimLeft: Int = Int.MIN_VALUE, walkAnimRight: Int = Int.MIN_VALUE, runAnim: Int = Int.MIN_VALUE, runAnimBack: Int = Int.MIN_VALUE, runAnimLeft: Int = Int.MIN_VALUE, runAnimRight: Int = Int.MIN_VALUE, crawlAnim: Int = Int.MIN_VALUE, crawlAnimBack: Int = Int.MIN_VALUE, crawlAnimLeft: Int = Int.MIN_VALUE, crawlAnimRight: Int = Int.MIN_VALUE, readyAnim: Int = Int.MIN_VALUE)

Sets the base animation set of this NPC with the provided values. If the value is equal to Int.MIN_VALUE, the animation will not be overwritten. Only the 16 lowest bits of the animation ids are used.

Link copied to clipboard

Overrides the combat level of this NPC with the provided level.

Link copied to clipboard
fun faceCoord(x: Int, z: Int, instant: Boolean = false)

Faces the center of the absolute coordinate provided.

Link copied to clipboard
fun headIconChange(slot: Int, group: Int, index: Int)

Changes the head icon of a NPC to the sprite at the provided group and sprite index.

Link copied to clipboard
fun nameChange(name: String?)

Overrides the name of this NPC with the provided name.

Link copied to clipboard

Removes a headbar on this avatar by the id of id, if one renders.

Link copied to clipboard
fun removeHitMark(delay: Int = 0)

Removes the oldest currently showing hitmark on this avatar, if one exists.

Link copied to clipboard

Resets any NPC body customisations applied.

Link copied to clipboard

Resets any chathead customisations applied to this NPC.

Link copied to clipboard
fun resetHeadIcon(slot: Int)

Resets the head icon at the specified slot.

Link copied to clipboard

Sets all the right-click options invisible on this NPC.

Link copied to clipboard

Sets all the right-click options as visible on this NPC.

Link copied to clipboard
fun setBaseAnimationSet(turnLeftAnim: Int = Int.MIN_VALUE, turnRightAnim: Int = Int.MIN_VALUE, walkAnim: Int = Int.MIN_VALUE, walkAnimBack: Int = Int.MIN_VALUE, walkAnimLeft: Int = Int.MIN_VALUE, walkAnimRight: Int = Int.MIN_VALUE, runAnim: Int = Int.MIN_VALUE, runAnimBack: Int = Int.MIN_VALUE, runAnimLeft: Int = Int.MIN_VALUE, runAnimRight: Int = Int.MIN_VALUE, crawlAnim: Int = Int.MIN_VALUE, crawlAnimBack: Int = Int.MIN_VALUE, crawlAnimLeft: Int = Int.MIN_VALUE, crawlAnimRight: Int = Int.MIN_VALUE, readyAnim: Int = Int.MIN_VALUE)

Sets the base animation set of this NPC with the provided values. If the value is equal to Int.MIN_VALUE, the animation will not be overwritten. Only the 16 lowest bits of the animation ids are used.

Link copied to clipboard
fun setBodyCustomisation(models: List<Int>, recolours: List<Int>, retextures: List<Int>)

Sets the NPC body customisation for this NPC.

Link copied to clipboard

Sets the NPC to mirror the body of the local player in its entirety, including any worn gear.

Link copied to clipboard

Overrides the combat level of this NPC with the provided level.

Link copied to clipboard
fun setCrawlAnims(crawlAnim: Int?, crawlAnimBack: Int?, crawlAnimLeft: Int?, crawlAnimRight: Int?)

Sets the crawl animations of this NPC. If any of the animations is null, that animation will not be overwritten by the client, allowing a subset of the below animations to be overridden.

Link copied to clipboard
fun setExactMove(deltaX1: Int, deltaZ1: Int, delay1: Int, deltaX2: Int, deltaZ2: Int, delay2: Int, angle: Int)

Sets an exact movement for this avatar. It should be noted that this is done in conjunction with actual movement, as the exact move extended info block is only responsible for visualizing precise movement, and will synchronize to the real coordinate once the exact movement has finished.

Link copied to clipboard
fun setFaceCoord(x: Int, z: Int, instant: Boolean = false)

Faces the center of the absolute coordinate provided.

Link copied to clipboard

Sets the face-locking onto the avatar with index index. If the target avatar is a player, add 0x10000 to the real index value (0-2048). If the target avatar is a NPC, set the index as it is. In order to stop facing an entity, set the index value to -1.

Link copied to clipboard
fun setHeadCustomisation(models: List<Int>, recolours: List<Int>, retextures: List<Int>)

Sets the chat head customisation for this NPC.

Link copied to clipboard

Sets the chathead of the NPC to be a mirror of the local player's own chathead.

Link copied to clipboard
fun setHeadIconChange(slot: Int, group: Int, index: Int)

Changes the head icon of a NPC to the sprite at the provided group and sprite index.

Link copied to clipboard
fun setNameChange(name: String?)

Overrides the name of this NPC with the provided name.

Link copied to clipboard
fun setReadyAnim(id: Int)

Sets the ready animation of this NPC to the provided id.

Link copied to clipboard
fun setRunAnims(runAnim: Int?, runAnimBack: Int?, runAnimLeft: Int?, runAnimRight: Int?)

Sets the run animations of this NPC. If any of the animations is null, that animation will not be overwritten by the client, allowing a subset of the below animations to be overridden.

Link copied to clipboard
fun setSay(text: String)

Sets the overhead chat of this avatar. If the text starts with the character ~, the message will additionally also be rendered in the chatbox of everyone nearby, although no chat icons will appear alongside. The first ~ character itself will not be rendered in that scenario.

Link copied to clipboard
fun setSequence(id: Int, delay: Int)

Sets the sequence for this avatar to play.

Link copied to clipboard
fun setSpotAnim(slot: Int, id: Int, delay: Int, height: Int)

Sets the spotanim in slot slot, overriding any previous spotanim in that slot in doing so.

Link copied to clipboard
fun setTinting(startTime: Int, endTime: Int, hue: Int, saturation: Int, lightness: Int, weight: Int)

Applies a tint over the non-textured parts of the character.

Link copied to clipboard

Transforms this NPC into the id provided. It should be noted that this extended info block is transient and only applies to one cycle. The server is expected to additionally change the id of the avatar itself, otherwise any new observers will get the old variant.

Link copied to clipboard
fun setTurnAnims(turnLeftAnim: Int?, turnRightAnim: Int?)

Sets the turn left and turn right animations of this NPC.

Link copied to clipboard
fun setVisibleOps(flag: Int)

Sets the visible ops flag of this NPC to the provided value.

fun setVisibleOps(op1: Boolean, op2: Boolean, op3: Boolean, op4: Boolean, op5: Boolean)

Marks the provided right-click options as visible or invisible.

Link copied to clipboard
fun setWalkAnims(walkAnim: Int?, walkAnimBack: Int?, walkAnimLeft: Int?, walkAnimRight: Int?)

Sets the walk animations of this NPC. If any of the animations is null, that animation will not be overwritten by the client, allowing a subset of the below animations to be overridden.

Link copied to clipboard
fun tinting(startTime: Int, endTime: Int, hue: Int, saturation: Int, lightness: Int, weight: Int)

Applies a tint over the non-textured parts of the character.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Transforms this NPC into the id provided. It should be noted that this extended info block is transient and only applies to one cycle. The server is expected to additionally change the id of the avatar itself, otherwise any new observers will get the old variant.

Link copied to clipboard
fun visibleOps(flag: Int)

Sets the visible ops flag of this NPC to the provided value.

fun visibleOps(op1: Boolean, op2: Boolean, op3: Boolean, op4: Boolean, op5: Boolean)

Marks the provided right-click options as visible or invisible.