Package net.risingworld.api.definitions
Class Npcs.NpcDefinition
java.lang.Object
net.risingworld.api.definitions.Npcs.NpcDefinition
- Enclosing class:
Npcs
Npc definition
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classfinal classfinal class -
Field Summary
FieldsModifier and TypeFieldDescriptionfloatStrength factor how much the npc adapts to the ground normal.If this npc is a child, this is the adult version.intfloatSpeed at which the move/run animations will play.floatDot product for attacks.floatbooleanIf this npc type can have childs, this is the child npc type name.booleanfloatintVariation ID parameter for the footstep soundintGender of this npc (if defined)floatMax steepness (result of the dot product between terrain normal and up vector) of terrain where the npc can still walk.booleanDetermines if the npc has an alert animation (played when alert state changes from false to true)booleanDetermines whether or not the npc has a "Clothes" object (representing the outfit/clothes of the npc)booleanDetermines whether or not the npc has a "Skin" object (representing skin color, hairstyle etc)Default head rotation (worldspace).shortNpc health (hit points)intintWhen this npc spawns naturally, this determines how many of them the game will spawn per herd/group (maximum, inclusive)intWhen this npc spawns naturally, this determines how many of them the game will spawn per herd/group (minimum, inclusive)shortAmount of damage the npc deals when hitting the player or other npcsshortInternal type ID of the npcbooleanIs this a child?booleanIf true, the npc does not get stored in the database (i.e it does not exist persistently)intLifetime (in seconds) how long the npc will life (until it dies/despawns automatically).Default mouth rotation (worldspace).Name of the npcfloatDetermines how much the npc can open its mouth (angle of jaw)floatIf another npc is related to this type, this is the relative.floatRotate/turn speed of the npcfloatRun speed of the npcfloatDefault scale factor that gets applied to the npc.intbooleanSeasons during which this npc may spawn naturally.floatshortNpc stamina (when running)Npc typeintNumber of npc variations.floatWalk speed of the npc -
Method Summary
-
Field Details
-
id
public short idInternal type ID of the npc -
name
Name of the npc -
type
Npc type -
variations
public int variationsNumber of npc variations. 0 means there are no additional variations available -
gender
Gender of this npc (if defined) -
ischild
public boolean ischildIs this a child? -
health
public short healthNpc health (hit points) -
stamina
public short staminaNpc stamina (when running) -
hitdamage
public short hitdamageAmount of damage the npc deals when hitting the player or other npcs -
attackrange
public float attackrange -
attackdot
public float attackdotDot product for attacks. Only if dot between player and npc is greater than this value, the npc can attack -
behaviour
-
attackreaction
-
aggroradius
public int aggroradius -
fov
public int fov -
sight
public int sight -
hearingrange
public int hearingrange -
eyeheight
public float eyeheight -
rayoffset
public float rayoffset -
spherecastradius
public float spherecastradius -
scale
public float scaleDefault scale factor that gets applied to the npc. Usually it's 1.0 -
grounddot
public float grounddotMax steepness (result of the dot product between terrain normal and up vector) of terrain where the npc can still walk. Higher values (towards 1) result in less mobility, lower values (towards 0) in more mobility on steep terrain -
headrotation
Default head rotation (worldspace). Only if a headbone is defined -
mouthrotation
Default mouth rotation (worldspace). Only if a mouthbone is defined -
openmouth
public float openmouthDetermines how much the npc can open its mouth (angle of jaw) -
hasskin
public boolean hasskinDetermines whether or not the npc has a "Skin" object (representing skin color, hairstyle etc) -
hasclothes
public boolean hasclothesDetermines whether or not the npc has a "Clothes" object (representing the outfit/clothes of the npc) -
hasalertanim
public boolean hasalertanimDetermines if the npc has an alert animation (played when alert state changes from false to true) -
istransient
public boolean istransientIf true, the npc does not get stored in the database (i.e it does not exist persistently) -
walkspeed
public float walkspeedWalk speed of the npc -
runspeed
public float runspeedRun speed of the npc -
rotatespeed
public float rotatespeedRotate/turn speed of the npc -
animspeed
public float animspeedSpeed at which the move/run animations will play. Default: 1.0 -
footstepvariant
public int footstepvariantVariation ID parameter for the footstep sound -
sleeps
public boolean sleeps -
canswim
public boolean canswim -
dropequippeditem
public boolean dropequippeditem -
lifetime
public int lifetimeLifetime (in seconds) how long the npc will life (until it dies/despawns automatically). -1 for not limit.
If this is a child npc and the "adult" field is not null, the lifetime instead determines how long it takes until the child is grown up -
spawnseasons
Seasons during which this npc may spawn naturally. Never null -
herdmin
public int herdminWhen this npc spawns naturally, this determines how many of them the game will spawn per herd/group (minimum, inclusive) -
herdmax
public int herdmaxWhen this npc spawns naturally, this determines how many of them the game will spawn per herd/group (maximum, inclusive) -
adult
If this npc is a child, this is the adult version. May be null -
child
If this npc type can have childs, this is the child npc type name. May be null -
relative
If another npc is related to this type, this is the relative. May be null -
adapttoterrain
public float adapttoterrainStrength factor how much the npc adapts to the ground normal. 0 means no adapt, 1 means full adapt -
corpsetype
-
loottype
-
-
Method Details
-
synchronize
public void synchronize()
-