1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-24 01:30:38 +01:00

Mobd update second part

This commit is contained in:
Ombridride 2015-07-16 00:15:56 +02:00
parent c93567ef87
commit 744ccb7bee
23 changed files with 627 additions and 288 deletions

View File

@ -28,10 +28,10 @@ This mod contains the following additions:
Changelog:
1.13- Added capture function (thanks blert2112) chance of picking up mob with hand, net and magic lasso
1.13- Added capture function (thanks blert2112) chance of picking up mob with hand; net; magic lasso, replaced some .x models with newer .b3d one's
1.12- Added animal ownership so that players cannot steal your tamed animals
1.11- Added flying mobs (and swimming), fly=true and fly_in="air" or "deafult:water_source" for fishy
1,10- Footstep removed (use replace), explosion routine added for exploding mobs.
1,10- Footstep removed (use replace), explosion routine added for exploding mobs.
1.09- reworked breeding routine, added mob rotation value, added footstep feature, added jumping mobs with sounds feature, added magic lasso for picking up animals
1.08- Mob throwing attack has been rehauled so that they can damage one another, also drops and on_die function added
1.07- Npc's can now be set to follow player or stand by using self.order and self.owner variables
@ -51,4 +51,4 @@ beta- Npc mob added, kills monsters, attacks player when punched, right click wi
0.4 - Dungeon Masters and Mese Monsters have much better aim due to shoot_offset, also they can both shoot through nodes that aren't walkable (flowers, grass etc) plus new sheep sound :)
0.3 - Added LOTT's Spider mob, made Cobwebs, added KPavel's Bee with Honey and Beehives (made texture), Warthogs now have sound and can be tamed, taming of shaved sheep or milked cow with 8 wheat so it will not despawn, many bug fixes :)
0.2 - Cooking bucket of milk into cheese now returns empty bucket
0.1 - Initial Release
0.1 - Initial Release

File diff suppressed because it is too large Load Diff

View File

@ -112,4 +112,4 @@ minetest.register_craft({
recipe = {
{"mobs:honey_block"},
}
})
})

View File

@ -96,4 +96,4 @@ mobs:register_mob("mobs:bunny", {
})
mobs:register_spawn("mobs:bunny", {"default:dirt_with_grass"}, 20, 8, 10000, 1, 31000)
mobs:register_egg("mobs:bunny", "Bunny", "mobs_bunny_inv.png", 0)
mobs:register_egg("mobs:bunny", "Bunny", "mobs_bunny_inv.png", 0)

View File

