Package noppes.npcs.api.handler.data
Interface ICustomEffect
-
public interface ICustomEffect
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetEveryXTick()Returns the tick interval at which this effect fires its script tick event.intgetFrameCount()Returns the number of frames in the icon animation.intgetFrameTime()Returns the duration of each animation frame in ticks.intgetHeight()Returns the height of the icon.StringgetIcon()Returns the resource path of the icon texture.intgetIconX()Returns the X offset of the icon within the texture.intgetIconY()Returns the Y offset of the icon within the texture.intgetID()Returns the unique ID of this custom effect.intgetIndex()Utilized by DBC Addon or other Addons to tell which map of Effects to Match to.StringgetMenuName()Returns the display name shown in menus.StringgetName()Returns the internal name of this custom effect.intgetWidth()Returns the width of the icon.booleanisAnimated()Returns whether the icon texture is animated.booleanisLossOnDeath()Returns whether this effect is removed when the player dies.ICustomEffectsave()Saves this custom effect to the effect controller.voidsetAnimated(boolean animated)Sets whether the icon texture is animated.voidsetEveryXTick(int everyXTick)Sets the tick interval at which this effect fires its script tick event.voidsetFrameCount(int frameCount)Sets the number of frames in the icon animation.voidsetFrameTime(int frametime)Sets the duration of each animation frame in ticks.voidsetHeight(int height)Sets the height of the icon.voidsetIcon(String icon)Sets the resource path of the icon texture.voidsetIconX(int iconX)Sets the X offset of the icon within the texture.voidsetIconY(int iconY)Sets the Y offset of the icon within the texture.voidsetID(int id)Sets the unique ID of this custom effect.voidsetLossOnDeath(boolean lossOnDeath)Sets whether this effect is removed when the player dies.voidsetMenuName(String name)Sets the display name shown in menus.voidsetName(String name)Sets the internal name of this custom effect.voidsetWidth(int width)Sets the width of the icon.
-
-
-
Method Detail
-
getID
int getID()
Returns the unique ID of this custom effect.- Returns:
- the effect ID, or -1 if not yet assigned
-
getName
String getName()
Returns the internal name of this custom effect.- Returns:
- the effect name
-
setMenuName
void setMenuName(String name)
Sets the display name shown in menus. Supports color codes using '&' (converted to section signs).- Parameters:
name- the display name to set; ignored if null or empty
-
getMenuName
String getMenuName()
Returns the display name shown in menus.- Returns:
- the menu display name
-
setName
void setName(String name)
Sets the internal name of this custom effect.- Parameters:
name- the name to set; ignored if null or empty
-
getIcon
String getIcon()
Returns the resource path of the icon texture.- Returns:
- the icon texture path
-
setIcon
void setIcon(String icon)
Sets the resource path of the icon texture.- Parameters:
icon- the icon texture path
-
getEveryXTick
int getEveryXTick()
Returns the tick interval at which this effect fires its script tick event.- Returns:
- the tick interval (always a multiple of 10, minimum 10)
-
setEveryXTick
void setEveryXTick(int everyXTick)
Sets the tick interval at which this effect fires its script tick event. The value is rounded to the nearest multiple of 10 with a minimum of 10.- Parameters:
everyXTick- the desired tick interval
-
getIconX
int getIconX()
Returns the X offset of the icon within the texture.- Returns:
- the icon X offset in pixels
-
setIconX
void setIconX(int iconX)
Sets the X offset of the icon within the texture.- Parameters:
iconX- the icon X offset in pixels
-
getIconY
int getIconY()
Returns the Y offset of the icon within the texture.- Returns:
- the icon Y offset in pixels
-
setIconY
void setIconY(int iconY)
Sets the Y offset of the icon within the texture.- Parameters:
iconY- the icon Y offset in pixels
-
getWidth
int getWidth()
Returns the width of the icon.- Returns:
- the icon width in pixels
-
setWidth
void setWidth(int width)
Sets the width of the icon.- Parameters:
width- the icon width in pixels
-
getHeight
int getHeight()
Returns the height of the icon.- Returns:
- the icon height in pixels
-
setHeight
void setHeight(int height)
Sets the height of the icon.- Parameters:
height- the icon height in pixels
-
isLossOnDeath
boolean isLossOnDeath()
Returns whether this effect is removed when the player dies.- Returns:
- true if the effect is lost on death
-
setLossOnDeath
void setLossOnDeath(boolean lossOnDeath)
Sets whether this effect is removed when the player dies.- Parameters:
lossOnDeath- true to remove the effect on death
-
save
ICustomEffect save()
Saves this custom effect to the effect controller.- Returns:
- the saved effect instance
-
setID
void setID(int id)
Sets the unique ID of this custom effect.- Parameters:
id- the effect ID to assign
-
getIndex
int getIndex()
Utilized by DBC Addon or other Addons to tell which map of Effects to Match to. Index: 0 - CNPC+ Index: 1 - DBC Addon- Returns:
- the effect's index in the effect list
-
isAnimated
boolean isAnimated()
Returns whether the icon texture is animated.- Returns:
- true if the icon is animated
-
setAnimated
void setAnimated(boolean animated)
Sets whether the icon texture is animated.- Parameters:
animated- true to enable icon animation
-
getFrameCount
int getFrameCount()
Returns the number of frames in the icon animation.- Returns:
- the frame count (minimum 1)
-
setFrameCount
void setFrameCount(int frameCount)
Sets the number of frames in the icon animation. Values less than 1 are clamped to 1.- Parameters:
frameCount- the number of animation frames
-
getFrameTime
int getFrameTime()
Returns the duration of each animation frame in ticks.- Returns:
- the frame time in ticks (minimum 1)
-
setFrameTime
void setFrameTime(int frametime)
Sets the duration of each animation frame in ticks. Values less than 1 are clamped to 1.- Parameters:
frametime- the frame duration in ticks
-
-