1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-26 02:30:38 +01:00
server-nalc/mods/mobs/greenslimes.lua

168 lines
5.0 KiB
Lua
Raw Normal View History

2015-04-12 18:59:07 +02:00
2015-04-12 02:18:21 +02:00
-- Green Slimes by TomasJLuis & TenPlus1
-- sounds
local green_sounds = {
2015-04-12 12:25:26 +02:00
damage = "mobs_slimes_damage",
death = "mobs_slimes_death",
jump = "mobs_slimes_jump",
attack = "mobs_slimes_attack",
2015-04-12 02:18:21 +02:00
}
-- green slime textures
2015-04-12 12:25:26 +02:00
local green_textures = {"mobs_green_slime_sides.png", "mobs_green_slime_sides.png", "mobs_green_slime_sides.png", "mobs_green_slime_sides.png", "mobs_green_slime_front.png", "mobs_green_slime_sides.png"}
2015-04-12 02:18:21 +02:00
-- register small green slime
mobs:register_mob("mobs:greensmall", {
2015-04-12 19:18:06 +02:00
-- animal, monster, npc, barbarian
2015-04-12 02:18:21 +02:00
type = "monster",
2015-04-12 19:18:06 +02:00
-- aggressive, deals 2 damage to player when hit
passive = false,
damage = 2,
attack_type = "dogfight",
attacks_monsters = true,
-- health and armor
hp_min = 4, hp_max = 8,
2015-04-12 19:18:06 +02:00
armor = 100,
-- textures and model
2015-04-12 02:18:21 +02:00
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
visual = "cube",
textures = { green_textures },
2015-04-12 12:25:26 +02:00
blood_texture = "mobs_green_slime_blood.png",
2015-04-12 19:18:06 +02:00
visual_size = {x = 0.5, y = 0.5},
2015-06-10 17:14:58 +02:00
-- sounds a bit here, but mainly define in the beginning
2015-04-12 02:18:21 +02:00
makes_footstep_sound = false,
sounds = green_sounds,
2015-04-12 19:18:06 +02:00
-- speed and jump, sinks in water
walk_velocity = 4,
run_velocity = 4,
2015-04-12 02:18:21 +02:00
walk_chance = 0,
2015-04-12 19:18:06 +02:00
jump = true,
2015-04-12 02:18:21 +02:00
jump_chance = 30,
jump_height = 6,
2015-04-12 19:18:06 +02:00
view_range = 16,
floats = 1,
-- chance of dropping glue and coins
2015-04-12 02:18:21 +02:00
drops = {
2015-04-12 19:18:06 +02:00
{name = "mesecons_materials:glue",
chance = 4, min = 1, max = 2},
{name = "maptools:silver_coin",
chance = 4, min = 1, max = 1,},
2015-04-12 02:18:21 +02:00
},
2015-04-12 19:18:06 +02:00
-- damaged by
2015-04-12 02:18:21 +02:00
water_damage = 0,
lava_damage = 10,
light_damage = 0,
2015-04-12 19:18:06 +02:00
-- model animation
-- no model animation
2015-04-12 02:18:21 +02:00
})
mobs:register_egg("mobs:greensmall", "Small Green Slime", "mobs_green_slime_medium_inv.png", 1)
2015-04-12 02:18:21 +02:00
-- register medium green slime
mobs:register_mob("mobs:greenmedium", {
2015-04-12 19:18:06 +02:00
-- animal, monster, npc, barbarian
2015-04-12 02:18:21 +02:00
type = "monster",
2015-04-12 19:18:06 +02:00
-- aggressive, deals 4 damage to player when hit
passive = false,
damage = 4,
attack_type = "dogfight",
attacks_monsters = true,
-- health and armor
hp_min = 16, hp_max = 32,
2015-04-12 19:18:06 +02:00
armor = 90,
-- textures and model
2015-04-12 02:18:21 +02:00
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
textures = { green_textures },
2015-04-12 12:25:26 +02:00
blood_texture = "mobs_green_slime_blood.png",
2015-04-12 19:18:06 +02:00
visual_size = {x = 1, y = 1},
2015-06-10 17:14:58 +02:00
-- sounds a bit here, but mainly define in the beginning
2015-04-12 02:18:21 +02:00
makes_footstep_sound = false,
sounds = green_sounds,
2015-04-12 19:18:06 +02:00
-- speed and jump, sinks in water
walk_velocity = 3,
run_velocity = 3,
2015-04-12 02:18:21 +02:00
walk_chance = 0,
2015-04-12 19:18:06 +02:00
jump = true,
2015-04-12 02:18:21 +02:00
jump_chance = 30,
jump_height = 6,
2015-04-12 19:18:06 +02:00
view_range = 16,
floats = 1,
-- chance of dropping glue and coins
drops = {
},
-- damaged by
water_damage = 0,
lava_damage = 10,
light_damage = 0,
-- model animation
-- no model animation
-- do things when die
2015-04-12 02:18:21 +02:00
on_die = function(self, pos)
local num = math.random(2, 4)
for i=1,num do
2015-04-12 12:28:15 +02:00
minetest.add_entity({x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}, "mobs:greensmall")
2015-04-12 02:18:21 +02:00
end
end,
})
mobs:register_egg("mobs:greenmedium", "Medium Green Slime", "mobs_green_slime_medium_inv.png", 1)
2015-04-12 02:18:21 +02:00
-- register big green slime
mobs:register_mob("mobs:greenbig", {
2015-04-12 19:18:06 +02:00
-- animal, monster, npc, barbarian
2015-04-12 02:18:21 +02:00
type = "monster",
2015-04-12 19:18:06 +02:00
-- aggressive, deals 6 damage to player when hit
passive = false,
damage = 6,
attack_type = "dogfight",
attacks_monsters = true,
-- health and armor
hp_min = 32, hp_max = 64,
2015-04-12 19:18:06 +02:00
armor = 90,
-- textures and model
2015-04-12 02:18:21 +02:00
collisionbox = {-1, -1, -1, 1, 1, 1},
visual = "cube",
textures = { green_textures },
2015-04-12 12:25:26 +02:00
blood_texture = "mobs_green_slime_blood.png",
2015-04-12 19:18:06 +02:00
visual_size = {x = 2, y = 2},
2015-06-10 17:14:58 +02:00
-- sounds a bit here, but mainly define in the beginning
2015-04-12 02:18:21 +02:00
makes_footstep_sound = false,
sounds = green_sounds,
2015-04-12 19:18:06 +02:00
-- speed and jump, sinks in water
walk_velocity = 2.5,
run_velocity = 2.5,
2015-04-12 02:18:21 +02:00
walk_chance = 0,
2015-04-12 19:18:06 +02:00
jump = true,
2015-04-12 02:18:21 +02:00
jump_chance = 30,
jump_height = 6,
2015-04-12 19:18:06 +02:00
view_range = 16,
floats = 1,
knock_back = 0, --this is a test
2015-04-12 19:18:06 +02:00
-- chance of dropping glue and coins
drops = {
},
-- damaged by
water_damage = 0,
lava_damage = 10,
light_damage = 0,
-- model animation
-- no model animation
-- do things when die
2015-04-12 02:18:21 +02:00
on_die = function(self, pos)
local num = math.random(1, 2)
for i=1,num do
2015-04-12 12:28:15 +02:00
minetest.add_entity({x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}, "mobs:greenmedium")
2015-04-12 02:18:21 +02:00
end
end,
})
mobs:register_egg("mobs:greenbig", "Big Green Slime", "mobs_green_slime_big_inv.png", 1)
2015-04-12 02:18:21 +02:00
--mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height)
mobs:spawn_specific("mobs:greenbig", {"default:acid_source"},{"default:acid_flowing"}, -1, 20, 30, 4000, 1, -32000, 32000, false)
mobs:spawn_specific("mobs:greenmedium", {"default:acid_source"},{"default:acid_flowing"},-1, 20, 30, 4000, 2, -32000, 32000, false)
--mobs:spawn_specific("mobs:greensmall", {"default:acid_source"},{"default:acid_flowing"},-1, 20, 30, 10000, 2, -32000, 32000)
2015-04-12 02:18:21 +02:00
--mobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height)
2015-04-12 12:05:17 +02:00
--mobs:register_spawn("mobs:greenmedium", {"default:mossycobble"}, 20, 4, 10000, 8, 32000)
--mobs:register_spawn("mobs:greensmall", {"default:mossycobble"}, 20, 4, 10000, 8, 32000)