@ -12,6 +12,7 @@ mobs:register_mob("mobs:chicken", {
collisionbox = {-0.3, -0.75, -0.3, 0.3, 0.1, 0.3},
visual = "mesh",
mesh = "mobs_chicken.x",
-- seems a lot of textures but this fixes the problem with the model
textures = {
{"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png",
"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png"},
@ -84,7 +85,8 @@ mobs:register_mob("mobs:chicken", {
self.owner = name
end
minetest.sound_play("mobs_chicken", {
object = self.object,gain = 1.0,
object = self.object,
gain = 1.0,
max_hear_distance = 15,
loop = false,
})
@ -155,4 +157,4 @@ minetest.register_craft({
type = "cooking",
recipe = "mobs:chicken_raw",
output = "mobs:chicken_cooked",
})
})

View File

@ -21,7 +21,6 @@ mobs:register_mob("mobs:cow", {
--{"mobs_cow_brown.png"}, -- dé-commenter quand "mobs_cow_brown.png" sera compatible
},
blood_texture = "mobs_blood.png",
visual_size = {x=1,y=1},
-- sounds
makes_footstep_sound = true,
sounds = {
@ -107,7 +106,7 @@ mobs:register_mob("mobs:cow", {
minetest.sound_play("mobs_cow", {
object = self.object,
gain = 1.0,
max_hear_distance = 32,
max_hear_distance = 16,
loop = false,
})
end
@ -131,10 +130,10 @@ mobs:register_mob("mobs:cow", {
elseif self.owner ~= name then
minetest.chat_send_player(name, "Not owner!")
end
--]]
end
end,
})--]]
})
-- spawn on default;green;prairie grass between 0 and 20 light, 1 in 11000 chance, 1 cow in area up to 31000 in height
mobs:register_spawn("mobs:cow", {"default:dirt_with_grass"}, 20, 8, 10000, 1, 31000)
-- register spawn egg

View File

@ -1,12 +1,12 @@
-- Meat & Cooked Meat
-- raw meat
minetest.register_craftitem("mobs:meat_raw", {
description = "Raw Meat",
inventory_image = "mobs_meat_raw.png",
on_use = minetest.item_eat(3),
})
-- cooked meat
minetest.register_craftitem("mobs:meat", {
description = "Meat",
inventory_image = "mobs_meat.png",
@ -20,8 +20,7 @@ minetest.register_craft({
cooktime = 5,
})
-- Golden Lasso
-- golden lasso
minetest.register_tool("mobs:magic_lasso", {
description = "Magic Lasso (right-click animal to put in inventory)",
inventory_image = "mobs_magic_lasso.png",
@ -36,8 +35,7 @@ minetest.register_craft({
}
})
-- Net
-- net
minetest.register_tool("mobs:net", {
description = "Net (right-click animal to put in inventory)",
inventory_image = "mobs_net.png",
@ -50,4 +48,4 @@ minetest.register_craft({
{"default:stick", "", "default:stick"},
{"farming:string", "default:stick", "farming:string"},
}
})
})

View File

@ -13,13 +13,12 @@ mobs:register_mob("mobs:dirt_monster", {
hp_max = 30,
armor = 90,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
visual = "mesh",
mesh = "mobs_stone_monster.x",
mesh = "mobs_stone_monster.b3d",
textures = {
{"mobs_dirt_monster.png"},
},
visual_size = {x=3, y=2.6},
blood_texture = "default_dirt.png",
-- sounds
makes_footstep_sound = true,
@ -54,4 +53,4 @@ mobs:register_mob("mobs:dirt_monster", {
-- spawn on dirt_with_grass and drygrass between -1 and 5 light, 1 in 10000 change, 1 dirt monster in area up to 31000 in height
mobs:register_spawn("mobs:dirt_monster", {"default:dirt_with_grass", "watershed:drygrass"}, 5, -1, 10000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:dirt_monster", "Dirt Monster", "default_dirt.png", 1)
mobs:register_egg("mobs:dirt_monster", "Dirt Monster", "default_dirt.png", 1)

View File

@ -13,13 +13,13 @@ mobs:register_mob("mobs:dungeon_master", {
attack_type = "shoot",
shoot_interval = 2.5,
arrow = "mobs:fireball",
shoot_offset = 0,
shoot_offset = 1,
-- health & armor
hp_min = 60,
hp_max = 80,
armor = 70,
-- textures and model
collisionbox = {-0.7, -0.01, -0.7, 0.7, 2.6, 0.7},
collisionbox = {-0.7, -1, -0.7, 0.7, 1.6, 0.7},
visual = "mesh",
mesh = "mobs_dungeon_master.b3d",
textures = {
@ -27,7 +27,6 @@ mobs:register_mob("mobs:dungeon_master", {
{"mobs_dungeon_master_cobblestone.png"},
{"mobs_dungeon_master_strangewhite.png"},
},
visual_size = {x=8, y=8},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,

View File

@ -58,4 +58,4 @@ dofile(path.."/crafts.lua")
if minetest.setting_get("log_mods") then
minetest.log("action", "mobs loaded")
end
end

View File

@ -81,4 +81,4 @@ mobs:register_mob("mobs:kitten", {
})
mobs:register_spawn("mobs:kitten", {"default:dirt_with_grass"}, 20, 0, 10000, 1, 31000)
mobs:register_egg("mobs:kitten", "Kitten", "mobs_kitten_inv.png", 0)
mobs:register_egg("mobs:kitten", "Kitten", "mobs_kitten_inv.png", 0)

View File

@ -20,7 +20,6 @@ mobs:register_mob("mobs:lava_flan", {
{"zmobs_lava_flan.png"},
},
blood_texture = "fire_basic_flame.png",
visual_size = {x=1, y=1},
-- sounds
makes_footstep_sound = false,
sounds = {
@ -67,4 +66,4 @@ minetest.register_craftitem("mobs:lava_orb", {
inventory_image = "zmobs_lava_orb.png",
})
minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb")
minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb")

View File

@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.

View File

@ -69,7 +69,7 @@ mobs:register_egg("mobs:mese_monster", "Mese Monster", "default_mese_block.png",
-- mese arrow (weapon)
mobs:register_arrow("mobs:mese_arrow", {
visual = "sprite",
visual_size = {x=.5, y=.5},
visual_size = {x = 0.5, y = 0.5},
textures = {"default_mese_crystal_fragment.png"},
velocity = 6,
@ -99,4 +99,4 @@ minetest.register_craft({
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
}
})
})

View File

@ -27,7 +27,6 @@ mobs:register_mob("mobs:npc", {
{"mobs_npc.png"},
{"mobs_npc2.png"}, -- female by nuttmeg20
},
visual_size = {x=1, y=1},
-- sounds
makes_footstep_sound = true,
sounds = {},
@ -69,7 +68,7 @@ mobs:register_mob("mobs:npc", {
local item = clicker:get_wielded_item()
local name = clicker:get_player_name()
if not name then return end
-- heal npc
-- feed toheal npc
if item:get_name() == "mobs:meat"
or item:get_name() == "farming:bread" then
-- feed and add health
@ -80,7 +79,6 @@ mobs:register_mob("mobs:npc", {
return
end
hp = hp + 4 -- add restorative value
-- new health shouldn't exceed self.hp_max
if hp > self.hp_max then hp = self.hp_max end
self.object:set_hp(hp)
-- take item
@ -136,4 +134,4 @@ mobs:register_mob("mobs:npc", {
-- spawning enable for now
mobs:register_spawn("mobs:npc", {"default:dirt_with_grass", "default:dirt", "default:junglegrass", "default:sand"}, 20, -1, 50000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:npc", "Npc", "default_brick.png", 1)
mobs:register_egg("mobs:npc", "Npc", "default_brick.png", 1)

View File

@ -13,14 +13,13 @@ mobs:register_mob("mobs:oerkki", {
hp_max = 50,
armor = 90,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
collisionbox = {-0.4, -1, -0.4, 0.4, 0.9, 0.4},
visual = "mesh",
mesh = "mobs_oerkki.b3d",
textures = {
{"mobs_oerkki.png"},
{"mobs_oerkki2.png"},
},
visual_size = {x=5, y=5},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = false,
@ -61,4 +60,4 @@ mobs:register_mob("mobs:oerkki", {
-- spawns on stone/sandstone between 5 and -1 light, 1 in 7000 chance, 1 in area starting at -10 and below
mobs:register_spawn("mobs:oerkki", {"default:stone", "default:sandstone"}, 5, -1, 7000, 1, -75)
-- register spawn egg
mobs:register_egg("mobs:oerkki", "Oerkki", "default_obsidian.png", 1)
mobs:register_egg("mobs:oerkki", "Oerkki", "default_obsidian.png", 1)

View File

@ -11,7 +11,7 @@ mobs:register_mob("mobs:rat", {
hp_max = 4,
armor = 200,
-- textures and model
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.2, 0.2},
collisionbox = {-0.2, -1, -0.2, 0.2, -0.8, 0.2},
visual = "mesh",
mesh = "mobs_rat.b3d",
textures = {
@ -61,4 +61,4 @@ minetest.register_craft({
output = "mobs:rat_cooked",
recipe = "mobs:rat",
cooktime = 5,
})
})

View File

@ -13,7 +13,7 @@ mobs:register_mob("mobs:sand_monster", {
hp_max = 20,
armor = 100,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
visual = "mesh",
mesh = "mobs_sand_monster.b3d",
textures = {
@ -55,4 +55,4 @@ mobs:register_mob("mobs:sand_monster", {
-- spawns on desert sand between -1 and 20 light, 1 in 15000 chance, 1 sand monster in area up to 31000 in height
mobs:register_spawn("mobs:sand_monster", {"default:desert_sand", "default:sand"}, 20, -1, 20000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:sand_monster", "Sand Monster", "default_desert_sand.png", 1)
mobs:register_egg("mobs:sand_monster", "Sand Monster", "default_desert_sand.png", 1)

View File

@ -1,4 +1,9 @@
local all_colours = {
"grey", "black", "red", "yellow", "green", "cyan", "blue", "magenta",
"orange", "violet", "brown", "pink", "dark_grey", "dark_green"
}
-- Sheep by PilzAdam
mobs:register_mob("mobs:sheep", {
@ -11,7 +16,7 @@ mobs:register_mob("mobs:sheep", {
hp_max = 15,
armor = 200,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
collisionbox = {-0.4, -1, -0.4, 0.4, 0.3, 0.4},
visual = "mesh",
mesh = "mobs_sheep.b3d",
textures = {
@ -56,6 +61,7 @@ mobs:register_mob("mobs:sheep", {
replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
replace_with = "air",
-- right click sheep to shear sheep and get wood, feed 8 wheat for wool to grow back
replace_offset = -1,
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
local name = clicker:get_player_name()
@ -86,12 +92,12 @@ mobs:register_mob("mobs:sheep", {
end
self.object:set_properties({
textures = {"mobs_sheep.png"},
mesh = "mobs_sheep.x",
mesh = "mobs_sheep.b3d",
})
minetest.sound_play("mobs_sheep", {
object = self.object,
gain = 1.0,
max_hear_distance = 20,
max_hear_distance = 10,
loop = false,
})
end
@ -119,6 +125,29 @@ mobs:register_mob("mobs:sheep", {
return
end
for _, col in ipairs(all_colours) do
if item:get_name() == "dye:"..col
and self.gotten == false
and self.child == false
and self.tamed == true
and name == self.owner then
local pos = self.object:getpos()
self.object:remove()
local mob = minetest.add_entity(pos, "mobs:sheep_"..col)
local ent = mob:get_luaentity()
ent.owner = clicker:get_player_name()
ent.tamed = true
-- take item
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
break
else
print ("not owner/tamed, cant dye sheep")
end
end
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end,
})
@ -148,3 +177,122 @@ minetest.register_craft({
{'', 'group:stick', 'default:steel_ingot'},
}
})
-- Coloured sheep
for _, col in ipairs(all_colours) do
mobs:register_mob("mobs:sheep_"..col, {
type = "animal",
passive = true,
hp_min = 8,
hp_max = 10,
armor = 200,
collisionbox = {-0.4, -1, -0.4, 0.4, 0.3, 0.4},
visual = "mesh",
mesh = "mobs_sheep.b3d",
textures = {
{"mobs_sheep_"..col..".png"},
},
gotten_texture = {"mobs_sheep_shaved.png"},
gotten_mesh = "mobs_sheep_shaved.b3d",
makes_footstep_sound = true,
sounds = {
random = "mobs_sheep",
},
walk_velocity = 1,
jump = true,
drops = {
{name = "mobs:meat_raw",
chance = 1, min = 2, max = 3},
{name = "wool:"..col,
chance = 1, min = 1, max = 1},
},
water_damage = 1,
lava_damage = 5,
light_damage = 0,
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 80,
walk_start = 81,
walk_end = 100,
},
follow = "farming:wheat",
view_range = 5,
replace_rate = 50,
replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
replace_with = "air",
replace_offset = -1,
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
local name = clicker:get_player_name()
if item:get_name() == "farming:wheat" then
-- take item
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
-- make child grow quicker
if self.child == true then
self.hornytimer = self.hornytimer + 10
return
end
-- feed and tame
self.food = (self.food or 0) + 1
if self.food > 7 then
self.food = 0
if self.hornytimer == 0 then
self.horny = true
end
self.gotten = false -- can be shaved again
self.tamed = true
-- make owner
if self.owner == "" then
self.owner = name
end
self.object:set_properties({
textures = {"mobs_sheep_"..col..".png"},
mesh = "mobs_sheep.b3d",
})
minetest.sound_play("mobs_sheep", {
object = self.object,
gain = 1.0,
max_hear_distance = 10,
loop = false,
})
end
return
end
if item:get_name() == "mobs:shears"
and self.gotten == false
and self.child == false then
self.gotten = true -- shaved
if minetest.registered_items["wool:"..col] then
local pos = self.object:getpos()
pos.y = pos.y + 0.5
local obj = minetest.add_item(pos, ItemStack("wool:"..col.." "..math.random(2,3)))
if obj then
obj:setvelocity({x = math.random(-1,1), y = 5, z = math.random(-1,1)})
end
item:add_wear(650) -- 100 uses
clicker:set_wielded_item(item)
end
self.object:set_properties({
textures = {"mobs_sheep_shaved.png"},
mesh = "mobs_sheep_shaved.b3d",
})
return
end
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end,
})
mobs:register_egg("mobs:sheep_"..col, "Sheep ("..col..")", "wool_"..col..".png", 1)
end

View File

@ -96,4 +96,4 @@ minetest.register_craft( {
{ "", "farming:string", "" },
{ "farming:string", "", "farming:string" }
},
})
})

View File

@ -19,7 +19,6 @@ mobs:register_mob("mobs:stone_monster", {
textures = {
{"mobs_stone_monster.png"},
},
visual_size = {x=3, y=2.6},
blood_texture = "default_stone.png",
-- sounds
makes_footstep_sound = true,
@ -60,4 +59,4 @@ mobs:register_mob("mobs:stone_monster", {
-- spawns on stone between -1 and 5 light, 1 in 7000 chance, 1 in area below -25
mobs:register_spawn("mobs:stone_monster", {"default:stone", "default:sandstone"}, 5, -1, 7000, 1, -25)
-- register spawn egg
mobs:register_egg("mobs:stone_monster", "Stone Monster", "default_stone.png", 1)
mobs:register_egg("mobs:stone_monster", "Stone Monster", "default_stone.png", 1)

View File

@ -13,13 +13,12 @@ mobs:register_mob("mobs:tree_monster", {
hp_max = 50,
armor = 80,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
visual = "mesh",
mesh = "mobs_tree_monster.b3d",
textures = {
{"mobs_tree_monster.png"},
},
visual_size = {x=4.5,y=4.5},
blood_texture = "default_wood.png",
-- sounds
makes_footstep_sound = true,
@ -65,4 +64,4 @@ mobs:register_egg("mobs:tree_monster", "Tree Monster", "default_tree_top.png", 1
if not minetest.get_modpath("ethereal") then
minetest.register_alias("ethereal:tree_sapling", "default:sapling")
minetest.register_alias("ethereal:jungle_tree_sapling", "default:junglesapling")
end
end

View File

@ -105,6 +105,7 @@ minetest.register_craftitem("mobs:pork_raw", {
on_use = minetest.item_eat(4),
})
-- cooked porkchop
minetest.register_craftitem("mobs:pork_cooked", {
description = "Cooked Porkchop",
inventory_image = "mobs_pork_cooked.png",
@ -116,4 +117,4 @@ minetest.register_craft({
output = "mobs:pork_cooked",
recipe = "mobs:pork_raw",
cooktime = 5,
})
})