1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-06-28 14:16:06 +02:00

Change mobs api and add new mobs from (water_mobs, pmobs, kpgmobs, mob_horse)

This commit is contained in:
sys4
2017-11-11 17:37:21 +01:00
parent d3a7d82233
commit 6241f4ecaf
491 changed files with 74864 additions and 12913 deletions

4
mods/slimes/depends.txt Normal file
View File

@ -0,0 +1,4 @@
default
tnt
mobs
mesecons_materials?

127
mods/slimes/greenslimes.lua Normal file
View File

@ -0,0 +1,127 @@
-- sounds
local green_sounds = {
damage = "slimes_damage",
death = "slimes_death",
jump = "slimes_jump",
attack = "slimes_attack",
}
-- green slime textures
local green_textures = {"green_slime_sides.png", "green_slime_sides.png", "green_slime_sides.png", "green_slime_sides.png", "green_slime_front.png", "green_slime_sides.png"}
-- register small green slime
mobs:register_mob("slimes:greensmall", {
type = "monster",
hp_min = 1, hp_max = 2,
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
visual = "cube",
visual_size = {x = 0.5, y = 0.5},
textures = { green_textures },
blood_texture = "green_slime_blood.png",
makes_footstep_sound = false,
sounds = green_sounds,
attack_type = "dogfight",
attacks_monsters = true,
damage = 1,
passive = false,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
jump_chance = 30,
jump_height = 6,
armor = 100,
view_range = 10,
drops = {
{name = "mesecons_materials:glue", chance = 4, min = 1, max = 2},
{name = "maptools:silver_coin", chance = 4, min = 1, max = 1,},
},
drawtype = "front",
water_damage = 0,
lava_damage = 10,
light_damage = 0,
})
mobs:register_egg("slimes:greensmall", "Small Green Slime", "green_slime_front.png", 0)
mobs:alias_mob("mobs:greensmall", "slimes:greensmall")
-- register medium green slime
mobs:register_mob("slimes:greenmedium", {
type = "monster",
hp_min = 3, hp_max = 4,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
visual_size = {x = 1, y = 1},
textures = { green_textures },
blood_texture = "green_slime_blood.png",
makes_footstep_sound = false,
sounds = green_sounds,
attack_type = "dogfight",
attacks_monsters = true,
damage = 1,
passive = false,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
jump_chance = 30,
jump_height = 6,
armor = 100,
view_range = 10,
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))}, "slimes:greensmall")
end
end,
drawtype = "front",
water_damage = 0,
lava_damage = 10,
light_damage = 0,
})
mobs:register_egg("slimes:greenmedium", "Medium Green Slime", "green_slime_front.png", 0)
mobs:alias_mob("mobs:greenmedium", "slimes:greenmedium")
-- register big green slime
mobs:register_mob("slimes:greenbig", {
type = "monster",
hp_min = 5, hp_max = 6,
collisionbox = {-1, -1, -1, 1, 1, 1},
visual = "cube",
visual_size = {x = 2, y = 2},
textures = { green_textures },
blood_texture = "green_slime_blood.png",
makes_footstep_sound = false,
sounds = green_sounds,
attack_type = "dogfight",
attacks_monsters = true,
damage = 2,
passive = false,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
jump_chance = 30,
jump_height = 6,
armor = 100,
view_range = 10,
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))}, "slimes:greenmedium")
end
end,
drawtype = "front",
water_damage = 0,
lava_damage = 10,
light_damage = 0,
})
mobs:register_egg("slimes:greenbig", "Big Green Slime", "green_slime_front.png", 0)
mobs:alias_mob("mobs:greenbig", "slimes:greenbig")
--mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height)
mobs:spawn_specific("slimes:greenbig", {"default:junglegrass", "default:acid_source"},{"air","default:junglegrass", "default:acid_flowing"}, 4, 20, 30, 5000, 8, 0, 32000)
mobs:spawn_specific("slimes:greenmedium", {"default:junglegrass", "default:acid_source"},{"air","default:junglegrass", "default:acid_flowing"}, 4, 20, 30, 10000, 8, 0, 32000)
mobs:spawn_specific("slimes:greensmall", {"default:junglegrass", "default:acid_source"},{"air","default:junglegrass", "default:acid_flowing"}, 4, 4, 30, 15000, 8, 0, 32000)
--mobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height)
mobs:register_spawn("slimes:greenmedium", {"default:mossycobble"}, 20, 4, 10000, 8, 32000)
mobs:register_spawn("slimes:greensmall", {"default:mossycobble"}, 20, 4, 10000, 8, 32000)

17
mods/slimes/init.lua Normal file
View File

@ -0,0 +1,17 @@
-- Slimes by ?
dofile(minetest.get_modpath("slimes").."/greenslimes.lua")
dofile(minetest.get_modpath("slimes").."/lavaslimes.lua")
-- cannot find mesecons?, craft glue instead
if not minetest.get_modpath("mesecons_materials") then
minetest.register_craftitem(":mesecons_materials:glue", {
image = "jeija_glue.png",
description="Glue",
})
end
if minetest.setting_get("log_mods") then minetest.log("action", "Slimes loaded") end
damage_enabled = minetest.setting_getbool("enable_damage")

133
mods/slimes/lavaslimes.lua Normal file
View File

@ -0,0 +1,133 @@
-- sounds
local lava_sounds = {
damage = "slimes_damage",
death = "slimes_death",
jump = "slimes_jump",
attack = "slimes_attack",
}
-- lava slime textures
local lava_textures = {"lava_slime_sides.png", "lava_slime_sides.png", "lava_slime_sides.png", "lava_slime_sides.png", "lava_slime_front.png", "lava_slime_sides.png"}
-- register small lava slime
mobs:register_mob("slimes:lavasmall", {
type = "monster",
hp_min = 1, hp_max = 2,
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
visual = "cube",
visual_size = {x = 0.5, y = 0.5},
textures = { lava_textures },
blood_texture = "lava_slime_blood.png",
makes_footstep_sound = false,
sounds = lava_sounds,
attack_type = "dogfight",
attacks_monsters = true,
damage = 1,
passive = false,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
jump_chance = 30,
jump_height = 6,
armor = 100,
view_range = 10,
drops = {
{name = "tnt:gunpowder", chance = 4, min = 1, max = 2},
{name = "mobs:lava_orb", chance = 15, min = 1, max = 1,},
{name = "maptools:silver_coin", chance = 4, min = 1, max = 1,},
},
drawtype = "front",
water_damage = 10,
lava_damage = 0,
light_damage = 0,
replace_rate = 20,
replace_what = {"air"},
replace_with = "fire:basic_flame",
})
mobs:register_egg("slimes:lavasmall", "Small Lava Slime", "lava_slime_front.png", 0)
mobs:alias_mob("mobs:lavasmall", "slimes:lavasmall")
-- register medium lava slime
mobs:register_mob("slimes:lavamedium", {
type = "monster",
hp_min = 3, hp_max = 4,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
visual_size = {x = 1, y = 1},
textures = { lava_textures },
blood_texture = "lava_slime_blood.png",
makes_footstep_sound = false,
sounds = lava_sounds,
attack_type = "dogfight",
attacks_monsters = true,
damage = 2,
passive = false,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
jump_chance = 30,
jump_height = 6,
armor = 100,
view_range = 10,
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))}, "slimes:lavasmall")
end
end,
drawtype = "front",
water_damage = 10,
lava_damage = 0,
light_damage = 0,
replace_rate = 20,
replace_what = {"air"},
replace_with = "fire:basic_flame",
})
mobs:register_egg("slimes:lavamedium", "Medium Lava Slime", "lava_slime_front.png", 0)
mobs:alias_mob("mobs:lavamedium", "slimes:lavamedium")
-- register big lava slime
mobs:register_mob("slimes:lavabig", {
type = "monster",
hp_min = 5, hp_max = 6,
collisionbox = {-1, -1, -1, 1, 1, 1},
visual = "cube",
visual_size = {x = 2, y = 2},
textures = { lava_textures },
blood_texture = "lava_slime_blood.png",
makes_footstep_sound = false,
sounds = lava_sounds,
attack_type = "dogfight",
attacks_monsters = true,
damage = 3,
passive = false,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
jump_chance = 30,
jump_height = 6,
armor = 100,
view_range = 10,
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))}, "slimes:lavamedium")
end
end,
drawtype = "front",
water_damage = 10,
lava_damage = 0,
light_damage = 0,
replace_offset = -1,
replace_rate = 20,
replace_what = {"air"},
replace_with = "fire:basic_flame",
})
mobs:register_egg("slimes:lavabig", "Big Lava Slime", "lava_slime_front.png", 0)
mobs:alias_mob("mobs:lavabig", "slimes:lavabig")
--mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height)
mobs:spawn_specific("slimes:lavabig", {"default:lava_source"},{"default:lava_flowing"}, 4, 20, 30, 5000, 8, -32000, -64)
mobs:spawn_specific("slimes:lavamedium", {"default:lava_source"},{"default:lava_flowing"}, 4, 20, 30, 10000, 8, -32000, -64)
mobs:spawn_specific("slimes:lavasmall", {"default:lava_source"},{"default:lava_flowing"}, 4, 20, 30, 15000, 8, -32000, -64)

93
mods/slimes/readme.txt Normal file
View File

@ -0,0 +1,93 @@
"Slimes Redone" - Mod for Minetest (http://www.minetest.net/)
Introduction
==========================================================================================================================
This mod adds two type of mobs in the world of Minetest: green slimes and lava slimes. They are hostile and will attack the
players as soon as they see them. If they are defeated, the slimes maybe will reward the player with useful resources.
Green slimes live in the tall grass of the jungles and in the ancient ruins of lost temples. And lava slimes live deep
underground near the lava pools.
I've made this mod inspired by this other: https://forum.minetest.net/viewtopic.php?f=11&t=2979&hilit=slimes which adds friendly
slimes. Thank you Jeija!
Details
==========================================================================================================================
- Adds two new hostile mobs: green slimes and lava slimes.
- They attack players and hurt them on touch. (i'm not sure if the amount of damage is enough or too much...:/)
- The biger ones split in a random amout of smaller versions when defeated: big > medium > small.
- They can get different enviromental damage: water, lava, sunlight and falling.
- They use custom textures and sounds. (more work needs to be done here ;P)
- Cartoonish animation (they deform a bit when landing and stretch out when jumping).
- Effects (blood, smoke, bubbles, footprints,..).
- API to add new slimes.
Green slimes:
> spawn in jungle grass or in temples mossy cobble (default:mossycobble).
> on die, they drop a randomish amount of glue (from mesecon mod)
> Lava hurts them.
Lava slimes:
> spawn in lava pools deep under ground.
> on die, they drop a randomish amount of gunpowder (from default tnt mod).
> water hurts them.
> when they jump they leave behind a footprint of fire. ^^
Install
==========================================================================================================================
Unzip the archive an place it in minetest-base-directory/mods/minetest/
If you have a windows client or a linux run-in-place client.
If you have a linux system-wide instalation place it in ~/.minetest/mods/minetest/.
If you want to install this mod only in one world create the folder worldmods/ in your world directory.
For further information or help see: http://wiki.minetest.com/wiki/Installing_Mods
How to use the mod:
==========================================================================================================================
Just install it an everything should work.
Mod Information
==========================================================================================================================
Version: 0.1
Required Minetest Version: >=0.4.12
Dependencies: default, default:tnt, mesecon (https://forum.minetest.net/viewtopic.php?f=11&t=628&hilit=mesecon)
Soft Dependencies: (none)
Highly Recommended: (none)
Craft Recipies: (none)
Git Repo: https://github.com/TomasJLuis/mt-slimes-redone
Modders/Developers
=========================================================================================================================
If you are a modder, you should know that I've never used LUA before. this is my first mod for Mintetest, and I've used
this mod to learn how to mod on Minetest. So may be you will find a code full of mistakes and bad practices... ;P
If you spot someting that can/must be improved/changed/removed and want to help me to improve this mode and my knowledge,
please tell me here: https://forum.minetest.net/viewtopic.php?f=9&t=11743&p=175186#p175186
Thank you!
Version history
==========================================================================================================================
0.1 - Initial release
Copyright and Licensing
==========================================================================================================================
- Author: Tomas J. Luis
- Original sound for slime damage by RandomationPictures under licence CC0 1.0.
http://www.freesound.org/people/RandomationPictures/sounds/138481/
- Original sounds for slime jump, land and death by Dr. Minky under licence CC BY 3.0.
http://www.freesound.org/people/DrMinky/sounds/
- Source code and images by Tomas J. Luis under WTFPL.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB