added missing texture
fixed sheep spawn typo fixed npc male/female follow/drop/tame chmod 755
0
mods/mobs/mff_menu.lua
Normal file → Executable file
@ -75,14 +75,9 @@ mobs:register_mob("mobs:npc", {
|
|||||||
},
|
},
|
||||||
-- right clicking with "cooked meat" or "bread" will give npc more health
|
-- right clicking with "cooked meat" or "bread" will give npc more health
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
|
|
||||||
-- feed to heal npc
|
|
||||||
if not mobs:feed_tame(self, clicker, 8, true) then
|
|
||||||
local item = clicker:get_wielded_item()
|
local item = clicker:get_wielded_item()
|
||||||
local name = clicker:get_player_name()
|
local name = clicker:get_player_name()
|
||||||
|
if item:get_name() == "default:diamond" then --/MFF (Crabman|07/14/2015) tamed with diamond
|
||||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
|
||||||
elseif item:get_name() == "default:diamond" then --/MFF (Crabman|07/14/2015) tamed with diamond
|
|
||||||
if (self.diamond_count or 0) < 4 then
|
if (self.diamond_count or 0) < 4 then
|
||||||
self.diamond_count = (self.diamond_count or 0) + 1
|
self.diamond_count = (self.diamond_count or 0) + 1
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
@ -92,27 +87,34 @@ mobs:register_mob("mobs:npc", {
|
|||||||
if self.diamond_count >= 4 then
|
if self.diamond_count >= 4 then
|
||||||
self.damages = 3
|
self.damages = 3
|
||||||
self.owner = clicker:get_player_name()
|
self.owner = clicker:get_player_name()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return
|
||||||
|
-- feed to heal npc
|
||||||
|
elseif not mobs:feed_tame(self, clicker, 8, true) then
|
||||||
|
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||||
|
if item:get_name() == "default:gold_lump" then
|
||||||
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
|
item:take_item()
|
||||||
|
clicker:set_wielded_item(item)
|
||||||
|
end
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
pos.y = pos.y + 0.5
|
pos.y = pos.y + 0.5
|
||||||
minetest.add_item(pos, {
|
minetest.add_item(pos, {name = mobs.npc_drops[math.random(1,#mobs.npc_drops)]})
|
||||||
name = mobs.npc_drops[math.random(1, #mobs.npc_drops)]
|
return
|
||||||
})
|
|
||||||
|
|
||||||
else
|
|
||||||
-- if owner switch between follow and stand
|
-- if owner switch between follow and stand
|
||||||
if self.owner and self.owner == clicker:get_player_name() then
|
elseif self.owner and self.owner == clicker:get_player_name() then
|
||||||
if self.order == "follow" then
|
if self.order == "follow" then
|
||||||
self.order = "stand"
|
self.order = "stand"
|
||||||
else
|
else
|
||||||
self.order = "follow"
|
self.order = "follow"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
|
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- spawning enable for now
|
-- 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)
|
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
|
-- register spawn egg
|
||||||
|
@ -29,6 +29,9 @@ mobs:register_mob("mobs:npc_female", {
|
|||||||
textures = {
|
textures = {
|
||||||
{"mobs_npc_female.png"}, -- female by nuttmeg20
|
{"mobs_npc_female.png"}, -- female by nuttmeg20
|
||||||
},
|
},
|
||||||
|
child_texture = {
|
||||||
|
{"mobs_npc_baby.png"}, -- derpy baby by AmirDerAssassine
|
||||||
|
},
|
||||||
-- sounds
|
-- sounds
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
sounds = {},
|
sounds = {},
|
||||||
@ -56,7 +59,7 @@ mobs:register_mob("mobs:npc_female", {
|
|||||||
lava_damage = 6,
|
lava_damage = 6,
|
||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
-- follow diamond
|
-- follow diamond
|
||||||
follow = "default:diamond",
|
follow = {"farming:bread", "mobs:meat", "default:diamond"},
|
||||||
view_range = 16,
|
view_range = 16,
|
||||||
-- set owner and order
|
-- set owner and order
|
||||||
owner = "",
|
owner = "",
|
||||||
@ -73,36 +76,7 @@ mobs:register_mob("mobs:npc_female", {
|
|||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
local item = clicker:get_wielded_item()
|
local item = clicker:get_wielded_item()
|
||||||
local name = clicker:get_player_name()
|
local name = clicker:get_player_name()
|
||||||
if not name then return end
|
if item:get_name() == "default:diamond" then --/MFF (Crabman|07/14/2015) tamed with diamond
|
||||||
-- feed toheal npc
|
|
||||||
if item:get_name() == "mobs:meat"
|
|
||||||
or item:get_name() == "farming:bread" then
|
|
||||||
-- feed and add health
|
|
||||||
local hp = self.object:get_hp()
|
|
||||||
-- return if full health
|
|
||||||
if hp >= self.hp_max then
|
|
||||||
minetest.chat_send_player(name, "NPC at full health.")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
hp = hp + 4 -- add restorative value
|
|
||||||
if hp > self.hp_max then hp = self.hp_max end
|
|
||||||
self.object:set_hp(hp)
|
|
||||||
-- take item
|
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
|
||||||
item:take_item()
|
|
||||||
clicker:set_wielded_item(item)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
|
||||||
elseif item:get_name() == "default:gold_lump" then
|
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
|
||||||
item:take_item()
|
|
||||||
clicker:set_wielded_item(item)
|
|
||||||
end
|
|
||||||
local pos = self.object:getpos()
|
|
||||||
pos.y = pos.y + 0.5
|
|
||||||
minetest.add_item(pos, {name = mobs.npc_drops[math.random(1,#mobs.npc_drops)]})
|
|
||||||
elseif item:get_name() == "default:diamond" then --/MFF (Crabman|07/14/2015) tamed with diamond
|
|
||||||
if (self.diamond_count or 0) < 4 then
|
if (self.diamond_count or 0) < 4 then
|
||||||
self.diamond_count = (self.diamond_count or 0) + 1
|
self.diamond_count = (self.diamond_count or 0) + 1
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
@ -114,22 +88,32 @@ mobs:register_mob("mobs:npc_female", {
|
|||||||
self.owner = clicker:get_player_name()
|
self.owner = clicker:get_player_name()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
return
|
||||||
|
-- feed to heal npc
|
||||||
|
elseif not mobs:feed_tame(self, clicker, 8, true) then
|
||||||
|
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||||
|
if item:get_name() == "default:gold_lump" then
|
||||||
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
|
item:take_item()
|
||||||
|
clicker:set_wielded_item(item)
|
||||||
|
end
|
||||||
|
local pos = self.object:getpos()
|
||||||
|
pos.y = pos.y + 0.5
|
||||||
|
minetest.add_item(pos, {name = mobs.npc_drops[math.random(1,#mobs.npc_drops)]})
|
||||||
|
return
|
||||||
-- if owner switch between follow and stand
|
-- if owner switch between follow and stand
|
||||||
if self.owner and self.owner == clicker:get_player_name() then
|
elseif self.owner and self.owner == clicker:get_player_name() then
|
||||||
if self.order == "follow" then
|
if self.order == "follow" then
|
||||||
self.order = "stand"
|
self.order = "stand"
|
||||||
else
|
else
|
||||||
self.order = "follow"
|
self.order = "follow"
|
||||||
end
|
end
|
||||||
else
|
|
||||||
self.owner = clicker:get_player_name()
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
|
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- spawning enable for now
|
-- 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)
|
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
|
-- register spawn egg
|
||||||
|
@ -143,7 +143,7 @@ for _, col in ipairs(all_colours) do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
mobs:spawn_specific("mobs:sheep", {"default:dirt_with_grass"}, {"air"}, 8, 20, 30, 10000, 1, -31000, 31000, true)
|
mobs:spawn_specific("mobs:sheep_white", {"default:dirt_with_grass"}, {"air"}, 8, 20, 30, 10000, 1, -31000, 31000, true)
|
||||||
|
|
||||||
-- compatibility (item and entity)
|
-- compatibility (item and entity)
|
||||||
minetest.register_alias("mobs:sheep", "mobs:sheep_white")
|
minetest.register_alias("mobs:sheep", "mobs:sheep_white")
|
||||||
|
0
mods/mobs/textures/mobs_dog_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
0
mods/mobs/textures/mobs_green_slime_big_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
0
mods/mobs/textures/mobs_green_slime_medium_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
mods/mobs/textures/mobs_lava_slime_big_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
0
mods/mobs/textures/mobs_lava_slime_medium_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
0
mods/mobs/textures/mobs_mese_monster_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
0
mods/mobs/textures/mobs_sheep_black_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
0
mods/mobs/textures/mobs_sheep_blue_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
0
mods/mobs/textures/mobs_sheep_brown_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
0
mods/mobs/textures/mobs_sheep_cyan_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
0
mods/mobs/textures/mobs_sheep_dark_green_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
0
mods/mobs/textures/mobs_sheep_dark_grey_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
0
mods/mobs/textures/mobs_sheep_green_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
0
mods/mobs/textures/mobs_sheep_grey_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
0
mods/mobs/textures/mobs_sheep_magenta_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
0
mods/mobs/textures/mobs_sheep_orange_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
0
mods/mobs/textures/mobs_sheep_pink_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
0
mods/mobs/textures/mobs_sheep_red_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
0
mods/mobs/textures/mobs_sheep_shaved_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
0
mods/mobs/textures/mobs_sheep_violet_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
BIN
mods/mobs/textures/mobs_sheep_white.png
Executable file
After Width: | Height: | Size: 801 B |
0
mods/mobs/textures/mobs_sheep_white_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
0
mods/mobs/textures/mobs_sheep_yellow_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
0
mods/mobs/textures/mobs_spider_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
0
mods/mobs/textures/mobs_wolf_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |