addHeadBar

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.

Parameters

sourceIndex

the index of the entity that dealt the hit that resulted in this headbar. 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. If there is no source, set the index to -1. The index will be used for rendering purposes, as both the player who dealt the hit, and the recipient will see the selfType variant, and everyone else will see the otherType variant, which, if set to -1 will be skipped altogether.

selfType

the id of the headbar to render to the entity on which the headbar appears, as well as the source who resulted in the creation of the headbar.

otherType

the id of the headbar to render to everyone that doesn't fit the selfType criteria. If set to -1, the headbar will not be rendered to these individuals.

startFill

the number of pixels to render of this headbar at in the start. The number of pixels that a headbar supports is defined in its respective headbar config.

endFill

the number of pixels to render of this headbar at in the end, if a startTime and endTime are defined.

startTime

the delay in client cycles (20ms/cc) until the headbar renders at startFill

endTime

the delay in client cycles (20ms/cc) until the headbar arrives at endFill.