99 lines
2.4 KiB
Lua
Executable File
99 lines
2.4 KiB
Lua
Executable File
mobs:register_mob("mobs:dungeon_master", {
|
|
type = "monster",
|
|
hp_min = 12,
|
|
hp_max = 47,
|
|
exp_min=5,
|
|
exp_max=100,
|
|
collisionbox = {-0.7, -0.01, -0.7, 0.7, 2.6, 0.7},
|
|
visual = "mesh",
|
|
mesh = "mobs_dungeon_master.x",
|
|
textures = {"mobs_dungeon_master.png"},
|
|
visual_size = {x=8, y=8},
|
|
makes_footstep_sound = true,
|
|
view_range = 15,
|
|
walk_velocity = 1,
|
|
run_velocity = 3,
|
|
damage = 4,
|
|
drops = {
|
|
{name = "default:mese",
|
|
chance = 65,
|
|
min = 1,
|
|
max = 2,},
|
|
},
|
|
armor = 60,
|
|
drawtype = "front",
|
|
water_damage = 1,
|
|
lava_damage = 1,
|
|
light_damage = 0,
|
|
on_rightclick = nil,
|
|
attack_type = "shoot",
|
|
arrow = "mobs:fireball",
|
|
arrow_offset = 2,
|
|
shoot_interval = 2.5,
|
|
sounds = {
|
|
attack = "mobs_fireball",
|
|
},
|
|
animation = {
|
|
stand_start = 0,
|
|
stand_end = 19,
|
|
walk_start = 20,
|
|
walk_end = 35,
|
|
punch_start = 36,
|
|
punch_end = 48,
|
|
speed_normal = 15,
|
|
speed_run = 15,
|
|
},
|
|
jump = true,
|
|
step=0.5,
|
|
lifetimer = false,
|
|
})
|
|
mobs:register_spawn("mobs:dungeon_master", {"default:stone"}, 3, -1, 7000, 1, -50)
|
|
|
|
mobs:register_arrow("mobs:fireball", {
|
|
visual = "sprite",
|
|
visual_size = {x=1, y=1},
|
|
--textures = {{name="mobs_fireball.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.5}}}, FIXME
|
|
textures = {"mobs_fireball.png"},
|
|
velocity = 5,
|
|
hit_player = function(self, player)
|
|
print("hit player")
|
|
local s = self.object:getpos()
|
|
local p = player:getpos()
|
|
local vec = {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z}
|
|
player:punch(self.object, 1.0, {
|
|
full_punch_interval=1.0,
|
|
damage_groups = {fleshy=4},
|
|
}, vec)
|
|
|
|
local pos = self.object:getpos()
|
|
for dx=-1,1 do
|
|
for dy=-1,1 do
|
|
for dz=-1,1 do
|
|
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
|
|
local n = minetest.env:get_node(pos).name
|
|
if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <= 30 then
|
|
minetest.env:set_node(p, {name="fire:basic_flame"})
|
|
else
|
|
--minetest.env:remove_node(p)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end,
|
|
hit_node = function(self, pos, node)
|
|
print("hit node")
|
|
for dx=-1,1 do
|
|
for dy=-2,1 do
|
|
for dz=-1,1 do
|
|
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
|
|
local n = minetest.env:get_node(pos).name
|
|
if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <= 30 then
|
|
minetest.env:set_node(p, {name="fire:basic_flame"})
|
|
else
|
|
--minetest.env:remove_node(p)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
}) |