Skip to content

NpcBody

class NpcBody(
bodyType: Int = 0,
parts: List<Int> = List(Appearance.PARTS) { Appearance.NONE },
colours: List<Int> = List(Appearance.COLOURS) { 0 },
worn: Map<EquipmentSlot, ItemDefinition> = emptyMap()
) : Component()
Example
on_world_start {
val guard = World.spawn(Assets.Npc.hans, Tile4.global(3222, 3218))
guard.replaceComponent(NpcBody(bodyType = 0, worn = mapOf(EquipmentSlot.MainHand to Assets.Item.shark)))
}
var bodyType: Int
var parts: List<Int>
var colours: List<Int>
var worn: Map<EquipmentSlot, ItemDefinition>
override fun refusalToJoin(entity: Entity): String?
override fun onComponentRemovedFromEntity()