code tweak/tidy, fixed bugs, spawn on 5.x nodes

master
tenplus1 2020-07-26 19:42:13 +01:00
parent ebadbee53d
commit 9348a169fc
59 changed files with 3834 additions and 3747 deletions

View File

@ -1,3 +1,8 @@
v3.02 (26th Jul 2020):
- Tweaked and tidied code
- Fixed bugs and used latest mobs redo api functions
- Changed spawning to use new minetest 5.x dirt types
v3.01 (8th Aug 2018):
- Fixed missing functions so that nssm uses mobs redo's global functions;
- Fixed performance issue thanks to Ihofhansl

View File

@ -1,9 +1,11 @@
local function duck_explosion(pos)
if minetest.is_protected(pos, "") then
return
end
pos.y = pos.y+1;
pos.y = pos.y + 1
minetest.add_particlespawner({
amount = 10,
time = 0.2,
@ -21,9 +23,13 @@ local function duck_explosion(pos)
vertical = false,
texture = "duck_egg_fragments.png",
})
core.after(0.4, function()
for dx = -1, 1 do
pos = {x = pos.x+dx, y=pos.y; z=pos.z+dx}
pos = {x = pos.x + dx, y = pos.y, z = pos.z + dx}
minetest.add_particlespawner({
amount = 100,
time = 0.2,
@ -41,6 +47,7 @@ local function duck_explosion(pos)
vertical = false,
texture = "tnt_smoke.png",
})
minetest.add_entity(pos, "nssm:duck")
end
end)
@ -52,6 +59,7 @@ mobs:register_arrow("nssm:duck_father", {
visual_size = {x = 1, y = 1},
textures = {"duck_egg.png"},
velocity = 8,
-- direct hit
hit_player = function(self, player)
local pos = self.object:get_pos()
@ -70,11 +78,16 @@ mobs:register_arrow("nssm:duck_father", {
local function ice_explosion(pos)
for i = pos.x - math.random(0, 1), pos.x + math.random(0, 1), 1 do
for j = pos.y - 1, pos.y + 4, 1 do
for k = pos.z-math.random(0, 1), pos.z + math.random(0, 1), 1 do
local p = {x = i, y = j, z = k}
local n = minetest.get_node(p).name
if minetest.get_item_group(n, "unbreakable") == 1
or minetest.is_protected(p, "")
or (n == "bones:bones" and not nssm:affectbones(self)) then
@ -92,6 +105,7 @@ mobs:register_arrow("nssm:snow_arrow", {
visual_size = {x = 1, y = 1},
textures = {"transparent.png"},
velocity =20,
-- direct hit
hit_player = function(self, player)
local pos = self.object:get_pos()
@ -102,6 +116,7 @@ mobs:register_arrow("nssm:snow_arrow", {
local pos = self.object:get_pos()
ice_explosion(pos)
end,
hit_node = function(self, pos, node)
ice_explosion(pos)
end,
@ -114,6 +129,7 @@ mobs:register_arrow("nssm:spine", {
visual_size = {x = 1, y = 1},
textures = {"manticore_spine_flying.png"},
velocity = 10,
-- direct hit
hit_player = function(self, player)
player:punch(self.object, 1.0, {
@ -154,17 +170,22 @@ mobs:register_arrow("nssm:morarrow", {
local function explosion_web(pos)
pos.y = round(pos.y)
if minetest.is_protected(pos, "") then
return
end
for i = pos.x - 1, pos.x + 1, 1 do
for j = pos.y - 3, pos.y, 1 do
for k = pos.z - 1, pos.z + 1, 1 do
local p = {x = i, y = j, z = k}
local k = {x = i, y = j + 1, z = k}
local current = minetest.get_node(p).name
local ontop = minetest.get_node(k).name
if (current ~= "air") and
(current ~= "nssm:web") and
(ontop == "air") and not
@ -184,6 +205,7 @@ mobs:register_arrow("nssm:webball", {
visual_size = {x = 1, y = 1},
textures = {"web_ball.png"},
velocity = 8,
-- direct hit
hit_player = function(self, player)
local p = player:get_pos()
@ -204,17 +226,22 @@ mobs:register_arrow("nssm:webball", {
function explosion_thickweb(pos)
pos.y = round(pos.y)
if minetest.is_protected(pos, "") then
return
end
for i = pos.x + 0, pos.x + 0, 1 do
for j = pos.y - 2, pos.y, 1 do
for k = pos.z + 0, pos.z + 0, 1 do
local p = {x = i, y = j, z = k}
local k = {x = i, y = j + 1, z = k}
local current = minetest.get_node(p).name
local ontop = minetest.get_node(k).name
if (current ~= "air") and
(current ~= "nssm:thick_web") and
(ontop == "air") and not
@ -233,6 +260,7 @@ mobs:register_arrow("nssm:thickwebball", {
visual_size = {x = 2, y = 2},
textures = {"thick_web_ball.png"},
velocity = 8,
-- direct hit
hit_player = function(self, player)
local p = player:get_pos()
@ -258,6 +286,7 @@ mobs:register_arrow("nssm:phoenix_arrow", {
visual_size = {x = 1, y = 1},
textures = {"transparent.png"},
velocity = 8,
-- direct hit
hit_player = function(self, player)
end,
@ -265,6 +294,7 @@ mobs:register_arrow("nssm:phoenix_arrow", {
on_step = function(self, dtime)
local pos = self.object:get_pos()
if minetest.is_protected(pos, "") then
return
end
@ -285,32 +315,41 @@ mobs:register_arrow("nssm:phoenix_arrow", {
end
if math.random(1, 6) == 1 then
dx = math.random(-1,1)
dy = math.random(-1,1)
dz = math.random(-1,1)
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local p = {
x = pos.x + math.random(-1, 1),
y = pos.y + math.random(-1, 1),
z = pos.z + math.random(-1, 1)
}
local n = minetest.get_node(p).name
if n == "air" then
minetest.set_node(p, {name = "nssm:phoenix_fire"})
end
end
end,
})
function gas_explosion(pos)
if minetest.is_protected(pos, "") then
return
end
for dx = -2, 2 do
for dy = -1, 4 do
for dz = -2, 2 do
local p = {x = pos.x + dx, y = pos.y + dy, z = pos.z + dz}
if minetest.is_protected(p, "") then
return
end
local n = minetest.get_node(p).name
if n == "air" then
minetest.set_node(p, {name = "nssm:venomous_gas"})
end
@ -322,9 +361,9 @@ end
mobs:register_arrow("nssm:super_gas", {
visual = "sprite",
visual_size = {x = 1, y = 1},
-- textures = {"transparent.png"},
textures = {"tnt_smoke.png^[colorize:green:170"},
velocity = 8,
-- direct hit
hit_player = function(self, player)
local p = player:get_pos()
@ -358,11 +397,18 @@ mobs:register_arrow("nssm:roar_of_the_dragon", {
end
local objects = minetest.get_objects_inside_radius(pos, 1)
for _,obj in ipairs(objects) do
local name = obj:get_entity_name()
if name~="nssm:roar_of_the_dragon" and name ~= "nssm:mese_dragon" then
if name ~= "nssm:roar_of_the_dragon"
and name ~= "nssm:mese_dragon" then
obj:set_hp(obj:get_hp() - 0.05)
if (obj:get_hp() <= 0) then
if obj:get_hp() <= 0 then
if (not obj:is_player())
and name ~= self.object:get_luaentity().name then
obj:remove()
@ -372,17 +418,20 @@ mobs:register_arrow("nssm:roar_of_the_dragon", {
end
minetest.set_node(pos, {name = "air"})
if math.random(1, 2) == 1 then
dx = math.random(-1,1)
dy = math.random(-1,1)
dz = math.random(-1,1)
if minetest.is_protected(p, "") then
return
end
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local p = {
x = pos.x + math.random(-1, 1),
y = pos.y + math.random(-1, 1),
z = pos.z + math.random(-1, 1)
}
if not minetest.is_protected(p, "") then
minetest.set_node(p, {name = "air"})
end
end
end
})
@ -391,17 +440,23 @@ mobs:register_arrow("nssm:lava_arrow", {
visual_size = {x = 1, y = 1},
textures = {"transparent.png"},
velocity = 10,
-- direct hit
hit_player = function(self, player)
local pos = self.object:get_pos()
if minetest.is_protected(pos, "") then
return
end
for dy = -1, 6, 1 do
for dx = -1, 1, 2 do
for dz = -1, 1, 2 do
local p = {x = pos.x + dx, y = pos.y + dy, z = pos.z + dz}
local n = minetest.get_node(p).name
if n ~= "default:lava_flowing"
and not minetest.is_protected(p, "") then
minetest.set_node(p, {name = "default:lava_flowing"})
@ -410,6 +465,7 @@ mobs:register_arrow("nssm:lava_arrow", {
end
end
end,
hit_node = function(self, pos, node)
end
})

View File

@ -1,8 +1,9 @@
local path = minetest.get_modpath("nssm")
nssm = {}
nssm.mymapgenis = tonumber(minetest.setting_get('mymapgenis')) or 7
nssm.multimobs = tonumber(minetest.setting_get('multimobs')) or 1000
nssm = {
mymapgenis = tonumber(minetest.setting_get('mymapgenis')) or 7,
multimobs = tonumber(minetest.setting_get('multimobs')) or 1000
}
dofile(path.."/spawn.lua")

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:ant_queen", {
collisionbox = {-0.6, 0.00, -0.6, 0.6, 1, 0.6},
visual = "mesh",
mesh = "ant_queen.x",
textures = {{"ant_queen.png"}},
textures = {
{"ant_queen.png"}
},
visual_size = {x = 6, y = 6},
makes_footstep_sound = true,
view_range = 30,
@ -21,22 +23,10 @@ mobs:register_mob("nssm:ant_queen", {
damage = 4,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 5,
max = 7,},
{name = "nssm:ant_queen_abdomen",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:ant_leg",
chance = 2,
min = 1,
max = 6,},
{name = "nssm:ant_mandible",
chance = 3,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 5, max = 7},
{name = "nssm:ant_queen_abdomen", chance = 1, min = 1, max = 1},
{name = "nssm:ant_leg", chance = 2, min = 1, max = 6},
{name = "nssm:ant_mandible", chance = 3, min = 1, max = 2},
},
reach = 8,
armor = 40,
@ -49,7 +39,6 @@ mobs:register_mob("nssm:ant_queen", {
stepheight = 2.1,
knock_back = 0,
jump_height = 12,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 20,
@ -65,16 +54,20 @@ mobs:register_mob("nssm:ant_queen", {
},
custom_attack = function(self)
self.ant_queen_counter = (self.ant_queen_counter or 0) + 1
if self.ant_queen_counter == 4 then
self.ant_queen_counter = 0
local counter = 0
self.ant_queen_counter = (self.ant_queen_counter or 0) + 1
if self.ant_queen_counter == 4 then
self.ant_queen_counter = 0
local counter = 0
local s = self.object:get_pos()
local p = self.attack:get_pos()
p.y = p.y + 1.5
s.y = s.y + 1.5
if mobs:line_of_sight(self, p, s) == true then
-- play attack sound
@ -84,20 +77,29 @@ mobs:register_mob("nssm:ant_queen", {
max_hear_distance = self.sounds.distance
})
end
local pos1 = {x=s.x+math.random(-3,3), y=s.y-1, z=s.z+math.random(-3,3)}
local pos1 = {
x = s.x + math.random(-3, 3),
y = s.y - 1,
z = s.z + math.random(-3, 3)
}
local objects = minetest.get_objects_inside_radius(s, 10)
for _,obj in ipairs(objects) do
if (obj:get_luaentity() and obj:get_luaentity().name == "nssm:ant_soldier") then
if (obj:get_luaentity()
and obj:get_luaentity().name == "nssm:ant_soldier") then
counter = counter + 1
end
end
if ((pos1.x~=s.x) and (pos1.z~=s.z))
and (minetest.get_node(pos1).name == "air")
and (counter < 4)
then
and (counter < 4) then
explosion_particles(pos1, 1)
minetest.add_entity(pos1, "nssm:ant_soldier")
end
end

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:ant_soldier", {
collisionbox = {-0.49, 0.00, -0.49, 0.49, 0.9, 0.49},
visual = "mesh",
mesh = "ant_soldier.x",
textures = {{"ant_soldier.png"}},
textures = {
{"ant_soldier.png"}
},
visual_size = {x = 3, y = 3},
makes_footstep_sound = true,
view_range = 20,
@ -19,22 +21,10 @@ mobs:register_mob("nssm:ant_soldier", {
damage = 6,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:ant_leg",
chance = 2,
min = 1,
max = 6,},
{name = "nssm:ant_mandible",
chance = 3,
min = 1,
max = 2,},
{name = "nssm:ant_hard_skin",
chance = 3,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:ant_leg", chance = 2, min = 1, max = 6},
{name = "nssm:ant_mandible", chance = 3, min = 1, max = 2},
{name = "nssm:ant_hard_skin", chance = 3, min = 1, max = 2},
},
reach = 2,
armor = 70,
@ -42,7 +32,6 @@ mobs:register_mob("nssm:ant_soldier", {
water_damage = 2,
lava_damage = 7,
light_damage = 0,
on_rightclick = nil,
group_attack = true,
attack_animals = false,
knock_back = 2,

View File

@ -6,7 +6,9 @@ mobs:register_mob("nssm:ant_worker", {
collisionbox = {-0.4, 0.00, -0.4, 0.4, 0.5, 0.4},
visual = "mesh",
mesh = "ant_worker.x",
textures = {{"ant_worker.png"}},
textures = {
{"ant_worker.png"}
},
visual_size = {x = 2, y = 2},
makes_footstep_sound = true,
view_range = 20,
@ -21,29 +23,16 @@ mobs:register_mob("nssm:ant_worker", {
reach = 2,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 2,
min = 1,
max = 1,},
{name = "nssm:ant_leg",
chance = 2,
min = 1,
max = 6,},
{name = "nssm:ant_mandible",
chance = 3,
min = 1,
max = 2,},
{name = "nssm:ant_hard_skin",
chance = 3,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 2, min = 1, max = 1},
{name = "nssm:ant_leg", chance = 2, min = 1, max = 6},
{name = "nssm:ant_mandible", chance = 3, min = 1, max = 2},
{name = "nssm:ant_hard_skin", chance = 3, min = 1, max = 2},
},
armor = 70,
drawtype = "front",
water_damage = 2,
lava_damage = 7,
light_damage = 0,
on_rightclick = nil,
group_attack = true,
knock_back = 4,
attack_animals = false,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:black_widow", {
collisionbox = {-0.4, 0.00, -0.4, 0.4, 0.8, 0.4},
visual = "mesh",
mesh = "black_widow.x",
textures = {{"black_widow.png"}},
textures = {
{"black_widow.png"}
},
visual_size = {x = 2, y = 2},
makes_footstep_sound = true,
view_range = 15,
@ -20,22 +22,10 @@ mobs:register_mob("nssm:black_widow", {
reach = 2,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:spider_leg",
chance = 3,
min = 1,
max = 8,},
{name = "nssm:silk_gland",
chance = 4,
min = 1,
max = 3,},
{name = "nssm:spider_meat",
chance = 4,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:spider_leg", chance = 3, min = 1, max = 8},
{name = "nssm:silk_gland", chance = 4, min = 1, max = 3},
{name = "nssm:spider_meat", chance = 4, min = 1, max = 2},
},
armor = 70,
drawtype = "front",
@ -47,7 +37,6 @@ mobs:register_mob("nssm:black_widow", {
blood_texture = "nssm_blood_blue.png",
stepheight = 1.1,
light_damage = 0,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 20,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:bloco", {
collisionbox = {-0.56, -0.2, -0.56, 0.56, 1.2, 0.56},
visual = "mesh",
mesh = "bloco.x",
textures = {{"bloco.png"}},
textures = {
{"bloco.png"}
},
visual_size = {x = 4, y = 4},
makes_footstep_sound = true,
view_range = 8,
@ -20,18 +22,9 @@ mobs:register_mob("nssm:bloco", {
reach = 2,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 1,},
{name = "default:stone",
chance = 1,
min = 2,
max = 3,},
{name = "nssm:bloco_skin",
chance = 3,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 1},
{name = "default:stone", chance = 1, min = 2, max = 3},
{name = "nssm:bloco_skin", chance = 3, min = 1, max = 2},
},
armor = 40,
drawtype = "front",
@ -42,9 +35,15 @@ mobs:register_mob("nssm:bloco", {
attack_animals = true,
knock_back = 0,
blood_texture = "stone_blood.png",
immune_to={{'default:sword_stone', -2},{'default:stone', -2}, {'default:cobble', -2}, {'default:axe_stone', -2}, {'default:shovel_stone', -2}, {'default:pick_stone', -2}},
immune_to = {
{'default:sword_stone', -2},
{'default:stone', -2},
{'default:cobble', -2},
{'default:axe_stone', -2},
{'default:shovel_stone', -2},
{'default:pick_stone', -2}
},
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 20,

View File

@ -5,7 +5,10 @@ mobs:register_mob("nssm:crab", {
collisionbox = {-0.5, 0, -0.5, 0.5, 0.55, 0.5},
visual = "mesh",
mesh = "crab.x",
textures = {{"crab1.png"},{"crab2.png"}},
textures = {
{"crab1.png"},
{"crab2.png"}
},
sounds = {
random = "crab",
},
@ -21,22 +24,10 @@ mobs:register_mob("nssm:crab", {
floats = 0,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:surimi",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:crab_chela",
chance = 4,
min = 1,
max = 2,},
{name = "nssm:crab_carapace_fragment",
chance = 4,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:surimi", chance = 1, min = 1, max = 2},
{name = "nssm:crab_chela", chance = 4, min = 1, max = 2},
{name = "nssm:crab_carapace_fragment", chance = 4, min = 1, max = 1},
},
armor = 40,
drawtype = "front",
@ -48,7 +39,6 @@ mobs:register_mob("nssm:crab", {
knock_back = 1,
blood_texture = "nssm_blood_blue.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 25,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:crocodile", {
collisionbox = {-0.45, -0.30, -0.45, 0.45, 0.3, 0.45},
visual = "mesh",
mesh = "crocodile.x",
textures = {{"croco.png"}},
textures = {
{"croco.png"}
},
sounds = {
random = "crocod",
},
@ -18,18 +20,9 @@ mobs:register_mob("nssm:crocodile", {
floats = 1,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:crocodile_tail",
chance = 2,
min = 1,
max = 1,},
{name = "nssm:crocodile_skin",
chance = 3,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:crocodile_tail", chance = 2, min = 1, max = 1},
{name = "nssm:crocodile_skin", chance = 3, min = 1, max = 1},
},
armor = 60,
drawtype = "front",
@ -42,7 +35,6 @@ mobs:register_mob("nssm:crocodile", {
knock_back = 3,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 25,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:daddy_long_legs", {
collisionbox = {-0.4, 0.00, -0.4, 0.4, 0.6, 0.4},
visual = "mesh",
mesh = "daddy_long_legs.x",
textures = {{"daddy_long_legs.png"}},
textures = {
{"daddy_long_legs.png"}
},
visual_size = {x = 8, y = 8},
makes_footstep_sound = true,
view_range = 12,
@ -19,18 +21,9 @@ mobs:register_mob("nssm:daddy_long_legs", {
damage = 3,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:spider_leg",
chance = 3,
min = 1,
max = 8,},
{name = "nssm:spider_meat",
chance = 4,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:spider_leg", chance = 3, min = 1, max = 8},
{name = "nssm:spider_meat", chance = 4, min = 1, max = 2},
},
armor = 70,
drawtype = "front",
@ -42,7 +35,6 @@ mobs:register_mob("nssm:daddy_long_legs", {
knock_back = 2,
blood_texture = "nssm_blood_blue.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 20,

View File

@ -5,7 +5,13 @@ mobs:register_mob("nssm:dolidrosaurus", {
collisionbox = {-0.5, 0, -0.5, 0.5, 0.52, 0.5},
visual = "mesh",
mesh = "dolidrosaurus.x",
textures = {{"dolidrosaurus1.png"},{"dolidrosaurus2.png"},{"dolidrosaurus3.png"},{"dolidrosaurus4.png"},{"dolidrosaurus5.png"}},
textures = {
{"dolidrosaurus1.png"},
{"dolidrosaurus2.png"},
{"dolidrosaurus3.png"},
{"dolidrosaurus4.png"},
{"dolidrosaurus5.png"}
},
visual_size = {x = 4, y = 4},
makes_footstep_sound = true,
view_range = 30,
@ -23,14 +29,8 @@ mobs:register_mob("nssm:dolidrosaurus", {
random = "crocod",
},
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 3,},
{name = "nssm:dolidrosaurus_fin",
chance = 2,
min = 1,
max = 3,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 3},
{name = "nssm:dolidrosaurus_fin", chance = 2, min = 1, max = 3},
},
armor = 60,
drawtype = "front",

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:duck", {
collisionbox = {-0.3, 0.00, -0.3, 0.3, 0.95, 0.3},
visual = "mesh",
mesh = "duck.x",
textures = {{"duck.png"}},
textures = {
{"duck.png"}
},
visual_size = {x = 2, y = 2},
makes_footstep_sound = true,
view_range = 13,
@ -18,22 +20,10 @@ mobs:register_mob("nssm:duck", {
random = "duck",
},
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:duck_legs",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:duck_beak",
chance = 5,
min = 1,
max = 1,},
{name = "nssm:duck_feather",
chance = 3,
min = 2,
max = 4,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 1},
{name = "nssm:duck_legs", chance = 1, min = 1, max = 2},
{name = "nssm:duck_beak", chance = 5, min = 1, max = 1},
{name = "nssm:duck_feather", chance = 3, min = 2, max = 4},
},
armor = 100,
drawtype = "front",
@ -46,7 +36,6 @@ mobs:register_mob("nssm:duck", {
attack_animals = true,
knock_back = 5,
blood_texture = "nssm_blood.png",
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,
@ -60,5 +49,4 @@ mobs:register_mob("nssm:duck", {
punch_start = 40,
punch_end = 60,
}
--pathfinding = 1,
})

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:duckking", {
collisionbox = {-1.2, -0.25, -1.2, 1.2, 4, 1.2},
visual = "mesh",
mesh = "king_duck.x",
textures = {{"king_duck.png"}},
textures = {
{"king_duck.png"}
},
visual_size = {x = 10, y = 10},
lifetimer = 300,
makes_footstep_sound = true,
@ -22,26 +24,11 @@ mobs:register_mob("nssm:duckking", {
attack = "duckking",
},
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 7,
max = 8,},
{name = "nssm:duck_legs",
chance = 1,
min = 40,
max = 50,},
{name = "nssm:helmet_crown",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:duck_beak",
chance = 4,
min = 10,
max = 20,},
{name = "nssm:duck_feather",
chance = 3,
min = 20,
max = 40,},
{name = "nssm:life_energy", chance = 1, min = 7, max = 8},
{name = "nssm:duck_legs", chance = 1, min = 40, max = 50},
{name = "nssm:helmet_crown", chance = 1, min = 1, max = 1},
{name = "nssm:duck_beak", chance = 4, min = 10, max = 20},
{name = "nssm:duck_feather", chance = 3, min = 20, max = 40},
},
armor = 50,
drawtype = "front",
@ -49,7 +36,6 @@ mobs:register_mob("nssm:duckking", {
floats = 1,
lava_damage = 5,
light_damage = 0,
on_rightclick = nil,
attack_type = "dogshoot",
dogshoot_switch = true,
dogshoot_count_max = 9,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:echidna", {
collisionbox = {-0.6, 0.00, -0.6, 0.6, 2, 0.6},
visual = "mesh",
mesh = "echidna.x",
textures = {{"echidnapes.png"}},
textures = {
{"echidnapes.png"}
},
visual_size = {x = 6, y = 6},
makes_footstep_sound = true,
view_range = 30,
@ -20,14 +22,8 @@ mobs:register_mob("nssm:echidna", {
random = "echidna",
},
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 6,
max = 7,},
{name = "nssm:snake_scute",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 6, max = 7},
{name = "nssm:snake_scute", chance = 1, min = 1, max = 1},
},
armor = 40,
drawtype = "front",
@ -40,7 +36,6 @@ mobs:register_mob("nssm:echidna", {
stepheight = 1.1,
knock_back = 0,
jump_height = 8,
on_rightclick = nil,
attack_type = "dogshoot",
dogshoot_switch = true,
arrow = "nssm:super_gas";

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:enderduck", {
collisionbox = {-0.28, 0.00, -0.28, 0.28, 1.8, 0.28},
visual = "mesh",
mesh = "enderduck.x",
textures = {{"enderduck.png"}},
textures = {
{"enderduck.png"}
},
visual_size = {x = 2, y = 2},
makes_footstep_sound = true,
view_range = 25,
@ -20,22 +22,10 @@ mobs:register_mob("nssm:enderduck", {
reach = 2,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2},
{name = "nssm:duck_legs",
chance = 1,
min = 1,
max = 2},
{name = "nssm:black_duck_feather",
chance = 3,
min = 1,
max = 4,},
{name = "nssm:duck_beak",
chance = 5,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:duck_legs", chance = 1, min = 1, max = 2},
{name = "nssm:black_duck_feather", chance = 3, min = 1, max = 4},
{name = "nssm:duck_beak", chance = 5, min = 1, max = 1},
},
armor = 80,
drawtype = "front",
@ -49,7 +39,6 @@ mobs:register_mob("nssm:enderduck", {
blood_texture = "nssm_blood.png",
jump_height = 12,
stepheight = 2.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:felucco", {
collisionbox = {-0.5, 0, -0.5, 0.5, 1.2, 0.5},
visual = "mesh",
mesh = "felucco.x",
textures = {{"felucco.png"}},
textures = {
{"felucco.png"}
},
visual_size = {x = 7, y = 7},
makes_footstep_sound = true,
view_range = 30,
@ -18,22 +20,10 @@ mobs:register_mob("nssm:felucco", {
damage = 5,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 3,
max = 4},
{name = "nssm:felucco_steak",
chance = 2,
min = 1,
max = 2},
{name = "nssm:felucco_fur",
chance = 2,
min = 1,
max = 1},
{name = "nssm:felucco_horn",
chance = 3,
min = 1,
max = 2},
{name = "nssm:life_energy", chance = 1, min = 3, max = 4},
{name = "nssm:felucco_steak", chance = 2, min = 1, max = 2},
{name = "nssm:felucco_fur", chance = 2, min = 1, max = 1},
{name = "nssm:felucco_horn", chance = 3, min = 1, max = 2},
},
armor = 70,
drawtype = "front",
@ -45,7 +35,6 @@ mobs:register_mob("nssm:felucco", {
knock_back = 2,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:flying_duck", {
collisionbox = {-0.3, -0.2, -0.3, 0.3, 0.2, 0.3},
visual = "mesh",
mesh = "nathan_petrelli.x",
textures = {{"nathan_petrelli.png"}},
textures = {
{"nathan_petrelli.png"}
},
visual_size = {x = 1, y = 1},
view_range = 30,
walk_velocity = 2,
@ -19,22 +21,10 @@ mobs:register_mob("nssm:flying_duck", {
reach = 2,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:duck_legs",
chance = 2,
min = 1,
max = 2,},
{name = "nssm:duck_beak",
chance = 5,
min = 1,
max = 1,},
{name = "nssm:duck_feather",
chance = 2,
min = 4,
max = 8,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:duck_legs", chance = 2, min = 1, max = 2},
{name = "nssm:duck_beak", chance = 5, min = 1, max = 1},
{name = "nssm:duck_feather", chance = 2, min = 4, max = 8},
},
armor = 80,
drawtype = "front",
@ -45,7 +35,6 @@ mobs:register_mob("nssm:flying_duck", {
attack_animals = true,
knock_back = 5,
blood_texture = "nssm_blood.png",
on_rightclick = nil,
fly = true,
attack_type = "dogfight",
animation = {

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:giant_sandworm", {
collisionbox = {-1.2, 0, -1.2, 1.2, 4.5, 1.2},
visual = "mesh",
mesh = "giant_sandworm.x",
textures = {{"sandworm.png"}},
textures = {
{"sandworm.png"}
},
visual_size = {x = 13, y = 13},
makes_footstep_sound = false,
view_range = 9,
@ -16,22 +18,10 @@ mobs:register_mob("nssm:giant_sandworm", {
damage = 12,
jump = false,
drops = {
{name = "nssm:worm_flesh",
chance = 1,
min = 20,
max = 30,},
{name = "nssm:sandworm_skin",
chance = 2,
min = 3,
max = 12,},
{name = "nssm:life_energy",
chance = 1,
min = 7,
max = 8,},
{name = "nssm:digested_sand",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:worm_flesh", chance = 1, min = 20, max = 30},
{name = "nssm:sandworm_skin", chance = 2, min = 3, max = 12},
{name = "nssm:life_energy", chance = 1, min = 7, max = 8},
{name = "nssm:digested_sand", chance = 1, min = 1, max = 1},
},
armor = 40,
drawtype = "front",
@ -42,7 +32,6 @@ mobs:register_mob("nssm:giant_sandworm", {
blood_amount = 50,
knock_back = 0,
jump_height = 0,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 25,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:icelamander", {
collisionbox = {-0.5, 0, -0.5, 0.5, 2.3, 0.5},
visual = "mesh",
mesh = "icelamander.x",
textures = {{"icelamander.png"}},
textures = {
{"icelamander.png"}
},
visual_size = {x = 4, y = 4},
makes_footstep_sound = true,
view_range = 35,
@ -19,33 +21,17 @@ mobs:register_mob("nssm:icelamander", {
damage = 12,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 6,
max = 8},
{name = "nssm:frosted_amphibian_heart",
chance = 1,
min = 1,
max = 1},
{name = "nssm:ice_tooth",
chance = 1,
min = 1,
max = 1},
{name = "nssm:little_ice_tooth",
chance = 1,
min = 0,
max = 20},
{name = "nssm:amphibian_ribs",
chance = 2,
min = 1,
max = 1},
{name = "nssm:life_energy", chance = 1, min = 6, max = 8},
{name = "nssm:frosted_amphibian_heart", chance = 1, min = 1, max = 1},
{name = "nssm:ice_tooth", chance = 1, min = 1, max = 1},
{name = "nssm:little_ice_tooth", chance = 1, min = 0, max = 20},
{name = "nssm:amphibian_ribs", chance = 2, min = 1, max = 1},
},
armor = 40,
drawtype = "front",
water_damage = 0,
lava_damage = 30,
light_damage = 0,
on_rightclick = nil,
attack_type = "dogshoot",
dogshoot_switch = true,
blood_texture = "nssm_blood.png",

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:icesnake", {
collisionbox = {-0.7, 0, -0.7, 0.7, 0.50, 0.7},
visual = "mesh",
mesh = "icesnake.x",
textures = {{"icesnake.png"}},
textures = {
{"icesnake.png"}
},
visual_size = {x = 7, y = 7},
makes_footstep_sound = false,
view_range = 10,
@ -20,22 +22,10 @@ mobs:register_mob("nssm:icesnake", {
reach = 2,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2},
{name = "nssm:frosted_amphibian_heart",
chance = 2,
min = 1,
max = 1},
{name = "nssm:little_ice_tooth",
chance = 2,
min = 0,
max = 4},
{name = "nssm:amphibian_ribs",
chance = 2,
min = 1,
max = 3},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:frosted_amphibian_heart", chance = 2, min = 1, max = 1},
{name = "nssm:little_ice_tooth", chance = 2, min = 0, max = 4},
{name = "nssm:amphibian_ribs", chance = 2, min = 1, max = 3},
},
armor = 70,
drawtype = "front",
@ -47,7 +37,6 @@ mobs:register_mob("nssm:icesnake", {
knock_back = 2,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,

View File

@ -5,7 +5,10 @@ mobs:register_mob("nssm:kraken", {
collisionbox = {-2, 0, -2, 2, 4, 2},
visual = "mesh",
mesh = "kraken.x",
textures = {{"kraken.png"}, {"kraken2.png"}},
textures = {
{"kraken.png"},
{"kraken2.png"}
},
visual_size = {x = 15, y = 15},
lifetimer=500,
inker = false,
@ -24,18 +27,9 @@ mobs:register_mob("nssm:kraken", {
random = "kraken",
},
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 6,
max = 7,},
{name = "nssm:tentacle",
chance = 1,
min = 30,
max = 40,},
{name = "nssm:tentacle_curly",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 6, max = 7},
{name = "nssm:tentacle", chance = 1, min = 30, max = 40},
{name = "nssm:tentacle_curly", chance = 1, min = 1, max = 1},
},
armor = 50,
drawtype = "front",
@ -45,7 +39,6 @@ mobs:register_mob("nssm:kraken", {
blood_texture = "nssm_blood_blue.png",
blood_amount = 100,
knock_back = 0,
on_rightclick = nil,
attack_type = "dogfight",
reach = 8,
animation = {

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:larva", {
collisionbox = {-0.3, 0, -0.3, 0.3, 0.41, 0.3},
visual = "mesh",
mesh = "larva.x",
textures = {{"larva.png"}},
textures = {
{"larva.png"}
},
visual_size = {x = 3, y = 3},
makes_footstep_sound = false,
view_range = 10,
@ -21,14 +23,8 @@ mobs:register_mob("nssm:larva", {
damage = 1,
reach = 1,
drops = {
{name = "nssm:life_energy",
chance = 3,
min = 1,
max = 1,},
{name = "nssm:larva_meat",
chance = 2,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 3, min = 1, max = 1},
{name = "nssm:larva_meat", chance = 2, min = 1, max = 2},
},
armor = 80,
drawtype = "front",
@ -39,7 +35,6 @@ mobs:register_mob("nssm:larva", {
attack_animals = true,
knock_back = 2,
blood_texture = "nssm_blood_blue.png",
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 20,
@ -53,13 +48,20 @@ mobs:register_mob("nssm:larva", {
punch_start = 180,
punch_end = 230,
},
do_custom = function (self)
self.metatimer = (self.metatimer) or os.time()
self.metatimer = self.metatimer or os.time()
if os.time() - self.metatimer > 20 then
minetest.log("action",
"metatimer expired, metamorphosis! ")
local pos = self.object:get_pos()
self.object:remove()
minetest.add_particlespawner(
200, --amount
0.1, --time
@ -76,11 +78,13 @@ mobs:register_mob("nssm:larva", {
false, --collisiondetection
"tnt_smoke.png" --texture
)
if math.random(1, 2) == 1 then
minetest.add_entity(pos, "nssm:mantis")
else
minetest.add_entity(pos, "nssm:mantis_beast")
end
return
end
end

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:lava_titan", {
collisionbox = {-0.45, -0.05, -0.45, 0.45, 1.8, 0.45},
visual = "mesh",
mesh = "lava_titan.x",
textures = {{"lava_titan.png"}},
textures = {
{"lava_titan.png"}
},
visual_size = {x = 2.7, y = 2.7},
makes_footstep_sound = true,
view_range = 20,
@ -21,18 +23,9 @@ mobs:register_mob("nssm:lava_titan", {
jump = false,
jump_height = 0,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 7,
max = 9,},
{name = "nssm:lava_titan_eye",
chance = 1,
min = 1,
max = 1,},
{name = "bucket:bucket_lava",
chance = 2,
min = 1,
max = 3,},
{name = "nssm:life_energy", chance = 1, min = 7, max = 9},
{name = "nssm:lava_titan_eye", chance = 1, min = 1, max = 1},
{name = "bucket:bucket_lava", chance = 2, min = 1, max = 3},
},
armor = 20,
drawtype = "front",
@ -40,7 +33,6 @@ mobs:register_mob("nssm:lava_titan", {
rotate = 270,
light_damage = 0,
lava_damage = 0,
on_rightclick = nil,
floats = 0,
blood_texture = "stone_blood.png",
blood_amount = 50,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:manticore", {
collisionbox = {-0.8, -0.85, -0.8, 0.8, 1.9, 0.8},
visual = "mesh",
mesh = "manticore.x",
textures = {{"manticore.png"}},
textures = {
{"manticore.png"}
},
visual_size = {x = 4, y = 4},
makes_footstep_sound = true,
view_range = 35,
@ -18,18 +20,9 @@ mobs:register_mob("nssm:manticore", {
damage = 6,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 3,
max = 4,},
{name = "nssm:manticore_spine",
chance = 3,
min = 2,
max = 5,},
{name = "nssm:manticore_fur",
chance = 3,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 3, max = 4},
{name = "nssm:manticore_spine", chance = 3, min = 2, max = 5},
{name = "nssm:manticore_fur", chance = 3, min = 1, max = 2},
},
armor = 60,
drawtype = "front",
@ -37,7 +30,6 @@ mobs:register_mob("nssm:manticore", {
rotate = 270,
lava_damage = 5,
light_damage = 0,
on_rightclick = nil,
attack_type = "dogshoot",
dogshoot_switch = true,
arrow = "nssm:spine",

View File

@ -5,7 +5,10 @@ mobs:register_mob("nssm:mantis", {
collisionbox = {-0.5, 0.00, -0.5, 0.5, 2.30, 0.5},
visual = "mesh",
mesh = "mantis.x",
textures = {{"mantis.png"}, {"mantis2.png"}},
textures = {
{"mantis.png"},
{"mantis2.png"}
},
visual_size = {x = 4, y = 4},
makes_footstep_sound = true,
view_range = 20,
@ -18,29 +21,16 @@ mobs:register_mob("nssm:mantis", {
damage = 4,
jump = true,
drops = {
{name = "nssm:mantis_claw",
chance = 2,
min = 1,
max = 4,},
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:mantis_skin",
chance = 3,
min = 1,
max = 2,},
{name = "nssm:mantis_meat",
chance = 2,
min = 1,
max = 2,},
{name = "nssm:mantis_claw", chance = 2, min = 1, max = 4},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:mantis_skin", chance = 3, min = 1, max = 2},
{name = "nssm:mantis_meat", chance = 2, min = 1, max = 2},
},
armor = 70,
drawtype = "front",
water_damage = 2,
lava_damage = 5,
light_damage = 0,
on_rightclick = nil,
group_attack = true,
attack_animals = true,
knock_back = 2,

View File

@ -5,7 +5,10 @@ mobs:register_mob("nssm:mantis_beast", {
collisionbox = {-0.65, 0.00, -0.65, 0.65, 1.50, 0.65},
visual = "mesh",
mesh = "mantis_beast.x",
textures = {{"mantis_beast.png"}, {"mantis_beast2.png"}},
textures = {
{"mantis_beast.png"},
{"mantis_beast2.png"}
},
visual_size = {x = 6, y = 6},
makes_footstep_sound = true,
view_range = 25,
@ -19,22 +22,10 @@ mobs:register_mob("nssm:mantis_beast", {
reach = 2,
jump = true,
drops = {
{name = "nssm:mantis_claw",
chance = 2,
min = 1,
max = 6,},
{name = "nssm:life_energy",
chance = 1,
min = 2,
max = 3,},
{name = "nssm:mantis_skin",
chance = 3,
min = 1,
max = 2,},
{name = "nssm:mantis_meat",
chance = 2,
min = 1,
max = 2,},
{name = "nssm:mantis_claw", chance = 2, min = 1, max = 6},
{name = "nssm:life_energy", chance = 1, min = 2, max = 3},
{name = "nssm:mantis_skin", chance = 3, min = 1, max = 2},
{name = "nssm:mantis_meat", chance = 2, min = 1, max = 2},
},
armor = 70,
drawtype = "front",
@ -46,7 +37,6 @@ mobs:register_mob("nssm:mantis_beast", {
knock_back = 2,
blood_texture = "nssm_blood_blue.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:masticone", {
collisionbox = {-0.45, 0.00, -0.45, 0.45, 0.40, 0.45},
visual = "mesh",
mesh = "masticone.x",
textures = {{"masticone.png"}},
textures = {
{"masticone.png"}
},
visual_size = {x = 4, y = 4},
makes_footstep_sound = true,
view_range = 15,
@ -20,23 +22,14 @@ mobs:register_mob("nssm:masticone", {
damage = 5,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 7,
max = 8,},
{name = "nssm:masticone_fang",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:masticone_skull_fragments",
chance = 2,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 7, max = 8},
{name = "nssm:masticone_fang", chance = 1, min = 1, max = 2},
{name = "nssm:masticone_skull_fragments", chance = 2, min = 1, max = 2},
},
armor = 60,
drawtype = "front",
water_damage = 0,
lava_damage = 0,
lava_damage = 10,
floats = 0,
light_damage = 0,
group_attack = true,
@ -44,7 +37,6 @@ mobs:register_mob("nssm:masticone", {
knock_back = 4,
blood_texture = "nssm_blood_blue.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
reach =1.5,
animation = {
@ -60,8 +52,11 @@ mobs:register_mob("nssm:masticone", {
punch_end = 180,
},
on_die = function(self, pos)
self.object:remove()
core.after(2, function()
minetest.add_particlespawner(
200, --amount
0.1, --time
@ -78,44 +73,21 @@ mobs:register_mob("nssm:masticone", {
false, --collisiondetection
"tnt_smoke.png" --texture
)
for i = 1, 2 do
local pos = {x=pos.x+math.random(-1,1), y=pos.y+0.5, z=pos.z+math.random(-1,1)}
local pos = {
x = pos.x + math.random(-1, 1),
y = pos.y + 0.5,
z = pos.z + math.random(-1, 1)
}
local n = minetest.get_node(pos).name
if n == "air" then
minetest.add_entity(pos, "nssm:masticone")
end
end
end)
end,
do_custom = function (self)
local pos = self.object:get_pos()
local n = minetest.get_node(pos).name
if n == "default:lava_source" or n == "default:lava_flowing" then
self.object:set_hp(self.object:get_hp()-5)
if self.object:get_hp() <=0 then
for _,drop in pairs(self.drops) do
if math.random(1, drop.chance) == 1 then
obj = minetest.add_item(pos,
ItemStack(drop.name .. " "
.. math.random(drop.min, drop.max)))
if obj then
obj:set_velocity({
x = math.random(-1, 1),
y = 6,
z = math.random(-1, 1)
})
end
end
end
self.object:remove()
end
end
end,
})

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:mese_dragon", {
collisionbox = {-1, 0, -1, 1, 5, 1},
visual = "mesh",
mesh = "mese_dragon.x",
textures = {{"mese_dragon.png"}},
textures = {
{"mese_dragon.png"}
},
visual_size = {x = 12, y = 12},
makes_footstep_sound = true,
view_range = 45,
@ -22,14 +24,8 @@ mobs:register_mob("nssm:mese_dragon", {
jump = true,
jump_height = 10,
drops = {
{name = "nssm:rainbow_staff",
chance = 1,
min = 1,
max = 1},
{name = "nssm:energy_globe",
chance = 1,
min = 99,
max = 99},
{name = "nssm:rainbow_staff", chance = 1, min = 1, max = 1},
{name = "nssm:energy_globe", chance = 1, min = 99, max = 99},
},
armor = 30,
drawtype = "front",
@ -65,25 +61,32 @@ mobs:register_mob("nssm:mese_dragon", {
dattack_start = 120,
dattack_end = 160,
},
do_custom = function(self)
midas_ability(self, "default:mese_block", self.run_velocity, 2, 3)
end,
custom_attack = function(self)
if self.timer > 1 then
self.timer = 0
self.attack_rip = self.attack_rip+1
self.attack_rip = (self.attack_rip or 0) + 1
local s = self.object:get_pos()
if minetest.is_protected(s, "") then
return
end
local p = self.attack:get_pos()
p.y = p.y + 1.5
s.y = s.y + 1.5
if minetest.line_of_sight(p, s) == true then
-- play attack sound
if self.sounds.attack then
minetest.sound_play(self.sounds.attack, {
@ -91,19 +94,26 @@ mobs:register_mob("nssm:mese_dragon", {
max_hear_distance = self.sounds.distance
})
end
-- punch player
self.attack:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = self.damage}
}, nil)
end
if self.attack_rip >= 8 then
self.attack_rip = 0
mobs:set_animation("punch1")
for dx = -17, 17 do
for dz = -17, 17 do
local k = {x = s.x + dx, y = s.y + 20, z = s.z + dz}
local n = minetest.get_node(k).name
if n == "air" and math.random(1, 23) == 1 then
minetest.set_node(k, {name="nssm:mese_meteor"})
nodeupdate(k)

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:moonheron", {
collisionbox = {-0.45, -0.3, -0.45, 0.45, 0.3, 0.45},
visual = "mesh",
mesh = "moonheron.x",
textures = {{"moonheron.png"}},
textures = {
{"moonheron.png"}
},
visual_size = {x = 10, y = 10},
view_range = 35,
rotate = 270,
@ -20,14 +22,8 @@ mobs:register_mob("nssm:moonheron", {
damage = 5,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 2,
max = 3,},
{name = "nssm:heron_leg",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 2, max = 3},
{name = "nssm:heron_leg", chance = 1, min = 1, max = 1},
},
armor = 70,
floats = 1,
@ -38,7 +34,6 @@ mobs:register_mob("nssm:moonheron", {
attack_animals = true,
knock_back = 4,
blood_texture = "nssm_blood.png",
on_rightclick = nil,
fly = true,
attack_type = "dogfight",
animation = {

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:mordain", {
collisionbox = {-0.5, -0.3, -0.5, 0.5, 2.7, 0.5},
visual = "mesh",
mesh = "mordain.x",
textures = {{"mordain.png"}},
textures = {
{"mordain.png"}
},
visual_size = {x = 3.5, y = 3.5},
makes_footstep_sound = false,
view_range = 30,
@ -19,26 +21,19 @@ mobs:register_mob("nssm:mordain", {
damage = 6,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:slothful_soul_fragment",
chance = 3,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 1},
{name = "nssm:slothful_soul_fragment", chance = 3, min = 1, max = 1},
},
armor = 80,
drawtype = "front",
water_damage = 0,
lava_damage = 1,
-- light_damage = 2,
group_attack = true,
attack_animals = true,
knock_back = 1,
blood_texture = "morparticle.png",
stepheight = 1.1,
--light_damage = 2,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,
@ -52,17 +47,24 @@ mobs:register_mob("nssm:mordain", {
punch_start = 210,
punch_end = 225,
},
--pathfinding = 1,
custom_attack = function(self)
self.mordain_timer = (self.mordain_timer or os.time())
self.mordain_timer = self.mordain_timer or os.time()
if (os.time() - self.mordain_timer) > 1 then
self.mordain_timer = os.time()
local s = self.object:get_pos()
local p = self.attack:get_pos()
mobs:set_animation(self, "punch")
if minetest.line_of_sight({x = p.x, y = p.y +1.5, z = p.z}, {x = s.x, y = s.y +1.5, z = s.z}) == true then
if minetest.line_of_sight(
{x = p.x, y = p.y + 1.5, z = p.z},
{x = s.x, y = s.y + 1.5, z = s.z}) == true then
-- play attack sound
if self.sounds.attack then
minetest.sound_play(self.sounds.attack, {
@ -70,6 +72,7 @@ mobs:register_mob("nssm:mordain", {
max_hear_distance = self.sounds.distance
})
end
-- punch player
self.attack:punch(self.object, 1.0, {
full_punch_interval = 1.0,
@ -78,44 +81,83 @@ mobs:register_mob("nssm:mordain", {
end
minetest.after(1, function()
local ty = s.y
local flag = 0
local m = 3
local v = {x=(p.x-s.x)*m, y = ty, z = (p.z-s.z)*m}
local d = {x=s.x+v.x, y = ty, z = s.z+v.z}
local v = {
x = (p.x - s.x) * m,
y = ty,
z = (p.z - s.z) * m
}
d.y = ty
local d = {
x = s.x + v.x,
y = ty,
z = s.z + v.z
}
for j = -3,3 do
ty = d.y + j
local current = minetest.get_node({x = d.x, y = ty, z = d.z}).name
local up = minetest.get_node({x = d.x, y = ty+1, z = d.z}).name
local current = minetest.get_node({
x = d.x,
y = ty,
z = d.z}).name
local up = minetest.get_node({
x = d.x,
y = ty + 1,
z = d.z}).name
if up == "air" and current ~= "air" then
d.y = d.y + j+1.5
flag = 1
break
end
end
while flag ~= 1 do
d.x = p.x + math.random(-m, m)
d.z = p.z + math.random(-m, m)
d.y = p.y
local dist = dist_pos(d, p)
if dist >= 2 then
for j = -3,3 do
ty = d.y + j
local current = minetest.get_node({x = d.x, y = ty, z = d.z}).name
local up = minetest.get_node({x = d.x, y = ty+1, z = d.z}).name
local current = minetest.get_node({
x = d.x,
y = ty,
z = d.z}).name
local up = minetest.get_node({
x = d.x,
y = ty + 1,
z = d.z}).name
if up == "air" and current ~= "air" then
d.y = d.y + j+1.5
flag = 1
break
end
end
end
end
self.object:set_pos(d)
end)
end

View File

@ -6,7 +6,9 @@ mobs:register_mob("nssm:morde", {
visual = "mesh",
rotate= 270,
mesh = "morde.x",
textures = {{"morde.png"}},
textures = {
{"morde.png"}
},
visual_size = {x = 10, y = 10},
makes_footstep_sound = true,
view_range = 20,
@ -19,14 +21,8 @@ mobs:register_mob("nssm:morde", {
random = "morde",
},
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 2,
max = 4,},
{name = "nssm:proud_soul_fragment",
chance = 3,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 2, max = 4},
{name = "nssm:proud_soul_fragment", chance = 3, min = 1, max = 1},
},
armor = 60,
drawtype = "front",
@ -40,7 +36,6 @@ mobs:register_mob("nssm:morde", {
knock_back = 1,
blood_texture = "morparticle.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,
@ -54,9 +49,13 @@ mobs:register_mob("nssm:morde", {
punch_start = 130,
punch_end = 160,
},
custom_attack = function (self)
self.morde_timer = (self.morde_timer or os.time())
self.morde_timer = self.morde_timer or os.time()
if (os.time() - self.morde_timer) > 1 then
self.morde_timer = os.time()
local s = self.object:get_pos()
@ -65,9 +64,13 @@ mobs:register_mob("nssm:morde", {
mobs:set_animation(self, "punch")
self.health = self.health + (self.damage * 2)
local m = 3
if minetest.line_of_sight({x = p.x, y = p.y +1.5, z = p.z}, {x = s.x, y = s.y +1.5, z = s.z}) == true then
if minetest.line_of_sight(
{x = p.x, y = p.y + 1.5, z = p.z},
{x = s.x, y = s.y + 1.5, z = s.z}) == true then
-- play attack sound
if self.sounds.attack then
minetest.sound_play(self.sounds.attack, {
@ -75,6 +78,7 @@ mobs:register_mob("nssm:morde", {
max_hear_distance = self.sounds.distance
})
end
-- punch player
self.attack:punch(self.object, 1.0, {
full_punch_interval = 1.0,
@ -100,9 +104,13 @@ mobs:register_mob("nssm:morde", {
end
end
end,
on_die = function(self)
local pos = self.object:get_pos()
self.object:remove()
minetest.add_entity(pos, "nssm:mortick")
end,
})
@ -117,10 +125,13 @@ minetest.register_entity("nssm:mortick", {
visual_size = {x = 3, y = 3},
--lifetime = 10,
damage = 1,
on_step = function(self, dtime)
self.mortick_timer = self.mortick_timer or os.time()
self.timer = self.timer or 0
self.timer = self.timer + dtime
local s = self.object:get_pos()
local s1 = {x=s.x, y = s.y-1, z = s.z}
@ -129,9 +140,12 @@ minetest.register_entity("nssm:mortick", {
self.object:remove()
end
]]
--The mortick dies when he finds himself in the fire
local name = minetest.get_node(s1).name
if name == "fire:basic_flame" then
if name == "fire:basic_flame"
or name == "fire:permanent_flame" then
self.object:remove()
end
@ -139,6 +153,7 @@ minetest.register_entity("nssm:mortick", {
self.attack = (self.attack or 0)
local objects = minetest.get_objects_inside_radius(s, 8)
for _,obj in ipairs(objects) do
if (obj:is_player()) then
self.attack = obj
@ -147,6 +162,7 @@ minetest.register_entity("nssm:mortick", {
--If found a player follow him
if self.attack ~= 0 then
local p = self.attack:get_pos()
local yawp = self.attack:get_look_yaw()
local pi = math.pi
@ -154,8 +170,13 @@ minetest.register_entity("nssm:mortick", {
p.y = p.y + 1
p.x = p.x - math.cos(yawp) / 2.5
p.z = p.z - math.sin(yawp) / 2.5
local m = 10
local v = {x=-(s.x-p.x)*m, y=-(s.y-p.y)*m, z=-(s.z-p.z)*m}
local v = {
x = -(s.x - p.x) * m,
y = -(s.y - p.y) * m,
z = -(s.z - p.z) * m
}
local yaws = yawp + pi
--stay attached to players back:

View File

@ -6,7 +6,9 @@ mobs:register_mob("nssm:morgre", {
visual = "mesh",
mesh = "morgre.x",
rotate = 270,
textures = {{"morgre.png"}},
textures = {
{"morgre.png"}
},
visual_size = {x = 5, y = 5},
explosion_radius = 4,
makes_footstep_sound = true,
@ -21,14 +23,8 @@ mobs:register_mob("nssm:morgre", {
damage = 1,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:greedy_soul_fragment",
chance = 5,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:greedy_soul_fragment", chance = 5, min = 1, max = 1},
},
armor = 60,
drawtype = "front",
@ -40,7 +36,6 @@ mobs:register_mob("nssm:morgre", {
knock_back = 1,
blood_texture = "morparticle.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "explode",
animation = {
speed_normal = 25,

View File

@ -6,7 +6,9 @@ mobs:register_mob("nssm:morgut", {
visual = "mesh",
rotate= 270,
mesh = "morgut.x",
textures = {{"morgut.png"}},
textures = {
{"morgut.png"}
},
visual_size = {x = 5, y = 5},
makes_footstep_sound = true,
view_range = 26,
@ -20,14 +22,8 @@ mobs:register_mob("nssm:morgut", {
random = "morgut",
},
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 3,},
{name = "nssm:gluttonous_soul_fragment",
chance = 3,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 3},
{name = "nssm:gluttonous_soul_fragment", chance = 3, min = 1, max = 1},
},
armor = 70,
drawtype = "front",
@ -41,7 +37,6 @@ mobs:register_mob("nssm:morgut", {
knock_back = 1,
blood_texture = "morparticle.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,
@ -57,21 +52,29 @@ mobs:register_mob("nssm:morgut", {
},
do_custom = function (self)
self.flag = (self.flag or 0)
if self.inv_flag ~= 1 then
self.inventory = {}
for i = 1, 32 do
self.inventory[i] = {name = '', num = 0}
end
end
self.inv_flag = (self.inv_flag or 1)
if self.flag == 1 then
self.state = ""
mobs:set_animation(self, "run")
self.object:set_yaw(self.dir)
set_velocity(self, 4)
self:set_velocity(4)
if os.time() - self.morgut_timer > 3 then
self.flag = 0
@ -80,16 +83,23 @@ mobs:register_mob("nssm:morgut", {
end
end,
custom_attack = function (self)
self.curr_attack = (self.curr_attack or self.attack)
self.morgut_timer = (self.morgut_timer or os.time())
self.dir = (self.dir or 0)
if (os.time() - self.morgut_timer) > 1 then
if self.attack then
local s = self.object:get_pos()
local p = self.attack:get_pos()
mobs:set_animation(self, "punch")
local m = 2
minetest.add_particlespawner(
@ -110,10 +120,12 @@ mobs:register_mob("nssm:morgut", {
)
minetest.after(1, function(self)
if self then
if self.attack:is_player() then
if self and self.attack:is_player() then
local pname = self.attack:get_player_name()
local player_inv = minetest.get_inventory({type='player', name = pname})
local player_inv = minetest.get_inventory(
{type = 'player', name = pname})
if player_inv:is_empty('main') then
--minetest.chat_send_all("Inventory empty")
@ -122,11 +134,16 @@ mobs:register_mob("nssm:morgut", {
--minetest.chat_send_all("Inventory is not empty")
local items = player_inv:get_stack('main', i)
local n = items:get_name()
if minetest.get_item_group(n, "eatable")==1 then
local index
local found = 0
for j = 1,32 do
if found == 0 then
if self.inventory[j].num == 0 then
--found an empty place
found = 2
@ -134,46 +151,65 @@ mobs:register_mob("nssm:morgut", {
else
--found a corrsponding itemstack
if self.inventory[j].name == n then
self.inventory[j].num = self.inventory[j].num +1
found = 1
end
end
end
end
if found == 2 then
self.inventory[index].name = n
self.inventory[index].num = 1
end
items:take_item()
player_inv:set_stack('main', i, items)
end
end
end
mobs:set_animation(self, "run")
self.flag = 1
self.morgut_timer = os.time()
self.curr_attack = self.attack
self.state = ""
local pyaw = self.curr_attack: get_look_yaw()
self.dir = pyaw
self.object:set_yaw(pyaw)
if self then
set_velocity(self, 4)
end
self:set_velocity(4)
end
end
end, self)
end
end
end,
on_die = function(self)
local pos = self.object:get_pos()
if (self.inventory ~= nil) then
local elem
for i = 1,32 do
if self.inventory[i].num ~= 0 then
local items = ItemStack(self.inventory[i].name.." "..self.inventory[i].num)
local items = ItemStack(self.inventory[i].name
.. " " .. self.inventory[i].num)
local obj = minetest.add_item(pos, items)
obj:set_velocity({
x = math.random(-1, 1),
y = 6,
@ -182,6 +218,7 @@ mobs:register_mob("nssm:morgut", {
end
end
end
self.object:remove()
end,
})

View File

@ -6,7 +6,9 @@ mobs:register_mob("nssm:morlu", {
visual = "mesh",
rotate= 270,
mesh = "morlu.x",
textures = {{"morlu.png"}},
textures = {
{"morlu.png"}
},
visual_size = {x = 7, y = 7},
makes_footstep_sound = true,
view_range = 28,
@ -21,14 +23,8 @@ mobs:register_mob("nssm:morlu", {
random = "morlu2"
},
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 3,
max = 4,},
{name = "nssm:lustful_soul_fragment",
chance = 3,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 3, max = 4},
{name = "nssm:lustful_soul_fragment", chance = 3, min = 1, max = 1},
},
armor = 40,
drawtype = "front",
@ -42,7 +38,6 @@ mobs:register_mob("nssm:morlu", {
knock_back = 1,
blood_texture = "morparticle.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,
@ -58,22 +53,30 @@ mobs:register_mob("nssm:morlu", {
},
do_custom = function (self)
self.flag = (self.flag or 0)
if self.inv_flag ~= 1 then
self.inventory = {}
self.invnum = 0
for i = 1, 6 do
self.inventory[i] = {name = ''}
end
end
self.inv_flag = (self.inv_flag or 1)
if self.flag == 1 then
self.state = ""
mobs:set_animation(self, "run")
self.object:set_yaw(self.dir)
set_velocity(self, 4)
self:set_yaw(self.dir)
self:set_velocity(4)
if os.time() - self.morlu_timer > 3 then
self.flag = 0
@ -82,24 +85,35 @@ mobs:register_mob("nssm:morlu", {
end
end,
custom_attack = function (self)
self.curr_attack = (self.curr_attack or self.attack)
self.morlu_timer = (self.morlu_timer or os.time())
self.dir = (self.dir or 0)
if (os.time() - self.morlu_timer) > 1 then
local s = self.object:get_pos()
local p = self.attack:get_pos()
mobs:set_animation(self, "punch")
local m = 1
if self.attack:is_player() then
if minetest.get_modpath("3d_armor") then
local pname, player_inv, armor_inv, ppos = armor:get_valid_player(self.attack, "[set_player_armor]")
local pname, player_inv, armor_inv, ppos = armor:get_valid_player(
self.attack, "[set_player_armor]")
local pname = self.attack:get_player_name()
local player_inv = minetest.get_inventory({type='player', name = pname})
if player_inv:is_empty('armor') then
-- punch player if he doesn't own an armor
self.attack:punch(self.object, 1.0, {
full_punch_interval = 1.0,
@ -111,15 +125,19 @@ mobs:register_mob("nssm:morlu", {
local steal_pos
for i = 1, 6 do
local armor_stack = player_inv:get_stack("armor", i)
local armor_item = armor_stack:get_name()
if armor_stack:get_count() > 0 then
armor_elements[armor_num] = {name=armor_item, pos=i}
armor_num = armor_num + 1
end
end
if armor_num > 0 then
steal_pos = math.random(1,armor_num)
steal_pos = math.random(armor_num)
steal_pos = steal_pos - 1
--[[for i=0,armor_num-1 do
minetest.chat_send_all("Posizione: "..armor_elements[i].pos.." Oggetto: "..armor_elements[i].name)
@ -161,12 +179,12 @@ mobs:register_mob("nssm:morlu", {
)
minetest.after(1, function (self)
if self then
local armor_stack = player_inv:get_stack("armor", armor_elements[steal_pos].pos)
armor_stack:take_item()
player_inv:set_stack('armor', armor_elements[steal_pos].pos, armor_stack)
armor_stack = armor_inv:get_stack("armor", armor_elements[steal_pos].pos)
armor_stack:take_item()
armor_inv:set_stack('armor', armor_elements[steal_pos].pos, armor_stack)
@ -205,7 +223,10 @@ mobs:register_mob("nssm:morlu", {
mobs:set_animation(self, "punch")
if minetest.line_of_sight({x = p.x, y = p.y +1.5, z = p.z}, {x = s.x, y = s.y +1.5, z = s.z}) == true then
if minetest.line_of_sight(
{x = p.x, y = p.y +1.5, z = p.z},
{x = s.x, y = s.y +1.5, z = s.z}) == true then
-- play attack sound
if self.sounds.attack then
minetest.sound_play(self.sounds.attack, {
@ -213,6 +234,7 @@ mobs:register_mob("nssm:morlu", {
max_hear_distance = self.sounds.distance
})
end
-- punch player
self.attack:punch(self.object, 1.0, {
full_punch_interval = 1.0,
@ -223,13 +245,20 @@ mobs:register_mob("nssm:morlu", {
end
end
end,
on_die = function(self)
local pos = self.object:get_pos()
if (self.inventory ~= nil) then
if self.invnum > 0 then
for i = 1, self.invnum do
local items = ItemStack(self.inventory[i].name.." 1")
local obj = minetest.add_item(pos, items)
obj:set_velocity({
x = math.random(-1, 1),
y = 6,
@ -238,6 +267,7 @@ mobs:register_mob("nssm:morlu", {
end
end
end
self.object:remove()
end,
})

View File

@ -1,5 +1,5 @@
local time_limit = 120
posmorvalarblock = {x=827, y=-30094, z=-817}
local posmorvalarblock = {x=827, y=-30094, z=-817}
function respawn_block(self)
--start a timer if it doesn't exist
@ -28,7 +28,9 @@ mobs:register_mob("nssm:morvalar", {
visual = "mesh",
--rotate= 270,
mesh = "morvalar.x",
textures = {{"morvalar.png"}},
textures = {
{"morvalar.png"}
},
visual_size = {x = 5, y = 5},
makes_footstep_sound = true,
view_range = 50,
@ -51,7 +53,6 @@ mobs:register_mob("nssm:morvalar", {
blood_amount = 10,
knock_back = 0,
light_damage = 0,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,
@ -71,22 +72,30 @@ mobs:register_mob("nssm:morvalar", {
end,
custom_attack = function (self)
self.curr_attack = (self.curr_attack or self.attack)
self.morvalar_timer = (self.morvalar_timer or os.time())
self.dir = (self.dir or 0)
if (os.time() - self.morvalar_timer) > 2 then
local s = self.object:get_pos()
local p = self.attack:get_pos()
mobs:set_animation(self, "punch")
local m = 1
if self.attack:is_player() then
if minetest.get_modpath("3d_armor") then
local pname, player_inv, armor_inv, ppos = armor:get_valid_player(self.attack, "[set_player_armor]")
local pname, player_inv, armor_inv, ppos = armor:get_valid_player(
self.attack, "[set_player_armor]")
local pname = self.attack:get_player_name()
local player_inv = minetest.get_inventory({type='player', name = pname})
if player_inv:is_empty('armor') then
-- punch player if he doesn't own an armor
self.attack:punch(self.object, 1.0, {
@ -99,16 +108,21 @@ mobs:register_mob("nssm:morvalar", {
local steal_pos
for i = 1, 6 do
local armor_stack = player_inv:get_stack("armor", i)
local armor_item = armor_stack:get_name()
if armor_stack:get_count() > 0 then
armor_elements[armor_num]={name=armor_item, pos=i}
armor_num = armor_num + 1
end
end
if armor_num > 0 then
steal_pos = math.random(1,armor_num)
steal_pos = steal_pos-1
local cpos = string.find(armor_elements[steal_pos].name, ":")
local mod_name = string.sub(armor_elements[steal_pos].name, 0, cpos - 1)
local nname = string.sub(armor_elements[steal_pos].name, cpos + 1)
@ -159,7 +173,10 @@ mobs:register_mob("nssm:morvalar", {
mobs:set_animation(self, "punch")
if minetest.line_of_sight({x = p.x, y = p.y +1.5, z = p.z}, {x = s.x, y = s.y +1.5, z = s.z}) == true then
if minetest.line_of_sight(
{x = p.x, y = p.y + 1.5, z = p.z},
{x = s.x, y = s.y +1.5, z = s.z}) == true then
-- play attack sound
if self.sounds.attack then
minetest.sound_play(self.sounds.attack, {
@ -177,9 +194,13 @@ mobs:register_mob("nssm:morvalar", {
end
end
end,
on_die = function(self)
local pos = self.object:get_pos()
self.object:remove()
add_entity_and_particles("nssm:morvalar6", pos, "morparticle.png", 10)
end,
})
@ -192,7 +213,9 @@ mobs:register_mob("nssm:morvalar6", {
visual = "mesh",
--rotate= 270,
mesh = "morvalar.x",
textures = {{"morvalar.png"}},
textures = {
{"morvalar.png"}
},
visual_size = {x = 5, y = 5},
makes_footstep_sound = true,
view_range = 50,
@ -215,7 +238,6 @@ mobs:register_mob("nssm:morvalar6", {
blood_texture = "morparticle.png",
blood_amount = 10,
knock_back = 0,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,
@ -229,13 +251,17 @@ mobs:register_mob("nssm:morvalar6", {
punch_start = 132,
punch_end = 162,
},
do_custom = function(self)
respawn_block(self)
end,
custom_attack = function (self)
self.morvalar6_timer = (self.morvalar6_timer or os.time())
self.dir = (self.dir or 0)
if (os.time() - self.morvalar6_timer) > 1 then
local s = self.object:get_pos()
@ -246,7 +272,9 @@ mobs:register_mob("nssm:morvalar6", {
minetest.after(1, function (self)
if self.attack:is_player() then
local pname = self.attack:get_player_name()
local player_inv = minetest.get_inventory({type='player', name = pname})
@ -254,6 +282,7 @@ mobs:register_mob("nssm:morvalar6", {
--minetest.chat_send_all("Inventory empty")
else
local imhungry = 0
for i = 1, 32 do
--minetest.chat_send_all("Inventory is not empty")
local items = player_inv:get_stack('main', i)

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:morvy", {
collisionbox = {-0.3, -0.1, -0.3, 0.3, 2.3, 0.3},
visual = "mesh",
mesh = "morvy.x",
textures = {{"morvy.png"}},
textures = {
{"morvy.png"}
},
visual_size = {x = 6, y = 6},
makes_footstep_sound = true,
view_range = 35,
@ -19,14 +21,8 @@ mobs:register_mob("nssm:morvy", {
},
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 5,
max = 7,},
{name = "nssm:envious_soul_fragment",
chance = 3,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 5, max = 7},
{name = "nssm:envious_soul_fragment", chance = 3, min = 1, max = 1},
},
reach = 8,
armor = 60,
@ -39,7 +35,6 @@ mobs:register_mob("nssm:morvy", {
knock_back = 1,
blood_texture = "morparticle.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 20,
@ -55,18 +50,24 @@ mobs:register_mob("nssm:morvy", {
},
custom_attack = function(self)
mobs:set_animation(self, "stand")
self.morvy_counter = (self.morvy_counter or 0) + 1
if self.morvy_counter == 4 then
mobs:set_animation(self, "punch")
self.morvy_counter = 0
local counter = 0
mobs:set_animation(self, "stand")
self.morvy_counter = (self.morvy_counter or 0) + 1
if self.morvy_counter == 4 then
mobs:set_animation(self, "punch")
self.morvy_counter = 0
local counter = 0
local s = self.object:get_pos()
local p = self.attack:get_pos()
p.y = p.y + 1.5
s.y = s.y + 1.5
if mobs:line_of_sight(self, p, s) == true then
--[[play attack sound
if self.sounds.attack then
@ -75,20 +76,31 @@ mobs:register_mob("nssm:morvy", {
max_hear_distance = self.sounds.distance
})
end]]
local pos1 = {x=s.x+math.random(-0.5,0.5), y=s.y+0.2, z=s.z+math.random(-0.5,0.5)}
local pos1 = {
x = s.x + math.random(-0.5, 0.5),
y = s.y + 0.2,
z = s.z + math.random(-0.5, 0.5)
}
local objects = minetest.get_objects_inside_radius(s, 10)
for _,obj in ipairs(objects) do
if (obj:get_luaentity() and ((obj:get_luaentity().name == "nssm:morbat1") or (obj:get_luaentity().name == "nssm:morbat2") or (obj:get_luaentity().name == "nssm:morbat3"))) then
if (obj:get_luaentity()
and ((obj:get_luaentity().name == "nssm:morbat1")
or (obj:get_luaentity().name == "nssm:morbat2")
or (obj:get_luaentity().name == "nssm:morbat3"))) then
counter = counter + 1
end
end
if (minetest.get_node(pos1).name == "air")
and (counter < 5)
then
if minetest.get_node(pos1).name == "air"
and counter < 5 then
local bat
local which = math.random(1,3)
if which == 1 then
bat = "nssm:morbat1"
elseif which == 2 then
@ -96,10 +108,13 @@ mobs:register_mob("nssm:morvy", {
elseif which == 3 then
bat = "nssm:morbat3"
end
if (bat=="nssm:morbat3") then
pos1.y = pos1.y + 1.5
end
minetest.add_entity(pos1, bat)
minetest.add_particlespawner(
20, --amount
0.1, --time
@ -132,7 +147,9 @@ mobs:register_mob("nssm:morbat1", {
collisionbox = {-0.1, 0.2, -0.1, 0.1, 0.4, 0.1},
visual = "mesh",
mesh = "morbat.x",
textures = {{"morbat1.png"}},
textures = {
{"morbat1.png"}
},
visual_size = {x = 2, y = 2},
view_range = 40,
walk_velocity = 0.5,
@ -147,10 +164,7 @@ mobs:register_mob("nssm:morbat1", {
jump = true,
rotate = 270,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
},
armor = 80,
drawtype = "front",
@ -158,7 +172,6 @@ mobs:register_mob("nssm:morbat1", {
lava_damage = 0,
light_damage = 0,
blood_texture="morparticle.png",
on_rightclick = nil,
fly = true,
attack_type = "dogfight",
animation = {
@ -182,7 +195,9 @@ mobs:register_mob("nssm:morbat2", {
collisionbox = {-0.1, 0.2, -0.1, 0.1, 0.4, 0.1},
visual = "mesh",
mesh = "morbat.x",
textures = {{"morbat2.png"}},
textures = {
{"morbat2.png"}
},
visual_size = {x = 2, y = 2},
view_range = 40,
walk_velocity = 0.5,
@ -197,10 +212,7 @@ mobs:register_mob("nssm:morbat2", {
jump = true,
rotate = 270,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
},
armor = 100,
drawtype = "front",
@ -208,7 +220,6 @@ mobs:register_mob("nssm:morbat2", {
lava_damage = 0,
light_damage = 0,
blood_texture="morparticle.png",
on_rightclick = nil,
fly = true,
attack_type = "explode",
explosion_radius = 3,
@ -234,7 +245,9 @@ mobs:register_mob("nssm:morbat3", {
collisionbox = {-0.1, 0.2, -0.1, 0.1, 0.4, 0.1},
visual = "mesh",
mesh = "morbat.x",
textures = {{"morbat3.png"}},
textures = {
{"morbat3.png"}
},
visual_size = {x = 2, y = 2},
view_range = 40,
walk_velocity = 0.5,
@ -249,10 +262,7 @@ mobs:register_mob("nssm:morbat3", {
jump = true,
rotate = 270,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
},
armor = 100,
drawtype = "front",
@ -260,7 +270,6 @@ mobs:register_mob("nssm:morbat3", {
lava_damage = 0,
light_damage = 0,
blood_texture = "morparticle.png",
on_rightclick = nil,
fly = true,
attack_type = "shoot",
arrow = "nssm:morarrow",

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:morwa", {
collisionbox = {-1, -0.1, -1, 1, 3, 1},
visual = "mesh",
mesh = "morwa.x",
textures = {{"morwa.png"}},
textures = {
{"morwa.png"}
},
visual_size = {x = 10, y = 10},
makes_footstep_sound = true,
view_range = 25,
@ -18,14 +20,8 @@ mobs:register_mob("nssm:morwa", {
damage = 8,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 3,
max = 4,},
{name = "nssm:wrathful_soul_fragment",
chance = 3,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 3, max = 4},
{name = "nssm:wrathful_soul_fragment", chance = 3, min = 1, max = 1},
},
armor = 50,
drawtype = "front",
@ -39,7 +35,6 @@ mobs:register_mob("nssm:morwa", {
knock_back = 1,
blood_texture = "morparticle.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogshoot",
dogshoot_switch = true,
arrow = "nssm:morarrow",
@ -59,11 +54,14 @@ mobs:register_mob("nssm:morwa", {
shoot_start =176,
shoot_end=226,
},
do_custom = function (self)
local pos = self.object:get_pos()
local light = minetest.get_node_light(pos)
--minetest.chat_send_all("Luce: "..light)
if (light < 8) then
if light < 8 then
self.object:remove()
minetest.set_node(pos, {name = "nssm:morwa_statue"})
end

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:night_master", {
collisionbox = {-0.65, -0.4, -0.65, 0.65, 0.4, 0.65},
visual = "mesh",
mesh = "moonherontrio.x",
textures = {{"moonherontrio.png"}},
textures = {
{"moonherontrio.png"}
},
visual_size = {x = 18, y = 18},
view_range = 40,
rotate = 270,
@ -28,7 +30,6 @@ mobs:register_mob("nssm:night_master", {
light_damage = 0,
blood_texture = "nssm_blood.png",
blood_amount = 50,
on_rightclick = nil,
fly = true,
attack_type = "dogfight",
animation = {
@ -43,7 +44,9 @@ mobs:register_mob("nssm:night_master", {
punch_start = 130,
punch_end = 160,
},
on_die = function(self, pos)
minetest.add_particlespawner(
200, --amount
0.1, --time
@ -60,7 +63,9 @@ mobs:register_mob("nssm:night_master", {
false, --collisiondetection
"tnt_smoke.png" --texture
)
self.object:remove()
minetest.add_entity(pos, "nssm:night_master_2")
end,
})
@ -72,7 +77,9 @@ mobs:register_mob("nssm:night_master_2", {
collisionbox = {-0.65, -0.4, -0.65, 0.65, 0.4, 0.65},
visual = "mesh",
mesh = "night_master_2.x",
textures = {{"moonherontrio.png"}},
textures = {
{"moonherontrio.png"}
},
visual_size = {x = 18, y = 18},
view_range = 40,
rotate = 270,
@ -93,7 +100,6 @@ mobs:register_mob("nssm:night_master_2", {
water_damage = 0,
lava_damage = 5,
light_damage = 0,
on_rightclick = nil,
fly = true,
attack_type = "dogfight",
animation = {
@ -108,7 +114,9 @@ mobs:register_mob("nssm:night_master_2", {
punch_start = 130,
punch_end = 160,
},
on_die = function(self, pos)
minetest.add_particlespawner(
200, --amount
0.1, --time
@ -125,7 +133,9 @@ mobs:register_mob("nssm:night_master_2", {
false, --collisiondetection
"tnt_smoke.png" --texture
)
self.object:remove()
minetest.add_entity(pos, "nssm:night_master_1")
end,
})
@ -137,7 +147,9 @@ mobs:register_mob("nssm:night_master_1", {
collisionbox = {-0.65, -0.4, -0.65, 0.65, 0.4, 0.65},
visual = "mesh",
mesh = "night_master_1.x",
textures = {{"moonherontrio.png"}},
textures = {
{"moonherontrio.png"}
},
visual_size = {x = 18, y = 18},
view_range = 40,
rotate = 270,
@ -154,25 +166,15 @@ mobs:register_mob("nssm:night_master_1", {
damage = 12,
jump = false,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 6,
max = 7,},
{name = "nssm:heron_leg",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:night_feather",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 6, max = 7},
{name = "nssm:heron_leg", chance = 1, min = 1, max = 1},
{name = "nssm:night_feather", chance = 1, min = 1, max = 1},
},
armor = 50,
drawtype = "front",
water_damage = 0,
lava_damage = 5,
light_damage = 0,
on_rightclick = nil,
fly = true,
attack_type = "dogfight",
animation = {

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:octopus", {
collisionbox = {-0.9, -0.5, -0.9, 0.9, 0.92, 0.9},
visual = "mesh",
mesh = "octopus.x",
textures = {{"octopus.png"}},
textures = {
{"octopus.png"}
},
visual_size = {x = 4, y = 4},
view_range = 25,
fly = true,
@ -23,14 +25,8 @@ mobs:register_mob("nssm:octopus", {
random = "octopus",
},
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 2,
max = 3,},
{name = "nssm:tentacle",
chance = 1,
min = 1,
max = 8,},
{name = "nssm:life_energy", chance = 1, min = 2, max = 3},
{name = "nssm:tentacle", chance = 1, min = 1, max = 8},
},
armor = 70,
drawtype = "front",
@ -41,7 +37,6 @@ mobs:register_mob("nssm:octopus", {
attack_animals = true,
knock_back = 2,
blood_texture = "nssm_blood_blue.png",
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 25,
@ -64,7 +59,9 @@ mobs:register_mob("nssm:xgaloctopus", {
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
visual = "mesh",
mesh = "octopus.x",
textures = {{"xgaloctopus.png"}},
textures = {
{"xgaloctopus.png"}
},
visual_size = {x = 1, y = 1},
view_range = 25,
fly = true,
@ -82,21 +79,14 @@ mobs:register_mob("nssm:xgaloctopus", {
random = "octopus",
},
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 2,
max = 3,},
{name = "nssm:tentacle",
chance = 1,
min = 1,
max = 8,},
{name = "nssm:life_energy", chance = 1, min = 2, max = 3},
{name = "nssm:tentacle", chance = 1, min = 1, max = 8},
},
armor = 60,
drawtype = "front",
water_damage = 0,
lava_damage = 10,
light_damage = 0,
on_rightclick = nil,
group_attack = true,
attack_animals = true,
knock_back = 2,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:phoenix", {
collisionbox = {-0.65, -0.4, -0.65, 0.65, 0.4, 0.65},
visual = "mesh",
mesh = "phoenix.x",
textures = {{"phoenix.png"}},
textures = {
{"phoenix.png"}
},
visual_size = {x = 18, y = 18},
view_range = 40,
lifetimer = 500,
@ -22,22 +24,10 @@ mobs:register_mob("nssm:phoenix", {
damage = 2,
jump = false,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 7,
max = 8,},
{name = "nssm:sun_feather",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:phoenix_tear",
chance = 1,
min = 5,
max = 6,},
{name = "nssm:phoenix_nuggets",
chance = 6,
min = 10,
max = 20,},
{name = "nssm:life_energy", chance = 1, min = 7, max = 8},
{name = "nssm:sun_feather", chance = 1, min = 1, max = 1},
{name = "nssm:phoenix_tear", chance = 1, min = 5, max = 6},
{name = "nssm:phoenix_nuggets", chance = 6, min = 10, max = 20},
},
armor = 40,
drawtype = "front",
@ -46,7 +36,6 @@ mobs:register_mob("nssm:phoenix", {
light_damage = 0,
blood_texture = "nssm_blood.png",
blood_amount = 50,
on_rightclick = nil,
fly = true,
attack_type = "shoot",
arrow = "nssm:phoenix_arrow",

View File

@ -6,7 +6,9 @@ mobs:register_mob("nssm:pumpboom_small", {
visual = "mesh",
mesh = "pumpboom.x",
rotate = 270,
textures = {{"pumpboom.png"}},
textures = {
{"pumpboom.png"}
},
visual_size = {x = 3, y = 3},
explosion_radius = 4,
makes_footstep_sound = true,
@ -20,14 +22,8 @@ mobs:register_mob("nssm:pumpboom_small", {
damage = 1.5,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:black_powder",
chance = 2,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:black_powder", chance = 2, min = 1, max = 2},
},
armor = 100,
drawtype = "front",
@ -39,7 +35,6 @@ mobs:register_mob("nssm:pumpboom_small", {
knock_back = 2,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "explode",
animation = {
speed_normal = 25,
@ -63,7 +58,9 @@ mobs:register_mob("nssm:pumpboom_medium", {
visual = "mesh",
mesh = "pumpboom.x",
rotate = 270,
textures = {{"pumpboom.png"}},
textures = {
{"pumpboom.png"}
},
visual_size = {x = 5, y = 5},
makes_footstep_sound = true,
view_range = 25,
@ -76,14 +73,8 @@ mobs:register_mob("nssm:pumpboom_medium", {
damage = 1.5,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 2,
max = 3,},
{name = "nssm:black_powder",
chance = 2,
min = 1,
max = 3,},
{name = "nssm:life_energy", chance = 1, min = 2, max = 3},
{name = "nssm:black_powder", chance = 2, min = 1, max = 3},
},
armor = 100,
drawtype = "front",
@ -95,7 +86,6 @@ mobs:register_mob("nssm:pumpboom_medium", {
knock_back = 2,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "explode",
animation = {
speed_normal = 25,
@ -120,7 +110,9 @@ mobs:register_mob("nssm:pumpboom_large", {
mesh = "pumpboom.x",
rotate = 270,
explosion_radius = 8,
textures = {{"pumpboom.png"}},
textures = {
{"pumpboom.png"}
},
visual_size = {x = 8, y = 8},
makes_footstep_sound = true,
view_range = 30,
@ -132,14 +124,8 @@ mobs:register_mob("nssm:pumpboom_large", {
damage = 1.5,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 3,
max = 4,},
{name = "nssm:black_powder",
chance = 2,
min = 2,
max = 4,},
{name = "nssm:life_energy", chance = 1, min = 3, max = 4},
{name = "nssm:black_powder", chance = 2, min = 2, max = 4},
},
armor = 100,
drawtype = "front",
@ -151,7 +137,6 @@ mobs:register_mob("nssm:pumpboom_large", {
knock_back = 2,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "explode",
animation = {
speed_normal = 25,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:pumpking", {
collisionbox = {-0.4, 0.00, -0.4, 0.4, 3.2, 0.4},
visual = "mesh",
mesh = "pumpking.x",
textures = {{"pumpking.png"}},
textures = {
{"pumpking.png"}
},
visual_size = {x = 2.5, y = 2.5},
makes_footstep_sound = true,
lifetimer = 500,
@ -21,18 +23,9 @@ mobs:register_mob("nssm:pumpking", {
damage = 13,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 7,
max = 9,},
{name = "nssm:cursed_pumpkin_seed",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:black_powder",
chance = 1,
min = 9,
max = 12,},
{name = "nssm:life_energy", chance = 1, min = 7, max = 9},
{name = "nssm:cursed_pumpkin_seed", chance = 1, min = 1, max = 1},
{name = "nssm:black_powder", chance = 1, min = 9, max = 12},
},
armor = 40,
drawtype = "front",
@ -44,7 +37,6 @@ mobs:register_mob("nssm:pumpking", {
stepheight = 2.1,
knock_back = 0,
jump_height = 12,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
stand_start = 165, stand_end = 210,
@ -53,22 +45,34 @@ mobs:register_mob("nssm:pumpking", {
punch_start = 300, punch_end = 330,
speed_normal = 15, speed_run = 15,
},
on_die=function(self,pos)
self.object:remove()
minetest.after(0.2, function(pos)
tnt.boom(pos, {damage_radius = 5, radius = 4, ignore_protection = false})
end, pos)
end,
custom_attack = function(self)
self.pumpking_timer = (self.pumpking_timer or os.time())
self.pumpking_timer = self.pumpking_timer or os.time()
if (os.time() - self.pumpking_timer) > 3 then
mobs:set_animation(self, "punch")
self.pumpking_timer = os.time()
local s = self.object:get_pos()
local p = self.attack:get_pos()
p.y = p.y + 1.5
s.y = s.y + 1.5
if minetest.line_of_sight(p, s) == true then
-- play attack sound
if self.sounds.attack then
minetest.sound_play(self.sounds.attack, {
@ -76,12 +80,17 @@ mobs:register_mob("nssm:pumpking", {
max_hear_distance = self.sounds.distance
})
end
local pos1 = {x=s.x+math.random(-1,1), y=s.y-1.5, z=s.z+math.random(-1,1)}
local pos1 = {
x = s.x + math.random(-1, 1),
y = s.y - 1.5,
z = s.z + math.random(-1, 1)
}
minetest.after(1, function(pos1)
minetest.set_node(pos1, {name = "nssm:pumpbomb"})
minetest.get_node_timer(pos1):start(2)
end,
pos1)
end, pos1)
end
end
end

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:sand_bloco", {
collisionbox = {-0.5, -0.2, -0.5, 0.5, 1.3, 0.5},
visual = "mesh",
mesh = "sand_bloco.x",
textures = {{"sand_bloco.png"}},
textures = {
{"sand_bloco.png"}
},
visual_size = {x = 4, y = 4},
makes_footstep_sound = true,
view_range = 14,
@ -20,18 +22,9 @@ mobs:register_mob("nssm:sand_bloco", {
reach = 1.5,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 1,},
{name = "default:sandstone",
chance = 1,
min = 2,
max = 3,},
{name = "nssm:sand_bloco_skin",
chance = 2,
min = 1,
max = 3,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 1},
{name = "default:sandstone", chance = 1, min = 2, max = 3},
{name = "nssm:sand_bloco_skin", chance = 2, min = 1, max = 3},
},
armor = 40,
drawtype = "front",
@ -42,7 +35,6 @@ mobs:register_mob("nssm:sand_bloco", {
attack_animals = true,
knock_back = 2,
blood_texture = "stone_blood.png",
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 20,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:sandworm", {
collisionbox = {-0.4, -0.2, -0.4, 0.4, 1.90, 0.4},
visual = "mesh",
mesh = "sandworm.x",
textures = {{"sandworm.png"}},
textures = {
{"sandworm.png"}
},
visual_size = {x = 4, y = 4},
makes_footstep_sound = false,
view_range = 17,
@ -21,18 +23,9 @@ mobs:register_mob("nssm:sandworm", {
},
jump = false,
drops = {
{name = "nssm:worm_flesh",
chance = 2,
min = 1,
max = 3,},
{name = "nssm:sandworm_skin",
chance = 2,
min = 1,
max = 3,},
{name = "nssm:life_energy",
chance = 1,
min = 2,
max = 3,},
{name = "nssm:worm_flesh", chance = 2, min = 1, max = 3},
{name = "nssm:sandworm_skin", chance = 2, min = 1, max = 3},
{name = "nssm:life_energy", chance = 1, min = 2, max = 3},
},
armor = 60,
drawtype = "front",
@ -44,7 +37,6 @@ mobs:register_mob("nssm:sandworm", {
knock_back = 2,
blood_texture = "nssm_blood_blue.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 25,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:scrausics", {
collisionbox = {-0.4, -0.3, -0.4, 0.4, 0.3, 0.4},
visual = "mesh",
mesh = "scrausics.x",
textures = {{"scrausics.png"}},
textures = {
{"scrausics.png"}
},
visual_size = {x = 10, y = 10},
view_range = 35,
rotate = 270,
@ -21,14 +23,8 @@ mobs:register_mob("nssm:scrausics", {
damage = 4,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 3,
max = 4,},
{name = "nssm:raw_scrausics_wing",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 3, max = 4},
{name = "nssm:raw_scrausics_wing", chance = 1, min = 1, max = 2},
},
armor = 80,
drawtype = "front",
@ -39,7 +35,6 @@ mobs:register_mob("nssm:scrausics", {
attack_animals = true,
knock_back = 2,
blood_texture = "nssm_blood.png",
on_rightclick = nil,
fly = true,
attack_type = "dogfight",
animation = {

View File

@ -5,7 +5,10 @@ mobs:register_mob("nssm:signosigno", {
collisionbox = {-0.2, 0.00, -0.2, 0.2, 1.6, 0.2},
visual = "mesh",
mesh = "signosigno.x",
textures = {{"signosigno.png"}, {"signosigno2.png"}},
textures = {
{"signosigno.png"},
{"signosigno2.png"}
},
visual_size = {x = 6, y = 6},
makes_footstep_sound = false,
view_range = 15,
@ -17,14 +20,8 @@ mobs:register_mob("nssm:signosigno", {
reach = 1.5,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:slothful_soul_fragment",
chance = 20,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:slothful_soul_fragment", chance = 20, min = 1, max = 1},
},
armor = 40,
drawtype = "front",
@ -35,7 +32,6 @@ mobs:register_mob("nssm:signosigno", {
attack_animals = true,
knock_back = 4,
blood_texture = "morparticle.png",
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 20,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:snow_biter", {
collisionbox = {-0.5, 0, -0.5, 0.5, 0.60, 0.5},
visual = "mesh",
mesh = "snow_biter.x",
textures = {{"snow_biter.png"}},
textures = {
{"snow_biter.png"}
},
visual_size = {x = 6, y = 6},
makes_footstep_sound = true,
view_range = 18,
@ -18,26 +20,13 @@ mobs:register_mob("nssm:snow_biter", {
sounds = {
random = "snow_biter",
},
--pathfinding = true,
damage = 4,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 2,
max = 3},
{name = "nssm:frosted_amphibian_heart",
chance = 2,
min = 1,
max = 1},
{name = "nssm:amphibian_ribs",
chance = 2,
min = 1,
max = 1},
{name = "nssm:little_ice_tooth",
chance = 2,
min = 0,
max = 4},
{name = "nssm:life_energy", chance = 1, min = 2, max = 3},
{name = "nssm:frosted_amphibian_heart", chance = 2, min = 1, max = 1},
{name = "nssm:amphibian_ribs", chance = 2, min = 1, max = 1},
{name = "nssm:little_ice_tooth", chance = 2, min = 0, max = 4},
},
armor = 80,
drawtype = "front",
@ -49,7 +38,6 @@ mobs:register_mob("nssm:snow_biter", {
knock_back = 4,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
double_melee_attack = true,
animation = {

View File

@ -6,7 +6,9 @@ mobs:register_mob("nssm:spiderduck", {
visual = "mesh",
rotate = 270,
mesh = "spiderduck.x",
textures = {{"spiderduck.png"}},
textures = {
{"spiderduck.png"}
},
visual_size = {x = 2, y = 2},
fear_height = 4,
makes_footstep_sound = true,
@ -19,26 +21,11 @@ mobs:register_mob("nssm:spiderduck", {
damage = 6,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:duck_legs",
chance = 1,
min = 1,
max = 8,},
{name = "nssm:silk_gland",
chance = 2,
min = 1,
max = 2,},
{name = "nssm:black_duck_feather",
chance = 3,
min = 1,
max = 4,},
{name = "nssm:duck_beak",
chance = 5,
min = 1,
max = 1,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:duck_legs", chance = 1, min = 1, max = 8},
{name = "nssm:silk_gland", chance = 2, min = 1, max = 2},
{name = "nssm:black_duck_feather", chance = 3, min = 1, max = 4},
{name = "nssm:duck_beak", chance = 5, min = 1, max = 1},
},
armor = 80,
drawtype = "front",
@ -50,7 +37,6 @@ mobs:register_mob("nssm:spiderduck", {
knock_back = 2,
blood_texture = "nssm_blood.png",
stepheight = 1.5,
on_rightclick = nil,
dogshoot_switch = true,
attack_type = "dogshoot",
arrow = "nssm:webball",

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:stone_eater", {
collisionbox = {-0.3, -0.05, -0.3, 0.3, 0.65, 0.3},
visual = "mesh",
mesh = "stone_eater.x",
textures = {{"stone_eater.png"}},
textures = {
{"stone_eater.png"}
},
visual_size = {x = 10, y = 10},
makes_footstep_sound = false,
view_range = 16,
@ -18,18 +20,9 @@ mobs:register_mob("nssm:stone_eater", {
damage = 5,
reach = 1.5,
drops = {
{name = "default:stone",
chance = 2,
min = 1,
max = 3,},
{name = "nssm:life_energy",
chance = 1,
min = 2,
max = 3,},
{name = "nssm:stoneater_mandible",
chance = 2,
min = 1,
max = 4,},
{name = "default:stone", chance = 2, min = 1, max = 3},
{name = "nssm:life_energy", chance = 1, min = 2, max = 3},
{name = "nssm:stoneater_mandible", chance = 2, min = 1, max = 4},
},
armor = 40,
drawtype = "front",
@ -39,9 +32,15 @@ mobs:register_mob("nssm:stone_eater", {
attack_animals = true,
knock_back = 0,
blood_texture = "stone_blood.png",
immune_to={{'default:sword_stone', -2},{'default:stone', -2}, {'default:cobble', -2}, {'default:axe_stone', -2}, {'default:shovel_stone', -2}, {'default:pick_stone', -2}},
immune_to={
{'default:sword_stone', -2},
{'default:stone', -2},
{'default:cobble', -2},
{'default:axe_stone', -2},
{'default:shovel_stone', -2},
{'default:pick_stone', -2}
},
light_damage = 0,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 20,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:swimming_duck", {
collisionbox = {-0.35, -0.30, -0.35, 0.35, 0.7, 0.35},
visual = "mesh",
mesh = "swimming_duck.x",
textures = {{"swimming_duck.png"}},
textures = {
{"swimming_duck.png"}
},
visual_size = {x = 1.5, y = 1.5},
view_range = 25,
floats = 1,
@ -20,22 +22,10 @@ mobs:register_mob("nssm:swimming_duck", {
random = "duck",
},
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:duck_legs",
chance = 1,
min = 1,
max = 2,},
{name = "nssm:duck_beak",
chance = 5,
min = 1,
max = 1,},
{name = "nssm:duck_feather",
chance = 6,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:duck_legs", chance = 1, min = 1, max = 2},
{name = "nssm:duck_beak", chance = 5, min = 1, max = 1},
{name = "nssm:duck_feather", chance = 6, min = 1, max = 2},
},
armor = 80,
drawtype = "front",
@ -46,7 +36,6 @@ mobs:register_mob("nssm:swimming_duck", {
attack_animals = true,
knock_back = 4,
blood_texture = "nssm_blood.png",
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 25,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:tarantula", {
collisionbox = {-0.5, 0.00, -0.5, 0.5, 0.9, 0.5},
visual = "mesh",
mesh = "tarantula.x",
textures = {{"tarantula.png"}},
textures = {
{"tarantula.png"}
},
visual_size = {x = 8, y = 8},
makes_footstep_sound = true,
view_range = 20,
@ -20,10 +22,7 @@ mobs:register_mob("nssm:tarantula", {
damage = 8,
jump = true,
drops = {
{name = "nssm:super_silk_gland",
chance = 1,
min = 3,
max = 5,},
{name = "nssm:super_silk_gland", chance = 1, min = 3, max = 5},
},
armor = 60,
drawtype = "front",
@ -34,7 +33,6 @@ mobs:register_mob("nssm:tarantula", {
blood_texture = "nssm_blood_blue.png",
stepheight = 1.1,
light_damage = 0,
on_rightclick = nil,
dogshoot_switch = true,
attack_type = "dogshoot",
arrow = "nssm:thickwebball",
@ -54,8 +52,11 @@ mobs:register_mob("nssm:tarantula", {
shoot_start = 180,
shoot_end = 200,
},
on_die = function(self, pos)
self.object:remove()
minetest.add_particlespawner(
200, --amount
0.1, --time
@ -72,6 +73,7 @@ mobs:register_mob("nssm:tarantula", {
false, --collisiondetection
"tnt_smoke.png" --texture
)
minetest.add_entity(pos, "nssm:tarantula_propower")
end,
})
@ -84,7 +86,9 @@ mobs:register_mob("nssm:tarantula_propower", {
collisionbox = {-0.5, 0.00, -0.5, 0.5, 1, 0.5},
visual = "mesh",
mesh = "tarantula_propower.x",
textures = {{"tarantula.png"}},
textures = {
{"tarantula.png"}
},
visual_size = {x = 10, y = 10},
makes_footstep_sound = true,
view_range = 30,
@ -98,26 +102,11 @@ mobs:register_mob("nssm:tarantula_propower", {
damage = 12,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 16,
max = 18,},
{name = "nssm:spider_leg",
chance = 1,
min = 1,
max = 8,},
{name = "nssm:tarantula_chelicerae",
chance = 1,
min = 1,
max = 1,},
{name = "nssm:silk_gland",
chance = 2,
min = 1,
max = 3,},
{name = "nssm:spider_meat",
chance = 2,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 16, max = 18},
{name = "nssm:spider_leg", chance = 1, min = 1, max = 8},
{name = "nssm:tarantula_chelicerae", chance = 1, min = 1, max = 1},
{name = "nssm:silk_gland", chance = 2, min = 1, max = 3},
{name = "nssm:spider_meat", chance = 2, min = 1, max = 2},
},
armor = 40,
drawtype = "front",
@ -128,7 +117,6 @@ mobs:register_mob("nssm:tarantula_propower", {
blood_texture = "nssm_blood_blue.png",
stepheight = 2.1,
light_damage = 0,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 20,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:uloboros", {
collisionbox = {-0.5, 0.00, -0.5, 0.5, 0.8, 0.5},
visual = "mesh",
mesh = "uloboros.x",
textures = {{"uloboros.png"}},
textures = {
{"uloboros.png"}
},
visual_size = {x = 4, y = 4},
makes_footstep_sound = true,
view_range = 22,
@ -20,22 +22,10 @@ mobs:register_mob("nssm:uloboros", {
reach = 2,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 1,
max = 4,},
{name = "nssm:spider_leg",
chance = 2,
min = 1,
max = 8,},
{name = "nssm:silk_gland",
chance = 4,
min = 1,
max = 3,},
{name = "nssm:spider_meat",
chance = 4,
min = 1,
max = 2,},
{name = "nssm:life_energy", chance = 1, min = 1, max = 4},
{name = "nssm:spider_leg", chance = 2, min = 1, max = 8},
{name = "nssm:silk_gland", chance = 4, min = 1, max = 3},
{name = "nssm:spider_meat", chance = 4, min = 1, max = 2},
},
armor = 80,
drawtype = "front",
@ -47,7 +37,6 @@ mobs:register_mob("nssm:uloboros", {
knock_back = 2,
blood_texture = "nssm_blood_blue.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 20,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:werewolf", {
collisionbox = {-0.85, -0.01, -0.85, 0.85, 3.50, 0.85},
visual = "mesh",
mesh = "werewolf.x",
textures = {{"werewolf.png"}},
textures = {
{"werewolf.png"}
},
visual_size = {x = 4, y = 4},
makes_footstep_sound = true,
view_range = 30,
@ -18,18 +20,9 @@ mobs:register_mob("nssm:werewolf", {
damage = 5,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 3,
max = 4},
{name = "nssm:werewolf_leg",
chance = 2,
min = 1,
max = 2},
{name = "nssm:wolf_fur",
chance = 2,
min = 1,
max = 1},
{name = "nssm:life_energy", chance = 1, min = 3, max = 4},
{name = "nssm:werewolf_leg", chance = 2, min = 1, max = 2},
{name = "nssm:wolf_fur", chance = 2, min = 1, max = 1},
},
armor = 80,
drawtype = "front",
@ -41,7 +34,6 @@ mobs:register_mob("nssm:werewolf", {
knock_back = 2,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,

View File

@ -5,7 +5,9 @@ mobs:register_mob("nssm:white_werewolf", {
collisionbox = {-0.85, -0.01, -0.85, 0.85, 3.50, 0.85},
visual = "mesh",
mesh = "white_werewolf.x",
textures = {{"white_werewolf.png"}},
textures = {
{"white_werewolf.png"}
},
visual_size = {x = 4, y = 4},
makes_footstep_sound = true,
view_range = 30,
@ -18,18 +20,9 @@ mobs:register_mob("nssm:white_werewolf", {
damage = 5,
jump = true,
drops = {
{name = "nssm:life_energy",
chance = 1,
min = 3,
max = 4},
{name = "nssm:werewolf_leg",
chance = 2,
min = 1,
max = 2},
{name = "nssm:white_wolf_fur",
chance = 2,
min = 1,
max = 1},
{name = "nssm:life_energy", chance = 1, min = 3, max = 4},
{name = "nssm:werewolf_leg", chance = 2, min = 1, max = 2},
{name = "nssm:white_wolf_fur", chance = 2, min = 1, max = 1},
},
armor = 80,
drawtype = "front",
@ -41,7 +34,6 @@ mobs:register_mob("nssm:white_werewolf", {
knock_back = 2,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
on_rightclick = nil,
attack_type = "dogfight",
animation = {
speed_normal = 15,

View File

@ -10,18 +10,24 @@ nssm.safebones = minetest.setting_getbool("nssm.safebones") or false
nssm.cryosave = minetest.setting_getbool("nssm.cryosave") or false
function nssm:virulence(mobe)
if not nssm.lessvirulent then
return 0
end
return math.ceil(100 / mobe.hp_max)
end
function nssm:affectbones(mobe) -- as function for adaptable heuristic
return not nssm.safebones
end
function drops(drop)
if drop then
drop:setvelocity({
x = math.random(-10, 10) / 9,
y = 5,
@ -30,20 +36,22 @@ function drops(drop)
end
end
function perpendicular_vector(vec) --returns a vector rotated of 90° in 2D
local ang = math.pi / 2
local c = math.cos(ang)
local s = math.sin(ang)
local i = vec.x * c - vec.z * s
local k = vec.x * s + vec.z * c
local j = 0
vec = {x=i, y=j, z=k}
return vec
return {x = i, y = j, z = k}
end
function add_entity_and_particles(entity, pos, particles, multiplier)
minetest.add_particlespawner({
amount = 100*multiplier,
time = 2,
@ -61,55 +69,78 @@ function add_entity_and_particles(entity, pos, particles, multiplier)
vertical = false,
texture = particles,
})
minetest.add_entity(pos, entity)
end
-- get node but use fallback for nil or unknown
function node_ok(pos, fallback)
fallback = fallback or "default:dirt"
local node = minetest.get_node_or_nil(pos)
if not node then
return minetest.registered_nodes[fallback]
end
if minetest.registered_nodes[node.name] then
return node
end
return minetest.registered_nodes[fallback]
end
function dist_pos(p, s)
local v = {x = math.abs(s.x-p.x), y = math.abs(s.y-p.y), z = math.abs(s.z-p.z)}
local r = math.sqrt(v.x^2+v.y^2+v.z^2)
return r
local v = {
x = math.abs(s.x - p.x),
y = math.abs(s.y - p.y),
z = math.abs(s.z - p.z)
}
return math.sqrt(v.x ^ 2 + v.y ^ 2 + v.z ^ 2)
end
--check_for_death functions customized for monsters who respawns (Masticone)
function check_for_death_hydra(self)
local hp = self.object:get_hp()
if hp > 0 then
self.health = hp
if self.sounds.damage ~= nil then
minetest.sound_play(self.sounds.damage,{
object = self.object,
max_hear_distance = self.sounds.distance
})
end
return false
end
local pos = self.object:get_pos()
local obj = nil
if self.sounds.death ~= nil then
minetest.sound_play(self.sounds.death,{
object = self.object,
max_hear_distance = self.sounds.distance
})
end
self.object:remove()
return true
end
function round(n)
if (n > 0) then
return n % 1 >= 0.5 and math.ceil(n) or math.floor(n)
else
@ -119,7 +150,9 @@ function round(n)
end
end
function explosion_particles(pos, exp_radius)
minetest.add_particlespawner(
100*exp_radius/2, --amount
0.1, --time
@ -137,198 +170,8 @@ function explosion_particles(pos, exp_radius)
"tnt_smoke.png" --texture
)
end
--[[
function explosion(pos, exp_radius, fire, kamehameha_bad)
local radius = exp_radius
-- if area protected or near map limits then no blast damage
if minetest.is_protected(pos, "")
or not within_limits(pos, radius) then
return
end
--sound
minetest.sound_play("boom", {
pos = pos,
max_hear_distance = exp_radius*4,
})
--particles:
explosion_particles(pos, exp_radius)
--Damages entities around (not the player)
local objects = minetest.get_objects_inside_radius(pos, exp_radius)
for _,obj in ipairs(objects) do
local obj_p = obj:get_pos()
local vec = {x=obj_p.x-pos.x, y=obj_p.y-pos.y, z=obj_p.z-pos.z}
local dist = (vec.x^2+vec.y^2+vec.z^2)^0.5
local damage = (-exp_radius*dist+exp_radius^2)*2
if not kamehameha_bad then
if obj:is_player() then
obj:set_hp(obj:get_hp()-damage)
elseif obj:get_luaentity().health then
obj:get_luaentity().health = obj:get_luaentity().health - damage
check_for_death(obj:get_luaentity())
end
else
if (obj:get_luaentity()) then
local name = obj:get_luaentity().name
if (name~="nssm:morvalar0") and (name~="nssm:morvalar5") then
if obj:is_player() then
obj:set_hp(obj:get_hp()-damage)
elseif obj:get_luaentity().health then
obj:get_luaentity().health = obj.get_luaentity().health - damage
check_for_death(obj:get_luaentity())
end
end
end
end
end
--damages blocks around and if necessary put some fire
pos = vector.round(pos) -- voxelmanip doesn't work properly unless pos is rounded ?!?!
local vm = VoxelManip()
local minp, maxp = vm:read_from_map(vector.subtract(pos, radius), vector.add(pos, radius))
local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
local p = {}
local pr = PseudoRandom(os.time())
--remove everything near the center of the explosion
for dz=-radius,radius do
for dy=-radius,radius do
local vi = a:index(pos.x + (-radius), pos.y + dy, pos.z + dz)
for dx=-radius,radius do
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
if (dx * dx) + (dy * dy) + (dz * dz) <= (radius * radius) + pr:next(-radius, radius)
and data[vi] ~= c_air
and data[vi] ~= c_ignore
and data[vi] ~= c_obsidian
and data[vi] ~= c_brick
and data[vi] ~= c_chest then
local n = node_ok(p).name
local on_blast = minetest.registered_nodes[n].on_blast
if on_blast then
return on_blast(p)
end
if minetest.get_item_group(n, "unbreakable") ~= 1 then
-- if chest then drop items inside
if n == "default:chest"
or n == "3dchest:chest"
or n == "bones:bones" then
local meta = minetest.get_meta(p)
local inv = meta:get_inventory()
for i = 1, inv:get_size("main") do
local m_stack = inv:get_stack("main", i)
local obj = minetest.add_item(p, m_stack)
if obj then
obj:set_velocity({
x = math.random(-2, 2),
y = 7,
z = math.random(-2, 2)
})
end
end
end
-- after effects
if fire > 0
and (minetest.registered_nodes[n].groups.flammable
or math.random(1, 100) <= 3) then
minetest.set_node(p, {name = "fire:basic_flame"})
else
local dist = round(((pos.x-p.x)^2 + (pos.y-p.y)^2 + (pos.z-p.z)^2)^1/2)
local prob = 2/dist
if math.random(1,100)<=prob*100 then
minetest.remove_node(p)
end
end
end
end
vi = vi+1
end
end
end
end
]]
-- SPECIAL ABILITIES OF SOME MOBS
--[[function digging_ability(
self, --the entity of the mob
group, --group of the blocks the mob can dig: nil=everything
max_vel, --max velocity of the mob
dim --vector representing the dimensions of the mob
)
--if math.random(1,nssm:virulence(self)) ~= 1 then return end
local v = self.object:get_velocity()
local pos = self.object:get_pos()
if minetest.is_protected(pos, "") then
return
end
local h = dim.y
local max = 0
--local posmax = 0 -- 1 = x, -1=-x, 2 = z, -2 = -z
local yaw = (self.object:get_yaw() + self.rotate) or 0
local x = math.sin(yaw)*-1
local z = math.cos(yaw)
local i = 1
local i1 = -1
local k = 1
local k1 = -1
local multiplier = 2
if x>0 then
i = round(x*max_vel)*multiplier
else
i1 = round(x*max_vel)*multiplier
end
if z>0 then
k = round(z*max_vel)*multiplier
else
k1 = round(z*max_vel)*multiplier
end
for dx = i1, i do
for dy = 0, h do
for dz = k1, k do
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(p).name
--local up = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
if group == nil then
if minetest.get_item_group(n, "unbreakable") == 1 or minetest.is_protected(p, "") or (n == "bones:bones" and not nssm:affectbones(self) ) then
else
--minetest.set_node(p, {name="air"})
minetest.remove_node(p)
end
else
if (minetest.get_item_group(n, group)==1) and (minetest.get_item_group(n, "unbreakable") ~= 1) and (n == "bones:bones" and not (minetest.is_protected(p, "")) ) then
--minetest.set_node(p, {name="air"})
minetest.remove_node(p)
end
end
end
end
end
end
]]--
function digging_attack(
self, --the entity of the mob
group, --group of the blocks the mob can dig: nil=everything
@ -338,25 +181,27 @@ function digging_attack(
--if math.random(1,nssm:virulence(self)) ~= 1 then return end
if self.attack and self.attack:is_player() then
local s = self.object:get_pos()
local p = self.attack:get_pos()
local dir = vector.subtract(p,s)
dir = vector.normalize(dir)
local per = perpendicular_vector(dir)
dir = vector.normalize(dir)
local per = perpendicular_vector(dir)
local posp = vector.add(s,dir)
--minetest.chat_send_all("La mia posizione:"..minetest.pos_to_string(s))
--minetest.chat_send_all("La posizione davanti:"..minetest.pos_to_string(posp))
posp = vector.subtract(posp,per)
for j = 1,3 do
--minetest.chat_send_all("pos1:"..minetest.pos_to_string(posp).." per.y= "..dim.y)
if minetest.is_protected(posp, "") then
return
end
local pos1 = posp
for i = 0, dim.y do
@ -365,18 +210,26 @@ function digging_attack(
local n = minetest.get_node(pos1).name
--local up = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
if group == nil then
if minetest.get_item_group(n, "unbreakable") == 1 or minetest.is_protected(pos1, "") or (n == "bones:bones" and not nssm:affectbones(self) ) then
if minetest.get_item_group(n, "unbreakable") == 1
or minetest.is_protected(pos1, "")
or (n == "bones:bones" and not nssm:affectbones(self) ) then
else
--minetest.set_node(p, {name="air"})
minetest.remove_node(pos1)
end
else
if ((minetest.get_item_group(n, group)==1) and (minetest.get_item_group(n, "unbreakable") ~= 1) and (n ~= "bones:bones") and not (minetest.is_protected(pos1, "")) ) then
if ((minetest.get_item_group(n, group)==1)
and (minetest.get_item_group(n, "unbreakable") ~= 1)
and (n ~= "bones:bones")
and not (minetest.is_protected(pos1, "")) ) then
--minetest.set_node(p, {name="air"})
minetest.remove_node(pos1)
end
end
pos1.y = pos1.y + 1
end
posp.y = s.y
@ -395,7 +248,6 @@ function putting_ability( --puts under the mob the block defined as 'p_block'
--if math.random(1,nssm:virulence(self)) ~= 1 then return end
local v = self.object:get_velocity()
local dx = 0
local dz = 0
@ -415,23 +267,44 @@ function putting_ability( --puts under the mob the block defined as 'p_block'
local pos = self.object:get_pos()
local pos1
pos.y=pos.y - 1
pos1 = {x = pos.x + dx, y = pos.y, z = pos.z + dz}
local n = minetest.get_node(pos).name
local n1 = minetest.get_node(pos1).name
local oldmetainf = {minetest.get_meta(pos):to_table(),minetest.get_meta(pos1):to_table() }
if n~=p_block and not minetest.is_protected(pos, "") and (n == "bones:bones" and nssm:affectbones(self) ) and n~="air" then
local oldmetainf = {
minetest.get_meta(pos):to_table(),
minetest.get_meta(pos1):to_table()
}
if n ~= p_block and not minetest.is_protected(pos, "")
and (n == "bones:bones"
and nssm:affectbones(self) )
and n ~= "air" then
minetest.set_node(pos, {name=p_block})
if nssm.cryosave then
local metai = minetest.get_meta(pos)
metai:from_table(oldmetainf[1]) -- this is enough to save the meta
metai:set_string("nssm", n)
end
end
if n1~=p_block and not minetest.is_protected(pos1, "") and (n == "bones:bones" and nssm:affectbones(self) ) and n~="air" then
if n1 ~= p_block and not minetest.is_protected(pos1, "")
and (n == "bones:bones" and nssm:affectbones(self) )
and n ~= "air" then
minetest.set_node(pos1, {name = p_block})
if nssm.cryosave then
local metai = minetest.get_meta(pos1)
metai:from_table(oldmetainf[2]) -- this is enough to save the meta
metai:set_string("nssm",n1)
end
@ -445,22 +318,29 @@ function webber_ability( --puts randomly around the block defined as w_block
radius --max distance the block can be put
)
if (nssm:virulence(self)~=0) and (math.random(1,nssm:virulence(self)) ~= 1) then return end
if (nssm:virulence(self) ~= 0)
and (math.random(1, nssm:virulence(self)) ~= 1) then return end
local pos = self.object:get_pos()
if (math.random(1, 55) == 1) then
local dx = math.random(1, radius)
local dz = math.random(1, radius)
local p = {x = pos.x + dx, y = pos.y - 1, z = pos.z + dz}
local t = {x = pos.x + dx, y = pos.y, z = pos.z + dz}
local n = minetest.get_node(p).name
local k = minetest.get_node(t).name
if ((n~="air")and(k=="air")) and not minetest.is_protected(t, "") then
if ((n ~= "air")
and(k == "air"))
and not minetest.is_protected(t, "") then
minetest.set_node(t, {name = w_block})
end
end
end
function midas_ability( --ability to transform every blocks it touches in the m_block block
self, --the entity of the mob
m_block,
@ -481,7 +361,6 @@ function midas_ability( --ability to transform every blocks it touches in the m
local yaw = (self.object:get_yaw() + self.rotate) or 0
local x = math.sin(yaw) * -1
local z = math.cos(yaw)
local i = 1
local i1 = -1
local k = 1
@ -504,6 +383,7 @@ function midas_ability( --ability to transform every blocks it touches in the m
for dx = i1, i do
for dy = -1, height do
for dz = k1, k do
local p = {x = pos.x + dx, y = pos.y + dy, z = pos.z + dz}
local n = minetest.get_node(p).name
@ -530,9 +410,10 @@ loss_prob["default:cobble"] = 3
loss_prob["default:dirt"] = 4
local tnt_radius = tonumber(minetest.setting_get("tnt_radius") or 3)
local cid_data = {}
minetest.after(0, function()
for name, def in pairs(minetest.registered_nodes) do
cid_data[minetest.get_content_id(name)] = {
name = name,
@ -543,24 +424,33 @@ minetest.after(0, function()
end
end)
local function rand_pos(center, pos, radius)
local def
local reg_nodes = minetest.registered_nodes
local i = 0
repeat
-- Give up and use the center if this takes too long
if i > 4 then
pos.x, pos.z = center.x, center.z
break
end
pos.x = center.x + math.random(-radius, radius)
pos.z = center.z + math.random(-radius, radius)
def = reg_nodes[minetest.get_node(pos).name]
i = i + 1
until def and not def.walkable
end
local function add_effects(pos, radius, drops)
minetest.add_particle({
pos = pos,
velocity = vector.new(),
@ -571,6 +461,7 @@ local function add_effects(pos, radius, drops)
vertical = false,
texture = "tnt_boom.png",
})
minetest.add_particlespawner({
amount = 64,
time = 0.5,
@ -591,11 +482,17 @@ local function add_effects(pos, radius, drops)
-- one of them to use as texture
local texture = "tnt_blast.png" --fallback texture
local most = 0
for name, stack in pairs(drops) do
local count = stack:get_count()
if count > most then
most = count
local def = minetest.registered_nodes[name]
if def and def.tiles and def.tiles[1] then
texture = def.tiles[1]
end
@ -620,18 +517,29 @@ local function add_effects(pos, radius, drops)
})
end
local function eject_drops(drops, pos, radius)
local drop_pos = vector.new(pos)
for _, item in pairs(drops) do
local count = math.min(item:get_count(), item:get_stack_max())
while count > 0 do
local take = math.max(1,math.min(radius * radius,
count,
item:get_stack_max()))
rand_pos(pos, drop_pos, radius)
local dropitem = ItemStack(item)
dropitem:set_count(take)
local obj = minetest.add_item(drop_pos, dropitem)
if obj then
obj:get_luaentity().collect = true
obj:set_acceleration({x = 0, y = -10, z = 0})
@ -639,23 +547,28 @@ local function eject_drops(drops, pos, radius)
y = math.random(0, 10),
z = math.random(-3, 3)})
end
count = count - take
end
end
end
local function calc_velocity(pos1, pos2, old_vel, power)
-- Avoid errors caused by a vector of zero length
if vector.equals(pos1, pos2) then
return old_vel
end
local vel = vector.direction(pos1, pos2)
vel = vector.normalize(vel)
vel = vector.multiply(vel, power)
-- Divide by distance
local dist = vector.distance(pos1, pos2)
dist = math.max(dist, 1)
vel = vector.divide(vel, dist)
@ -671,19 +584,25 @@ local function calc_velocity(pos1, pos2, old_vel, power)
-- Limit to terminal velocity
dist = vector.length(vel)
if dist > 250 then
vel = vector.divide(vel, dist / 250)
end
return vel
end
local function entity_physics(pos, radius, drops)
local objs = minetest.get_objects_inside_radius(pos, radius)
for _, obj in pairs(objs) do
local obj_pos = obj:get_pos()
local dist = math.max(1, vector.distance(pos, obj_pos))
local damage = (4 / dist) * radius
if obj:is_player() then
-- currently the engine has no method to set
-- player velocity. See #2960
@ -691,7 +610,9 @@ local function entity_physics(pos, radius, drops)
local dir = vector.normalize(vector.subtract(obj_pos, pos))
local moveoff = vector.multiply(dir, dist + 1.0)
local newpos = vector.add(pos, moveoff)
newpos = vector.add(newpos, {x = 0, y = 0.2, z = 0})
obj:set_pos(newpos)
obj:set_hp(obj:get_hp() - damage)
@ -704,7 +625,10 @@ local function entity_physics(pos, radius, drops)
local name = luaobj.name
if objdef and objdef.on_blast then
if ((name == "nssm:pumpking") or (name == "nssm:morvalar0") or (name== "nssm:morvalar5")) then
if ((name == "nssm:pumpking")
or (name == "nssm:morvalar0")
or (name== "nssm:morvalar5")) then
do_damage = false
do_knockback = false
else
@ -713,18 +637,24 @@ local function entity_physics(pos, radius, drops)
end
if do_knockback then
local obj_vel = obj:get_velocity()
obj:set_velocity(calc_velocity(pos, obj_pos,
obj_vel, radius * 10))
end
if do_damage then
if not obj:get_armor_groups().immortal then
obj:punch(obj, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = damage},
}, nil)
end
end
for _, item in pairs(entity_drops) do
add_drop(drops, item)
end
@ -732,14 +662,19 @@ local function entity_physics(pos, radius, drops)
end
end
local function add_drop(drops, item)
item = ItemStack(item)
local name = item:get_name()
if loss_prob[name] ~= nil and math.random(1, loss_prob[name]) == 1 then
return
end
local drop = drops[name]
if drop == nil then
drops[name] = item
else
@ -747,7 +682,9 @@ local function add_drop(drops, item)
end
end
local function destroy(drops, npos, cid, c_air, c_fire, on_blast_queue, ignore_protection, ignore_on_blast)
if not ignore_protection and minetest.is_protected(npos, "") then
return cid
end
@ -770,8 +707,11 @@ local function destroy(drops, npos, cid, c_air, c_fire, on_blast_queue, ignore_p
end
end
local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast)
pos = vector.round(pos)
-- scan for adjacent TNT nodes first, and enlarge the explosion
local vm1 = VoxelManip()
local p1 = vector.subtract(pos, 2)
@ -787,13 +727,18 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast)
for z = pos.z - 2, pos.z + 2 do
for y = pos.y - 2, pos.y + 2 do
local vi = a:index(pos.x - 2, y, z)
for x = pos.x - 2, pos.x + 2 do
local cid = data[vi]
if cid == c_tnt or cid == c_tnt_boom or cid == c_tnt_burning then
count = count + 1
data[vi] = c_air
end
vi = vi + 1
end
end
@ -808,6 +753,7 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast)
-- perform the explosion
local vm = VoxelManip()
local pr = PseudoRandom(os.time())
p1 = vector.subtract(pos, radius)
p2 = vector.add(pos, radius)
minp, maxp = vm:read_from_map(p1, p2)
@ -816,22 +762,29 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast)
local drops = {}
local on_blast_queue = {}
local c_fire = minetest.get_content_id("fire:basic_flame")
for z = -radius, radius do
for y = -radius, radius do
local vi = a:index(pos.x + (-radius), pos.y + y, pos.z + z)
for x = -radius, radius do
local r = vector.length(vector.new(x, y, z))
if (radius * radius) / (r * r) >= (pr:next(80, 125) / 100) then
local cid = data[vi]
local p = {x = pos.x + x, y = pos.y + y, z = pos.z + z}
if cid ~= c_air then
data[vi] = destroy(drops, p, cid, c_air, c_fire,
on_blast_queue, ignore_protection,
ignore_on_blast)
end
end
vi = vi + 1
end
end
@ -846,9 +799,11 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast)
for y = -radius * 1.5, radius * 1.5 do
for z = -radius * 1.5, radius * 1.5 do
for x = -radius * 1.5, radius * 1.5 do
local rad = {x = x, y = y, z = z}
local s = vector.add(pos, rad)
local r = vector.length(rad)
if r / radius < 1.4 then
--nodeupdate_single(s)
core.check_single_for_falling(s)
@ -858,10 +813,13 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast)
end
for _, queued_data in pairs(on_blast_queue) do
local dist = math.max(1, vector.distance(queued_data.pos, pos))
local intensity = (radius * radius) / (dist * dist)
local node_drops = queued_data.on_blast(queued_data.pos, intensity)
if node_drops then
for _, item in pairs(node_drops) do
add_drop(drops, item)
end
@ -871,16 +829,23 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast)
return drops, radius
end
function tnt_boom_nssm(pos, def)
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
minetest.set_node(pos, {name = "tnt:boom"})
local drops, radius = tnt_explode(pos, def.radius, def.ignore_protection,
def.ignore_on_blast)
-- append entity drops
local damage_radius = (radius / def.radius) * def.damage_radius
entity_physics(pos, damage_radius, drops)
if not def.disable_drops then
eject_drops(drops, pos, radius)
end
add_effects(pos, radius, drops)
end

View File

@ -38,24 +38,28 @@ local materials = {
}
for k, v in pairs(stats) do
minetest.register_tool("nssm:helmet_"..k, {
description = v.name.." Helmet",
inventory_image ="inv_helmet_"..k..".png",
groups = {armor_head=math.floor(4*v.armor), armor_heal=v.heal, armor_use=v.use},
wear = 0,
})
minetest.register_tool("nssm:chestplate_"..k, {
description = v.name.." Chestplate",
inventory_image ="inv_chestplate_"..k..".png",
groups = {armor_torso=math.floor(6*v.armor), armor_heal=v.heal, armor_use=v.use},
wear = 0,
})
minetest.register_tool("nssm:leggings_"..k, {
description = v.name.." Leggings",
inventory_image = "inv_leggings_"..k..".png",
groups = {armor_legs=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use},
wear = 0,
})
minetest.register_tool("nssm:boots_"..k, {
description = v.name.." Boots",
inventory_image ="inv_boots_"..k..".png",
@ -65,6 +69,7 @@ for k, v in pairs(stats) do
end
for k, v in pairs(materials) do
minetest.register_craft({
output = "nssm:helmet_"..k,
recipe = {
@ -73,6 +78,7 @@ for k, v in pairs(materials) do
{"", "", ""},
},
})
minetest.register_craft({
output = "nssm:chestplate_"..k,
recipe = {
@ -81,6 +87,7 @@ for k, v in pairs(materials) do
{v, v, v},
},
})
minetest.register_craft({
output = "nssm:leggings_"..k,
recipe = {
@ -89,6 +96,7 @@ for k, v in pairs(materials) do
{v, "", v},
},
})
minetest.register_craft({
output = "nssm:boots_"..k,
recipe = {
@ -118,6 +126,7 @@ if minetest.get_modpath("shields") then
}
for k, v in pairs(stats) do
minetest.register_tool("nssm:shield_"..k, {
description = v.name.." Shield",
inventory_image ="inv_shield_"..k..".png",
@ -126,6 +135,7 @@ if minetest.get_modpath("shields") then
})
local m = materials[k]
minetest.register_craft({
output = "nssm:shield_"..k,
recipe = {
@ -146,6 +156,7 @@ local stats = {
}
for k, v in pairs(stats) do
minetest.register_tool("nssm:helmet_"..k, {
description = v.name.." ",
inventory_image ="inv_helmet_"..k..".png",
@ -169,6 +180,7 @@ minetest.register_craft({
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
},
})
minetest.register_craft({
output = "nssm:helmet_masticone",
recipe = {
@ -177,6 +189,7 @@ minetest.register_craft({
{"nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments"},
},
})
minetest.register_craft({
output = "nssm:helmet_masticone_crowned",
recipe = {

View File

@ -1,6 +1,5 @@
--non eatable craftitems
local function nssm_craftitem (name, descr)
minetest.register_craftitem("nssm:"..name, {
@ -380,21 +379,19 @@ minetest.register_node("nssm:pumpbomb", {
minetest.register_abm({
nodenames = {"nssm:mese_meteor"},
neighbors = {"air"},
interval = 1,
interval = 2, -- 1
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.is_protected(pos, "") then
return
end
--local under = {x=pos.x, y=pos.y-1, z=pos.z}
--local n = minetest.get_node(under).name
--if n~= "air" then
minetest.set_node({x=pos.x+1, y=pos.y, z=pos.z}, {name = "fire:basic_flame"})
minetest.set_node({x=pos.x-1, y=pos.y, z=pos.z}, {name = "fire:basic_flame"})
minetest.set_node({x=pos.x, y=pos.y, z=pos.z-1}, {name = "fire:basic_flame"})
minetest.set_node({x=pos.x, y=pos.y, z=pos.z+1}, {name = "fire:basic_flame"})
minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "fire:basic_flame"})
end
})
@ -491,7 +488,9 @@ minetest.register_tool('nssm:sun_sword', {
damage_groups = {fleshy=10},
},
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
if puncher:get_wielded_item():get_name() == 'nssm:sun_sword' then
if node.name ~= "air" and not minetest.is_protected(pos, "") then
minetest.add_node(pointed_thing.above, {name = "fire:basic_flame"})
end
@ -800,12 +799,17 @@ minetest.register_tool("nssm:axe_of_pride", {
damage_groups = {fleshy=16},
},
on_drop = function(itemstack, dropper, pos)
local objects = minetest.get_objects_inside_radius(pos, 10)
local flag = 0
local part = 0
for _,obj in ipairs(objects) do
part = 0
if flag == 0 then
local pname = dropper:get_player_name()
local player_inv = minetest.get_inventory({type='player', name = pname})
@ -813,32 +817,45 @@ minetest.register_tool("nssm:axe_of_pride", {
--minetest.chat_send_all("Inventory empty")
else
local found = 0
for i = 1,32 do
local items = player_inv:get_stack('main', i)
local n = items:get_name()
if n == "nssm:energy_globe" then
found = i
break
end
end
if found == 0 then
minetest.chat_send_player(pname, "You haven't got any Energy Globe!")
return
else
if (obj:is_player()) then
--minetest.chat_send_all("Giocatore")
if (obj:get_player_name()~=dropper:get_player_name()) then
obj:set_hp(obj:get_hp() - 10)
dropper:set_hp(dropper:get_hp() + 10)
--flag = 1
local items = player_inv:get_stack('main', found)
items:take_item()
player_inv:set_stack('main', found, items)
part = 1
end
else
if (obj:get_luaentity().health) then
--minetest.chat_send_all("Entity")
obj:get_luaentity().health = obj:get_luaentity().health -10
-- check_for_death(obj:get_luaentity())
@ -847,12 +864,17 @@ minetest.register_tool("nssm:axe_of_pride", {
--flag = 1
local items = player_inv:get_stack('main', found)
items:take_item()
player_inv:set_stack('main', found, items)
part = 1
end
end
if part == 1 then
local s = dropper:get_pos()
local p = obj:get_pos()
local m = 2
@ -895,6 +917,7 @@ minetest.register_tool("nssm:gratuitousness_battleaxe", {
damage_groups = {fleshy=18},
},
on_drop = function(itemstack, dropper, pos)
local objects = minetest.get_objects_inside_radius(pos, 10)
local flag = 0
local vec = dropper:get_look_dir()
@ -908,21 +931,27 @@ minetest.register_tool("nssm:gratuitousness_battleaxe", {
local pname = dropper:get_player_name()
local player_inv = minetest.get_inventory({type='player', name = pname})
local found = 0
for i = 1, 32 do
local items = player_inv:get_stack('main', i)
local n = items:get_name()
if n == "nssm:energy_globe" then
found = i
break
end
end
if found == 0 then
minetest.chat_send_player(pname, "You haven't got any Energy Globe!")
return
else
local items = player_inv:get_stack('main', found)
items:take_item()
player_inv:set_stack('main', found, items)
tnt.boom(pos, {damage_radius=5,radius=4,ignore_protection=false})
end
end,
@ -942,11 +971,16 @@ minetest.register_tool("nssm:sword_of_eagerness", {
damage_groups = {fleshy=14},
},
on_drop = function(itemstack, dropper, pos)
local objects = minetest.get_objects_inside_radius(pos, 10)
local flag = 0
for _,obj in ipairs(objects) do
local part = 0
if flag == 0 then
local pname = dropper:get_player_name()
local player_inv = minetest.get_inventory({type='player', name = pname})
@ -954,23 +988,32 @@ minetest.register_tool("nssm:sword_of_eagerness", {
--minetest.chat_send_all("Inventory empty")
else
local found = 0
for i = 1,32 do
local items = player_inv:get_stack('main', i)
local n = items:get_name()
if n == "nssm:energy_globe" then
found = i
break
end
end
if found == 0 then
minetest.chat_send_player(pname, "You haven't got any Energy Globe!")
return
else
local pos = obj:get_pos()
pos.y = pos.y + 15
if (obj:is_player()) then
if (obj:get_player_name()~=dropper:get_player_name()) then
part=1
obj:set_pos(pos)
--flag = 1
@ -986,13 +1029,19 @@ minetest.register_tool("nssm:sword_of_eagerness", {
--flag = 1
local items = player_inv:get_stack('main', found)
items:take_item()
player_inv:set_stack('main', found, items)
end
end
if part==1 then
local s = pos
s.y = s.y - 15
minetest.add_particlespawner(
25, --amount
0.3, --time

328
spawn.lua
View File

@ -7,124 +7,308 @@ local mm = nssm.multimobs
if (mymapgenis ~= 6) and (mymapgenis ~= 7) then
mymapgenis = 7
end
-- Spawning parameters
if mm ~= 0 then
if mymapgenis == 6 then
-- ANTS
mobs:spawn_specific("nssm:ant_queen", {"nssm:ant_dirt"}, {"air"}, 0, 20, 60, 200000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:ant_soldier", {"nssm:ant_dirt"}, {"air"}, 0, 20, 7, 30000/mm, 4, -31000, 31000)
mobs:spawn_specific("nssm:ant_worker", {"nssm:ant_dirt"}, {"air"}, 0, 20, 5, 10000/mm, 5, -31000, 31000)
mobs:spawn_specific("nssm:ant_queen",
{"nssm:ant_dirt"}, {"air"}, 0, 20, 60, 200000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:ant_soldier",
{"nssm:ant_dirt"}, {"air"}, 0, 20, 7, 30000/mm, 4, -31000, 31000)
mobs:spawn_specific("nssm:ant_worker",
{"nssm:ant_dirt"}, {"air"}, 0, 20, 5, 10000/mm, 5, -31000, 31000)
-- SPIDERS
mobs:spawn_specific("nssm:black_widow", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 20, 20, 1200000/mm, 2, -31000, 31000)
mobs:spawn_specific("nssm:daddy_long_legs", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 20, 10, 1200000/mm, 2, -31000, 31000)
mobs:spawn_specific("nssm:tarantula", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 14, 120, 5000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:uloboros", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 20, 20, 1200000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:black_widow",
{"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" },
{"air"}, 0, 20, 20, 1200000/mm, 2, -31000, 31000)
mobs:spawn_specific("nssm:daddy_long_legs",
{"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" },
{"air"}, 0, 20, 10, 1200000/mm, 2, -31000, 31000)
mobs:spawn_specific("nssm:tarantula",
{"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" },
{"air"}, 0, 14, 120, 5000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:uloboros",
{"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" },
{"air"}, 0, 20, 20, 1200000/mm, 1, -31000, 31000)
-- DUCKS
mobs:spawn_specific("nssm:duck", {"default:dirt_with_grass"}, {"group:flora"}, 10, 20, 20, 350000/mm, 1, -31000, 20)
mobs:spawn_specific("nssm:duckking", {"default:dirt_with_grass"}, {"group:flora"}, 10, 20, 300, 5000000/mm, 1, -31000, 20)
mobs:spawn_specific("nssm:enderduck", {"default:dirt_with_grass"}, {"group:flora"}, 0, 10, 45, 900000/mm, 1, -31000, 20)
mobs:spawn_specific("nssm:flying_duck", {"air"}, {"group:leaves"}, 10, 20, 120, 24000000/mm, 1, 1, 25)
mobs:spawn_specific("nssm:flying_duck", {"air"}, {"group:flora"}, 10, 20, 120, 6000000/mm, 1, 1, 25)
mobs:spawn_specific("nssm:spiderduck", {"default:dirt_with_grass"}, {"group:flora"}, 0, 10, 45, 850000/mm, 1, -31000, 20)
mobs:spawn_specific("nssm:swimming_duck", {"default:water_source"}, {"default:water_source"}, 0, 20, 60, 45000000/mm, 1, -31000, 20)
mobs:spawn_specific("nssm:duck", {"default:dirt_with_grass"},
{"group:flora"}, 10, 20, 20, 350000/mm, 1, -31000, 20)
mobs:spawn_specific("nssm:duckking", {"default:dirt_with_grass"},
{"group:flora"}, 10, 20, 300, 5000000/mm, 1, -31000, 20)
mobs:spawn_specific("nssm:enderduck", {"default:dirt_with_grass"},
{"group:flora"}, 0, 10, 45, 900000/mm, 1, -31000, 20)
mobs:spawn_specific("nssm:flying_duck", {"air"},
{"group:leaves"}, 10, 20, 120, 24000000/mm, 1, 1, 25)
mobs:spawn_specific("nssm:flying_duck", {"air"},
{"group:flora"}, 10, 20, 120, 6000000/mm, 1, 1, 25)
mobs:spawn_specific("nssm:spiderduck", {"default:dirt_with_grass"},
{"group:flora"}, 0, 10, 45, 850000/mm, 1, -31000, 20)
mobs:spawn_specific("nssm:swimming_duck", {"default:water_source"},
{"default:water_source"}, 0, 20, 60, 45000000/mm, 1, -31000, 20)
-- MOUNTAINS
mobs:spawn_specific("nssm:echidna", {"default:dirt_with_grass"}, {"default:dirt_with_grass"}, 0, 20, 200, 100000000/mm, 1, 22, 31000)
mobs:spawn_specific("nssm:manticore", {"default:dirt_with_grass"}, {"default:dirt_with_grass"}, 10, 20, 60, 12000000/mm, 1, 20, 31000)
mobs:spawn_specific("nssm:werewolf", {"default:dirt_with_grass"}, {"default:dirt_with_grass"}, 0, 10, 60, 12000000/mm, 1, 20, 31000)
mobs:spawn_specific("nssm:echidna", {"default:dirt_with_grass"},
{"default:dirt_with_grass"}, 0, 20, 200, 100000000/mm, 1, 22, 31000)
mobs:spawn_specific("nssm:manticore", {"default:dirt_with_grass"},
{"default:dirt_with_grass"}, 10, 20, 60, 12000000/mm, 1, 20, 31000)
mobs:spawn_specific("nssm:werewolf", {"default:dirt_with_grass"},
{"default:dirt_with_grass"}, 0, 10, 60, 12000000/mm, 1, 20, 31000)
-- ICE
mobs:spawn_specific("nssm:icelamander", {"default:snowblock", "default:ice"}, {"default:snowblock", "default:ice"}, 0, 20, 120, 25000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:icesnake", {"default:snowblock", "default:ice", "default:dirt_with_snow"}, {"default:snowblock", "default:ice", "default:dirt_with_snow"}, 0, 20, 30, 6000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:white_werewolf", {"default:dirt_with_snow","default:snowblock"}, {"air"}, 0, 20, 60, 9000000/mm, 1, 20, 31000)
mobs:spawn_specific("nssm:snow_biter", {"default:snowblock", "default:ice", "default:dirt_with_snow"}, {"default:snowblock", "default:ice", "default:dirt_with_snow"}, 0, 20, 30, 6000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:icelamander",
{"default:snowblock", "default:ice"}, {"default:snowblock", "default:ice"},
0, 20, 120, 25000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:icesnake",
{"default:snowblock", "default:ice", "default:dirt_with_snow"},
{"default:snowblock", "default:ice", "default:dirt_with_snow"},
0, 20, 30, 6000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:white_werewolf",
{"default:dirt_with_snow","default:snowblock"},
{"air"}, 0, 20, 60, 9000000/mm, 1, 20, 31000)
mobs:spawn_specific("nssm:snow_biter",
{"default:snowblock", "default:ice", "default:dirt_with_snow"},
{"default:snowblock", "default:ice", "default:dirt_with_snow"},
0, 20, 30, 6000000/mm, 1, -31000, 31000)
-- FOREST
mobs:spawn_specific("nssm:larva", {"default:dirt_with_grass"}, {"default:tree","default:aspen_tree"}, 0, 20, 40, 200000/mm, 1, -31000, 140)
mobs:spawn_specific("nssm:masticone", {"default:dirt_with_grass"}, {"default:tree","default:aspen_tree"}, 0, 20, 120, 5000000/mm, 2, -31000, 140)
mobs:spawn_specific("nssm:larva", {"default:dirt_with_grass"},
{"default:tree","default:aspen_tree"}, 0, 20, 40, 200000/mm, 1, -31000, 140)
mobs:spawn_specific("nssm:masticone", {"default:dirt_with_grass"},
{"default:tree","default:aspen_tree"}, 0, 20, 120, 5000000/mm, 2, -31000, 140)
-- PINE FOREST
mobs:spawn_specific("nssm:pumpboom_small", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_tree"}, 0, 20, 30, 600000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpboom_medium", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_tree"}, 0, 20, 30, 800000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpboom_large", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_tree"}, 0, 20, 30, 1000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpking", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_needles", "default:pine_tree"}, 0, 12, 120, 8000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpboom_small",
{"default:dirt_with_coniferous_litter", "default:dirt_with_snow",
"default:snowblock"}, {"default:pine_tree"},
0, 20, 30, 600000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpboom_medium",
{"default:dirt_with_coniferous_litter", "default:dirt_with_snow",
"default:snowblock"}, {"default:pine_tree"},
0, 20, 30, 800000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpboom_large",
{"default:dirt_with_coniferous_litter", "default:dirt_with_snow",
"default:snowblock"}, {"default:pine_tree"},
0, 20, 30, 1000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpking",
{"default:dirt_with_coniferous_litter", "default:dirt_with_snow",
"default:snowblock"}, {"default:pine_needles", "default:pine_tree"},
0, 12, 120, 8000000/mm, 1, -31000, 31000)
else
-- SPIDERS
mobs:spawn_specific("nssm:black_widow", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 20, 30, 4400000/mm, 2, -31000, 31000)
mobs:spawn_specific("nssm:daddy_long_legs", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 30, 10, 4400000/mm, 2, -31000, 31000)
mobs:spawn_specific("nssm:tarantula", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 14, 120, 50000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:uloboros", {"default:jungle_grass", "default:jungletree", "nssm:web" }, {"air"}, 0, 20, 30, 4400000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:black_widow",
{"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" },
{"air"}, 0, 20, 30, 4400000/mm, 2, -31000, 31000)
mobs:spawn_specific("nssm:daddy_long_legs",
{"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" },
{"air"}, 0, 30, 10, 4400000/mm, 2, -31000, 31000)
mobs:spawn_specific("nssm:tarantula",
{"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" },
{"air"}, 0, 14, 120, 50000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:uloboros",
{"default:dirt_with_rainforest_litter", "default:jungletree", "nssm:web" },
{"air"}, 0, 20, 30, 4400000/mm, 1, -31000, 31000)
-- DUCKS
mobs:spawn_specific("nssm:duck", {"default:dirt_with_grass"}, {"group:flora"}, 10, 20, 50, 1500000/mm, 1, -31000, 40)
mobs:spawn_specific("nssm:duckking", {"default:dirt_with_grass"}, {"group:flora"}, 10, 20, 400, 120000000/mm, 1, -31000, 40)
mobs:spawn_specific("nssm:enderduck", {"default:dirt_with_grass"}, {"group:flora"}, 0, 10, 120, 5000000/mm, 1, -31000, 40)
mobs:spawn_specific("nssm:flying_duck", {"air"}, {"group:leaves"}, 10, 20, 120, 8000000/mm, 1, 1, 40)
mobs:spawn_specific("nssm:flying_duck", {"air"}, {"group:flora"}, 10, 20, 120, 25000000/mm, 1, 1, 40)
mobs:spawn_specific("nssm:spiderduck", {"default:dirt_with_grass"}, {"group:flora"}, 0, 10, 120, 5000000/mm, 1, -31000, 45)
mobs:spawn_specific("nssm:swimming_duck", {"default:water_source"}, {"default:water_source"}, 0, 20, 60, 45000000/mm, 1, -31000, 40)
mobs:spawn_specific("nssm:swimming_duck", {"default:river_water_source"}, {"default:sand","default:river_water_source"}, 0, 20, 60, 3000000/mm, 1, -31000, 300)
mobs:spawn_specific("nssm:duck", {"default:dirt_with_grass"},
{"group:flora"}, 10, 20, 50, 1500000/mm, 1, -31000, 40)
mobs:spawn_specific("nssm:duckking", {"default:dirt_with_grass"},
{"group:flora"}, 10, 20, 400, 120000000/mm, 1, -31000, 40)
mobs:spawn_specific("nssm:enderduck", {"default:dirt_with_grass"},
{"group:flora"}, 0, 10, 120, 5000000/mm, 1, -31000, 40)
mobs:spawn_specific("nssm:flying_duck", {"air"},
{"group:leaves"}, 10, 20, 120, 8000000/mm, 1, 1, 40)
mobs:spawn_specific("nssm:flying_duck", {"air"},
{"group:flora"}, 10, 20, 120, 25000000/mm, 1, 1, 40)
mobs:spawn_specific("nssm:spiderduck", {"default:dirt_with_grass"},
{"group:flora"}, 0, 10, 120, 5000000/mm, 1, -31000, 45)
mobs:spawn_specific("nssm:swimming_duck", {"default:water_source"},
{"default:water_source"}, 0, 20, 60, 45000000/mm, 1, -31000, 40)
mobs:spawn_specific("nssm:swimming_duck", {"default:river_water_source"},
{"default:sand","default:river_water_source"},
0, 20, 60, 3000000/mm, 1, -31000, 300)
-- MOUNTAINS
mobs:spawn_specific("nssm:echidna", {"default:dirt_with_grass"}, {"default:dirt_with_grass"}, 0, 20, 200, 100000000/mm, 1, 50, 31000)
mobs:spawn_specific("nssm:manticore", {"default:dirt_with_grass"}, {"default:dirt_with_grass"}, 10, 20, 60, 13000000/mm, 1, 40, 31000)
mobs:spawn_specific("nssm:werewolf", {"default:dirt_with_grass"}, {"default:dirt_with_grass"}, 0, 10, 60, 13000000/mm, 1, 40, 31000)
mobs:spawn_specific("nssm:echidna", {"default:dirt_with_grass"},
{"default:dirt_with_grass"}, 0, 20, 200, 100000000/mm, 1, 50, 31000)
mobs:spawn_specific("nssm:manticore", {"default:dirt_with_grass"},
{"default:dirt_with_grass"}, 10, 20, 60, 13000000/mm, 1, 40, 31000)
mobs:spawn_specific("nssm:werewolf", {"default:dirt_with_grass"},
{"default:dirt_with_grass"}, 0, 10, 60, 13000000/mm, 1, 40, 31000)
-- ICE
mobs:spawn_specific("nssm:icelamander", {"default:snowblock", "default:ice"}, {"default:snowblock", "default:ice"}, 0, 20, 180, 120000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:icesnake", {"default:snowblock", "default:ice", "default:dirt_with_snow"}, {"default:snowblock", "default:ice", "default:dirt_with_snow"}, 0, 20, 40, 20000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:white_werewolf", {"default:dirt_with_snow","default:snowblock"}, {"air"}, 0, 20, 35, 22000000/mm, 1, 50, 31000)
mobs:spawn_specific("nssm:snow_biter", {"default:snowblock", "default:ice", "default:dirt_with_snow"}, {"default:snowblock", "default:ice", "default:dirt_with_snow"}, 0, 20, 40, 20000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:icelamander",
{"default:snowblock", "default:ice"}, {"default:snowblock", "default:ice"},
0, 20, 180, 120000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:icesnake",
{"default:snowblock", "default:ice", "default:dirt_with_snow"},
{"default:snowblock", "default:ice", "default:dirt_with_snow"},
0, 20, 40, 20000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:white_werewolf",
{"default:dirt_with_snow","default:snowblock"},
{"air"}, 0, 20, 35, 22000000/mm, 1, 50, 31000)
mobs:spawn_specific("nssm:snow_biter",
{"default:snowblock", "default:ice", "default:dirt_with_snow"},
{"default:snowblock", "default:ice", "default:dirt_with_snow"},
0, 20, 40, 20000000/mm, 1, -31000, 31000)
-- FOREST
mobs:spawn_specific("nssm:larva", {"default:dirt_with_grass"}, {"default:tree","default:aspen_tree"}, 0, 20, 40, 800000/mm, 1, -31000, 140)
mobs:spawn_specific("nssm:masticone", {"default:dirt_with_grass"}, {"default:tree","default:aspen_tree"}, 0, 20, 180, 6000000/mm, 2, -31000, 140)
mobs:spawn_specific("nssm:larva", {"default:dirt_with_grass"},
{"default:tree","default:aspen_tree"}, 0, 20, 40, 800000/mm, 1, -31000, 140)
mobs:spawn_specific("nssm:masticone", {"default:dirt_with_grass"},
{"default:tree","default:aspen_tree"}, 0, 20, 180, 6000000/mm, 2, -31000, 140)
-- PINE FOREST
mobs:spawn_specific("nssm:pumpboom_small", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_tree"}, 0, 20, 80, 1400000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpboom_medium", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_tree"}, 0, 20, 80, 1600000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpboom_large", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_tree"}, 0, 20, 80, 1800000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpking", {"default:dirt_with_grass", "default:dirt_with_snow","default:snowblock"}, {"default:pine_needles", "default:pine_tree"}, 0, 12, 120, 8000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpboom_small",
{"default:dirt_with_coniferous_litter", "default:dirt_with_snow",
"default:snowblock"}, {"default:pine_tree"},
0, 20, 80, 1400000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpboom_medium",
{"default:dirt_with_coniferous_litter", "default:dirt_with_snow",
"default:snowblock"}, {"default:pine_tree"},
0, 20, 80, 1600000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpboom_large",
{"default:dirt_with_coniferous_litter", "default:dirt_with_snow",
"default:snowblock"}, {"default:pine_tree"},
0, 20, 80, 1800000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:pumpking",
{"default:dirt_with_coniferous_litter", "default:dirt_with_snow",
"default:snowblock"}, {"default:pine_needles", "default:pine_tree"},
0, 12, 120, 8000000/mm, 1, -31000, 31000)
-- SAVANNA
mobs:spawn_specific("nssm:felucco", {"default:dirt_with_dry_grass"}, {"default:dirt_with_dry_grass"}, 0, 20, 80, 20000000/mm, 1, -200, 31000)
mobs:spawn_specific("nssm:felucco", {"default:dirt_with_dry_grass",
"default:dry_dirt_with_dry_grass"}, {"default:dirt_with_dry_grass"},
0, 20, 80, 20000000/mm, 1, -200, 31000)
end
-- NSSB SPECIAL
if minetest.get_modpath("nssb") then
mobs:spawn_specific("nssm:xgaloctopus", {"default:water_source"}, {"nssb:marine_brick"}, 0, 20, 20, 800000/mm, 1, -31000, 0)
mobs:spawn_specific("nssm:xgaloctopus", {"default:water_source"},
{"nssb:marine_brick"}, 0, 20, 20, 800000/mm, 1, -31000, 0)
end
-- CAVES
mobs:spawn_specific("nssm:bloco", {"default:stone", "default:desert_stone"}, {"default:stone", "default:desert_stone"}, 0, 20, 30, 500000/mm, 3, -31000, -20)
mobs:spawn_specific("nssm:lava_titan", {"default:stone", "default:desert_stone"}, {"air"}, 0, 120, 12, 22000000/mm, 1, -31000, -100)
mobs:spawn_specific("nssm:stone_eater", {"default:stone", "default:desert_stone"}, {"default:stone", "default:desert_stone"}, 0, 20, 40, 700000/mm, 2, -31000, -20)
mobs:spawn_specific("nssm:signosigno", {"default:stone", "default:desert_stone"}, {"default:stone", "default:desert_stone"}, 0, 10, 20, 400000/mm, 2, -31000, -20)
mobs:spawn_specific("nssm:signosigno", {"bones:bones"}, {"air"}, 0, 15, 20, 5000/mm, 5, -31000, 31000)
mobs:spawn_specific("nssm:bloco", {"default:stone", "default:desert_stone"},
{"default:stone", "default:desert_stone"}, 0, 20, 30, 500000/mm, 3, -31000, -20)
mobs:spawn_specific("nssm:lava_titan", {"default:stone", "default:desert_stone"},
{"air"}, 0, 120, 12, 22000000/mm, 1, -31000, -100)
mobs:spawn_specific("nssm:stone_eater", {"default:stone", "default:desert_stone"},
{"default:stone", "default:desert_stone"}, 0, 20, 40, 700000/mm, 2, -31000, -20)
mobs:spawn_specific("nssm:signosigno", {"default:stone", "default:desert_stone"},
{"default:stone", "default:desert_stone"}, 0, 10, 20, 400000/mm, 2, -31000, -20)
mobs:spawn_specific("nssm:signosigno", {"bones:bones"},
{"air"}, 0, 15, 20, 5000/mm, 5, -31000, 31000)
-- SEA
mobs:spawn_specific("nssm:crab", {"default:sand"}, {"default:water_source"}, 0, 20, 60, 4000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:crocodile", {"default:sand","default:water_source"}, {"default:water_source"}, 0, 20, 100, 35000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:crocodile", {"default:sand","default:river_water_source"}, {"default:river_water_source"}, 0, 20, 60, 12000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:dolidrosaurus", {"default:water_source"}, {"default:water_source"}, 0, 20, 100, 35000000/mm, 1, -31000, -1)
mobs:spawn_specific("nssm:kraken", {"default:water_source"}, {"default:water_source"}, 0, 20, 400, 500000000/mm, 1, -31000, 0)
mobs:spawn_specific("nssm:octopus", {"default:water_source"}, {"default:water_source"}, 0, 20, 80, 38000000/mm, 1, -31000, 0)
mobs:spawn_specific("nssm:crab", {"default:sand"},
{"default:water_source"}, 0, 20, 60, 4000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:crocodile", {"default:sand","default:water_source"},
{"default:water_source"}, 0, 20, 100, 35000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:crocodile", {"default:sand","default:river_water_source"},
{"default:river_water_source"}, 0, 20, 60, 12000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:dolidrosaurus", {"default:water_source"},
{"default:water_source"}, 0, 20, 100, 35000000/mm, 1, -31000, -1)
mobs:spawn_specific("nssm:kraken", {"default:water_source"},
{"default:water_source"}, 0, 20, 400, 500000000/mm, 1, -31000, 0)
mobs:spawn_specific("nssm:octopus", {"default:water_source"},
{"default:water_source"}, 0, 20, 80, 38000000/mm, 1, -31000, 0)
-- DESERT
mobs:spawn_specific("nssm:sandworm", {"default:desert_sand", "default:desert_stone"}, {"air"}, 0, 20, 100, 28000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:giant_sandworm", {"default:desert_sand", "default:desert_stone"}, {"air"}, 0, 20, 400, 600000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:sand_bloco", {"default:desert_sand", "default:desert_stone"}, {"air"}, 0, 20, 90, 20000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:sandworm", {"default:desert_sand", "default:desert_stone"},
{"air"}, 0, 20, 100, 28000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:giant_sandworm", {"default:desert_sand",
"default:desert_stone"}, {"air"}, 0, 20, 400, 600000000/mm, 1, -31000, 31000)
mobs:spawn_specific("nssm:sand_bloco", {"default:desert_sand",
"default:desert_stone"}, {"air"}, 0, 20, 90, 20000000/mm, 1, -31000, 31000)
-- SKY
mobs:spawn_specific("nssm:moonheron", {"air"}, {"air"}, 0, 10, 110, 950000000/mm, 1, 10, 180)
mobs:spawn_specific("nssm:night_master", {"air"}, {"air"}, 0, 7, 400, 4500000000/mm, 2, 10, 180)
mobs:spawn_specific("nssm:phoenix", {"air"}, {"air"}, 10, 20, 400, 10000000000/mm, 1, 10, 180)
mobs:spawn_specific("nssm:scrausics", {"air"}, {"air"}, 10, 20, 110, 950000000/mm, 1, 10, 180)
mobs:spawn_specific("nssm:moonheron", {"air"}, {"air"},
0, 10, 110, 950000000/mm, 1, 10, 180)
mobs:spawn_specific("nssm:night_master", {"air"}, {"air"},
0, 7, 400, 4500000000/mm, 2, 10, 180)
mobs:spawn_specific("nssm:phoenix", {"air"}, {"air"},
10, 20, 400, 10000000000/mm, 1, 10, 180)
mobs:spawn_specific("nssm:scrausics", {"air"}, {"air"},
10, 20, 110, 950000000/mm, 1, 10, 180)
end