diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index c3e1db38..b5b7c344 100755 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -1586,3 +1586,63 @@ function mobs:capture_mob(self, clicker, chance_hand, chance_net, chance_lasso, end end end + + +--Menu mobs spawner +mobs.shown_spawner_menu = function(player_name) + local formspec = {"size[7,9]label[2.7,0;Mobs Spawner]"} + if mobs["spawning_mobs"] ~= nil then + local Y = 1 + local X = 1 + for name, etat in pairs(mobs["spawning_mobs"]) do + table.insert(formspec, "item_image_button["..X..","..Y..";1,1;"..name..";"..name..";]") + X = X+1 + if X > 5 then + X = 1 + Y = Y+1.2 + end + end + end + table.insert(formspec, "button_exit[2.9,8.5;1.2,1;close;Close]") + minetest.show_formspec(player_name, "mobs:spawner", table.concat(formspec)) +end + +minetest.register_on_player_receive_fields(function(player, formname, fields) + local player_name = player:get_player_name() + if not player_name then return end + if formname == "mobs:spawner" then + for f in pairs(fields) do + if string.find(f, "mobs:") then + local pos = player:getpos() + minetest.add_entity(pos, f) + return + end + end + end +end) + + +if (minetest.get_modpath("unified_inventory")) ~= nil then + unified_inventory.register_button("menu_mobs", { + type = "image", + image = "mobs_dungeon_master_fireball.png", + tooltip = "Mobs Spawner Menu", + show_with = "server", + action = function(player) + local player_name = player:get_player_name() + if not player_name then return end + if minetest.check_player_privs(player_name, {server=true}) then + mobs.shown_spawner_menu(player_name) + end + end, + }) +else + minetest.register_chatcommand("mobs_spawner", { + params = "", + description = "Spawn entity at given (or your) position", + privs = {server=true}, + func = function(name, param) + mobs.shown_spawner_menu(name) + end, + }) +end diff --git a/mods/mobs/cow.lua b/mods/mobs/cow.lua index 9ee9154c..243d7231 100755 --- a/mods/mobs/cow.lua +++ b/mods/mobs/cow.lua @@ -122,7 +122,7 @@ mobs:register_mob("mobs:cow", { -- 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:spawn_specific("mobs:cow", {"default:dirt_with_grass"}, {"air"}, 8, 20, 30, 10000, 1, -31000, 31000, true) -- register spawn egg -mobs:register_egg("mobs:cow", "Cow", "default_grass.png", 1) +mobs:register_egg("mobs:cow", "Cow", "mobs_cow_inv.png", 1) -- leather minetest.register_craftitem("mobs:leather", { diff --git a/mods/mobs/dirtmonster.lua b/mods/mobs/dirtmonster.lua index fddaa374..66ddc90d 100755 --- a/mods/mobs/dirtmonster.lua +++ b/mods/mobs/dirtmonster.lua @@ -53,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:spawn_specific("mobs:dirt_monster", {"default:dirt_with_grass", "watershed:drygrass"}, {"air"}, -1, 5, 30, 10000, 1, -31000, 31000, false) -- register spawn egg -mobs:register_egg("mobs:dirt_monster", "Dirt Monster", "default_dirt.png", 1) +mobs:register_egg("mobs:dirt_monster", "Dirt Monster", "mobs_dirtmonster_inv.png", 1) diff --git a/mods/mobs/dungeonmaster.lua b/mods/mobs/dungeonmaster.lua index bb56c468..b962322f 100755 --- a/mods/mobs/dungeonmaster.lua +++ b/mods/mobs/dungeonmaster.lua @@ -70,7 +70,7 @@ mobs:register_mob("mobs:dungeon_master", { -- spawn on stone between 20 and -1 light, 1 in 7000 chance, 1 dungeon master in area starting at -100 and below mobs:spawn_specific("mobs:dungeon_master", {"default:stone", "default:sandstone", "nether:netherrack"}, {"air"}, -1, 20, 30, 7000, 1, -31000, -250, false) -- register spawn egg -mobs:register_egg("mobs:dungeon_master", "Dungeon Master", "fire_basic_flame.png", 1) +mobs:register_egg("mobs:dungeon_master", "Dungeon Master", "mobs_dongeon_master_inv.png", 1) -- fireball (weapon) mobs:register_arrow("mobs:fireball", { diff --git a/mods/mobs/goat.lua b/mods/mobs/goat.lua index 9265b080..7f45b843 100755 --- a/mods/mobs/goat.lua +++ b/mods/mobs/goat.lua @@ -64,4 +64,4 @@ mobs:register_mob("mobs:goat", { -- spawn on dirt_with_grass between -1 and 20 light, 1 in 20000 chance, 1 goat in area up to 31000 in height mobs:spawn_specific("mobs:goat", {"default:dirt_with_grass"}, {"air"}, -1, 20, 30, 10000, 1, -31000, 31000, true) -- register spawn egg -mobs:register_egg("mobs:goat", "Goat", "default_grass.png", 1) +mobs:register_egg("mobs:goat", "Goat", "mobs_goat_inv.png", 1) diff --git a/mods/mobs/minotaur.lua b/mods/mobs/minotaur.lua index 5d8698d9..356eb3ce 100755 --- a/mods/mobs/minotaur.lua +++ b/mods/mobs/minotaur.lua @@ -62,7 +62,7 @@ mobs:register_mob("mobs:minotaur", { -- spawns on desert sand between -1 and 20 light, 1 in 20000 chance, 1 Minotaur in area up to 31000 in height mobs:spawn_specific("mobs:minotaur", {"watershed:drygrass"}, {"air"}, -1, 20, 30, 100000, 1, -31000, 31000, false) -- register spawn egg -mobs:register_egg("mobs:minotaur", "Minotaur", "default_desert_sand.png", 1) +mobs:register_egg("mobs:minotaur", "Minotaur", "mobs_minotaur_inv.png", 1) minetest.register_craftitem("mobs:minotaur_eye", { description = "Minotaur Eye", diff --git a/mods/mobs/npc.lua b/mods/mobs/npc.lua index baa0c616..a8a9d7be 100755 --- a/mods/mobs/npc.lua +++ b/mods/mobs/npc.lua @@ -134,4 +134,4 @@ mobs:register_mob("mobs:npc", { -- spawning enable for now mobs:spawn_specific("mobs:npc", {"default:dirt_with_grass", "default:dirt", "default:junglegrass", "default:sand"}, {"air"}, -1, 20, 30, 100000, 1, -31000, 31000, true) -- register spawn egg -mobs:register_egg("mobs:npc", "Npc", "default_brick.png", 1) +mobs:register_egg("mobs:npc", "Npc", "mobs_npc_male_inv.png", 1) diff --git a/mods/mobs/npc_female.lua b/mods/mobs/npc_female.lua index 5eb2a961..583955fa 100755 --- a/mods/mobs/npc_female.lua +++ b/mods/mobs/npc_female.lua @@ -133,4 +133,4 @@ mobs:register_mob("mobs:npc_female", { -- spawning enable for now mobs:spawn_specific("mobs:npc_female", {"default:dirt_with_grass", "default:dirt", "default:junglegrass", "default:sand"}, {"air"}, -1, 20, 30, 100000, 1, -31000, 31000, true) -- register spawn egg -mobs:register_egg("mobs:npc_female", "Npc", "default_brick.png", 1) +mobs:register_egg("mobs:npc_female", "Npc", "mobs_npc_female_inv.png", 1) diff --git a/mods/mobs/oerkki.lua b/mods/mobs/oerkki.lua index 1b77c285..c20203da 100755 --- a/mods/mobs/oerkki.lua +++ b/mods/mobs/oerkki.lua @@ -60,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:spawn_specific("mobs:oerkki", {"default:stone", "default:sandstone"}, {"air"}, -1, 5, 30, 7000, 1, -31000, -75, false) -- register spawn egg -mobs:register_egg("mobs:oerkki", "Oerkki", "default_obsidian.png", 1) +mobs:register_egg("mobs:oerkki", "Oerkki", "mobs_oerkki_inv.png", 1) diff --git a/mods/mobs/rat.lua b/mods/mobs/rat.lua index d50294e3..26b0a880 100755 --- a/mods/mobs/rat.lua +++ b/mods/mobs/rat.lua @@ -47,7 +47,7 @@ mobs:register_mob("mobs:rat", { -- spawn on stone between 1 and 20 light, 1 in 7000 chance, 1 per area up to 31000 in height mobs:spawn_specific("mobs:rat", {"default:stone", "default:sandstone"}, {"air"}, 0, 20, 30, 10000, 1, -31000, 31000, true) -- register spawn egg -mobs:register_egg("mobs:rat", "Rat", "mobs_rat_inventory.png", 0) +mobs:register_egg("mobs:rat", "Rat", "mobs_rat_inv.png", 0) -- cooked rat, yummy! minetest.register_craftitem("mobs:rat_cooked", { diff --git a/mods/mobs/sandmonster.lua b/mods/mobs/sandmonster.lua index b25ad3c4..be64dacf 100755 --- a/mods/mobs/sandmonster.lua +++ b/mods/mobs/sandmonster.lua @@ -54,4 +54,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:spawn_specific("mobs:sand_monster", {"default:desert_sand", "default:sand"}, {"air"}, -1, 20, 30, 20000, 1, -31000, 31000, false) -- register spawn egg -mobs:register_egg("mobs:sand_monster", "Sand Monster", "default_desert_sand.png", 1) +mobs:register_egg("mobs:sand_monster", "Sand Monster", "mobs_sand_monster_inv.png", 1) diff --git a/mods/mobs/stonemonster.lua b/mods/mobs/stonemonster.lua index 3955967b..4048b3c4 100755 --- a/mods/mobs/stonemonster.lua +++ b/mods/mobs/stonemonster.lua @@ -59,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:spawn_specific("mobs:stone_monster", {"default:stone", "default:sandstone"}, {"air"}, -1, 5, 30, 7000, 1, -31000, -25, false) -- register spawn egg -mobs:register_egg("mobs:stone_monster", "Stone Monster", "default_stone.png", 1) +mobs:register_egg("mobs:stone_monster", "Stone Monster", "mobs_stone_monster_inv.png", 1) diff --git a/mods/mobs/textures/mobs_cow_inv.png b/mods/mobs/textures/mobs_cow_inv.png new file mode 100755 index 00000000..d072df63 Binary files /dev/null and b/mods/mobs/textures/mobs_cow_inv.png differ diff --git a/mods/mobs/textures/mobs_creeper_inv.png b/mods/mobs/textures/mobs_creeper_inv.png index 9f1470ab..d738c6a8 100755 Binary files a/mods/mobs/textures/mobs_creeper_inv.png and b/mods/mobs/textures/mobs_creeper_inv.png differ diff --git a/mods/mobs/textures/mobs_dirt_monster_inv.png b/mods/mobs/textures/mobs_dirt_monster_inv.png new file mode 100755 index 00000000..5f126e56 Binary files /dev/null and b/mods/mobs/textures/mobs_dirt_monster_inv.png differ diff --git a/mods/mobs/textures/mobs_dongeon_master_inv.png b/mods/mobs/textures/mobs_dongeon_master_inv.png new file mode 100755 index 00000000..1d792e20 Binary files /dev/null and b/mods/mobs/textures/mobs_dongeon_master_inv.png differ diff --git a/mods/mobs/textures/mobs_goat_inv.png b/mods/mobs/textures/mobs_goat_inv.png new file mode 100755 index 00000000..6f610a6b Binary files /dev/null and b/mods/mobs/textures/mobs_goat_inv.png differ diff --git a/mods/mobs/textures/mobs_minotaur_inv.png b/mods/mobs/textures/mobs_minotaur_inv.png new file mode 100755 index 00000000..26bb9db3 Binary files /dev/null and b/mods/mobs/textures/mobs_minotaur_inv.png differ diff --git a/mods/mobs/textures/mobs_npc_female_inv.png b/mods/mobs/textures/mobs_npc_female_inv.png new file mode 100755 index 00000000..ca9908ed Binary files /dev/null and b/mods/mobs/textures/mobs_npc_female_inv.png differ diff --git a/mods/mobs/textures/mobs_npc_male_inv.png b/mods/mobs/textures/mobs_npc_male_inv.png new file mode 100755 index 00000000..74953be1 Binary files /dev/null and b/mods/mobs/textures/mobs_npc_male_inv.png differ diff --git a/mods/mobs/textures/mobs_oerkki_inv.png b/mods/mobs/textures/mobs_oerkki_inv.png new file mode 100755 index 00000000..cd553719 Binary files /dev/null and b/mods/mobs/textures/mobs_oerkki_inv.png differ diff --git a/mods/mobs/textures/mobs_rat_inv.png b/mods/mobs/textures/mobs_rat_inv.png new file mode 100755 index 00000000..6d147d40 Binary files /dev/null and b/mods/mobs/textures/mobs_rat_inv.png differ diff --git a/mods/mobs/textures/mobs_sand_monster_inv.png b/mods/mobs/textures/mobs_sand_monster_inv.png new file mode 100755 index 00000000..382f5e01 Binary files /dev/null and b/mods/mobs/textures/mobs_sand_monster_inv.png differ diff --git a/mods/mobs/textures/mobs_stone_monster_inv.png b/mods/mobs/textures/mobs_stone_monster_inv.png new file mode 100755 index 00000000..9d0f7d51 Binary files /dev/null and b/mods/mobs/textures/mobs_stone_monster_inv.png differ diff --git a/mods/mobs/textures/mobs_tree_monster_inv.png b/mods/mobs/textures/mobs_tree_monster_inv.png new file mode 100755 index 00000000..decce806 Binary files /dev/null and b/mods/mobs/textures/mobs_tree_monster_inv.png differ diff --git a/mods/mobs/textures/mobs_warthog_inv.png b/mods/mobs/textures/mobs_warthog_inv.png new file mode 100755 index 00000000..fc4ec88b Binary files /dev/null and b/mods/mobs/textures/mobs_warthog_inv.png differ diff --git a/mods/mobs/textures/mobs_yeti_inv.png b/mods/mobs/textures/mobs_yeti_inv.png new file mode 100755 index 00000000..c48457b3 Binary files /dev/null and b/mods/mobs/textures/mobs_yeti_inv.png differ diff --git a/mods/mobs/textures/mobs_zombies_inv.png b/mods/mobs/textures/mobs_zombies_inv.png new file mode 100755 index 00000000..89f6c7ca Binary files /dev/null and b/mods/mobs/textures/mobs_zombies_inv.png differ diff --git a/mods/mobs/treemonster.lua b/mods/mobs/treemonster.lua index 9c68478d..87ce4c0d 100755 --- a/mods/mobs/treemonster.lua +++ b/mods/mobs/treemonster.lua @@ -60,7 +60,7 @@ mobs:register_mob("mobs:tree_monster", { -- spawn on leaves and beech_leaves, between 0 and 5 light, 1 in 8000 chance, 1 in area up to 31000 in height mobs:spawn_specific("mobs:tree_monster", {"default:leaves", "moretrees:beech_leaves"}, {"air"}, 0, 5, 30, 8000, 1, -31000, 31000, false) -- register spawn egg -mobs:register_egg("mobs:tree_monster", "Tree Monster", "default_tree_top.png", 1) +mobs:register_egg("mobs:tree_monster", "Tree Monster", "mobs_tree_monster_inv.png", 1) -- ethereal sapling compatibility if not minetest.get_modpath("ethereal") then diff --git a/mods/mobs/warthog.lua b/mods/mobs/warthog.lua index da0dae8a..28211742 100755 --- a/mods/mobs/warthog.lua +++ b/mods/mobs/warthog.lua @@ -97,7 +97,7 @@ mobs:register_mob("mobs:pumba", { -- spawns on dirt or junglegrass, between 8 and 20 light, 1 in 10000 chance, 1 in area up to 31000 in height mobs:spawn_specific("mobs:pumba", {"default:dirt", "default:junglegrass"}, {"air"}, 8, 20, 30, 10000, 1, -31000, 31000, true) -- register spawn egg -mobs:register_egg("mobs:pumba", "Warthog", "wool_pink.png", 1) +mobs:register_egg("mobs:pumba", "Warthog", "mobs_warthog_inv.png", 1) -- porkchop (raw and cooked) minetest.register_craftitem("mobs:pork_raw", { diff --git a/mods/mobs/yeti.lua b/mods/mobs/yeti.lua index 59fdd344..94a1a0da 100755 --- a/mods/mobs/yeti.lua +++ b/mods/mobs/yeti.lua @@ -60,7 +60,7 @@ mobs:register_mob("mobs:yeti", { -- spawn on stone between 20 and -1 light, 1 in 7000 chance, 1 in area below 31000 mobs:spawn_specific("mobs:yeti", {"default:dirt_with_snow", "default:snow", "default:snowblock"}, {"air"}, -1, 20, 30, 30000, 1, -31000, 31000, false) -- register spawn egg -mobs:register_egg("mobs:yeti", "Yeti", "default_snow.png", 1) +mobs:register_egg("mobs:yeti", "Yeti", "mobs_yeti_inv.png", 1) -- snowball (weapon) mobs:register_arrow("mobs:snowball", { diff --git a/mods/mobs/zombie.lua b/mods/mobs/zombie.lua index 75d2dd31..f0ce2ad1 100755 --- a/mods/mobs/zombie.lua +++ b/mods/mobs/zombie.lua @@ -61,7 +61,7 @@ mobs:register_mob("mobs:zombie", { -- spawn in nether forest between -1 and 5 light, 1 in 6000 change, 1 zombie in area up to 31000 in height mobs:spawn_specific("mobs:zombie", {"nether:dirt_top"}, {"air"}, -1, 5, 30, 6600, 1, -31000, 31000, false) -- register spawn egg -mobs:register_egg("mobs:zombie", "Zombie", "mobs_zombie_head.png", 1) +mobs:register_egg("mobs:zombie", "Zombie", "mobs_zombie_inv.png", 1) minetest.register_craftitem("mobs:zombie_tibia", { description = "Zombie Tibia",