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

added missing texture

fixed sheep spawn typo
fixed npc male/female follow/drop/tame
chmod 755
This commit is contained in:
crabman77 2015-08-18 23:44:59 +02:00
parent 8847a0188e
commit a1a87f5cb3
29 changed files with 48 additions and 62 deletions

0
mods/mobs/mff_menu.lua Normal file → Executable file
View File

View File

@ -75,14 +75,9 @@ mobs:register_mob("mobs:npc", {
},
-- right clicking with "cooked meat" or "bread" will give npc more health
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 name = clicker:get_player_name()
-- 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 item:get_name() == "default:diamond" then --/MFF (Crabman|07/14/2015) tamed with diamond
if (self.diamond_count or 0) < 4 then
self.diamond_count = (self.diamond_count or 0) + 1
if not minetest.setting_getbool("creative_mode") then
@ -92,27 +87,34 @@ mobs:register_mob("mobs:npc", {
if self.diamond_count >= 4 then
self.damages = 3
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()
pos.y = pos.y + 0.5
minetest.add_item(pos, {
name = mobs.npc_drops[math.random(1, #mobs.npc_drops)]
})
else
minetest.add_item(pos, {name = mobs.npc_drops[math.random(1,#mobs.npc_drops)]})
return
-- 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
self.order = "stand"
else
self.order = "follow"
end
end
end
end
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
end
end,
})
-- 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

View File

@ -29,6 +29,9 @@ mobs:register_mob("mobs:npc_female", {
textures = {
{"mobs_npc_female.png"}, -- female by nuttmeg20
},
child_texture = {
{"mobs_npc_baby.png"}, -- derpy baby by AmirDerAssassine
},
-- sounds
makes_footstep_sound = true,
sounds = {},
@ -56,7 +59,7 @@ mobs:register_mob("mobs:npc_female", {
lava_damage = 6,
light_damage = 0,
-- follow diamond
follow = "default:diamond",
follow = {"farming:bread", "mobs:meat", "default:diamond"},
view_range = 16,
-- set owner and order
owner = "",
@ -73,36 +76,7 @@ mobs:register_mob("mobs:npc_female", {
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
local name = clicker:get_player_name()
if not name then return end
-- 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 item:get_name() == "default:diamond" then --/MFF (Crabman|07/14/2015) tamed with diamond
if (self.diamond_count or 0) < 4 then
self.diamond_count = (self.diamond_count or 0) + 1
if not minetest.setting_getbool("creative_mode") then
@ -114,22 +88,32 @@ mobs:register_mob("mobs:npc_female", {
self.owner = clicker:get_player_name()
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 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
self.order = "stand"
else
self.order = "follow"
end
else
self.owner = clicker:get_player_name()
end
end
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
end
end,
})
-- 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

View File

@ -143,7 +143,7 @@ for _, col in ipairs(all_colours) do
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)
minetest.register_alias("mobs:sheep", "mobs:sheep_white")

0
mods/mobs/textures/mobs_dog_inv.png Normal file → Executable file
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

0
mods/mobs/textures/mobs_sheep_white_inv.png Normal file → Executable file
View 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
View 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
View 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
View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB