1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-29 12:10:34 +01:00
server-nalc/mods/mobs/lavaslimes.lua

185 lines
5.1 KiB
Lua
Raw Normal View History

2015-04-12 02:18:21 +02:00
-- Lava Slimes by TomasJLuis & TenPlus1
-- sounds
local lava_sounds = {
damage = "mobs_slimes_damage",
death = "mobs_slimes_death",
jump = "mobs_slimes_jump",
attack = "mobs_slimes_attack",
}
-- lava slime textures
local lava_textures = {"mobs_lava_slime_sides.png", "mobs_lava_slime_sides.png", "mobs_lava_slime_sides.png", "mobs_lava_slime_sides.png", "mobs_lava_slime_front.png", "mobs_lava_slime_sides.png"}
-- register small lava slime
mobs:register_mob("mobs:lavasmall", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 2 damage to player when hit
passive = false,
pathfinding = false,
2016-02-17 13:14:33 +01:00
reach = 2,
2015-04-12 02:18:21 +02:00
damage = 2,
attack_type = "dogfight",
attacks_monsters = true,
-- health and armor
2016-02-10 05:02:17 +01:00
hp_min = 4,
hp_max = 8,
armor = 200,
2015-04-12 02:18:21 +02:00
-- textures and model
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
visual = "cube",
textures = { lava_textures },
blood_texture = "mobs_lava_slime_blood.png",
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 = lava_sounds,
-- speed and jump, sinks in water
walk_velocity = 4,
run_velocity = 4,
2015-04-12 02:18:21 +02:00
walk_chance = 0,
jump = true,
jump_chance = 30,
jump_height = 6,
replace_rate = 20,
footstep = "fire:basic_flame",
view_range = 16,
floats = 1,
-- chance of dropping lava orb and coins
2015-04-12 02:18:21 +02:00
drops = {
2016-02-10 05:02:17 +01:00
{name = "mobs:lava_orb", chance = 15, min = 1, max = 1,},
{name = "maptools:silver_coin", chance = 4, min = 1, max = 1,},
2015-04-12 02:18:21 +02:00
},
-- damaged by
water_damage = 10,
lava_damage = 0,
light_damage = 0,
-- model animation
-- no model animation
})
mobs:register_egg("mobs:lavasmall", "Small Lava Slime", "mobs_lava_slime_medium_inv.png", 1)
2015-04-12 02:18:21 +02:00
-- register medium lava slime
mobs:register_mob("mobs:lavamedium", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 4 damage to player when hit
passive = false,
2016-02-17 13:14:33 +01:00
reach = 2,
damage = 3,
2015-04-12 02:18:21 +02:00
attack_type = "dogfight",
attacks_monsters = true,
-- health and armor
hp_min = 15,
hp_max = 25,
armor = 100,
2015-04-12 02:18:21 +02:00
-- textures and model
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
textures = { lava_textures },
blood_texture = "mobs_lava_slime_blood.png",
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 = lava_sounds,
-- speed and jump, sinks in water
walk_velocity = 3,
run_velocity = 3,
2015-04-12 02:18:21 +02:00
walk_chance = 0,
jump = true,
jump_chance = 30,
jump_height = 6,
replace_rate = 20,
footstep = "fire:basic_flame",
view_range = 16,
floats = 1,
-- chance of dropping lava orb and coins
2015-04-12 02:18:21 +02:00
drops = {
},
-- damaged by
water_damage = 10,
lava_damage = 0,
light_damage = 0,
-- model animation
-- no model animation
-- do things when die
on_die = function(self, pos)
local num = math.random(2, 4)
for i=1,num do
minetest.add_entity({x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}, "mobs:lavasmall")
end
end,
})
2016-02-17 13:14:33 +01:00
mobs:register_egg("mobs:lavamedium", "Medium Lava Slime", "mobs_lava_slime_medium_inv.png", 1)
2015-04-12 02:18:21 +02:00
-- register big lava slime
mobs:register_mob("mobs:lavabig", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 6 damage to player when hit
passive = false,
2016-02-17 13:14:33 +01:00
reach = 2,
damage = 5,
2015-04-12 02:18:21 +02:00
attack_type = "dogfight",
attacks_monsters = true,
-- health and armor
hp_min = 30, hp_max = 50,
armor = 100,
2015-04-12 02:18:21 +02:00
-- textures and model
collisionbox = {-1, -1, -1, 1, 1, 1},
visual = "cube",
textures = { lava_textures },
blood_texture = "mobs_lava_slime_blood.png",
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 = lava_sounds,
-- 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,
jump = true,
jump_chance = 30,
jump_height = 6,
replace_rate = 20,
replace_offset = -1,
footstep = "fire:basic_flame",
view_range = 16,
floats = 1,
knock_back = 0, --this is a test
-- chance of dropping lava orb and coins
2015-04-12 02:18:21 +02:00
drops = {
},
-- damaged by
water_damage = 10,
lava_damage = 0,
light_damage = 0,
-- model animation
-- no model animation
-- do things when die
on_die = function(self, pos)
local num = math.random(1, 2)
for i=1,num do
minetest.add_entity({x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}, "mobs:lavamedium")
end
end,
})
2016-02-10 05:02:17 +01:00
mobs:register_egg("mobs:lavabig", "Big Lava Slime", "mobs_lava_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:lavabig", {"default:lava_source"},{"default:lava_flowing"}, -1, 20, 30, 5000, 1, -32000, 32000, false)
mobs:spawn_specific("mobs:lavamedium", {"default:lava_source"},{"default:lava_flowing"}, -1, 20, 30, 5000, 2, -32000, 32000, false)
--mobs:spawn_specific("mobs:lavasmall", {"default:lava_source"},{"default:lava_flowing"}, -1, 20, 30, 10s000, 2, -32000, 32000, false)
-- lava orb
minetest.register_craftitem("mobs:lava_orb", {
description = "Lava orb",
inventory_image = "zmobs_lava_orb.png",
})
minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb")