2021-05-23 08:11:37 -07:00
|
|
|
|
2021-08-12 23:10:12 -07:00
|
|
|
local S = core.get_translator(skeleton.modname)
|
2021-05-23 21:18:55 -07:00
|
|
|
|
2021-08-12 22:21:10 -07:00
|
|
|
local bones_sound, death_sound
|
|
|
|
if core.global_exists("sounds") then
|
|
|
|
if sounds.skeleton then
|
|
|
|
bones_sound = sounds.skeleton:get(1)
|
|
|
|
end
|
|
|
|
if sounds.zombie_death then
|
|
|
|
death_sound = sounds.zombie_death:get(1)
|
|
|
|
end
|
|
|
|
end
|
2021-05-23 21:18:55 -07:00
|
|
|
|
2021-05-23 21:12:32 -07:00
|
|
|
|
2021-08-12 23:10:12 -07:00
|
|
|
local mob_name = "skeleton:skeleton"
|
2021-05-24 19:05:13 -07:00
|
|
|
|
2021-08-12 19:27:59 -07:00
|
|
|
local base_def = {
|
|
|
|
name = mob_name,
|
|
|
|
nametag = S("Skeleton"),
|
|
|
|
hp_min = 55,
|
|
|
|
hp_max = 55,
|
|
|
|
hostile = true,
|
|
|
|
knockback = true,
|
|
|
|
sneaky = false,
|
|
|
|
floats = true,
|
|
|
|
stepheight = 1,
|
|
|
|
collisionbox = {-0.25, -0.01, -0.25, 0.25, 1.65, 0.25},
|
|
|
|
rotation = -90.0,
|
2021-08-12 22:39:27 -07:00
|
|
|
mesh = "creatures_zombie.b3d",
|
2021-08-12 23:10:12 -07:00
|
|
|
textures = {"skeleton_mesh.png"},
|
2021-08-12 19:27:59 -07:00
|
|
|
drops = {
|
2021-08-12 23:10:12 -07:00
|
|
|
{name="skeleton:bone", min=1, max=1, chance=1},
|
2021-05-23 08:12:41 -07:00
|
|
|
},
|
2021-08-12 19:27:59 -07:00
|
|
|
spawn = {
|
2021-08-12 23:10:12 -07:00
|
|
|
interval = skeleton.spawn_interval,
|
|
|
|
chance = skeleton.spawn_chance,
|
2021-08-12 19:27:59 -07:00
|
|
|
nodes = {
|
|
|
|
"group:sand",
|
|
|
|
"group:stone",
|
|
|
|
"nether:rack",
|
|
|
|
"nether:rack_deep",
|
|
|
|
},
|
|
|
|
light_range = {min=0, max=8},
|
|
|
|
height_range = {min=-31000, max=31000},
|
|
|
|
count = {min=1, max=2},
|
2021-05-23 08:12:41 -07:00
|
|
|
},
|
2021-08-12 19:27:59 -07:00
|
|
|
combat = {
|
|
|
|
radius = 2.0,
|
|
|
|
damage = 13,
|
|
|
|
chance = 100,
|
2021-05-23 08:12:41 -07:00
|
|
|
},
|
2021-08-12 19:27:59 -07:00
|
|
|
speed = {
|
|
|
|
walk = 1,
|
|
|
|
run = 3,
|
2021-05-23 08:12:41 -07:00
|
|
|
},
|
2021-08-12 19:27:59 -07:00
|
|
|
search = {
|
|
|
|
radius = 20,
|
|
|
|
target = "player",
|
2021-05-23 08:12:41 -07:00
|
|
|
},
|
2021-08-12 19:27:59 -07:00
|
|
|
mode_chance = {
|
|
|
|
idle = 0.3,
|
|
|
|
walk = 0.7,
|
2021-05-23 08:12:41 -07:00
|
|
|
},
|
2021-08-12 19:27:59 -07:00
|
|
|
sounds = {
|
2021-08-12 22:21:10 -07:00
|
|
|
random = bones_sound,
|
|
|
|
death = death_sound,
|
2021-08-12 19:27:59 -07:00
|
|
|
war_cry = nil,
|
|
|
|
attack = nil,
|
|
|
|
damage = nil,
|
2021-05-23 08:12:41 -07:00
|
|
|
},
|
2021-08-12 19:27:59 -07:00
|
|
|
animation = {
|
|
|
|
idle = {start=0, stop=80, speed=15},
|
2021-08-12 22:39:27 -07:00
|
|
|
walk = {start=102, stop=122, speed=15.5},
|
2021-08-12 19:27:59 -07:00
|
|
|
run = {},
|
2021-08-12 22:39:27 -07:00
|
|
|
attack = {start=102, stop=122, speed=25},
|
2021-08-12 19:27:59 -07:00
|
|
|
death = {start=81, stop=101, speed=28, loop=false, rotate=false, duration=2.12},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-08-12 23:10:12 -07:00
|
|
|
dofile(skeleton.modpath .. "/register/" .. skeleton.lib .. ".lua")(base_def)
|
2021-05-23 08:12:41 -07:00
|
|
|
|
|
|
|
|
2021-05-23 08:13:15 -07:00
|
|
|
if core.global_exists("asm") then
|
|
|
|
asm.addEgg({
|
|
|
|
name = "skeleton",
|
2021-05-23 21:18:55 -07:00
|
|
|
title = S("Skeleton"),
|
2021-08-12 23:10:12 -07:00
|
|
|
inventory_image = "skeleton_inv.png",
|
2021-05-24 19:05:13 -07:00
|
|
|
spawn = mob_name,
|
2021-08-12 23:10:12 -07:00
|
|
|
ingredients = "skeleton:bone",
|
2021-05-23 08:13:15 -07:00
|
|
|
})
|
|
|
|
end
|
2021-08-12 23:10:12 -07:00
|
|
|
|
|
|
|
-- use entity name for spawnegg alias
|
|
|
|
if not core.registered_items["skeleton:skeleton"] then
|
|
|
|
core.register_alias("skeleton:skeleton", "spawneggs:skeleton")
|
2021-05-24 19:06:02 -07:00
|
|
|
end
|
2021-05-23 08:13:15 -07:00
|
|
|
|
|
|
|
|
2021-08-12 23:10:12 -07:00
|
|
|
core.register_craftitem("skeleton:bone", {
|
2021-05-23 21:18:55 -07:00
|
|
|
description = S("Bone"),
|
2021-08-12 23:10:12 -07:00
|
|
|
inventory_image = "skeleton_bone.png",
|
2021-05-23 21:12:52 -07:00
|
|
|
stack_max = 99,
|
2021-05-23 08:11:37 -07:00
|
|
|
})
|