Compare commits
10 Commits
8eafc83def
...
ab849be9a1
Author | SHA1 | Date | |
---|---|---|---|
|
ab849be9a1 | ||
|
c802423068 | ||
|
9c9a491d90 | ||
|
521176d898 | ||
|
80147ebe6e | ||
|
35b51d299c | ||
|
f627f4f924 | ||
|
e5b45921a4 | ||
|
b295831c14 | ||
|
f8ea841785 |
31
LICENSE
Normal file
@ -0,0 +1,31 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Skandarella
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
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.
|
||||
|
||||
|
||||
Lincense for original Code (mobs redo + mobs_animal + mob_horse + mobs_npc): (MIT) Copyright (c) 2014 Krupnov Pavel and 2016 TenPlus1
|
||||
|
||||
Modified Code by Liil/Wilhelmine/Skandarella (c) 2021
|
||||
Textures, Models and Animation by Liil/Wilhelmine/Skandarella under (MIT) License (c) 2021
|
||||
|
||||
People Sounds by Liil/Wilhelmine/Skandarella. Animal Sounds + Environment are from freesound.org under Creative Commons License.
|
||||
Thanks to Baidonovan, Timtube, Qubodup, Egomassive, Travisneedham, Mrauralization, Gibarroule, Acclivity, Inspectorj, O-ciz,
|
||||
Lydmakeren, Shadeslayer99, Erokia, Filmscore, Anton, 15gpanskabokstefflova-nicola, Vataaa and Robinhood76
|
142
aboinstructor.lua
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.aboinstructor_drops = {
|
||||
"people:samwarrior"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:aboinstructor", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Instructor.b3d",
|
||||
textures = {
|
||||
{"textureaboinstructor.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_instructor",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:weaponstand", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:instructorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"default:gold_ingot"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 75,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "people:emblemoftriumph" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.aboinstructor_drops or mobs.aboinstructor_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("NPC dropped you an item for honor!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Instructor stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Instructor will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:aboinstructor",
|
||||
nodes = {"default:junglewood"},
|
||||
neighbors = {"people:weaponstand"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:aboinstructor", S("Instructor Jungle"), "aaboinstructor.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:aboinstructor", "people:aboinstructor")
|
144
abominer.lua
Normal file
@ -0,0 +1,144 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.abominer_drops = {
|
||||
"default:copper_lump", "default:tin_lump", "default:iron_lump",
|
||||
"default:gold_lump", "default:diamond", "default:copper_lump",
|
||||
"default:iron_lump", "default:tin_lump", "default:copper_lump", "default:tin_lump", "default:iron_lump",
|
||||
"default:gold_lump"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:abominer", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Miner.b3d",
|
||||
textures = {
|
||||
{"textureabominer.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = { random = "people_miner",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:mineshaft", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:minergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:hemp_oil", "farming:hemp_leaf"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "farming:turkish_delight" or item:get_name() == "farming:donut_apple" or item:get_name() == "farming:porridge" or item:get_name() == "farming:jaffa_cake" or item:get_name() == "farming:apple_pie" or item:get_name() == "farming:spaghetti" or item:get_name() == "farming:burger" or item:get_name() == "farming:bibimbap" or item:get_name() == "farming:baked_potato" or item:get_name() == "farming:sunflower_bread" or item:get_name() == "farming:pumpkin_bread" or item:get_name() == "farming:garlic_bread" or item:get_name() == "farming:tomato_soup" or item:get_name() == "pie:brpd_0" or item:get_name() == "farming:bread" or item:get_name() == "farming:bread_multigrain" or item:get_name() == "farming:spanish_potatoes" or item:get_name() == "farming:beetroot_soup" or item:get_name() == "farming:farming:blueberry_pie" or item:get_name() == "farming:porridge" or item:get_name() == "farming:bibimbap" or item:get_name() == "farming:burger" or item:get_name() == "farming:paella" or item:get_name() == "farming:mac_and_cheese" or item:get_name() == "livingcaves:healingsoup" or item:get_name() == "farming:spaghetti" or item:get_name() == "animalworld:escargots" or item:get_name() == "farming:rhubarb_pie" or item:get_name() == "farming:potato_omlet" or item:get_name() == "farming:potato_salad" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.abominer_drops or mobs.abominer_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("NPC dropped you an item for food!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Miner stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Miner will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:abominer",
|
||||
nodes = {"default:junglewood"},
|
||||
neighbors = {"people:mineshaft"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:abominer", S("Miner Jungle"), "aabominer.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:abominer", "people:abominer")
|
142
afrfarmer.lua
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.afrfarmer_drops = {
|
||||
"people:dog", "people:goat", "people:dogfoodsack", "people:ridepig", "people:rideostrich", "people:plough"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:afrfarmer", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Medfarmer.b3d",
|
||||
textures = {
|
||||
{"textureafrfarmer.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_farmerm",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:feeder", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:farmergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"default:coal_lump"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 80,
|
||||
walk_start = 300,
|
||||
walk_end = 400,
|
||||
punch_speed = 100,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_ingot" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.afrfarmer_drops or mobs.afrfarmer_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Farmer dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Farmer stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Farmer will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:afrfarmer",
|
||||
nodes = {"default:acacia_wood"},
|
||||
neighbors = {"people:feeder"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:afrfarmer", S("Farmer Acacia"), "aafrfarmer.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:afrfarmer", "people:afrfarmer")
|
142
afrinstructor.lua
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.afrinstructor_drops = {
|
||||
"people:afrwarrior"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:afrinstructor", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Instructor.b3d",
|
||||
textures = {
|
||||
{"textureafrinstructor.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_instructor",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:weaponstand", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:instructorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"default:gold_ingot"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 75,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "people:emblemoftriumph" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.afrinstructor_drops or mobs.afrinstructor_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("NPC dropped you an item for honor!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Instructor stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Instructor will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:afrinstructor",
|
||||
nodes = {"default:acacia_wood"},
|
||||
neighbors = {"people:weaponstand"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:afrinstructor", S("Instructor Acacia"), "aafrinstructor.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:afrinstructor", "people:afrinstructor")
|
152
afrsmith.lua
Normal file
@ -0,0 +1,152 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.afrsmith_drops = {
|
||||
"default:axe_steel", "default:axe_steel", "default:axe_steel",
|
||||
"default:axe_steel", "default:axe_mese", "default:axe_mese",
|
||||
"default:axe_diamond", "default:axe_diamond", "default:pick_bronze", "default:pick_bronze","default:pick_steel", "default:pick_steel","default:pick_mese", "default:pick_mese",
|
||||
"default:pick_diamond", "default:pick_diamond",
|
||||
"default:shovel_bronze", "default:shovel_bronze",
|
||||
"default:shovel_steel", "default:shovel_steel",
|
||||
"default:shovel_mese", "default:shovel_mese",
|
||||
"default:shovel_diamond", "default:shovel_diamond ",
|
||||
"default:sword_bronze", "default:sword_bronze", "default:sword_steel",
|
||||
"default:sword_steel", "default:sword_mese", "default:sword_mese",
|
||||
"default:sword_diamond", "default:sword_diamond"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:afrsmith", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Medsmith.b3d",
|
||||
textures = {
|
||||
{"textureafrsmith.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_smith",
|
||||
damage = "people_female5",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:forge", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:smithgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_ingot" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.afrsmith_drops or mobs.afrsmith_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Blackmith dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Blacksmith stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Blacksmith will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:afrsmith",
|
||||
nodes = {"default:acacia_wood"},
|
||||
neighbors = {"people:forge"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:afrsmith", S("Blacksmith Acacia"), "aafrsmith.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:afrsmith", "people:afrsmith")
|
155
afrwarrior.lua
Normal file
@ -0,0 +1,155 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
-- Npc by TenPlus1
|
||||
|
||||
|
||||
mobs:register_mob("people:afrwarrior", {
|
||||
type = "npc",
|
||||
passive = false,
|
||||
damage = 10,
|
||||
attack_type = "dogshoot",
|
||||
dogshoot_switch = 1,
|
||||
dogshoot_count_max = 12, -- shoot for 12 seconds
|
||||
dogshoot_count2_max = 3, -- dogfight for 3 seconds
|
||||
shoot_interval = 1.5,
|
||||
arrow = "people:spearfly",
|
||||
shoot_offset = 2,
|
||||
attacks_monsters = true,
|
||||
attack_npcs = false,
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
hp_min = 100,
|
||||
hp_max = 145,
|
||||
armor = 80,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Warrior.b3d",
|
||||
drawtype = "front",
|
||||
textures = {
|
||||
{"textureafrwarrior.png"},
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
attack = "people_warrior3",
|
||||
random = "people_warrior2",
|
||||
damage = "people_male5",
|
||||
death = "people_warrior",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 3,
|
||||
run_velocity = 4,
|
||||
jump = true,
|
||||
stay_near = {{"people:weaponstand", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 5},
|
||||
drops = { {name = "people:warriorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 2,
|
||||
light_damage = 0,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 12,
|
||||
owner = "",
|
||||
order = "stand",
|
||||
fear_height = 3,
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
walk_speed = 100,
|
||||
walk_start = 100,
|
||||
walk_end = 200,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
shoot_start = 300,
|
||||
shoot_speed = 80,
|
||||
shoot_end = 400,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||
|
||||
-- capture npc with net or lasso
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
-- protect npc with mobs:protector
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
|
||||
|
||||
-- by right-clicking owner can switch npc between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Warrior stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
|
||||
minetest.chat_send_player(name, S("Warrior will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
|
||||
do_punch = function(self, hitter,
|
||||
time_from_last_punch,
|
||||
tool_capabilities,
|
||||
direction)
|
||||
|
||||
-- Prevent friendly fire from killing each other :)
|
||||
local entity = hitter:get_luaentity()
|
||||
|
||||
if entity == "people:afrwarrior" then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("people:afrwarrior", S("Warrior Acacia"), "aafrwarrior.png" )
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:afrwarrior", "people:afrwarrior")
|
||||
|
||||
mobs:register_arrow("people:spearfly", {
|
||||
visual = "sprite",
|
||||
visual_size = {x=.5, y=.5},
|
||||
textures = {"spearfly.png"},
|
||||
velocity = 8,
|
||||
drop = true,
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=13},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=13},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
end,
|
||||
})
|
142
aradoctor.lua
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.aradoctor_drops = {
|
||||
"farming:hemp_leaf", "farming:hemp_oil", "farming:carrot_gold", "people:firsaidkit"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:aradoctor", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Doctor.b3d",
|
||||
textures = {
|
||||
{"texturearadoctor.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_female",
|
||||
damage = "people_female5",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:firstaidnode", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:doctorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:mint_tea"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 80,
|
||||
walk_start = 300,
|
||||
walk_end = 400,
|
||||
punch_speed = 100,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_lump" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.aradoctor_drops or mobs.aradoctor_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Doctor dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Doctor stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Doctor will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:aradoctor",
|
||||
nodes = {"default:acacia_wood"},
|
||||
neighbors = {"people:firstaidnode"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:aradoctor", S("Doctor Acacia"), "aaradoctor.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:aradoctor", "people:aradoctor")
|
144
araminer.lua
Normal file
@ -0,0 +1,144 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.araminer_drops = {
|
||||
"default:copper_lump", "default:tin_lump", "default:iron_lump",
|
||||
"default:gold_lump", "default:diamond", "default:copper_lump",
|
||||
"default:iron_lump", "default:tin_lump", "default:copper_lump", "default:tin_lump", "default:iron_lump",
|
||||
"default:gold_lump"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:araminer", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Miner.b3d",
|
||||
textures = {
|
||||
{"texturearaminer.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = { random = "people_miner",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:mineshaft", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:minergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:hemp_oil", "farming:hemp_leaf"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "farming:turkish_delight" or item:get_name() == "farming:donut_apple" or item:get_name() == "farming:porridge" or item:get_name() == "farming:jaffa_cake" or item:get_name() == "farming:apple_pie" or item:get_name() == "farming:spaghetti" or item:get_name() == "farming:burger" or item:get_name() == "farming:bibimbap" or item:get_name() == "farming:baked_potato" or item:get_name() == "farming:sunflower_bread" or item:get_name() == "farming:pumpkin_bread" or item:get_name() == "farming:garlic_bread" or item:get_name() == "farming:tomato_soup" or item:get_name() == "pie:brpd_0" or item:get_name() == "farming:bread" or item:get_name() == "farming:bread_multigrain" or item:get_name() == "farming:spanish_potatoes" or item:get_name() == "farming:beetroot_soup" or item:get_name() == "farming:farming:blueberry_pie" or item:get_name() == "farming:porridge" or item:get_name() == "farming:bibimbap" or item:get_name() == "farming:burger" or item:get_name() == "farming:paella" or item:get_name() == "farming:mac_and_cheese" or item:get_name() == "livingcaves:healingsoup" or item:get_name() == "farming:spaghetti" or item:get_name() == "animalworld:escargots" or item:get_name() == "farming:rhubarb_pie" or item:get_name() == "farming:potato_omlet" or item:get_name() == "farming:potato_salad" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.araminer_drops or mobs.araminer_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("NPC dropped you an item for food!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Miner stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Miner will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:araminer",
|
||||
nodes = {"default:acacia_wood"},
|
||||
neighbors = {"people:mineshaft"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:araminer", S("Miner Acacia"), "aaraminer.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:araminer", "people:araminer")
|
87
aravillager.lua
Normal file
@ -0,0 +1,87 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:aravillager", {
|
||||
stepheight = 1,
|
||||
type = "animal",
|
||||
passive = true,
|
||||
attack_type = "dogfight",
|
||||
group_attack = true,
|
||||
owner_loyal = true,
|
||||
attack_npcs = false,
|
||||
reach = 2,
|
||||
damage = 2,
|
||||
hp_min = 30,
|
||||
hp_max = 60,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-0.8,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Villager.b3d",
|
||||
visual_size = {x = 0.8, y = 0.8},
|
||||
textures = {
|
||||
{"texturearavillager.png"},
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_female2",
|
||||
damage = "people_female4",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2.5,
|
||||
walk_chance = 10,
|
||||
runaway = true,
|
||||
runaway_from = {"animalworld:bear", "animalworld:crocodile", "animalworld:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "livingfloatlands:tyrannosaurus", "livingfloatlands:velociraptor", "people:pirate", "people:evilminer", "people:jealousminer", "people:hatefulminer", "people:plunderercrossbow", "people:plundererflask", "people:plundererstick"},
|
||||
jump = true,
|
||||
jump_height = 6,
|
||||
pushable = true,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 10,
|
||||
drops = { {name = "people:villagergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
fear_height = 2,
|
||||
stay_near = {{"people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 65,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:aravillager",
|
||||
nodes = {"default:acacia_wood"},
|
||||
neighbors = {"people:villagerbed"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
|
||||
mobs:register_egg("people:aravillager", S("Villager Acacia"), "aaravillager.png")
|
||||
|
||||
|
||||
mobs:alias_mob("people:aravillager", "people:aravillager") -- compatibility
|
22
bootynode.lua
Normal file
@ -0,0 +1,22 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
minetest.register_node("people:bootynode", {
|
||||
description = S"Booty",
|
||||
tiles = {
|
||||
"people_bootynode_top.png",
|
||||
"people_bootynode_bottom.png",
|
||||
"people_bootynode_right.png",
|
||||
"people_bootynode_left.png",
|
||||
"people_bootynode_back.png",
|
||||
"people_bootynode_front.png"
|
||||
},
|
||||
groups = {choppy = 2},
|
||||
drop = "default:gold_lump 1",
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "people:bootynode",
|
||||
burntime = 4,
|
||||
})
|
142
chindoctor.lua
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.chindoctor_drops = {
|
||||
"farming:hemp_leaf", "farming:hemp_oil", "farming:carrot_gold", "people:firsaidkit"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:chindoctor", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Doctor.b3d",
|
||||
textures = {
|
||||
{"texturechindoctor.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_female",
|
||||
damage = "people_female5",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:firstaidnode", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:doctorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:mint_tea"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 80,
|
||||
walk_start = 300,
|
||||
walk_end = 400,
|
||||
punch_speed = 100,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_lump" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.chindoctor_drops or mobs.chindoctor_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Doctor dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Doctor stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Doctor will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:chindoctor",
|
||||
nodes = {"default:aspen_wood"},
|
||||
neighbors = {"people:firstaidnode"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:chindoctor", S("Doctor Aspen"), "achindoctor.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:chindoctor", "people:chindoctor")
|
142
chinfarmer.lua
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.chinfarmer_drops = {
|
||||
"people:dog", "people:goat", "people:dogfoodsack", "people:ridepig", "people:ridereindeer", "people:plough"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:chinfarmer", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Medfarmer2.b3d",
|
||||
textures = {
|
||||
{"texturechinfarmer.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_farmerf",
|
||||
damage = "people_female5",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:feeder", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:farmergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"default:coal_lump"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 80,
|
||||
walk_start = 300,
|
||||
walk_end = 400,
|
||||
punch_speed = 100,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_ingot" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.chinfarmer_drops or mobs.chinfarmer_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Farmer dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Farmer stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Farmer will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:chinfarmer",
|
||||
nodes = {"default:aspen_wood"},
|
||||
neighbors = {"people:feeder"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:chinfarmer", S("Farmer Aspen"), "achinfarmer.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:chinfarmer", "people:chinfarmer")
|
142
chininstructor.lua
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.chininstructor_drops = {
|
||||
"people:ewewarrior"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:chininstructor", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Instructor.b3d",
|
||||
textures = {
|
||||
{"texturechininstructor.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_instructor",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:weaponstand", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:instructorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"default:gold_ingot"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 75,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "people:emblemoftriumph" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.chininstructor_drops or mobs.chininstructor_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("NPC dropped you an item for honor!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Instructor stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Instructor will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:chininstructor",
|
||||
nodes = {"default:aspen_wood"},
|
||||
neighbors = {"people:weaponstand"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:chininstructor", S("Instructor Aspen"), "achininstructor.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:chininstructor", "people:chininstructor")
|
152
chinsmith.lua
Normal file
@ -0,0 +1,152 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.chinsmith_drops = {
|
||||
"default:axe_steel", "default:axe_steel", "default:axe_steel",
|
||||
"default:axe_steel", "default:axe_mese", "default:axe_mese",
|
||||
"default:axe_diamond", "default:axe_diamond", "default:pick_bronze", "default:pick_bronze","default:pick_steel", "default:pick_steel","default:pick_mese", "default:pick_mese",
|
||||
"default:pick_diamond", "default:pick_diamond",
|
||||
"default:shovel_bronze", "default:shovel_bronze",
|
||||
"default:shovel_steel", "default:shovel_steel",
|
||||
"default:shovel_mese", "default:shovel_mese",
|
||||
"default:shovel_diamond", "default:shovel_diamond ",
|
||||
"default:sword_bronze", "default:sword_bronze", "default:sword_steel",
|
||||
"default:sword_steel", "default:sword_mese", "default:sword_mese",
|
||||
"default:sword_diamond", "default:sword_diamond"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:chinsmith", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Medsmith.b3d",
|
||||
textures = {
|
||||
{"texturechinsmith.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_smith",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:forge", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:smithgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_ingot" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.chinsmith_drops or mobs.chinsmith_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Blackmith dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Blacksmith stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Blacksmith will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:chinsmith",
|
||||
nodes = {"default:aspen_wood"},
|
||||
neighbors = {"people:forge"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:chinsmith", S("Blacksmith Aspen"), "achinsmith.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:chinsmith", "people:chinsmith")
|
7
depends.txt
Normal file
@ -0,0 +1,7 @@
|
||||
mobs
|
||||
default
|
||||
farming
|
||||
ethereal?
|
||||
xocean?
|
||||
fishing?
|
||||
hunger_ng?
|
3
description.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Based on Mobs Redo.
|
||||
Adds the possibility to build living villages in your Minetest Game world.
|
||||
Trade items for random stuff from your villagers, recruit mounts and warriors.
|
153
dog.lua
Normal file
@ -0,0 +1,153 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:dog", {
|
||||
type = "animal",
|
||||
visual = "mesh",
|
||||
mesh = "Dog.b3d",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.5, 0.4},
|
||||
animation = {
|
||||
speed_normal = 100,
|
||||
stand_speed = 50,
|
||||
stand_start = 400,
|
||||
stand_end = 500,
|
||||
stand2_speed = 50,
|
||||
stand2_start = 250,
|
||||
stand2_end = 350,
|
||||
stand3_speed = 50,
|
||||
stand3_start = 400,
|
||||
stand3_end = 500,
|
||||
stand4_speed = 50,
|
||||
stand4_start = 500,
|
||||
stand4_end = 600,
|
||||
stand5_speed = 50,
|
||||
stand5_start = 500,
|
||||
stand5_end = 600,
|
||||
walk_start = 0,
|
||||
walk_end = 100,
|
||||
punch_start = 100,
|
||||
punch_end = 200,
|
||||
punch2_start = 100,
|
||||
punch2_end = 200,
|
||||
die_start = 100,
|
||||
die_end = 200,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
textures = {
|
||||
{"texturedog.png"}
|
||||
},
|
||||
child_texture = {
|
||||
{"texturedogbaby.png"},
|
||||
},
|
||||
fear_height = 3,
|
||||
runaway = false,
|
||||
jump = true,
|
||||
jump_height = 6,
|
||||
fly = false,
|
||||
walk_velocity = 1,
|
||||
run_velocity = 4,
|
||||
view_range = 10,
|
||||
passive = false,
|
||||
attack_type = "dogfight",
|
||||
damage = 6,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npcs = false,
|
||||
pathfinding = true,
|
||||
group_attack = true,
|
||||
hp_min = 45,
|
||||
hp_max = 75,
|
||||
armor = 100,
|
||||
knock_back = 2,
|
||||
lava_damage = 5,
|
||||
fall_damage = 1,
|
||||
water_damage = 0,
|
||||
stay_near = {{"people:dogfoodsack", "mobs:meatblock"}, 5},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
attack = "people_dog4",
|
||||
random = "people_dog2",
|
||||
damage = "people_dog3",
|
||||
death = "people_dog5",
|
||||
distance = 10,
|
||||
},
|
||||
follow = {"people:dogfood", "people:dogfood_cooked", "livingfloatlands:theropodcooked", "mobs:meatblock", "animalworld:whelaemeat_cooked", "animalworld:rat_cooked", "mobs:meat", "animalworld:chicken_cooked", "livingfloatlands:sauropodcooked", "livingfloatlands:ornithischiacooked", "nativevillages:driedhumanmeat", "livingfloatlands:largemammalcooked", "pie:meat"},
|
||||
on_rightclick = function(self, clicker)
|
||||
if mobs:feed_tame(self, clicker, 6, true, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 15, 25, 0, false, nil) then return end
|
||||
|
||||
if clicker:get_wielded_item():is_empty() and clicker:get_player_name() == self.owner then
|
||||
if clicker:get_player_control().sneak then
|
||||
self.order = ""
|
||||
self.state = "walk"
|
||||
self.walk_velocity = 2
|
||||
self.stepheight = 2
|
||||
else
|
||||
if self.order == "follow" then
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self.walk_velocity = 2
|
||||
self.stepheight = 2
|
||||
else
|
||||
self.order = "follow"
|
||||
self.state = "walk"
|
||||
self.walk_velocity = 3
|
||||
self.stepheight = 2
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
mobs:register_egg("people:dog", S"Dog", "adog.png")
|
||||
-- raw dogfood
|
||||
minetest.register_craftitem(":people:dogfood", {
|
||||
description = S("Dog Food"),
|
||||
inventory_image = "people_dogfood.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = {food_meat_raw = 1, food_mutton_raw = 1, flammable = 2},
|
||||
})
|
||||
|
||||
-- cooked dogfood
|
||||
minetest.register_craftitem(":people:dogfood_cooked", {
|
||||
description = S("Cooked Dog Food"),
|
||||
inventory_image = "people_dogfood_cooked.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
groups = {food_meat = 1, food_mutton = 1, flammable = 2},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "people:dogfood_cooked",
|
||||
recipe = "people:dogfood",
|
||||
cooktime = 5,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("people:dogfoodsack", {
|
||||
description = S"Sack of Dog Food",
|
||||
tiles = {
|
||||
"people_dogfoodsack_top.png",
|
||||
"people_dogfoodsack_bottom.png",
|
||||
"people_dogfoodsack_right.png",
|
||||
"people_dogfoodsack_left.png",
|
||||
"people_dogfoodsack_back.png",
|
||||
"people_dogfoodsack_front.png"
|
||||
},
|
||||
groups = {crumbly = 3},
|
||||
drop = "people:dogfood 9",
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "people:dogfoodsack",
|
||||
recipe = {
|
||||
{"people:dogfood", "people:dogfood", "people:dogfood"},
|
||||
{"people:dogfood", "people:dogfood", "people:dogfood"},
|
||||
{"people:dogfood", "people:dogfood", "people:dogfood"},
|
||||
}
|
||||
})
|
82
evilminer.lua
Normal file
@ -0,0 +1,82 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:evilminer", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attack_type = "dogfight",
|
||||
attack_animals = true,
|
||||
reach = 2,
|
||||
damage = 9,
|
||||
hp_min = 55,
|
||||
hp_max = 85,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Miner.b3d",
|
||||
visual_size = {x = 1.0, y = 1.0},
|
||||
textures = {
|
||||
{"textureevilminer.png"},
|
||||
},
|
||||
sounds = {
|
||||
attack = "people_evilminer2",
|
||||
random = "people_evilminer4",
|
||||
damage = "people_evilminer",
|
||||
death = "people_evilminer3",
|
||||
distance = 15,
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
run_velocity = 3,
|
||||
runaway = false,
|
||||
jump = true,
|
||||
stay_near = {{"default:stone_with_coal", "default:stone_with_copper", " default:stone_with_tin", "default:stone_with_iron", "default:stone_with_gold", "default:stone_with_mese", "default:stone_with_diamond"}, 5},
|
||||
drops = {
|
||||
{name = "default:gold_lump", chance = 1, min = 1, max = 1},
|
||||
{name = "people:emblemoftriumph", chance = 7, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 5,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
view_range = 15,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed or tame
|
||||
if mobs:feed_tame(self, clicker, 4, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:evilminer",
|
||||
nodes = {"default:stone"},
|
||||
neighbors = {"default:stone_with_diamond", "default:mese"},
|
||||
min_light = 0,
|
||||
interval = 60,
|
||||
chance = 2, -- 15000
|
||||
min_height = -1000,
|
||||
max_height = -400,
|
||||
})
|
||||
end
|
||||
|
||||
mobs:register_egg("people:evilminer", S("Evil Miner"), "aevilminer.png")
|
144
eweminer.lua
Normal file
@ -0,0 +1,144 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.eweminer_drops = {
|
||||
"default:copper_lump", "default:tin_lump", "default:iron_lump",
|
||||
"default:gold_lump", "default:diamond", "default:copper_lump",
|
||||
"default:iron_lump", "default:tin_lump", "default:copper_lump", "default:tin_lump", "default:iron_lump",
|
||||
"default:gold_lump"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:eweminer", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Miner.b3d",
|
||||
textures = {
|
||||
{"textureeweminer.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = { random = "people_miner",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:mineshaft", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:minergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:hemp_oil", "farming:hemp_leaf"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "farming:turkish_delight" or item:get_name() == "farming:donut_apple" or item:get_name() == "farming:porridge" or item:get_name() == "farming:jaffa_cake" or item:get_name() == "farming:apple_pie" or item:get_name() == "farming:spaghetti" or item:get_name() == "farming:burger" or item:get_name() == "farming:bibimbap" or item:get_name() == "farming:baked_potato" or item:get_name() == "farming:sunflower_bread" or item:get_name() == "farming:pumpkin_bread" or item:get_name() == "farming:garlic_bread" or item:get_name() == "farming:tomato_soup" or item:get_name() == "pie:brpd_0" or item:get_name() == "farming:bread" or item:get_name() == "farming:bread_multigrain" or item:get_name() == "farming:spanish_potatoes" or item:get_name() == "farming:beetroot_soup" or item:get_name() == "farming:farming:blueberry_pie" or item:get_name() == "farming:porridge" or item:get_name() == "farming:bibimbap" or item:get_name() == "farming:burger" or item:get_name() == "farming:paella" or item:get_name() == "farming:mac_and_cheese" or item:get_name() == "livingcaves:healingsoup" or item:get_name() == "farming:spaghetti" or item:get_name() == "animalworld:escargots" or item:get_name() == "farming:rhubarb_pie" or item:get_name() == "farming:potato_omlet" or item:get_name() == "farming:potato_salad" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.eweminer_drops or mobs.eweminer_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("NPC dropped you an item for food!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Miner stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Miner will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:eweminer",
|
||||
nodes = {"default:aspen_wood"},
|
||||
neighbors = {"people:mineshaft"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:eweminer", S("Miner Aspen"), "aeweminer.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:eweminer", "people:eweminer")
|
87
ewevillager.lua
Normal file
@ -0,0 +1,87 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:ewevillager", {
|
||||
stepheight = 1,
|
||||
type = "animal",
|
||||
passive = true,
|
||||
attack_type = "dogfight",
|
||||
group_attack = true,
|
||||
owner_loyal = true,
|
||||
attack_npcs = false,
|
||||
reach = 2,
|
||||
damage = 2,
|
||||
hp_min = 30,
|
||||
hp_max = 60,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-0.7,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Villager.b3d",
|
||||
visual_size = {x = 0.7, y = 0.7},
|
||||
textures = {
|
||||
{"textureewevillager.png"},
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_female2",
|
||||
damage = "people_female4",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2.5,
|
||||
walk_chance = 10,
|
||||
runaway = true,
|
||||
runaway_from = {"animalworld:bear", "animalworld:crocodile", "animalworld:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "livingfloatlands:tyrannosaurus", "livingfloatlands:velociraptor", "people:pirate", "people:evilminer", "people:jealousminer", "people:hatefulminer", "people:plunderercrossbow", "people:plundererflask", "people:plundererstick"},
|
||||
jump = true,
|
||||
jump_height = 6,
|
||||
stay_near = {{"people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
pushable = true,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 10,
|
||||
drops = { {name = "people:villagergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
fear_height = 2,
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 65,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:ewevillager",
|
||||
nodes = {"default:aspen_wood"},
|
||||
neighbors = {"people:villagerbed"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
|
||||
mobs:register_egg("people:ewevillager", S("Villager Aspen"), "aewevillager.png")
|
||||
|
||||
|
||||
mobs:alias_mob("people:ewevillager", "people:ewevillager") -- compatibility
|
155
ewewarrior.lua
Normal file
@ -0,0 +1,155 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
-- Npc by TenPlus1
|
||||
|
||||
|
||||
mobs:register_mob("people:ewewarrior", {
|
||||
type = "npc",
|
||||
passive = false,
|
||||
damage = 10,
|
||||
attack_type = "dogshoot",
|
||||
dogshoot_switch = 1,
|
||||
dogshoot_count_max = 12, -- shoot for 12 seconds
|
||||
dogshoot_count2_max = 3, -- dogfight for 3 seconds
|
||||
shoot_interval = 1.5,
|
||||
arrow = "people:spearfly",
|
||||
shoot_offset = 2,
|
||||
attacks_monsters = true,
|
||||
attack_npcs = false,
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
hp_min = 100,
|
||||
hp_max = 145,
|
||||
armor = 80,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Warrior.b3d",
|
||||
drawtype = "front",
|
||||
textures = {
|
||||
{"textureewewarrior.png"},
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
attack = "people_warrior3",
|
||||
random = "people_warrior2",
|
||||
damage = "people_male5",
|
||||
death = "people_warrior",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 3,
|
||||
run_velocity = 4,
|
||||
jump = true,
|
||||
stay_near = {{"people:weaponstand", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 5},
|
||||
drops = { {name = "people:warriorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 2,
|
||||
light_damage = 0,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 12,
|
||||
owner = "",
|
||||
order = "stand",
|
||||
fear_height = 3,
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
walk_speed = 100,
|
||||
walk_start = 100,
|
||||
walk_end = 200,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
shoot_start = 300,
|
||||
shoot_speed = 80,
|
||||
shoot_end = 400,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||
|
||||
-- capture npc with net or lasso
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
-- protect npc with mobs:protector
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
|
||||
|
||||
-- by right-clicking owner can switch npc between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Warrior stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
|
||||
minetest.chat_send_player(name, S("Warrior will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
|
||||
do_punch = function(self, hitter,
|
||||
time_from_last_punch,
|
||||
tool_capabilities,
|
||||
direction)
|
||||
|
||||
-- Prevent friendly fire from killing each other :)
|
||||
local entity = hitter:get_luaentity()
|
||||
|
||||
if entity == "people:ewewarrior" then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("people:ewewarrior", S("Warrior Aspen"), "aewewarrior.png" )
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:ewewarrior", "people:ewewarrior")
|
||||
|
||||
mobs:register_arrow("people:spearfly", {
|
||||
visual = "sprite",
|
||||
visual_size = {x=.5, y=.5},
|
||||
textures = {"spearfly.png"},
|
||||
velocity = 8,
|
||||
drop = true,
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=13},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=13},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
end,
|
||||
})
|
22
feeder.lua
Normal file
@ -0,0 +1,22 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
minetest.register_node("people:feeder", {
|
||||
description = S"Feeder",
|
||||
visual_scale = 1,
|
||||
mesh = "Feeder.b3d",
|
||||
tiles = {"texturefeeder.png"},
|
||||
inventory_image = "afeeder.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = false,
|
||||
groups = {choppy = 3},
|
||||
drawtype = "mesh",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 2.0, 0.4},
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "people:feeder",
|
||||
burntime = 4,
|
||||
})
|
20
firstaidnode.lua
Normal file
@ -0,0 +1,20 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
minetest.register_node("people:firstaidnode", {
|
||||
description = S"First Aid Node",
|
||||
tiles = {
|
||||
"people_firstaidnode_top.png",
|
||||
"people_firstaidnode_bottom.png",
|
||||
"people_firstaidnode_right.png",
|
||||
"people_firstaidnode_left.png",
|
||||
"people_firstaidnode_back.png",
|
||||
"people_firstaidnode_front.png"
|
||||
},
|
||||
groups = {choppy = 2}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "people:firstaidnode",
|
||||
burntime = 4,
|
||||
})
|
35
forge.lua
Normal file
@ -0,0 +1,35 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
minetest.register_node("people:forge", {
|
||||
description = S"Anvil",
|
||||
visual_scale = 0.5,
|
||||
mesh = "Forge.b3d",
|
||||
tiles = {"textureforge.png"},
|
||||
inventory_image = "aforge.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 3},
|
||||
walkable = false,
|
||||
drawtype = "mesh",
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
|
||||
--[[{-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
|
||||
{-0.3, -0.3, -0.3, 0.3, 0.3, 0.3}]]
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3, -0.3, -0.3, 0.3, 0.3, 0.3}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "default:steel_ingot",
|
||||
recipe = "people:forge",
|
||||
})
|
178
goat.lua
Normal file
@ -0,0 +1,178 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:goat", {
|
||||
stay_near = {"farming:straw", 10, "people:feeder", 10},
|
||||
stepheight = 1,
|
||||
type = "animal",
|
||||
passive = true,
|
||||
damage = 4,
|
||||
hp_min = 25,
|
||||
hp_max = 45,
|
||||
armor = 100,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.5, 0.4},
|
||||
visual = "mesh",
|
||||
mesh = "Goat.b3d",
|
||||
textures = {
|
||||
{"texturegoat.png"},
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_goat",
|
||||
damage = "people_goat2",
|
||||
distance = 5,
|
||||
},
|
||||
walk_velocity = 1,
|
||||
run_velocity = 2,
|
||||
runaway = true,
|
||||
runaway_from = {"animalworld:bear", "animalworld:crocodile", "animalworld:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "livingfloatlands:tyrannosaurus", "livingfloatlands:velociraptor", "animalworld:divingbeetle", "animalworld:scorpion", "animalworld:polarbear", "animalworld:leopardseal", "animalworld:stellerseagle", "animalworld:wolf", "animalworld:panda", "animalworld:stingray", "marinaramobs:jellyfish", "marinaramobs:octopus", "livingcavesmobs:biter", "livingcavesmobs:flesheatingbacteria"},
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
pushable = true,
|
||||
stay_near = {{"people:feeder", "marinara:reed_bundle", "naturalbiomes:reed_bundle", "farming:straw"}, 5},
|
||||
drops = {
|
||||
{name = "people:mutton_raw", chance = 1, min = 1, max = 2},
|
||||
{name = "wool:white", chance = 1, min = 1, max = 2},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
speed_run = 80,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
walk_speed = 90,
|
||||
walk_start = 100,
|
||||
walk_end = 200,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
follow = {
|
||||
"farming:wheat", "default:grass_1", "farming:barley",
|
||||
"farming:oat", "farming:rye", "default:dry_grass_1", "default:dry_grass_2", "default:dry_grass_3", "default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5", "default:marram_grass_1", "default:marram_grass_2", "default:marram_grass_3", "default:coldsteppe_grass_1", "default:coldsteppe_grass_2", "default:coldsteppe_grass_3", "default:coldsteppe_grass_4", "default:coldsteppe_grass_5", "default:coldsteppe_grass_6", "naturalbiomes:savanna_grass1", "naturalbiomes:savanna_grass2", "naturalbiomes:savanna_grass3", "naturalbiomes:outback_grass1", "naturalbiomes:outback_grass2", "naturalbiomes:outback_grass3", "naturalbiomes:outback_grass4", "naturalbiomes:outback_grass5", "naturalbiomes:outback_grass6", "naturalbiomes:med_grass1", "naturalbiomes:med_grass2", "naturalbiomes:heath_grass1", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:alpine_grass1", "naturalbiomes:alpine_grass2", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:", "naturalbiomes:", "naturalbiomes:bushland_grass", "naturalbiomes:bushland_grass2", "naturalbiomes:bushland_grass3", "naturalbiomes:bushland_grass4", "naturalbiomes:bushland_grass5", "naturalbiomes:bushland_grass6", "naturalbiomes:bushland_grass7", "group:grass", "group:normal_grass"
|
||||
},
|
||||
view_range = 8,
|
||||
replace_rate = 10,
|
||||
replace_what = {
|
||||
{"group:grass", "air", -1},
|
||||
{"default:dirt_with_grass", "default:dirt", -2}
|
||||
},
|
||||
fear_height = 2,
|
||||
on_replace = function(self, pos, oldnode, newnode)
|
||||
|
||||
self.food = (self.food or 0) + 1
|
||||
|
||||
-- if sheep replaces 8x grass then it regrows wool
|
||||
if self.food >= 8 then
|
||||
|
||||
self.food = 0
|
||||
self.gotten = false
|
||||
|
||||
self.object:set_properties({
|
||||
textures = {"texturegoat.png"},
|
||||
mesh = "Goat.b3d",
|
||||
})
|
||||
end
|
||||
end,
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
--are we feeding?
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then
|
||||
|
||||
--if fed 7 times then sheep regrows wool
|
||||
if self.food and self.food > 6 then
|
||||
|
||||
self.gotten = false
|
||||
|
||||
self.object:set_properties({
|
||||
textures = {"texturegoat.png"},
|
||||
mesh = "Goat.b3d",
|
||||
})
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local itemname = item:get_name()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
--are we giving a haircut>
|
||||
if itemname == "mobs:shears" then
|
||||
|
||||
if self.gotten ~= false
|
||||
or self.child ~= false
|
||||
or name ~= self.owner
|
||||
or not minetest.get_modpath("wool") then
|
||||
return
|
||||
end
|
||||
|
||||
self.gotten = true -- shaved
|
||||
|
||||
local obj = minetest.add_item(
|
||||
self.object:get_pos(),
|
||||
ItemStack( "wool:white" )
|
||||
)
|
||||
|
||||
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)
|
||||
|
||||
self.object:set_properties({
|
||||
textures = {"texturegoat2.png"},
|
||||
mesh = "Goat.b3d",
|
||||
})
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- protect mod with mobs:protector item
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
--are we capturing?
|
||||
if mobs:capture_mob(self, clicker, 15, 0, 25, false, nil) then return end
|
||||
end
|
||||
})
|
||||
|
||||
mobs:register_egg("people:goat", S("Goat"), "agoat.png")
|
||||
|
||||
mobs:alias_mob("people:goat", "people:goat") -- compatibility
|
||||
|
||||
-- raw mutton
|
||||
minetest.register_craftitem(":people:mutton_raw", {
|
||||
description = S("Raw Mutton"),
|
||||
inventory_image = "people_mutton_raw.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = {food_meat_raw = 1, food_mutton_raw = 1, flammable = 2},
|
||||
})
|
||||
|
||||
-- cooked mutton
|
||||
minetest.register_craftitem(":people:mutton_cooked", {
|
||||
description = S("Cooked Mutton"),
|
||||
inventory_image = "people_mutton_cooked.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
groups = {food_meat = 1, food_mutton = 1, flammable = 2},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "people:mutton_cooked",
|
||||
recipe = "people:mutton_raw",
|
||||
cooktime = 5,
|
||||
})
|
37
guide.txt
Normal file
@ -0,0 +1,37 @@
|
||||
Guide:
|
||||
|
||||
First you should reach a certain level of strength in Minetest, best above stone tech level, if you are playing Single Player or without NPCs to fight for you.
|
||||
I recommend to use 3D Armor.
|
||||
Brace yourself for your first contact with the plunderers, normally they come in a pack of melee and range and you can only beat one of them,
|
||||
if you manage to separate a plunderer from the group.
|
||||
|
||||
If you are lucky you will be victorious and gain your first item for attracting people. This could be an Anvil, Weaponstand, Feeder, Villager Bed,
|
||||
Mineshaft or First Aid Node.
|
||||
|
||||
If you haven't build a building yet, now is the time to come, because you need a wooden floor to place your gathered items on.
|
||||
All 5 default wood types (apple, acacia, pine, aspen, jungle) are suitable for a building floor and will spawn different looking people.
|
||||
After your first citizen has spawned, he is trading with you, but wont stay near your building. You first have to “tame” him or her,
|
||||
every profession likes and needs different things:
|
||||
|
||||
Blacksmith: Farming Dishes
|
||||
Farmer: Coal Lumps
|
||||
Doctor: Mint Tea
|
||||
Miner: Hemp Oil + Hemp Leaves
|
||||
Instructor: Gold Ingot
|
||||
Warrior: Farming Dishes
|
||||
Villager: Farming Dishes
|
||||
|
||||
To get items from them, you need to trade the following things with them:
|
||||
|
||||
Blacksmith: Gold Ingot
|
||||
Farmer: Gold Ingot
|
||||
Doctor: Gold Lump
|
||||
Miner: Food (e.g. cooked dishes from the farming mod)
|
||||
|
||||
After you satisfied your new resident, you can tell him or her to stay at place. If an enemy will raid your town and kill someone,
|
||||
you will find a wooden cross. You can burn it in the furnace, or bury the dead, but beware: Do not forget to bury the citizens
|
||||
in soil which provides the corpse the chance to rot, otherwise, a surprise will occur at night...
|
||||
|
||||
To be successful you need to mine a lot of gold and use the trading system wisely, because its based on chance.
|
||||
|
||||
There is some more stuff in this mod, but this will not be revealed here, the basics are enough to play successful, the rest should be discovered by yourself.
|
37
guideDE.txt
Normal file
@ -0,0 +1,37 @@
|
||||
Handbuch:
|
||||
|
||||
Zunächst sollten Sie in Minetest eine ausreichend hochrangige Ausrüstung(Waffen, Rüstung) erreichen, am besten über dem Stein-Tech-Level, wenn Sie Einzelspieler spielen oder ohne NPCs, die für Sie kämpfen.
|
||||
Ich empfehle die Verwendung von 3D Armor.
|
||||
Mach dich bereit für deinen ersten Kontakt mit den Plünderern! Normalerweise kommen sie in einer Gruppe aus Nah- und Fernkampf und du kannst nur einen von ihnen besiegen.
|
||||
Dies ist am einfachsten, wenn es Ihnen gelingt, einen Plünderer von der Gruppe zu trennen.
|
||||
|
||||
Wenn Sie Glück haben, werden Sie siegreich sein und Ihren ersten Gegenstand erhalten, um Menschen/Dorfbewohner anzuziehen. Dies könnte ein Amboss, ein Waffenständer, eine Futterstelle, ein Dorfbewohnerbett,
|
||||
Minenschacht oder ein Erste-Hilfe-Knotenpunkt sein.
|
||||
|
||||
Wenn Sie noch kein Gebäude gebaut haben, ist es jetzt an der Zeit, denn Sie brauchen einen Holzboden, auf dem Sie Ihre gesammelten Gegenstände platzieren können.
|
||||
Alle 5 Standardholzarten (Apfel, Akazie, Kiefer, Espe, Dschungel) eignen sich für einen Gebäudeboden und bringen unterschiedlich aussehende Menschen hervor.
|
||||
Nachdem Ihr erster Bürger gespawnt ist, handelt er mit Ihnen, bleibt aber nicht in der Nähe Ihres Gebäudes. Sie müssen ihn oder sie zuerst „zähmen“. Dafür müssen
|
||||
sie Rohstoffe und andere Gegenstände opfern.
|
||||
Jeder Beruf mag und braucht andere Dinge:
|
||||
|
||||
Schmied: Landwirtschaftliche Gerichte
|
||||
Bauer: Kohlenklumpen
|
||||
Arzt: Pfefferminztee
|
||||
Miner: Hanföl + Hanfblätter
|
||||
Lehrer: Goldbarren
|
||||
Krieger: Landwirtschaftliche Gerichte
|
||||
Dorfbewohner: Landwirtschaftliche Gerichte
|
||||
|
||||
Um Gegenstände von ihnen zu erhalten, müssen Sie folgende Dinge mit ihnen handeln:
|
||||
|
||||
Schmied: Goldbarren
|
||||
Bauer: Goldbarren
|
||||
Arzt: Goldklumpen
|
||||
Miner: Nahrungsmittel (z.B. Gekochte Gerichte aus dem Farming-Mod)
|
||||
Ausbilder: Emblem des Triumphs
|
||||
|
||||
Nachdem Sie Ihren neuen Bewohner zufrieden gestellt haben, können Sie ihm oder ihr sagen, dass er(sie an Ort und Stelle bleiben soll. Wenn ein Feind deine Stadt überfällt und jemanden tötet,
|
||||
werden Sie ein Holzkreuz finden. Sie können es im Ofen verbrennen oder die Toten begraben, aber Vorsicht: Vergessen Sie nicht, die Bürger
|
||||
in Erde zu begraben, die der Leiche Gelegenheit zum Verrotten gibt, sonst gibt es des Nachts eine Überraschung...
|
||||
|
||||
Um erfolgreich zu sein, müssen Sie viel Gold abbauen und das Handelssystem mit Bedacht einsetzen, da es auf Zufall basiert.
|
82
hatefulminer.lua
Normal file
@ -0,0 +1,82 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:hatefulminer", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attack_type = "dogfight",
|
||||
attack_animals = true,
|
||||
reach = 2,
|
||||
damage = 6,
|
||||
hp_min = 35,
|
||||
hp_max = 55,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Miner.b3d",
|
||||
visual_size = {x = 1.0, y = 1.0},
|
||||
textures = {
|
||||
{"texturehatefulminer.png"},
|
||||
},
|
||||
sounds = {
|
||||
attack = "people_evilminer2",
|
||||
random = "people_evilminer4",
|
||||
damage = "people_evilminer",
|
||||
death = "people_evilminer3",
|
||||
distance = 15,
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
run_velocity = 3,
|
||||
runaway = false,
|
||||
jump = true,
|
||||
stay_near = {{"default:stone_with_coal", "default:stone_with_copper", " default:stone_with_tin", "default:stone_with_iron", "default:stone_with_gold", "default:stone_with_mese", "default:stone_with_diamond"}, 5},
|
||||
drops = {
|
||||
{name = "default:iron_lump", chance = 1, min = 1, max = 1},
|
||||
{name = "people:emblemoftriumph", chance = 7, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 5,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
view_range = 15,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed or tame
|
||||
if mobs:feed_tame(self, clicker, 4, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:hatefulminer",
|
||||
nodes = {"default:stone"},
|
||||
neighbors = {"default:stone_with_iron", "default:stone_with_gold"},
|
||||
min_light = 0,
|
||||
interval = 60,
|
||||
chance = 2, -- 15000
|
||||
min_height = -300,
|
||||
max_height = -80,
|
||||
})
|
||||
end
|
||||
|
||||
mobs:register_egg("people:hatefulminer", S("Hateful Miner"), "ahatefulminer.png")
|
17
hunger.lua
Normal file
@ -0,0 +1,17 @@
|
||||
if minetest.get_modpath("hunger_ng") ~= nil then
|
||||
hunger_ng.add_hunger_data('people:mutton_raw', {
|
||||
satiates = 1.0,
|
||||
})
|
||||
hunger_ng.add_hunger_data('people:mutton_cooked', {
|
||||
satiates = 3.0,
|
||||
})
|
||||
hunger_ng.add_hunger_data('people:dogfood', {
|
||||
satiates = 1.0,
|
||||
})
|
||||
hunger_ng.add_hunger_data('people:dogfood_cooked', {
|
||||
satiates = 3.0,
|
||||
})
|
||||
hunger_ng.add_hunger_data('people:bandage', {
|
||||
heals = 20.0,
|
||||
})
|
||||
end
|
97
init.lua
Normal file
@ -0,0 +1,97 @@
|
||||
|
||||
-- Load support for intllib.
|
||||
local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
||||
|
||||
local S = minetest.get_translator and minetest.get_translator("people") or
|
||||
dofile(path .. "intllib.lua")
|
||||
|
||||
mobs.intllib = S
|
||||
|
||||
|
||||
-- Check for custom mob spawn file
|
||||
local input = io.open(path .. "spawn.lua", "r")
|
||||
|
||||
if input then
|
||||
mobs.custom_spawn_people = true
|
||||
input:close()
|
||||
input = nil
|
||||
end
|
||||
|
||||
|
||||
-- Animals
|
||||
dofile(path .. "goat.lua") --
|
||||
dofile(path .. "dog.lua") --
|
||||
dofile(path .. "hunger.lua") --
|
||||
dofile(path .. "forge.lua") --
|
||||
dofile(path .. "feeder.lua") --
|
||||
dofile(path .. "weaponstand.lua") --
|
||||
dofile(path .. "villagerbed.lua") --
|
||||
dofile(path .. "mineshaft.lua") --
|
||||
dofile(path .. "firstaidnode.lua") --
|
||||
dofile(path .. "bootynode.lua") --
|
||||
dofile(path .. "plunderercrossbow.lua") --
|
||||
dofile(path .. "pirate.lua") --
|
||||
dofile(path .. "plundererstick.lua") --
|
||||
dofile(path .. "plundererflask.lua") --
|
||||
dofile(path .. "spawnbooty.lua") --
|
||||
dofile(path .. "medsmith.lua") --
|
||||
dofile(path .. "afrsmith.lua") --
|
||||
dofile(path .. "norsmith.lua") --
|
||||
dofile(path .. "chinsmith.lua") --
|
||||
dofile(path .. "samsmith.lua") --
|
||||
dofile(path .. "medfarmer.lua") --
|
||||
dofile(path .. "norfarmer.lua") --
|
||||
dofile(path .. "samfarmer.lua") --
|
||||
dofile(path .. "afrfarmer.lua") --
|
||||
dofile(path .. "chinfarmer.lua") --
|
||||
dofile(path .. "medvillager.lua") --
|
||||
dofile(path .. "aravillager.lua") --
|
||||
dofile(path .. "papvillager.lua") --
|
||||
dofile(path .. "ewevillager.lua") --
|
||||
dofile(path .. "norvillager.lua") --
|
||||
dofile(path .. "medminer.lua") --
|
||||
dofile(path .. "araminer.lua") --
|
||||
dofile(path .. "abominer.lua") --
|
||||
dofile(path .. "eweminer.lua") --
|
||||
dofile(path .. "norminer.lua") --
|
||||
dofile(path .. "jealousminer.lua") --
|
||||
dofile(path .. "hatefulminer.lua") --
|
||||
dofile(path .. "evilminer.lua") --
|
||||
dofile(path .. "meddoctor.lua") --
|
||||
dofile(path .. "aradoctor.lua") --
|
||||
dofile(path .. "chindoctor.lua") --
|
||||
dofile(path .. "nordoctor.lua") --
|
||||
dofile(path .. "papdoctor.lua") --
|
||||
dofile(path .. "medwarrior.lua") --
|
||||
dofile(path .. "norwarrior.lua") --
|
||||
dofile(path .. "samwarrior.lua") --
|
||||
dofile(path .. "ewewarrior.lua") --
|
||||
dofile(path .. "afrwarrior.lua") --
|
||||
dofile(path .. "medinstructor.lua") --
|
||||
dofile(path .. "norinstructor.lua") --
|
||||
dofile(path .. "chininstructor.lua") --
|
||||
dofile(path .. "afrinstructor.lua") --
|
||||
dofile(path .. "aboinstructor.lua") --
|
||||
dofile(path .. "zombiedoctor.lua") --
|
||||
dofile(path .. "zombiesmith.lua") --
|
||||
dofile(path .. "zombievillager.lua") --
|
||||
dofile(path .. "zombiewarrior.lua") --
|
||||
dofile(path .. "zombiefarmer.lua") --
|
||||
dofile(path .. "zombieinstructor.lua") --
|
||||
dofile(path .. "zombieminer.lua") --
|
||||
dofile(path .. "ridepig.lua") --
|
||||
dofile(path .. "rideelephant.lua") --
|
||||
dofile(path .. "rideostrich.lua") --
|
||||
dofile(path .. "ridehorse.lua") --
|
||||
dofile(path .. "ridereindeer.lua") --
|
||||
dofile(path .. "rideox.lua") --
|
||||
dofile(path .. "plough.lua") --
|
||||
|
||||
-- Load custom spawning
|
||||
if mobs.custom_spawn_people then
|
||||
dofile(path .. "spawn.lua")
|
||||
end
|
||||
|
||||
|
||||
|
||||
print (S("[MOD] Mobs Redo Animals loaded"))
|
3
intllib.lua
Normal file
@ -0,0 +1,3 @@
|
||||
-- Support for the old multi-load method
|
||||
dofile(minetest.get_modpath("intllib").."/init.lua")
|
||||
|
82
jealousminer.lua
Normal file
@ -0,0 +1,82 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:jealousminer", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attack_type = "dogfight",
|
||||
attack_animals = true,
|
||||
reach = 2,
|
||||
damage = 4,
|
||||
hp_min = 15,
|
||||
hp_max = 25,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Miner.b3d",
|
||||
visual_size = {x = 1.0, y = 1.0},
|
||||
textures = {
|
||||
{"texturejealousminer.png"},
|
||||
},
|
||||
sounds = {
|
||||
attack = "people_evilminer2",
|
||||
random = "people_evilminer4",
|
||||
damage = "people_evilminer",
|
||||
death = "people_evilminer3",
|
||||
distance = 15,
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
run_velocity = 3,
|
||||
runaway = false,
|
||||
jump = true,
|
||||
stay_near = {{"default:stone_with_coal", "default:stone_with_copper", " default:stone_with_tin", "default:stone_with_iron", "default:stone_with_gold", "default:stone_with_mese", "default:stone_with_diamond"}, 5},
|
||||
drops = {
|
||||
{name = "default:copper_lump", chance = 1, min = 1, max = 1},
|
||||
{name = "people:emblemoftriumph", chance = 7, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 5,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
view_range = 15,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed or tame
|
||||
if mobs:feed_tame(self, clicker, 4, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:jealousminer",
|
||||
nodes = {"default:stone"},
|
||||
neighbors = {"default:stone_with_coal", "default:stone_with_copper"},
|
||||
min_light = 0,
|
||||
interval = 60,
|
||||
chance = 2, -- 15000
|
||||
min_height = -100,
|
||||
max_height = 0,
|
||||
})
|
||||
end
|
||||
|
||||
mobs:register_egg("people:jealousminer", S("Jealous Miner"), "ajealousminer.png")
|
85
locale/people.de.tr
Normal file
@ -0,0 +1,85 @@
|
||||
# textdomain: people
|
||||
|
||||
Instructor Jungle=Dschungel Ausbilder
|
||||
Miner Jungle=Dschungel Minenarbeiter
|
||||
Farmer Acacia=Akazien Bauer
|
||||
Instructor Acacia=Akazien Ausbilder
|
||||
Blacksmith Acacia=Akazien Schmied
|
||||
Warrior Acacia=Akazien Krieger
|
||||
Doctor Acacia=Akazien Arzt
|
||||
Miner Acacia=Akazien Minenarbeiter
|
||||
Villager Acacia=Akazien Dorfbewohner
|
||||
Booty=Beute
|
||||
Doctor Aspen=Espen Arzt
|
||||
Farmer Aspen=Espen Bauer
|
||||
Instructor Aspen=Espen Ausbilder
|
||||
Blacksmith Aspen=Espen Schmied
|
||||
Dog Food=Hundefutter
|
||||
Cooked Dog Food=Gekochtes Hundefutter
|
||||
Dog=Hund
|
||||
Evil Miner=Bösartiger Minenarbeiter
|
||||
Miner Aspen=Espen Minenarbeiter
|
||||
Villager Aspen=Espen Dorfbewohner
|
||||
Warrior Aspen=Espen Krieger
|
||||
Feeder=Futtertrog
|
||||
First Aid Node=Erste Hilfe Block
|
||||
Anvil=Amboss
|
||||
Goat=Ziege
|
||||
Raw Mutton=Rohes Ziegenfleisch
|
||||
Cooked Mutton=Gekochtes Ziegenfleisch
|
||||
Hateful Miner=Hasserfüllter Minenarbeiter
|
||||
Jealous Miner=Neidischer Minenarbeiter
|
||||
Doctor Apple=Apfelbaum Arzt
|
||||
Healing Bandage=Heilender Verband
|
||||
Grave=Grab
|
||||
Farmer Apple=Apfelbaum Bauer
|
||||
Instructor Apple=Apfelbaum Ausbilder
|
||||
Miner Apple=Apfelbaum Minenarbeiter
|
||||
Blacksmith Apple=Apfelbaum Schmied
|
||||
Villager Apple=Apfelbaum Dorfbewohner
|
||||
Warrior Apple=Apfelbaum Krieger
|
||||
Mineshaft=Minenschacht
|
||||
Doctor dropped you an item for gold!=Der Arzt hat einen Gegenstand für Gold gegeben!
|
||||
Doctor stands still.=Arzt bleibt stehen.
|
||||
Doctor will follow you.=Arzt folgt dir.
|
||||
Doctor Pine=Pinien Arzt
|
||||
Farmer dropped you an item for gold!=Der Bauer hat einen Gegenstand für Gold gegeben!
|
||||
Farmer stands still.=Bauer bleibt stehen.
|
||||
Farmer will follow you.=Bauer folgt dir.
|
||||
Farmer Pine=Pinien Bauer
|
||||
Instructor dropped you an item for honor!=Ausbilder hat einen Gegenstand für Ehre gegeben!
|
||||
Instructor Pine=Pinien Ausbilder
|
||||
Miner dropped you an item for food!=Minenarbeiter hat einen Gegenstand für Nahrung gegeben!
|
||||
Miner stands still.=Minenarbeiter bleibt stehen.
|
||||
Miner will follow you.=Minenarbeiter wird dir folgen.
|
||||
Miner Pine=Pinien Minenarbeiter
|
||||
Blackmith dropped you an item for gold!=Schmied hat einen Gegenstand für Gold gegeben!
|
||||
Blacksmith stands still.=Schmied bleibt stehen.
|
||||
Blacksmith will follow you.=Schmied folgt dir.
|
||||
Blacksmith Pine=Pinien Schmied
|
||||
Villager Pine=Pinien Dorfbewohner
|
||||
Warrior Pine=Pinien Krieger
|
||||
Doctor Jungle=Dschungel Arzt
|
||||
Villager Jungle=Dschungel Dorfbewohner
|
||||
Pirate Plunderer=Piratenplünderer
|
||||
Plunderer with Crossbow=Plünderer mit Armbrust
|
||||
Plunderer with Flask=Plünderer mit Flasche
|
||||
Plunderer with a Stick=Plünderer mit Kampfstab
|
||||
Ridable Elephant=Reitbarer Elefant
|
||||
Ridable Horse=Reitbares Pferd
|
||||
Ridable Ostrich=Reitbarer Strauß
|
||||
Ridable Ox=Ochsenkarren
|
||||
Ridable Pig=Reitbares Schwein
|
||||
Ridable Reindeer=Reitbares Rentier
|
||||
Farmer Jungle=Dschungel Bauer
|
||||
Blacksmith Jungle=Dschungel Schmied
|
||||
Warrior Jungle=Dschungel Krieger
|
||||
Villager Bed=Dorfbewohner Bett
|
||||
Weaponstand=Waffenstand
|
||||
Zombie=Zombie
|
||||
Sack of Dog Food=Hundefuttersack
|
||||
First Aid Kit=Erste Hilfe Kasten
|
||||
Emblem of Triumph=Emblem des Triumphes
|
||||
Plough stands still.=Pflug wartet.
|
||||
Plough will follow you.=Pflug folgt dir.
|
||||
Plough=Pflug
|
194
meddoctor.lua
Normal file
@ -0,0 +1,194 @@
|
||||
|
||||
local S = mobs.intllib
|
||||
|
||||
|
||||
mobs.meddoctor_drops = {
|
||||
"farming:hemp_leaf", "farming:hemp_oil", "farming:carrot_gold", "people:firsaidkit"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:meddoctor", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Doctor.b3d",
|
||||
textures = {
|
||||
{"texturemeddoctor.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_female",
|
||||
damage = "people_female5",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:firstaidnode", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:doctorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:mint_tea"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 80,
|
||||
walk_start = 300,
|
||||
walk_end = 400,
|
||||
punch_speed = 100,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_lump" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.meddoctor_drops or mobs.meddoctor_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Doctor dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Doctor stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Doctor will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:meddoctor",
|
||||
nodes = {"default:wood"},
|
||||
neighbors = {"people:firstaidnode"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:meddoctor", S("Doctor Apple"), "ameddoctor.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:meddoctor", "people:meddoctor")
|
||||
|
||||
minetest.register_node("people:firsaidkit", {
|
||||
description = S"First Aid Kit",
|
||||
tiles = {
|
||||
"people_firsaidkit_top.png",
|
||||
"people_firsaidkit_bottom.png",
|
||||
"people_firsaidkit_right.png",
|
||||
"people_firsaidkit_left.png",
|
||||
"people_firsaidkit_back.png",
|
||||
"people_firsaidkit_front.png"
|
||||
},
|
||||
groups = {crumbly = 3},
|
||||
drop = "people:bandage 9",
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "people:firsaidkit",
|
||||
recipe = {
|
||||
{"people:bandage", "people:bandage", "people:bandage"},
|
||||
{"people:bandage", "people:bandage", "people:bandage"},
|
||||
{"people:bandage", "people:bandage", "people:bandage"},
|
||||
}
|
||||
})
|
||||
|
||||
-- bandage
|
||||
minetest.register_craftitem(":people:bandage", {
|
||||
description = S("Healing Bandage"),
|
||||
inventory_image = "people_bandage.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = {food_meat_raw = 1, fleshy = 3, flammable = 2},
|
||||
})
|
||||
|
||||
minetest.register_node("people:doctorgrave", {
|
||||
description = S"Grave",
|
||||
visual_scale = 1,
|
||||
mesh = "Grave.b3d",
|
||||
tiles = {"texturegrave.png"},
|
||||
inventory_image = "agrave.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 3},
|
||||
drawtype = "mesh",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.4, 0.4},
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "people:doctorgrave",
|
||||
burntime = 6,
|
||||
})
|
163
medfarmer.lua
Normal file
@ -0,0 +1,163 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.medfarmer_drops = {
|
||||
"people:dog", "people:goat", "people:dogfoodsack", "people:ridepig", "people:rideox", "people:plough"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:medfarmer", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Medfarmer.b3d",
|
||||
textures = {
|
||||
{"texturemedfarmer.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_farmerm",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:feeder", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:farmergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"default:coal_lump"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 80,
|
||||
walk_start = 300,
|
||||
walk_end = 400,
|
||||
punch_speed = 100,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_ingot" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.medfarmer_drops or mobs.medfarmer_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Farmer dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Farmer stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Farmer will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:medfarmer",
|
||||
nodes = {"default:wood"},
|
||||
neighbors = {"people:feeder"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:medfarmer", S("Farmer Apple"), "amedfarmer.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:medfarmer", "people:medfarmer")
|
||||
|
||||
minetest.register_node("people:farmergrave", {
|
||||
description = S"Grave",
|
||||
visual_scale = 1,
|
||||
mesh = "Grave.b3d",
|
||||
tiles = {"texturegrave.png"},
|
||||
inventory_image = "agrave.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 3},
|
||||
drawtype = "mesh",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.4, 0.4},
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "people:farmergrave",
|
||||
burntime = 6,
|
||||
})
|
||||
|
168
medinstructor.lua
Normal file
@ -0,0 +1,168 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.medinstructor_drops = {
|
||||
"people:medwarrior"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:medinstructor", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Instructor.b3d",
|
||||
textures = {
|
||||
{"texturemedinstructor.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_instructor",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:weaponstand", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:instructorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"default:gold_ingot"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 75,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "people:emblemoftriumph" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.medinstructor_drops or mobs.medinstructor_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("NPC dropped you an item for honor!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Instructor stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Instructor will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:medinstructor",
|
||||
nodes = {"default:wood"},
|
||||
neighbors = {"people:weaponstand"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:medinstructor", S("Instructor Apple"), "amedinstructor.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:medinstructor", "people:medinstructor")
|
||||
|
||||
minetest.register_craftitem("people:emblemoftriumph", {
|
||||
description = S("Emblem of Triumph"),
|
||||
inventory_image = "people_emblemoftriumph.png",
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("people:instructorgrave", {
|
||||
description = S"Grave",
|
||||
visual_scale = 1,
|
||||
mesh = "Grave.b3d",
|
||||
tiles = {"texturegrave.png"},
|
||||
inventory_image = "agrave.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 3},
|
||||
drawtype = "mesh",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.4, 0.4},
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "people:instructorgrave",
|
||||
burntime = 6,
|
||||
})
|
164
medminer.lua
Normal file
@ -0,0 +1,164 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.medminer_drops = {
|
||||
"default:copper_lump", "default:tin_lump", "default:iron_lump",
|
||||
"default:gold_lump", "default:diamond", "default:copper_lump",
|
||||
"default:iron_lump", "default:tin_lump", "default:copper_lump", "default:tin_lump", "default:iron_lump",
|
||||
"default:gold_lump"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:medminer", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Miner.b3d",
|
||||
textures = {
|
||||
{"texturemedminer.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = { random = "people_miner",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:mineshaft", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:minergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:hemp_oil", "farming:hemp_leaf"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "farming:turkish_delight" or item:get_name() == "farming:donut_apple" or item:get_name() == "farming:porridge" or item:get_name() == "farming:jaffa_cake" or item:get_name() == "farming:apple_pie" or item:get_name() == "farming:spaghetti" or item:get_name() == "farming:burger" or item:get_name() == "farming:bibimbap" or item:get_name() == "farming:baked_potato" or item:get_name() == "farming:sunflower_bread" or item:get_name() == "farming:pumpkin_bread" or item:get_name() == "farming:garlic_bread" or item:get_name() == "farming:tomato_soup" or item:get_name() == "pie:brpd_0" or item:get_name() == "farming:bread" or item:get_name() == "farming:bread_multigrain" or item:get_name() == "farming:spanish_potatoes" or item:get_name() == "farming:beetroot_soup" or item:get_name() == "farming:farming:blueberry_pie" or item:get_name() == "farming:porridge" or item:get_name() == "farming:bibimbap" or item:get_name() == "farming:burger" or item:get_name() == "farming:paella" or item:get_name() == "farming:mac_and_cheese" or item:get_name() == "livingcaves:healingsoup" or item:get_name() == "farming:spaghetti" or item:get_name() == "animalworld:escargots" or item:get_name() == "farming:rhubarb_pie" or item:get_name() == "farming:potato_omlet" or item:get_name() == "farming:potato_salad" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.medminer_drops or mobs.medminer_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("NPC dropped you an item for food!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Miner stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Miner will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:medminer",
|
||||
nodes = {"default:wood"},
|
||||
neighbors = {"people:mineshaft"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:medminer", S("Miner Apple"), "amedminer.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:medminer", "people:medminer")
|
||||
|
||||
minetest.register_node("people:minergrave", {
|
||||
description = S"Grave",
|
||||
visual_scale = 1,
|
||||
mesh = "Grave.b3d",
|
||||
tiles = {"texturegrave.png"},
|
||||
inventory_image = "agrave.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 3},
|
||||
drawtype = "mesh",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.4, 0.4},
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "people:minergrave",
|
||||
burntime = 6,
|
||||
})
|
173
medsmith.lua
Normal file
@ -0,0 +1,173 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.medsmith_drops = {
|
||||
"default:axe_steel", "default:axe_steel", "default:axe_steel",
|
||||
"default:axe_steel", "default:axe_mese", "default:axe_mese",
|
||||
"default:axe_diamond", "default:axe_diamond", "default:pick_bronze", "default:pick_bronze","default:pick_steel", "default:pick_steel","default:pick_mese", "default:pick_mese",
|
||||
"default:pick_diamond", "default:pick_diamond",
|
||||
"default:shovel_bronze", "default:shovel_bronze",
|
||||
"default:shovel_steel", "default:shovel_steel",
|
||||
"default:shovel_mese", "default:shovel_mese",
|
||||
"default:shovel_diamond", "default:shovel_diamond ",
|
||||
"default:sword_bronze", "default:sword_bronze", "default:sword_steel",
|
||||
"default:sword_steel", "default:sword_mese", "default:sword_mese",
|
||||
"default:sword_diamond", "default:sword_diamond"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:medsmith", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Medsmith.b3d",
|
||||
textures = {
|
||||
{"texturemedsmith.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_smith",
|
||||
damage = "people_female5",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:forge", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:smithgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_ingot" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.medsmith_drops or mobs.medsmith_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Blackmith dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Blacksmith stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Blacksmith will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:medsmith",
|
||||
nodes = {"default:wood"},
|
||||
neighbors = {"people:forge"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:medsmith", S("Blacksmith Apple"), "amedsmith.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:medsmith", "people:medsmith")
|
||||
|
||||
minetest.register_node("people:smithgrave", {
|
||||
description = S"Grave",
|
||||
visual_scale = 1,
|
||||
mesh = "Grave.b3d",
|
||||
tiles = {"texturegrave.png"},
|
||||
inventory_image = "agrave.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 3},
|
||||
drawtype = "mesh",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.4, 0.4},
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "people:smithgrave",
|
||||
burntime = 6,
|
||||
})
|
||||
|
108
medvillager.lua
Normal file
@ -0,0 +1,108 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:medvillager", {
|
||||
stepheight = 1,
|
||||
type = "animal",
|
||||
passive = true,
|
||||
attack_type = "dogfight",
|
||||
group_attack = true,
|
||||
owner_loyal = true,
|
||||
attack_npcs = false,
|
||||
reach = 2,
|
||||
damage = 2,
|
||||
hp_min = 30,
|
||||
hp_max = 60,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-0.7,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Villager.b3d",
|
||||
visual_size = {x = 0.7, y = 0.7},
|
||||
textures = {
|
||||
{"texturemedvillager.png"},
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_female2",
|
||||
damage = "people_female4",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2.5,
|
||||
walk_chance = 10,
|
||||
runaway = true,
|
||||
runaway_from = {"animalworld:bear", "animalworld:crocodile", "animalworld:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "livingfloatlands:tyrannosaurus", "livingfloatlands:velociraptor", "people:pirate", "people:evilminer", "people:jealousminer", "people:hatefulminer", "people:plunderercrossbow", "people:plundererflask", "people:plundererstick"},
|
||||
jump = true,
|
||||
jump_height = 6,
|
||||
pushable = true,
|
||||
stay_near = {{"people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 10,
|
||||
drops = { {name = "people:villagergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
fear_height = 2,
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 65,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:medvillager",
|
||||
nodes = {"default:wood"},
|
||||
neighbors = {"people:villagerbed"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
|
||||
mobs:register_egg("people:medvillager", S("Villager Apple"), "amedvillager.png")
|
||||
|
||||
|
||||
mobs:alias_mob("people:medvillager", "people:medvillager") -- compatibility
|
||||
|
||||
minetest.register_node("people:villagergrave", {
|
||||
description = S"Grave",
|
||||
visual_scale = 1,
|
||||
mesh = "Grave.b3d",
|
||||
tiles = {"texturegrave.png"},
|
||||
inventory_image = "agrave.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 3},
|
||||
drawtype = "mesh",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.4, 0.4},
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "people:villagergrave",
|
||||
burntime = 6,
|
||||
})
|
||||
|
175
medwarrior.lua
Normal file
@ -0,0 +1,175 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
-- Npc by TenPlus1
|
||||
|
||||
|
||||
mobs:register_mob("people:medwarrior", {
|
||||
type = "npc",
|
||||
passive = false,
|
||||
damage = 10,
|
||||
attack_type = "dogshoot",
|
||||
dogshoot_switch = 1,
|
||||
dogshoot_count_max = 12, -- shoot for 12 seconds
|
||||
dogshoot_count2_max = 3, -- dogfight for 3 seconds
|
||||
shoot_interval = 1.5,
|
||||
arrow = "people:spearfly",
|
||||
shoot_offset = 2,
|
||||
attacks_monsters = true,
|
||||
attack_npcs = false,
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
hp_min = 100,
|
||||
hp_max = 145,
|
||||
armor = 80,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Warrior.b3d",
|
||||
drawtype = "front",
|
||||
textures = {
|
||||
{"texturemedwarrior.png"},
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
attack = "people_warrior3",
|
||||
random = "people_warrior2",
|
||||
damage = "people_male5",
|
||||
death = "people_warrior",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 3,
|
||||
run_velocity = 4,
|
||||
jump = true,
|
||||
stay_near = {{"people:weaponstand", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 5},
|
||||
drops = { {name = "people:warriorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 2,
|
||||
light_damage = 0,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 12,
|
||||
owner = "",
|
||||
order = "stand",
|
||||
fear_height = 3,
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
walk_speed = 100,
|
||||
walk_start = 100,
|
||||
walk_end = 200,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
shoot_start = 300,
|
||||
shoot_speed = 80,
|
||||
shoot_end = 400,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||
|
||||
-- capture npc with net or lasso
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
-- protect npc with mobs:protector
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
|
||||
|
||||
-- by right-clicking owner can switch npc between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Warrior stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
|
||||
minetest.chat_send_player(name, S("Warrior will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
do_punch = function(self, hitter,
|
||||
time_from_last_punch,
|
||||
tool_capabilities,
|
||||
direction)
|
||||
|
||||
-- Prevent friendly fire from killing each other :)
|
||||
local entity = hitter:get_luaentity()
|
||||
|
||||
if entity == "people:medwarrior" then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("people:medwarrior", S("Warrior Apple"), "amedwarrior.png" )
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:medwarrior", "people:medwarrior")
|
||||
|
||||
mobs:register_arrow("people:spearfly", {
|
||||
visual = "sprite",
|
||||
visual_size = {x=.5, y=.5},
|
||||
textures = {"spearfly.png"},
|
||||
velocity = 8,
|
||||
drop = true,
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=13},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=13},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("people:warriorgrave", {
|
||||
description = S"Grave",
|
||||
visual_scale = 1,
|
||||
mesh = "Grave.b3d",
|
||||
tiles = {"texturegrave.png"},
|
||||
inventory_image = "agrave.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 3},
|
||||
drawtype = "mesh",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.4, 0.4},
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "people:warriorgrave",
|
||||
burntime = 6,
|
||||
})
|
||||
|
34
mineshaft.lua
Normal file
@ -0,0 +1,34 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
minetest.register_node("people:mineshaft", {
|
||||
description = S"Mineshaft",
|
||||
visual_scale = 1.0,
|
||||
mesh = "Mineshaft.b3d",
|
||||
tiles = {"texturemineshaft.png"},
|
||||
inventory_image = "amineshaft.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 3},
|
||||
drawtype = "mesh",
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1, -0.5, -1, 1, -0.2, 1},
|
||||
--[[{-1, -0.5, -1, 1, -0.2, 1},
|
||||
{-1, -0.5, -1, 1, -0.2, 1}]]
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1, -0.5, -1, 1, -0.2, 1}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "people:mineshaft",
|
||||
burntime = 8,
|
||||
})
|
141
nordoctor.lua
Normal file
@ -0,0 +1,141 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs.nordoctor_drops = {
|
||||
"farming:hemp_leaf", "farming:hemp_oil", "farming:carrot_gold", "people:firsaidkit"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:nordoctor", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Doctor.b3d",
|
||||
textures = {
|
||||
{"texturenordoctor.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_female",
|
||||
damage = "people_female5",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:firstaidnode", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:doctorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:mint_tea"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 80,
|
||||
walk_start = 300,
|
||||
walk_end = 400,
|
||||
punch_speed = 100,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_lump" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.nordoctor_drops or mobs.nordoctor_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Doctor dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Doctor stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Doctor will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:nordoctor",
|
||||
nodes = {"default:acacia_wood"},
|
||||
neighbors = {"people:firstaidnode"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:nordoctor", S("Doctor Pine"), "anordoctor.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:nordoctor", "people:nordoctor")
|
142
norfarmer.lua
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.norfarmer_drops = {
|
||||
"people:dog", "people:goat", "people:dogfoodsack", "people:ridepig", "people:ridehorse", "people:plough"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:norfarmer", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Medfarmer2.b3d",
|
||||
textures = {
|
||||
{"texturenorfarmer.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_farmerf",
|
||||
damage = "people_female5",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:feeder", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:farmergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"default:coal_lump"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 80,
|
||||
walk_start = 300,
|
||||
walk_end = 400,
|
||||
punch_speed = 100,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_ingot" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.norfarmer_drops or mobs.norfarmer_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Farmer dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Farmer stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Farmer will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:norfarmer",
|
||||
nodes = {"default:pine_wood"},
|
||||
neighbors = {"people:feeder"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:norfarmer", S("Farmer Pine"), "anorfarmer.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:norfarmer", "people:norfarmer")
|
142
norinstructor.lua
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.norinstructor_drops = {
|
||||
"people:norwarrior"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:norinstructor", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Instructor.b3d",
|
||||
textures = {
|
||||
{"texturenorinstructor.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_instructor",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:weaponstand", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:instructorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1.5,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"default:gold_ingot"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 75,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "people:emblemoftriumph" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.norinstructor_drops or mobs.norinstructor_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Instructor dropped you an item for honor!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Instructor stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Instructor will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:norinstructor",
|
||||
nodes = {"default:pine_wood"},
|
||||
neighbors = {"people:weaponstand"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:norinstructor", S("Instructor Pine"), "anorinstructor.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:norinstructor", "people:norinstructor")
|
144
norminer.lua
Normal file
@ -0,0 +1,144 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.norminer_drops = {
|
||||
"default:copper_lump", "default:tin_lump", "default:iron_lump",
|
||||
"default:gold_lump", "default:diamond", "default:copper_lump",
|
||||
"default:iron_lump", "default:tin_lump", "default:copper_lump", "default:tin_lump", "default:iron_lump",
|
||||
"default:gold_lump"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:norminer", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Miner.b3d",
|
||||
textures = {
|
||||
{"texturenorminer.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = { random = "people_miner",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:mineshaft", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:minergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:hemp_oil", "farming:hemp_leaf"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "farming:turkish_delight" or item:get_name() == "farming:donut_apple" or item:get_name() == "farming:porridge" or item:get_name() == "farming:jaffa_cake" or item:get_name() == "farming:apple_pie" or item:get_name() == "farming:spaghetti" or item:get_name() == "farming:burger" or item:get_name() == "farming:bibimbap" or item:get_name() == "farming:baked_potato" or item:get_name() == "farming:sunflower_bread" or item:get_name() == "farming:pumpkin_bread" or item:get_name() == "farming:garlic_bread" or item:get_name() == "farming:tomato_soup" or item:get_name() == "pie:brpd_0" or item:get_name() == "farming:bread" or item:get_name() == "farming:bread_multigrain" or item:get_name() == "farming:spanish_potatoes" or item:get_name() == "farming:beetroot_soup" or item:get_name() == "farming:farming:blueberry_pie" or item:get_name() == "farming:porridge" or item:get_name() == "farming:bibimbap" or item:get_name() == "farming:burger" or item:get_name() == "farming:paella" or item:get_name() == "farming:mac_and_cheese" or item:get_name() == "livingcaves:healingsoup" or item:get_name() == "farming:spaghetti" or item:get_name() == "animalworld:escargots" or item:get_name() == "farming:rhubarb_pie" or item:get_name() == "farming:potato_omlet" or item:get_name() == "farming:potato_salad" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.norminer_drops or mobs.norminer_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Miner dropped you an item for food!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Miner stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Miner will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:norminer",
|
||||
nodes = {"default:pine_wood"},
|
||||
neighbors = {"people:mineshaft"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:norminer", S("Miner Pine"), "anorminer.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:norminer", "people:norminer")
|
152
norsmith.lua
Normal file
@ -0,0 +1,152 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.norsmith_drops = {
|
||||
"default:axe_steel", "default:axe_steel", "default:axe_steel",
|
||||
"default:axe_steel", "default:axe_mese", "default:axe_mese",
|
||||
"default:axe_diamond", "default:axe_diamond", "default:pick_bronze", "default:pick_bronze","default:pick_steel", "default:pick_steel","default:pick_mese", "default:pick_mese",
|
||||
"default:pick_diamond", "default:pick_diamond",
|
||||
"default:shovel_bronze", "default:shovel_bronze",
|
||||
"default:shovel_steel", "default:shovel_steel",
|
||||
"default:shovel_mese", "default:shovel_mese",
|
||||
"default:shovel_diamond", "default:shovel_diamond ",
|
||||
"default:sword_bronze", "default:sword_bronze", "default:sword_steel",
|
||||
"default:sword_steel", "default:sword_mese", "default:sword_mese",
|
||||
"default:sword_diamond", "default:sword_diamond"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:norsmith", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Medsmith2.b3d",
|
||||
textures = {
|
||||
{"texturenorsmith.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_smith",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:forge", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:smithgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_ingot" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.norsmith_drops or mobs.norsmith_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Blackmith dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Blacksmith stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Blacksmith will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:norsmith",
|
||||
nodes = {"default:pine_wood"},
|
||||
neighbors = {"people:forge"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:norsmith", S("Blacksmith Pine"), "anorsmith.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:norsmith", "people:norsmith")
|
87
norvillager.lua
Normal file
@ -0,0 +1,87 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:norvillager", {
|
||||
stepheight = 1,
|
||||
type = "animal",
|
||||
passive = true,
|
||||
attack_type = "dogfight",
|
||||
group_attack = true,
|
||||
owner_loyal = true,
|
||||
attack_npcs = false,
|
||||
reach = 2,
|
||||
damage = 2,
|
||||
hp_min = 30,
|
||||
hp_max = 60,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-0.9,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Villager.b3d",
|
||||
visual_size = {x = 0.9, y = 0.9},
|
||||
textures = {
|
||||
{"texturenorvillager.png"},
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_female2",
|
||||
damage = "people_female4",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2.5,
|
||||
walk_chance = 10,
|
||||
runaway = true,
|
||||
runaway_from = {"animalworld:bear", "animalworld:crocodile", "animalworld:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "livingfloatlands:tyrannosaurus", "livingfloatlands:velociraptor", "people:pirate", "people:evilminer", "people:jealousminer", "people:hatefulminer", "people:plunderercrossbow", "people:plundererflask", "people:plundererstick"},
|
||||
jump = true,
|
||||
jump_height = 6,
|
||||
pushable = true,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 10,
|
||||
drops = { {name = "people:villagergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
fear_height = 2,
|
||||
stay_near = {{"people:villagerbed", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 65,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:norvillager",
|
||||
nodes = {"default:pine_wood"},
|
||||
neighbors = {"people:villagerbed"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
|
||||
mobs:register_egg("people:norvillager", S("Villager Pine"), "anorvillager.png")
|
||||
|
||||
|
||||
mobs:alias_mob("people:norvillager", "people:norvillager") -- compatibility
|
154
norwarrior.lua
Normal file
@ -0,0 +1,154 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
-- Npc by TenPlus1
|
||||
|
||||
|
||||
mobs:register_mob("people:norwarrior", {
|
||||
type = "npc",
|
||||
passive = false,
|
||||
damage = 10,
|
||||
attack_type = "dogshoot",
|
||||
dogshoot_switch = 1,
|
||||
dogshoot_count_max = 12, -- shoot for 10 seconds
|
||||
dogshoot_count2_max = 3, -- dogfight for 3 seconds
|
||||
shoot_interval = 1.5,
|
||||
arrow = "people:spearfly",
|
||||
shoot_offset = 2,
|
||||
attacks_monsters = true,
|
||||
attack_npcs = false,
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
hp_min = 100,
|
||||
hp_max = 145,
|
||||
armor = 80,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Warrior.b3d",
|
||||
drawtype = "front",
|
||||
textures = {
|
||||
{"texturenorwarrior.png"},
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
attack = "people_warrior3",
|
||||
random = "people_warrior2",
|
||||
damage = "people_male5",
|
||||
death = "people_warrior",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 3,
|
||||
run_velocity = 4,
|
||||
jump = true,
|
||||
stay_near = {{"people:weaponstand", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 5},
|
||||
drops = { {name = "people:warriorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 2,
|
||||
light_damage = 0,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 12,
|
||||
owner = "",
|
||||
order = "stand",
|
||||
fear_height = 3,
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
walk_speed = 100,
|
||||
walk_start = 100,
|
||||
walk_end = 200,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
shoot_start = 300,
|
||||
shoot_speed = 80,
|
||||
shoot_end = 400,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||
|
||||
-- capture npc with net or lasso
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
-- protect npc with mobs:protector
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
|
||||
|
||||
-- by right-clicking owner can switch npc between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Warrior stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
|
||||
minetest.chat_send_player(name, S("Warrior will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
do_punch = function(self, hitter,
|
||||
time_from_last_punch,
|
||||
tool_capabilities,
|
||||
direction)
|
||||
|
||||
-- Prevent friendly fire from killing each other :)
|
||||
local entity = hitter:get_luaentity()
|
||||
|
||||
if entity == "people:norwarrior" then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("people:norwarrior", S("Warrior Pine"), "anorwarrior.png" )
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:norwarrior", "people:norwarrior")
|
||||
|
||||
mobs:register_arrow("people:spearfly", {
|
||||
visual = "sprite",
|
||||
visual_size = {x=.5, y=.5},
|
||||
textures = {"spearfly.png"},
|
||||
velocity = 8,
|
||||
drop = true,
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=13},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=13},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
end,
|
||||
})
|
142
papdoctor.lua
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.papdoctor_drops = {
|
||||
"farming:hemp_leaf", "farming:hemp_oil", "farming:carrot_gold", "people:firsaidkit"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:papdoctor", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Doctor.b3d",
|
||||
textures = {
|
||||
{"texturepapdoctor.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_female",
|
||||
damage = "people_female5",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:firstaidnode", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:doctorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"farming:mint_tea"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 80,
|
||||
walk_start = 300,
|
||||
walk_end = 400,
|
||||
punch_speed = 100,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_lump" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.papdoctor_drops or mobs.papdoctor_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Doctor dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Doctor stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Doctor will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:papdoctor",
|
||||
nodes = {"default:junglewood"},
|
||||
neighbors = {"people:firstaidnode"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:papdoctor", S("Doctor Jungle"), "apapdoctor.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:papdoctor", "people:apapdoctor")
|
87
papvillager.lua
Normal file
@ -0,0 +1,87 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:papvillager", {
|
||||
stepheight = 1,
|
||||
type = "animal",
|
||||
passive = true,
|
||||
attack_type = "dogfight",
|
||||
group_attack = true,
|
||||
owner_loyal = true,
|
||||
attack_npcs = false,
|
||||
reach = 2,
|
||||
damage = 2,
|
||||
hp_min = 30,
|
||||
hp_max = 60,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-0.7,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Villager.b3d",
|
||||
visual_size = {x = 0.7, y = 0.7},
|
||||
textures = {
|
||||
{"texturepapvillager.png"},
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_female2",
|
||||
damage = "people_female4",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2.5,
|
||||
walk_chance = 10,
|
||||
runaway = true,
|
||||
runaway_from = {"animalworld:bear", "animalworld:crocodile", "animalworld:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "livingfloatlands:tyrannosaurus", "livingfloatlands:velociraptor", "people:pirate", "people:evilminer", "people:jealousminer", "people:hatefulminer", "people:plunderercrossbow", "people:plundererflask", "people:plundererstick"},
|
||||
jump = true,
|
||||
jump_height = 6,
|
||||
pushable = true,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 10,
|
||||
stay_near = {{"people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:villagergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
fear_height = 2,
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 65,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:papvillager",
|
||||
nodes = {"default:junglewood"},
|
||||
neighbors = {"people:villagerbed"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
|
||||
mobs:register_egg("people:papvillager", S("Villager Jungle"), "apapvillager.png")
|
||||
|
||||
|
||||
mobs:alias_mob("people:papvillager", "people:papvillager") -- compatibility
|
105
pirate.lua
Normal file
@ -0,0 +1,105 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:pirate", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
step_height = 2,
|
||||
fear_height = 4,
|
||||
attack_type = "dogfight",
|
||||
attack_animals = true,
|
||||
reach = 2,
|
||||
damage = 12,
|
||||
hp_min = 35,
|
||||
hp_max = 75,
|
||||
armor = 100,
|
||||
collisionbox = {-0.5, -0.01, -0.5, 0.5, 0.95, 0.5},
|
||||
visual = "mesh",
|
||||
mesh = "Pirate.b3d",
|
||||
visual_size = {x = 1.0, y = 1.0},
|
||||
textures = {
|
||||
{"texturepirate.png"},
|
||||
},
|
||||
sounds = {
|
||||
attack = "people_plundererpirate",
|
||||
random = "people_plundererpirate2",
|
||||
damage = "people_plundererpirate3",
|
||||
death = "people_plundererpirate",
|
||||
distance = 15,
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 2,
|
||||
run_velocity = 4,
|
||||
walk_chance = 10,
|
||||
runaway = false,
|
||||
stay_near = {{"people:bootynode"}, 5},
|
||||
jump = true,
|
||||
drops = {
|
||||
{name = "people:forge", chance = 7, min = 1, max = 1},
|
||||
{name = "people:feeder", chance = 7, min = 1, max = 1},
|
||||
{name = "people:mineshaft", chance = 7, min = 1, max = 1},
|
||||
{name = "people:villagerbed", chance = 7, min = 1, max = 1},
|
||||
{name = "people:weaponstand", chance = 7, min = 1, max = 1},
|
||||
{name = "people:firstaidnode", chance = 7, min = 1, max = 1},
|
||||
{name = "people:emblemoftriumph", chance = 7, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 100,
|
||||
stand_speed = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
walk_start = 100,
|
||||
walk_end = 200,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
view_range = 15,
|
||||
|
||||
do_punch = function(self, hitter,
|
||||
time_from_last_punch,
|
||||
tool_capabilities,
|
||||
direction)
|
||||
|
||||
-- Prevent friendly fire from killing each other :)
|
||||
local entity = hitter:get_luaentity()
|
||||
|
||||
if entity == "people:pirate" then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
|
||||
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed or tame
|
||||
if mobs:feed_tame(self, clicker, 4, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:pirate",
|
||||
nodes = {"default:cobble", "default:mossycobble", "default:sandstonebrick"},
|
||||
neighbors = {"people:bootynode"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
active_object_count = 2,
|
||||
chance = 10, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
|
||||
mobs:register_egg("people:pirate", S("Pirate Plunderer"), "apirate.png")
|
114
plough.lua
Normal file
@ -0,0 +1,114 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:plough", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 3,
|
||||
reach = 2,
|
||||
group_attack = false,
|
||||
attack_type = "dogfight",
|
||||
attacks_monsters = true,
|
||||
attack_npcs = false,
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
hp_min = 80,
|
||||
hp_max = 120,
|
||||
armor = 100,
|
||||
collisionbox = {-1.0,-0.1,-1.0, 1.0,1.0,1.0},
|
||||
visual = "mesh",
|
||||
mesh = "Plough.b3d",
|
||||
drawtype = "front",
|
||||
textures = {
|
||||
{"textureplough.png"},
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_ox3",
|
||||
damage = "people_ox",
|
||||
death = "people_ox2",
|
||||
distance = 15,
|
||||
},
|
||||
replace_rate = 0.01,
|
||||
replace_what = {
|
||||
{"group:grass", "air", 0},
|
||||
{"default:dirt_with_grass", "farming:soil", -1}
|
||||
},
|
||||
replace_what2 = {
|
||||
{"group:grass", "air", 0},
|
||||
{"default:dirt", "farming:soil", -1}
|
||||
},
|
||||
walk_velocity = 1,
|
||||
walk_chance = 100,
|
||||
run_velocity = 2,
|
||||
jump = false,
|
||||
walk_chance = 70,
|
||||
drops = {
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 2,
|
||||
light_damage = 0,
|
||||
follow = {"farming:wheat", "default:apple", "farming:oat",
|
||||
"farming:barley", "farming:corn", "ethereal:banana_single", "farming:corn_cob", "farming:cabbage", "default:dry_grass_1", "default:dry_grass_2", "default:dry_grass_3", "default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5", "default:marram_grass_1", "default:marram_grass_2", "default:marram_grass_3", "default:coldsteppe_grass_1", "default:coldsteppe_grass_2", "default:coldsteppe_grass_3", "default:coldsteppe_grass_4", "default:coldsteppe_grass_5", "default:coldsteppe_grass_6", "naturalbiomes:savanna_grass1", "naturalbiomes:savanna_grass2", "naturalbiomes:savanna_grass3", "naturalbiomes:outback_grass1", "naturalbiomes:outback_grass2", "naturalbiomes:outback_grass3", "naturalbiomes:outback_grass4", "naturalbiomes:outback_grass5", "naturalbiomes:outback_grass6", "naturalbiomes:med_grass1", "naturalbiomes:med_grass2", "naturalbiomes:heath_grass1", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:alpine_grass1", "naturalbiomes:alpine_grass2", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:", "naturalbiomes:", "naturalbiomes:bushland_grass", "naturalbiomes:bushland_grass2", "naturalbiomes:bushland_grass3", "naturalbiomes:bushland_grass4", "naturalbiomes:bushland_grass5", "naturalbiomes:bushland_grass6", "naturalbiomes:bushland_grass7", "group:grass", "group:normal_grass"},
|
||||
view_range = 15,
|
||||
owner = "singleplayer",
|
||||
order = "follow",
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
animation = {
|
||||
speed_normal = 25,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand1_start = 100,
|
||||
stand1_end = 200,
|
||||
stand2_start = 200,
|
||||
stand2_end = 300,
|
||||
walk_speed = 50,
|
||||
walk_start = 300,
|
||||
walk_end = 400,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||
|
||||
-- capture npc with net or lasso
|
||||
if mobs:capture_mob(self, clicker, 25, 0, 25, false, nil) then return end
|
||||
|
||||
-- protect npc with mobs:protector
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
|
||||
|
||||
|
||||
-- by right-clicking owner can switch npc between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Plough stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
|
||||
minetest.chat_send_player(name, S("Plough will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("people:plough", S("Plough"), "aplough.png")
|
132
plunderercrossbow.lua
Normal file
@ -0,0 +1,132 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:plunderercrossbow", {
|
||||
-- animal, monster, npc
|
||||
type = "monster",
|
||||
-- aggressive, shoots bolts
|
||||
passive = false,
|
||||
step_height = 2,
|
||||
fear_height = 4,
|
||||
damage = 8,
|
||||
attack_type = "shoot",
|
||||
shoot_interval = 2,
|
||||
arrow = "people:bolt",
|
||||
shoot_offset = 2,
|
||||
attacks_monsters = false,
|
||||
-- health & armor
|
||||
hp_min = 35, hp_max = 70, armor = 130,
|
||||
-- textures and model
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Plunderercrossbow.b3d",
|
||||
drawtype = "front",
|
||||
textures = {
|
||||
{"textureplunderercrossbow.png"},
|
||||
},
|
||||
visual_size = {x=1, y=1},
|
||||
-- sounds
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
shoot_attack = "people_plunderercrossbow2",
|
||||
random = "people_plunderercrossbow",
|
||||
damage = "people_plunderercrossbow3",
|
||||
distance = 15,
|
||||
},
|
||||
-- speed and jump
|
||||
walk_velocity = 2,
|
||||
run_velocity = 3,
|
||||
walk_chance = 10,
|
||||
jump = true,
|
||||
stay_near = {{"people:bootynode"}, 5},
|
||||
drops = {
|
||||
{name = "people:forge", chance = 7, min = 1, max = 1},
|
||||
{name = "people:feeder", chance = 7, min = 1, max = 1},
|
||||
{name = "people:mineshaft", chance = 7, min = 1, max = 1},
|
||||
{name = "people:villagerbed", chance = 7, min = 1, max = 1},
|
||||
{name = "people:weaponstand", chance = 7, min = 1, max = 1},
|
||||
{name = "people:firstaidnode", chance = 7, min = 1, max = 1},
|
||||
{name = "people:emblemoftriumph", chance = 7, min = 1, max = 1},
|
||||
},
|
||||
-- damaged by
|
||||
water_damage = 0,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
view_range = 20,
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 70,
|
||||
speed_run = 100,
|
||||
stand_speed = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
walk_start = 100,
|
||||
walk_end = 200,
|
||||
run_start = 100,
|
||||
run_end = 200,
|
||||
shoot_start = 200,
|
||||
shoot_end = 300,
|
||||
speed_shoot = 55,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
|
||||
do_punch = function(self, hitter,
|
||||
time_from_last_punch,
|
||||
tool_capabilities,
|
||||
direction)
|
||||
|
||||
-- Prevent friendly fire from killing each other :)
|
||||
local entity = hitter:get_luaentity()
|
||||
|
||||
if entity == "people:plunderercrossbow" then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:plunderercrossbow",
|
||||
nodes = {"default:cobble", "default:mossycobble", "default:sandstonebrick"},
|
||||
neighbors = {"people:bootynode"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
active_object_count = 2,
|
||||
chance = 10, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
|
||||
mobs:register_egg("people:plunderercrossbow", S"Plunderer with Crossbow", "aplunderercrossbow.png")
|
||||
|
||||
mobs:register_arrow("people:bolt", {
|
||||
visual = "sprite",
|
||||
visual_size = {x=.5, y=.5},
|
||||
textures = {"bolt.png"},
|
||||
velocity = 15,
|
||||
drop = true,
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=15},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=15},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
end,
|
||||
})
|
112
plundererflask.lua
Normal file
@ -0,0 +1,112 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:plundererflask", {
|
||||
-- animal, monster, npc
|
||||
type = "monster",
|
||||
-- aggressive, shoots flasks
|
||||
passive = false,
|
||||
step_height = 2,
|
||||
fear_height = 4,
|
||||
damage = 10,
|
||||
attack_type = "shoot",
|
||||
shoot_interval = 1,
|
||||
arrow = "people:flask",
|
||||
shoot_offset = 2,
|
||||
attacks_monsters = false,
|
||||
-- health & armor
|
||||
hp_min = 20, hp_max = 40, armor = 100,
|
||||
-- textures and model
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Plundererflask.b3d",
|
||||
drawtype = "front",
|
||||
textures = {
|
||||
{"textureplundererflask.png"},
|
||||
},
|
||||
visual_size = {x=1, y=1},
|
||||
-- sounds
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
shoot_attack = "people_plundererflask2",
|
||||
random = "people_plundererflask",
|
||||
damage = "people_plundererflask3",
|
||||
distance = 15,
|
||||
},
|
||||
-- speed and jump
|
||||
walk_velocity = 2,
|
||||
run_velocity = 3,
|
||||
walk_chance = 10,
|
||||
jump = true,
|
||||
stay_near = {{"people:bootynode"}, 5},
|
||||
drops = {
|
||||
{name = "people:forge", chance = 7, min = 1, max = 1},
|
||||
{name = "people:feeder", chance = 7, min = 1, max = 1},
|
||||
{name = "people:mineshaft", chance = 7, min = 1, max = 1},
|
||||
{name = "people:villagerbed", chance = 7, min = 1, max = 1},
|
||||
{name = "people:weaponstand", chance = 7, min = 1, max = 1},
|
||||
{name = "people:firstaidnode", chance = 7, min = 1, max = 1},
|
||||
{name = "people:emblemoftriumph", chance = 7, min = 1, max = 1},
|
||||
},
|
||||
-- damaged by
|
||||
water_damage = 0,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
view_range = 15,
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 70, speed_run = 100,
|
||||
stand_speed = 50,
|
||||
stand_start = 0, stand_end = 100,
|
||||
walk_start = 100, walk_end = 200,
|
||||
run_start = 100, run_end = 200,
|
||||
shoot_start = 200, shoot_end = 300,
|
||||
speed_shoot = 55,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:plundererflask",
|
||||
nodes = {"default:cobble", "default:mossycobble", "default:sandstonebrick"},
|
||||
neighbors = {"people:bootynode"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
active_object_count = 2,
|
||||
chance = 10, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
|
||||
mobs:register_egg("people:plundererflask", S"Plunderer with Flask", "aplundererflask.png")
|
||||
|
||||
mobs:register_arrow("people:flask", {
|
||||
visual = "sprite",
|
||||
visual_size = {x=.5, y=.5},
|
||||
textures = {"flask.png"},
|
||||
velocity = 12,
|
||||
drop = true,
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=13},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=13},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
end,
|
||||
})
|
87
plundererstick.lua
Normal file
@ -0,0 +1,87 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
mobs:register_mob("people:plundererstick", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
step_height = 2,
|
||||
fear_height = 4,
|
||||
attack_type = "dogfight",
|
||||
attack_animals = true,
|
||||
reach = 3,
|
||||
damage = 7,
|
||||
hp_min = 25,
|
||||
hp_max = 65,
|
||||
armor = 100,
|
||||
collisionbox = {-0.5, -0.01, -0.5, 0.5, 0.95, 0.5},
|
||||
visual = "mesh",
|
||||
mesh = "Plundererstick.b3d",
|
||||
visual_size = {x = 1.0, y = 1.0},
|
||||
textures = {
|
||||
{"textureplundererstick.png"},
|
||||
},
|
||||
sounds = {
|
||||
attack = "people_plundererstick3",
|
||||
random = "people_plunderersick",
|
||||
damage = "people_plundererstick2",
|
||||
distance = 15,
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 2,
|
||||
run_velocity = 4,
|
||||
walk_chance = 10,
|
||||
runaway = false,
|
||||
stay_near = {{"people:bootynode"}, 5},
|
||||
jump = true,
|
||||
drops = {
|
||||
{name = "people:forge", chance = 7, min = 1, max = 1},
|
||||
{name = "people:feeder", chance = 7, min = 1, max = 1},
|
||||
{name = "people:mineshaft", chance = 7, min = 1, max = 1},
|
||||
{name = "people:villagerbed", chance = 7, min = 1, max = 1},
|
||||
{name = "people:weaponstand", chance = 7, min = 1, max = 1},
|
||||
{name = "people:firstaidnode", chance = 7, min = 1, max = 1},
|
||||
{name = "people:emblemoftriumph", chance = 7, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 100,
|
||||
stand_speed = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
walk_start = 100,
|
||||
walk_end = 200,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
view_range = 15,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed or tame
|
||||
if mobs:feed_tame(self, clicker, 4, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:plundererstick",
|
||||
nodes = {"default:cobble", "default:mossycobble", "default:sandstonebrick"},
|
||||
neighbors = {"people:bootynode"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
active_object_count = 2,
|
||||
chance = 10, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
|
||||
mobs:register_egg("people:plundererstick", S("Plunderer with a Stick"), "aplundererstick.png")
|
234
rideelephant.lua
Normal file
@ -0,0 +1,234 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S = minetest.get_translator and minetest.get_translator("people") or
|
||||
dofile(MP .. "/intllib.lua")
|
||||
|
||||
-- 0.4.17 or 5.0 check
|
||||
local y_off = 20
|
||||
if minetest.features.object_independent_selectionbox then
|
||||
y_off = 10
|
||||
end
|
||||
|
||||
-- horse shoes (speed, jump, break, overlay texture)
|
||||
local shoes = {
|
||||
["people:horseshoe_steel"] = {7, 4, 2, "people_horseshoe_steelo.png"},
|
||||
["people:horseshoe_bronze"] = {7, 4, 4, "people_horseshoe_bronzeo.png"},
|
||||
["people:horseshoe_mese"] = {9, 5, 8, "people_horseshoe_meseo.png"},
|
||||
["people:horseshoe_diamond"] = {10, 6, 6, "people_horseshoe_diamondo.png"}
|
||||
}
|
||||
|
||||
-- rideable horse
|
||||
mobs:register_mob("people:rideelephant", {
|
||||
type = "animal",
|
||||
visual = "mesh",
|
||||
visual_size = {x = 1, y = 1},
|
||||
mesh = "Rideelephant.b3d",
|
||||
collisionbox = {-0.5, -0.01, -0.5, 0.5, 2, 0.5},
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
run_speed = 100,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
walk_speed = 50,
|
||||
walk_start = 101,
|
||||
walk_end = 200,
|
||||
run_start = 101,
|
||||
run_end = 200,
|
||||
die_start = 0,
|
||||
die_end = 100,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
textures = {
|
||||
{"texturerideelephant.png"},
|
||||
|
||||
},
|
||||
fear_height = 3,
|
||||
runaway = true,
|
||||
fly = false,
|
||||
walk_chance = 60,
|
||||
walk_velocity = 1.5,
|
||||
view_range = 10,
|
||||
knock_back = false,
|
||||
stay_near = {{"people:feeder", "marinara:reed_bundle", "naturalbiomes:reed_bundle", "farming:straw"}, 5},
|
||||
follow = {
|
||||
"farming:wheat", "default:apple", "farming:oat",
|
||||
"farming:barley", "farming:corn", "default:dry_grass_1", "default:dry_grass_2", "default:dry_grass_3", "default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5", "default:marram_grass_1", "default:marram_grass_2", "default:marram_grass_3", "default:coldsteppe_grass_1", "default:coldsteppe_grass_2", "default:coldsteppe_grass_3", "default:coldsteppe_grass_4", "default:coldsteppe_grass_5", "default:coldsteppe_grass_6", "naturalbiomes:savanna_grass1", "naturalbiomes:savanna_grass2", "naturalbiomes:savanna_grass3", "naturalbiomes:outback_grass1", "naturalbiomes:outback_grass2", "naturalbiomes:outback_grass3", "naturalbiomes:outback_grass4", "naturalbiomes:outback_grass5", "naturalbiomes:outback_grass6", "naturalbiomes:med_grass1", "naturalbiomes:med_grass2", "naturalbiomes:heath_grass1", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:alpine_grass1", "naturalbiomes:alpine_grass2", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:", "naturalbiomes:", "naturalbiomes:bushland_grass", "naturalbiomes:bushland_grass2", "naturalbiomes:bushland_grass3", "naturalbiomes:bushland_grass4", "naturalbiomes:bushland_grass5", "naturalbiomes:bushland_grass6", "naturalbiomes:bushland_grass7", "farming:melon_8", "farming:pumpkin_8", "ethereal:strawberry", "farming:blackberry", "naturalbiomes:blackberry", "naturalbiomes:cowberry", "naturalbiomes:banana", "naturalbiomes:banana_bunch", "farming:blueberries", "ethereal:orange", "livingdesert:figcactus_fruit", "livingfloatlands:paleojungle_clubmoss_fruit", "ethereal:banana", "livingdesert:date_palm_fruits", "farming:melon_slice", "naturalbiomes:wildrose", "naturalbiomes:banana", "group:grass", "group:normal_grass"},
|
||||
passive = true,
|
||||
hp_min = 100,
|
||||
hp_max = 400,
|
||||
armor = 100,
|
||||
lava_damage = 5,
|
||||
fall_damage = 5,
|
||||
water_damage = 0,
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_elephant2",
|
||||
damage = "people_elephant",
|
||||
death = "people_elephant3",
|
||||
distance = 15,
|
||||
},
|
||||
drops = {
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2}
|
||||
},
|
||||
|
||||
do_custom = function(self, dtime)
|
||||
|
||||
-- set needed values if not already present
|
||||
if not self.v2 then
|
||||
self.v2 = 0
|
||||
self.max_speed_forward = 5
|
||||
self.max_speed_reverse = 2
|
||||
self.accel = 6
|
||||
self.terrain_type = 3
|
||||
self.driver_attach_at = {x = 0, y = 23, z = -8}
|
||||
self.driver_eye_offset = {x = 0, y = 23, z = -0}
|
||||
end
|
||||
|
||||
-- if driver present allow control of horse
|
||||
if self.driver then
|
||||
|
||||
mobs.drive(self, "walk", "stand", false, dtime)
|
||||
|
||||
return false -- skip rest of mob functions
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
|
||||
on_die = function(self, pos)
|
||||
|
||||
-- drop saddle when horse is killed while riding
|
||||
-- also detach from horse properly
|
||||
if self.driver then
|
||||
|
||||
minetest.add_item(pos, "mobs:saddle")
|
||||
|
||||
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
||||
|
||||
self.saddle = nil
|
||||
end
|
||||
|
||||
-- drop any horseshoes added
|
||||
if self.shoed then
|
||||
minetest.add_item(pos, self.shoed)
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
do_punch = function(self, hitter)
|
||||
|
||||
-- don't cut the branch you're... ah, that's not about that
|
||||
if hitter ~= self.driver then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- make sure player is clicking
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
-- feed, tame or heal horse
|
||||
if mobs:feed_tame(self, clicker, 10, true, true) then
|
||||
return
|
||||
end
|
||||
|
||||
-- applying protection rune
|
||||
if mobs:protect(self, clicker) then
|
||||
return
|
||||
end
|
||||
|
||||
local player_name = clicker:get_player_name()
|
||||
|
||||
-- make sure tamed horse is being clicked by owner only
|
||||
if self.tamed and self.owner == player_name then
|
||||
|
||||
local inv = clicker:get_inventory()
|
||||
local tool = clicker:get_wielded_item()
|
||||
local item = tool:get_name()
|
||||
|
||||
-- detatch player already riding horse
|
||||
if self.driver and clicker == self.driver then
|
||||
|
||||
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
||||
|
||||
-- add saddle back to inventory
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker:get_pos(), "mobs:saddle")
|
||||
end
|
||||
|
||||
self.saddle = nil
|
||||
|
||||
-- attach player to horse
|
||||
elseif (not self.driver and not self.child
|
||||
and clicker:get_wielded_item():get_name() == "mobs:saddle")
|
||||
or self.saddle then
|
||||
|
||||
self.object:set_properties({stepheight = 1.1})
|
||||
mobs.attach(self, clicker)
|
||||
|
||||
-- take saddle from inventory
|
||||
if not self.saddle then
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
|
||||
self.saddle = true
|
||||
end
|
||||
|
||||
-- apply horseshoes
|
||||
if item:find("people:horseshoe") then
|
||||
|
||||
-- drop any existing shoes
|
||||
if self.shoed then
|
||||
minetest.add_item(self.object:get_pos(), self.shoed)
|
||||
end
|
||||
|
||||
local speed = shoes[item][1]
|
||||
local jump = shoes[item][2]
|
||||
local reverse = shoes[item][3]
|
||||
local overlay = shoes[item][4]
|
||||
|
||||
self.max_speed_forward = speed
|
||||
self.jump_height = jump
|
||||
self.max_speed_reverse = reverse
|
||||
self.accel = speed
|
||||
self.shoed = item
|
||||
|
||||
-- apply horseshoe overlay to current horse texture
|
||||
if overlay then
|
||||
self.texture_mods = "^" .. overlay
|
||||
self.object:set_texture_mod(self.texture_mods)
|
||||
end
|
||||
|
||||
-- show horse speed and jump stats with shoes fitted
|
||||
minetest.chat_send_player(player_name,
|
||||
S("Horse shoes fitted -")
|
||||
.. S(" speed: ") .. speed
|
||||
.. S(" , jump height: ") .. jump
|
||||
.. S(" , stop speed: ") .. reverse)
|
||||
|
||||
tool:take_item()
|
||||
|
||||
clicker:set_wielded_item(tool)
|
||||
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- used to capture horse with magic lasso
|
||||
if mobs:capture_mob(self, clicker, 0, 0, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("people:rideelephant", S("Ridable Elephant"), "arideelephant.png")
|
||||
|
||||
|
245
ridehorse.lua
Normal file
@ -0,0 +1,245 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S = minetest.get_translator and minetest.get_translator("people") or
|
||||
dofile(MP .. "/intllib.lua")
|
||||
|
||||
-- 0.4.17 or 5.0 check
|
||||
local y_off = 20
|
||||
if minetest.features.object_independent_selectionbox then
|
||||
y_off = 10
|
||||
end
|
||||
|
||||
-- horse shoes (speed, jump, break, overlay texture)
|
||||
local shoes = {
|
||||
["people:horseshoe_steel"] = {7, 4, 2, "people_horseshoe_steelo.png"},
|
||||
["people:horseshoe_bronze"] = {7, 4, 4, "people_horseshoe_bronzeo.png"},
|
||||
["people:horseshoe_mese"] = {9, 5, 8, "people_horseshoe_meseo.png"},
|
||||
["people:horseshoe_diamond"] = {10, 6, 6, "people_horseshoe_diamondo.png"}
|
||||
}
|
||||
|
||||
-- rideable horse
|
||||
mobs:register_mob("people:ridehorse", {
|
||||
type = "animal",
|
||||
visual = "mesh",
|
||||
visual_size = {x = 1, y = 1},
|
||||
mesh = "Ridehorse.b3d",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.25, 0.4},
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
run_speed = 100,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 75,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
run_start = 200,
|
||||
run_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
textures = {
|
||||
{"textureridehorse.png"},
|
||||
{"textureridehorse2.png"},
|
||||
{"textureridehorse3.png"},
|
||||
{"textureridehorse4.png"},
|
||||
{"textureridehorse5.png"},
|
||||
{"textureridehorse6.png"},
|
||||
{"textureridehorse7.png"},
|
||||
{"textureridehorse8.png"},
|
||||
{"textureridehorse9.png"},
|
||||
|
||||
|
||||
},
|
||||
fear_height = 3,
|
||||
runaway = true,
|
||||
stay_near = {{"people:feeder", "marinara:reed_bundle", "naturalbiomes:reed_bundle", "farming:straw"}, 5},
|
||||
fly = false,
|
||||
walk_chance = 60,
|
||||
walk_velocity = 1.5,
|
||||
view_range = 10,
|
||||
knock_back = false,
|
||||
follow = {
|
||||
"farming:wheat", "default:apple", "farming:oat",
|
||||
"farming:barley", "farming:corn", "default:dry_grass_1", "default:dry_grass_2", "default:dry_grass_3", "default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5", "default:marram_grass_1", "default:marram_grass_2", "default:marram_grass_3", "default:coldsteppe_grass_1", "default:coldsteppe_grass_2", "default:coldsteppe_grass_3", "default:coldsteppe_grass_4", "default:coldsteppe_grass_5", "default:coldsteppe_grass_6", "naturalbiomes:savanna_grass1", "naturalbiomes:savanna_grass2", "naturalbiomes:savanna_grass3", "naturalbiomes:outback_grass1", "naturalbiomes:outback_grass2", "naturalbiomes:outback_grass3", "naturalbiomes:outback_grass4", "naturalbiomes:outback_grass5", "naturalbiomes:outback_grass6", "naturalbiomes:med_grass1", "naturalbiomes:med_grass2", "naturalbiomes:heath_grass1", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:alpine_grass1", "naturalbiomes:alpine_grass2", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:", "naturalbiomes:", "naturalbiomes:bushland_grass", "naturalbiomes:bushland_grass2", "naturalbiomes:bushland_grass3", "naturalbiomes:bushland_grass4", "naturalbiomes:bushland_grass5", "naturalbiomes:bushland_grass6", "naturalbiomes:bushland_grass7", "group:grass", "group:normal_grass"},
|
||||
passive = true,
|
||||
hp_min = 50,
|
||||
hp_max = 120,
|
||||
armor = 100,
|
||||
lava_damage = 5,
|
||||
fall_damage = 5,
|
||||
water_damage = 1,
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_horse2",
|
||||
damage = "people_horse3",
|
||||
death = "people_horse",
|
||||
distance = 15,
|
||||
},
|
||||
drops = {
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2}
|
||||
},
|
||||
|
||||
do_custom = function(self, dtime)
|
||||
|
||||
-- set needed values if not already present
|
||||
if not self.v2 then
|
||||
self.v2 = 0
|
||||
self.max_speed_forward = 6
|
||||
self.max_speed_reverse = 2
|
||||
self.accel = 6
|
||||
self.terrain_type = 3
|
||||
self.driver_attach_at = {x = 0, y = 14.2, z = -3}
|
||||
self.driver_eye_offset = {x = 0, y = 14.2, z = 0}
|
||||
end
|
||||
|
||||
-- if driver present allow control of horse
|
||||
if self.driver then
|
||||
|
||||
mobs.drive(self, "walk", "stand", false, dtime)
|
||||
|
||||
return false -- skip rest of mob functions
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
|
||||
on_die = function(self, pos)
|
||||
|
||||
-- drop saddle when horse is killed while riding
|
||||
-- also detach from horse properly
|
||||
if self.driver then
|
||||
|
||||
minetest.add_item(pos, "mobs:saddle")
|
||||
|
||||
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
||||
|
||||
self.saddle = nil
|
||||
end
|
||||
|
||||
-- drop any horseshoes added
|
||||
if self.shoed then
|
||||
minetest.add_item(pos, self.shoed)
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
do_punch = function(self, hitter)
|
||||
|
||||
-- don't cut the branch you're... ah, that's not about that
|
||||
if hitter ~= self.driver then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- make sure player is clicking
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
-- feed, tame or heal horse
|
||||
if mobs:feed_tame(self, clicker, 10, true, true) then
|
||||
return
|
||||
end
|
||||
|
||||
-- applying protection rune
|
||||
if mobs:protect(self, clicker) then
|
||||
return
|
||||
end
|
||||
|
||||
local player_name = clicker:get_player_name()
|
||||
|
||||
-- make sure tamed horse is being clicked by owner only
|
||||
if self.tamed and self.owner == player_name then
|
||||
|
||||
local inv = clicker:get_inventory()
|
||||
local tool = clicker:get_wielded_item()
|
||||
local item = tool:get_name()
|
||||
|
||||
-- detatch player already riding horse
|
||||
if self.driver and clicker == self.driver then
|
||||
|
||||
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
||||
|
||||
-- add saddle back to inventory
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker:get_pos(), "mobs:saddle")
|
||||
end
|
||||
|
||||
self.saddle = nil
|
||||
|
||||
-- attach player to horse
|
||||
elseif (not self.driver and not self.child
|
||||
and clicker:get_wielded_item():get_name() == "mobs:saddle")
|
||||
or self.saddle then
|
||||
|
||||
self.object:set_properties({stepheight = 1.1})
|
||||
mobs.attach(self, clicker)
|
||||
|
||||
-- take saddle from inventory
|
||||
if not self.saddle then
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
|
||||
self.saddle = true
|
||||
end
|
||||
|
||||
-- apply horseshoes
|
||||
if item:find("people:horseshoe") then
|
||||
|
||||
-- drop any existing shoes
|
||||
if self.shoed then
|
||||
minetest.add_item(self.object:get_pos(), self.shoed)
|
||||
end
|
||||
|
||||
local speed = shoes[item][1]
|
||||
local jump = shoes[item][2]
|
||||
local reverse = shoes[item][3]
|
||||
local overlay = shoes[item][4]
|
||||
|
||||
self.max_speed_forward = speed
|
||||
self.jump_height = jump
|
||||
self.max_speed_reverse = reverse
|
||||
self.accel = speed
|
||||
self.shoed = item
|
||||
|
||||
-- apply horseshoe overlay to current horse texture
|
||||
if overlay then
|
||||
self.texture_mods = "^" .. overlay
|
||||
self.object:set_texture_mod(self.texture_mods)
|
||||
end
|
||||
|
||||
-- show horse speed and jump stats with shoes fitted
|
||||
minetest.chat_send_player(player_name,
|
||||
S("Horse shoes fitted -")
|
||||
.. S(" speed: ") .. speed
|
||||
.. S(" , jump height: ") .. jump
|
||||
.. S(" , stop speed: ") .. reverse)
|
||||
|
||||
tool:take_item()
|
||||
|
||||
clicker:set_wielded_item(tool)
|
||||
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- used to capture horse with magic lasso
|
||||
if mobs:capture_mob(self, clicker, 0, 0, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("people:ridehorse", S("Ridable Horse"), "aridehorse.png")
|
||||
|
229
rideostrich.lua
Normal file
@ -0,0 +1,229 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S = minetest.get_translator and minetest.get_translator("people") or
|
||||
dofile(MP .. "/intllib.lua")
|
||||
|
||||
-- 0.4.17 or 5.0 check
|
||||
local y_off = 20
|
||||
if minetest.features.object_independent_selectionbox then
|
||||
y_off = 10
|
||||
end
|
||||
|
||||
-- horse shoes (speed, jump, break, overlay texture)
|
||||
local shoes = {
|
||||
["people:horseshoe_steel"] = {7, 4, 2, "people_horseshoe_steelo.png"},
|
||||
["people:horseshoe_bronze"] = {7, 4, 4, "people_horseshoe_bronzeo.png"},
|
||||
["people:horseshoe_mese"] = {9, 5, 8, "people_horseshoe_meseo.png"},
|
||||
["people:horseshoe_diamond"] = {10, 6, 6, "people_horseshoe_diamondo.png"}
|
||||
}
|
||||
|
||||
-- rideable horse
|
||||
mobs:register_mob("people:rideostrich", {
|
||||
type = "animal",
|
||||
visual = "mesh",
|
||||
visual_size = {x = 1, y = 1},
|
||||
mesh = "Rideostrich.b3d",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.25, 0.4},
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
run_speed = 100,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_end = 200,
|
||||
stand2_start = 300,
|
||||
walk_speed = 75,
|
||||
walk_start = 100,
|
||||
walk_end = 200,
|
||||
run_start = 200,
|
||||
run_end = 300,
|
||||
die_start = 100,
|
||||
die_end = 200,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
textures = {
|
||||
{"texturerideostrich.png"},
|
||||
|
||||
},
|
||||
fear_height = 3,
|
||||
runaway = true,
|
||||
fly = false,
|
||||
walk_chance = 60,
|
||||
walk_velocity = 3,
|
||||
view_range = 10,
|
||||
stay_near = {{"people:feeder", "marinara:reed_bundle", "naturalbiomes:reed_bundle", "farming:straw"}, 5},
|
||||
follow = {
|
||||
"farming:wheat", "default:apple", "farming:oat",
|
||||
"farming:barley", "farming:corn", "farming:corn_cob", "farming:seed_hemp", "farming:seed_barley", "farming:seed_oat", "farming:seed_cotton", "farming:seed_sunflower", "farming:seed_wheat", "farming:seed_rye", "naturalbiomes:coconut", "naturalbiomes:coconut_slice", "naturalbiomes:hazelnut", "naturalbiomes:hazelnut_cracked", "farming:sunflower_seeds_toasted", "livingfloatlands:roasted_pine_nuts", "livingfloatlands:giantforest_oaknut", "livingfloatlands:giantforest_oaknut_cracked", "livingfloatlands:coldsteppe_pine3_pinecone", "livingfloatlands:coldsteppe_pine_pinecone", "livingfloatlands:coldsteppe_pine2_pinecone", "default:dry_grass_1", "default:dry_grass_2", "default:dry_grass_3", "default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5", "default:marram_grass_1", "default:marram_grass_2", "default:marram_grass_3", "default:coldsteppe_grass_1", "default:coldsteppe_grass_2", "default:coldsteppe_grass_3", "default:coldsteppe_grass_4", "default:coldsteppe_grass_5", "default:coldsteppe_grass_6", "naturalbiomes:savanna_grass1", "naturalbiomes:savanna_grass2", "naturalbiomes:savanna_grass3", "naturalbiomes:outback_grass1", "naturalbiomes:outback_grass2", "naturalbiomes:outback_grass3", "naturalbiomes:outback_grass4", "naturalbiomes:outback_grass5", "naturalbiomes:outback_grass6", "naturalbiomes:med_grass1", "naturalbiomes:med_grass2", "naturalbiomes:heath_grass1", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:alpine_grass1", "naturalbiomes:alpine_grass2", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:", "naturalbiomes:", "naturalbiomes:bushland_grass", "naturalbiomes:bushland_grass2", "naturalbiomes:bushland_grass3", "naturalbiomes:bushland_grass4", "naturalbiomes:bushland_grass5", "naturalbiomes:bushland_grass6", "naturalbiomes:bushland_grass7", "group:grass", "group:normal_grass"},
|
||||
passive = true,
|
||||
hp_min = 25,
|
||||
hp_max = 55,
|
||||
armor = 100,
|
||||
lava_damage = 5,
|
||||
fall_damage = 5,
|
||||
water_damage = 1,
|
||||
makes_footstep_sound = true,
|
||||
drops = {
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2}
|
||||
},
|
||||
|
||||
do_custom = function(self, dtime)
|
||||
|
||||
-- set needed values if not already present
|
||||
if not self.v2 then
|
||||
self.v2 = 0
|
||||
self.max_speed_forward = 9
|
||||
self.max_speed_reverse = 4
|
||||
self.accel = 6
|
||||
self.terrain_type = 3
|
||||
self.driver_attach_at = {x = 0, y = 11, z = -1.6}
|
||||
self.driver_eye_offset = {x = 0, y = 11, z = 0}
|
||||
end
|
||||
|
||||
-- if driver present allow control of horse
|
||||
if self.driver then
|
||||
|
||||
mobs.drive(self, "walk", "stand", false, dtime)
|
||||
|
||||
return false -- skip rest of mob functions
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
|
||||
on_die = function(self, pos)
|
||||
|
||||
-- drop saddle when horse is killed while riding
|
||||
-- also detach from horse properly
|
||||
if self.driver then
|
||||
|
||||
minetest.add_item(pos, "mobs:saddle")
|
||||
|
||||
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
||||
|
||||
self.saddle = nil
|
||||
end
|
||||
|
||||
-- drop any horseshoes added
|
||||
if self.shoed then
|
||||
minetest.add_item(pos, self.shoed)
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
do_punch = function(self, hitter)
|
||||
|
||||
-- don't cut the branch you're... ah, that's not about that
|
||||
if hitter ~= self.driver then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- make sure player is clicking
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
-- feed, tame or heal horse
|
||||
if mobs:feed_tame(self, clicker, 10, true, true) then
|
||||
return
|
||||
end
|
||||
|
||||
-- applying protection rune
|
||||
if mobs:protect(self, clicker) then
|
||||
return
|
||||
end
|
||||
|
||||
local player_name = clicker:get_player_name()
|
||||
|
||||
-- make sure tamed horse is being clicked by owner only
|
||||
if self.tamed and self.owner == player_name then
|
||||
|
||||
local inv = clicker:get_inventory()
|
||||
local tool = clicker:get_wielded_item()
|
||||
local item = tool:get_name()
|
||||
|
||||
-- detatch player already riding horse
|
||||
if self.driver and clicker == self.driver then
|
||||
|
||||
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
||||
|
||||
-- add saddle back to inventory
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker:get_pos(), "mobs:saddle")
|
||||
end
|
||||
|
||||
self.saddle = nil
|
||||
|
||||
-- attach player to horse
|
||||
elseif (not self.driver and not self.child
|
||||
and clicker:get_wielded_item():get_name() == "mobs:saddle")
|
||||
or self.saddle then
|
||||
|
||||
self.object:set_properties({stepheight = 1.1})
|
||||
mobs.attach(self, clicker)
|
||||
|
||||
-- take saddle from inventory
|
||||
if not self.saddle then
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
|
||||
self.saddle = true
|
||||
end
|
||||
|
||||
-- apply horseshoes
|
||||
if item:find("people:horseshoe") then
|
||||
|
||||
-- drop any existing shoes
|
||||
if self.shoed then
|
||||
minetest.add_item(self.object:get_pos(), self.shoed)
|
||||
end
|
||||
|
||||
local speed = shoes[item][1]
|
||||
local jump = shoes[item][2]
|
||||
local reverse = shoes[item][3]
|
||||
local overlay = shoes[item][4]
|
||||
|
||||
self.max_speed_forward = speed
|
||||
self.jump_height = jump
|
||||
self.max_speed_reverse = reverse
|
||||
self.accel = speed
|
||||
self.shoed = item
|
||||
|
||||
-- apply horseshoe overlay to current horse texture
|
||||
if overlay then
|
||||
self.texture_mods = "^" .. overlay
|
||||
self.object:set_texture_mod(self.texture_mods)
|
||||
end
|
||||
|
||||
-- show horse speed and jump stats with shoes fitted
|
||||
minetest.chat_send_player(player_name,
|
||||
S("Horse shoes fitted -")
|
||||
.. S(" speed: ") .. speed
|
||||
.. S(" , jump height: ") .. jump
|
||||
.. S(" , stop speed: ") .. reverse)
|
||||
|
||||
tool:take_item()
|
||||
|
||||
clicker:set_wielded_item(tool)
|
||||
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- used to capture horse with magic lasso
|
||||
if mobs:capture_mob(self, clicker, 0, 0, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("people:rideostrich", S("Ridable Ostrich"), "arideostrich.png")
|
||||
|
||||
|
233
rideox.lua
Normal file
@ -0,0 +1,233 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S = minetest.get_translator and minetest.get_translator("people") or
|
||||
dofile(MP .. "/intllib.lua")
|
||||
|
||||
-- 0.4.17 or 5.0 check
|
||||
local y_off = 20
|
||||
if minetest.features.object_independent_selectionbox then
|
||||
y_off = 10
|
||||
end
|
||||
|
||||
-- horse shoes (speed, jump, break, overlay texture)
|
||||
local shoes = {
|
||||
["people:horseshoe_steel"] = {7, 4, 2, "people_horseshoe_steelo.png"},
|
||||
["people:horseshoe_bronze"] = {7, 4, 4, "people_horseshoe_bronzeo.png"},
|
||||
["people:horseshoe_mese"] = {9, 5, 8, "people_horseshoe_meseo.png"},
|
||||
["people:horseshoe_diamond"] = {10, 6, 6, "people_horseshoe_diamondo.png"}
|
||||
}
|
||||
|
||||
-- rideable horse
|
||||
mobs:register_mob("people:rideox", {
|
||||
type = "animal",
|
||||
visual = "mesh",
|
||||
visual_size = {x = 1, y = 1},
|
||||
mesh = "Rideox.b3d",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.25, 0.4},
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
run_speed = 100,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
walk_speed = 75,
|
||||
walk_start = 100,
|
||||
walk_end = 200,
|
||||
run_start = 100,
|
||||
run_end = 200,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
textures = {
|
||||
{"texturerideox.png"},
|
||||
|
||||
},
|
||||
fear_height = 3,
|
||||
runaway = true,
|
||||
fly = false,
|
||||
walk_chance = 60,
|
||||
walk_velocity = 1.5,
|
||||
view_range = 10,
|
||||
knock_back = false,
|
||||
stay_near = {{"people:feeder", "marinara:reed_bundle", "naturalbiomes:reed_bundle", "farming:straw"}, 5},
|
||||
follow = {
|
||||
"farming:wheat", "default:apple", "farming:oat",
|
||||
"farming:barley", "farming:corn", "ethereal:banana_single", "farming:corn_cob", "farming:cabbage", "default:dry_grass_1", "default:dry_grass_2", "default:dry_grass_3", "default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5", "default:marram_grass_1", "default:marram_grass_2", "default:marram_grass_3", "default:coldsteppe_grass_1", "default:coldsteppe_grass_2", "default:coldsteppe_grass_3", "default:coldsteppe_grass_4", "default:coldsteppe_grass_5", "default:coldsteppe_grass_6", "naturalbiomes:savanna_grass1", "naturalbiomes:savanna_grass2", "naturalbiomes:savanna_grass3", "naturalbiomes:outback_grass1", "naturalbiomes:outback_grass2", "naturalbiomes:outback_grass3", "naturalbiomes:outback_grass4", "naturalbiomes:outback_grass5", "naturalbiomes:outback_grass6", "naturalbiomes:med_grass1", "naturalbiomes:med_grass2", "naturalbiomes:heath_grass1", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:alpine_grass1", "naturalbiomes:alpine_grass2", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:", "naturalbiomes:", "naturalbiomes:bushland_grass", "naturalbiomes:bushland_grass2", "naturalbiomes:bushland_grass3", "naturalbiomes:bushland_grass4", "naturalbiomes:bushland_grass5", "naturalbiomes:bushland_grass6", "naturalbiomes:bushland_grass7", "group:grass", "group:normal_grass"},
|
||||
passive = true,
|
||||
hp_min = 100,
|
||||
hp_max = 250,
|
||||
armor = 100,
|
||||
lava_damage = 5,
|
||||
fall_damage = 5,
|
||||
water_damage = 1,
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_ox3",
|
||||
damage = "people_ox",
|
||||
death = "people_ox2",
|
||||
distance = 15,
|
||||
},
|
||||
drops = {
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2}
|
||||
},
|
||||
|
||||
do_custom = function(self, dtime)
|
||||
|
||||
-- set needed values if not already present
|
||||
if not self.v2 then
|
||||
self.v2 = 0
|
||||
self.max_speed_forward = 4
|
||||
self.max_speed_reverse = 1
|
||||
self.accel = 6
|
||||
self.terrain_type = 3
|
||||
self.driver_attach_at = {x = 0, y = 9, z = -13}
|
||||
self.driver_eye_offset = {x = 0, y = 9, z = -10}
|
||||
end
|
||||
|
||||
-- if driver present allow control of horse
|
||||
if self.driver then
|
||||
|
||||
mobs.drive(self, "walk", "stand", false, dtime)
|
||||
|
||||
return false -- skip rest of mob functions
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
|
||||
on_die = function(self, pos)
|
||||
|
||||
-- drop saddle when horse is killed while riding
|
||||
-- also detach from horse properly
|
||||
if self.driver then
|
||||
|
||||
minetest.add_item(pos, "mobs:saddle")
|
||||
|
||||
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
||||
|
||||
self.saddle = nil
|
||||
end
|
||||
|
||||
-- drop any horseshoes added
|
||||
if self.shoed then
|
||||
minetest.add_item(pos, self.shoed)
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
do_punch = function(self, hitter)
|
||||
|
||||
-- don't cut the branch you're... ah, that's not about that
|
||||
if hitter ~= self.driver then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- make sure player is clicking
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
-- feed, tame or heal horse
|
||||
if mobs:feed_tame(self, clicker, 10, true, true) then
|
||||
return
|
||||
end
|
||||
|
||||
-- applying protection rune
|
||||
if mobs:protect(self, clicker) then
|
||||
return
|
||||
end
|
||||
|
||||
local player_name = clicker:get_player_name()
|
||||
|
||||
-- make sure tamed horse is being clicked by owner only
|
||||
if self.tamed and self.owner == player_name then
|
||||
|
||||
local inv = clicker:get_inventory()
|
||||
local tool = clicker:get_wielded_item()
|
||||
local item = tool:get_name()
|
||||
|
||||
-- detatch player already riding horse
|
||||
if self.driver and clicker == self.driver then
|
||||
|
||||
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
||||
|
||||
-- add saddle back to inventory
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker:get_pos(), "mobs:saddle")
|
||||
end
|
||||
|
||||
self.saddle = nil
|
||||
|
||||
-- attach player to horse
|
||||
elseif (not self.driver and not self.child
|
||||
and clicker:get_wielded_item():get_name() == "mobs:saddle")
|
||||
or self.saddle then
|
||||
|
||||
self.object:set_properties({stepheight = 1.1})
|
||||
mobs.attach(self, clicker)
|
||||
|
||||
-- take saddle from inventory
|
||||
if not self.saddle then
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
|
||||
self.saddle = true
|
||||
end
|
||||
|
||||
-- apply horseshoes
|
||||
if item:find("people:horseshoe") then
|
||||
|
||||
-- drop any existing shoes
|
||||
if self.shoed then
|
||||
minetest.add_item(self.object:get_pos(), self.shoed)
|
||||
end
|
||||
|
||||
local speed = shoes[item][1]
|
||||
local jump = shoes[item][2]
|
||||
local reverse = shoes[item][3]
|
||||
local overlay = shoes[item][4]
|
||||
|
||||
self.max_speed_forward = speed
|
||||
self.jump_height = jump
|
||||
self.max_speed_reverse = reverse
|
||||
self.accel = speed
|
||||
self.shoed = item
|
||||
|
||||
-- apply horseshoe overlay to current horse texture
|
||||
if overlay then
|
||||
self.texture_mods = "^" .. overlay
|
||||
self.object:set_texture_mod(self.texture_mods)
|
||||
end
|
||||
|
||||
-- show horse speed and jump stats with shoes fitted
|
||||
minetest.chat_send_player(player_name,
|
||||
S("Horse shoes fitted -")
|
||||
.. S(" speed: ") .. speed
|
||||
.. S(" , jump height: ") .. jump
|
||||
.. S(" , stop speed: ") .. reverse)
|
||||
|
||||
tool:take_item()
|
||||
|
||||
clicker:set_wielded_item(tool)
|
||||
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- used to capture horse with magic lasso
|
||||
if mobs:capture_mob(self, clicker, 25, 0, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("people:rideox", S("Ridable Ox"), "arideox.png")
|
||||
|
229
ridepig.lua
Normal file
@ -0,0 +1,229 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S = minetest.get_translator and minetest.get_translator("people") or
|
||||
dofile(MP .. "/intllib.lua")
|
||||
|
||||
-- 0.4.17 or 5.0 check
|
||||
local y_off = 20
|
||||
if minetest.features.object_independent_selectionbox then
|
||||
y_off = 10
|
||||
end
|
||||
|
||||
-- horse shoes (speed, jump, break, overlay texture)
|
||||
local shoes = {
|
||||
["people:horseshoe_steel"] = {7, 4, 2, "people_horseshoe_steelo.png"},
|
||||
["people:horseshoe_bronze"] = {7, 4, 4, "people_horseshoe_bronzeo.png"},
|
||||
["people:horseshoe_mese"] = {9, 5, 8, "people_horseshoe_meseo.png"},
|
||||
["people:horseshoe_diamond"] = {10, 6, 6, "people_horseshoe_diamondo.png"}
|
||||
}
|
||||
|
||||
-- rideable horse
|
||||
mobs:register_mob("people:ridepig", {
|
||||
type = "animal",
|
||||
visual = "mesh",
|
||||
visual_size = {x = 1, y = 1},
|
||||
mesh = "Ridepig.b3d",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.25, 0.4},
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
run_speed = 100,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
walk_speed = 75,
|
||||
walk_start = 100,
|
||||
walk_end = 200,
|
||||
run_start = 200,
|
||||
run_end = 300,
|
||||
die_start = 100,
|
||||
die_end = 200,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
textures = {
|
||||
{"textureridepig.png"},
|
||||
|
||||
},
|
||||
fear_height = 3,
|
||||
runaway = true,
|
||||
knock_back = false,
|
||||
fly = false,
|
||||
walk_chance = 60,
|
||||
view_range = 10,
|
||||
follow = {"default:apple", "farming:potato", "ethereal:banana_bread", "farming:melon_slice", "farming:carrot", "farming:seed_rice", "farming:corn", "farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad", "farming:corn_cob", "farming:seed_hemp", "farming:seed_barley", "farming:seed_oat", "farming:seed_cotton", "farming:seed_sunflower", "farming:seed_wheat", "farming:seed_rye", "naturalbiomes:coconut", "naturalbiomes:coconut_slice", "naturalbiomes:hazelnut", "naturalbiomes:hazelnut_cracked", "farming:sunflower_seeds_toasted", "livingfloatlands:roasted_pine_nuts", "livingfloatlands:giantforest_oaknut", "livingfloatlands:giantforest_oaknut_cracked", "livingfloatlands:coldsteppe_pine3_pinecone", "livingfloatlands:coldsteppe_pine_pinecone", "livingfloatlands:coldsteppe_pine2_pinecone"},
|
||||
passive = true,
|
||||
hp_min = 60,
|
||||
hp_max = 100,
|
||||
armor = 100,
|
||||
lava_damage = 5,
|
||||
fall_damage = 5,
|
||||
water_damage = 1,
|
||||
stay_near = {{"people:feeder", "marinara:reed_bundle", "naturalbiomes:reed_bundle", "farming:straw"}, 5},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_pig",
|
||||
damage = "people_pig2",
|
||||
death = "people_pig3",
|
||||
distance = 15,
|
||||
},
|
||||
drops = {
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2}
|
||||
},
|
||||
|
||||
do_custom = function(self, dtime)
|
||||
|
||||
-- set needed values if not already present
|
||||
if not self.v2 then
|
||||
self.v2 = 0
|
||||
self.max_speed_forward = 4
|
||||
self.max_speed_reverse = 2
|
||||
self.accel = 6
|
||||
self.terrain_type = 3
|
||||
self.driver_attach_at = {x = 0, y = 11, z = -2}
|
||||
self.driver_eye_offset = {x = 0, y = 11, z = 0}
|
||||
end
|
||||
|
||||
-- if driver present allow control of horse
|
||||
if self.driver then
|
||||
|
||||
mobs.drive(self, "walk", "stand", false, dtime)
|
||||
|
||||
return false -- skip rest of mob functions
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
|
||||
on_die = function(self, pos)
|
||||
|
||||
-- drop saddle when horse is killed while riding
|
||||
-- also detach from horse properly
|
||||
if self.driver then
|
||||
|
||||
minetest.add_item(pos, "mobs:saddle")
|
||||
|
||||
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
||||
|
||||
self.saddle = nil
|
||||
end
|
||||
|
||||
-- drop any horseshoes added
|
||||
if self.shoed then
|
||||
minetest.add_item(pos, self.shoed)
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
do_punch = function(self, hitter)
|
||||
|
||||
-- don't cut the branch you're... ah, that's not about that
|
||||
if hitter ~= self.driver then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- make sure player is clicking
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
-- feed, tame or heal horse
|
||||
if mobs:feed_tame(self, clicker, 10, true, true) then
|
||||
return
|
||||
end
|
||||
|
||||
-- applying protection rune
|
||||
if mobs:protect(self, clicker) then
|
||||
return
|
||||
end
|
||||
|
||||
local player_name = clicker:get_player_name()
|
||||
|
||||
-- make sure tamed horse is being clicked by owner only
|
||||
if self.tamed and self.owner == player_name then
|
||||
|
||||
local inv = clicker:get_inventory()
|
||||
local tool = clicker:get_wielded_item()
|
||||
local item = tool:get_name()
|
||||
|
||||
-- detatch player already riding horse
|
||||
if self.driver and clicker == self.driver then
|
||||
|
||||
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
||||
|
||||
-- add saddle back to inventory
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker:get_pos(), "mobs:saddle")
|
||||
end
|
||||
|
||||
self.saddle = nil
|
||||
|
||||
-- attach player to horse
|
||||
elseif (not self.driver and not self.child
|
||||
and clicker:get_wielded_item():get_name() == "mobs:saddle")
|
||||
or self.saddle then
|
||||
|
||||
self.object:set_properties({stepheight = 1.1})
|
||||
mobs.attach(self, clicker)
|
||||
|
||||
-- take saddle from inventory
|
||||
if not self.saddle then
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
|
||||
self.saddle = true
|
||||
end
|
||||
|
||||
-- apply horseshoes
|
||||
if item:find("people:horseshoe") then
|
||||
|
||||
-- drop any existing shoes
|
||||
if self.shoed then
|
||||
minetest.add_item(self.object:get_pos(), self.shoed)
|
||||
end
|
||||
|
||||
local speed = shoes[item][1]
|
||||
local jump = shoes[item][2]
|
||||
local reverse = shoes[item][3]
|
||||
local overlay = shoes[item][4]
|
||||
|
||||
self.max_speed_forward = speed
|
||||
self.jump_height = jump
|
||||
self.max_speed_reverse = reverse
|
||||
self.accel = speed
|
||||
self.shoed = item
|
||||
|
||||
-- apply horseshoe overlay to current horse texture
|
||||
if overlay then
|
||||
self.texture_mods = "^" .. overlay
|
||||
self.object:set_texture_mod(self.texture_mods)
|
||||
end
|
||||
|
||||
-- show horse speed and jump stats with shoes fitted
|
||||
minetest.chat_send_player(player_name,
|
||||
S("Horse shoes fitted -")
|
||||
.. S(" speed: ") .. speed
|
||||
.. S(" , jump height: ") .. jump
|
||||
.. S(" , stop speed: ") .. reverse)
|
||||
|
||||
tool:take_item()
|
||||
|
||||
clicker:set_wielded_item(tool)
|
||||
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- used to capture horse with magic lasso
|
||||
if mobs:capture_mob(self, clicker, 25, 0, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("people:ridepig", S("Ridable Pig"), "aridepig.png")
|
226
ridereindeer.lua
Normal file
@ -0,0 +1,226 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S = minetest.get_translator and minetest.get_translator("people") or
|
||||
dofile(MP .. "/intllib.lua")
|
||||
|
||||
-- 0.4.17 or 5.0 check
|
||||
local y_off = 20
|
||||
if minetest.features.object_independent_selectionbox then
|
||||
y_off = 10
|
||||
end
|
||||
|
||||
-- horse shoes (speed, jump, break, overlay texture)
|
||||
local shoes = {
|
||||
["people:horseshoe_steel"] = {7, 4, 2, "people_horseshoe_steelo.png"},
|
||||
["people:horseshoe_bronze"] = {7, 4, 4, "people_horseshoe_bronzeo.png"},
|
||||
["people:horseshoe_mese"] = {9, 5, 8, "people_horseshoe_meseo.png"},
|
||||
["people:horseshoe_diamond"] = {10, 6, 6, "people_horseshoe_diamondo.png"}
|
||||
}
|
||||
|
||||
-- rideable horse
|
||||
mobs:register_mob("people:ridereindeer", {
|
||||
type = "animal",
|
||||
visual = "mesh",
|
||||
visual_size = {x = 1, y = 1},
|
||||
mesh = "Ridereindeer.b3d",
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.25, 0.4},
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
run_speed = 100,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 75,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
run_start = 200,
|
||||
run_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
textures = {
|
||||
{"textureridereindeer.png"},
|
||||
|
||||
},
|
||||
fear_height = 3,
|
||||
runaway = true,
|
||||
fly = false,
|
||||
walk_chance = 50,
|
||||
walk_velocity = 1.5,
|
||||
view_range = 5,
|
||||
follow = {"default:apple", "default:permafrost_with_moss", "ethereal:snowygrass", "ethereal:crystalgrass", "default:dry_shrub ", "default:grass_1", "ethereal:dry_shrub", "farming:seed_wheat", "farming:seed_rye", "default:junglegrass", "default:dry_grass_1", "default:dry_grass_2", "default:dry_grass_3", "default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5", "default:marram_grass_1", "default:marram_grass_2", "default:marram_grass_3", "default:coldsteppe_grass_1", "default:coldsteppe_grass_2", "default:coldsteppe_grass_3", "default:coldsteppe_grass_4", "default:coldsteppe_grass_5", "default:coldsteppe_grass_6", "naturalbiomes:savanna_grass1", "naturalbiomes:savanna_grass2", "naturalbiomes:savanna_grass3", "naturalbiomes:outback_grass1", "naturalbiomes:outback_grass2", "naturalbiomes:outback_grass3", "naturalbiomes:outback_grass4", "naturalbiomes:outback_grass5", "naturalbiomes:outback_grass6", "naturalbiomes:med_grass1", "naturalbiomes:med_grass2", "naturalbiomes:heath_grass1", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:alpine_grass1", "naturalbiomes:alpine_grass2", "naturalbiomes:heath_grass2", "naturalbiomes:heath_grass3", "naturalbiomes:", "naturalbiomes:", "naturalbiomes:bushland_grass", "naturalbiomes:bushland_grass2", "naturalbiomes:bushland_grass3", "naturalbiomes:bushland_grass4", "naturalbiomes:bushland_grass5", "naturalbiomes:bushland_grass6", "naturalbiomes:bushland_grass7", "group:grass", "group:normal_grass"},
|
||||
passive = true,
|
||||
hp_min = 35,
|
||||
hp_max = 75,
|
||||
armor = 100,
|
||||
stay_near = {{"people:feeder", "marinara:reed_bundle", "naturalbiomes:reed_bundle", "farming:straw"}, 5},
|
||||
lava_damage = 5,
|
||||
fall_damage = 5,
|
||||
water_damage = 0,
|
||||
makes_footstep_sound = true,
|
||||
drops = {
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2}
|
||||
},
|
||||
|
||||
do_custom = function(self, dtime)
|
||||
|
||||
-- set needed values if not already present
|
||||
if not self.v2 then
|
||||
self.v2 = 0
|
||||
self.max_speed_forward = 5
|
||||
self.max_speed_reverse = 3
|
||||
self.accel = 6
|
||||
self.terrain_type = 3
|
||||
self.driver_attach_at = {x = 0, y = 11.4, z = -4.5}
|
||||
self.driver_eye_offset = {x = 0, y = 11.4, z = 0}
|
||||
end
|
||||
|
||||
-- if driver present allow control of horse
|
||||
if self.driver then
|
||||
|
||||
mobs.drive(self, "walk", "stand", false, dtime)
|
||||
|
||||
return false -- skip rest of mob functions
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
|
||||
on_die = function(self, pos)
|
||||
|
||||
-- drop saddle when horse is killed while riding
|
||||
-- also detach from horse properly
|
||||
if self.driver then
|
||||
|
||||
minetest.add_item(pos, "mobs:saddle")
|
||||
|
||||
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
||||
|
||||
self.saddle = nil
|
||||
end
|
||||
|
||||
-- drop any horseshoes added
|
||||
if self.shoed then
|
||||
minetest.add_item(pos, self.shoed)
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
do_punch = function(self, hitter)
|
||||
|
||||
-- don't cut the branch you're... ah, that's not about that
|
||||
if hitter ~= self.driver then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- make sure player is clicking
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
-- feed, tame or heal horse
|
||||
if mobs:feed_tame(self, clicker, 10, true, true) then
|
||||
return
|
||||
end
|
||||
|
||||
-- applying protection rune
|
||||
if mobs:protect(self, clicker) then
|
||||
return
|
||||
end
|
||||
|
||||
local player_name = clicker:get_player_name()
|
||||
|
||||
-- make sure tamed horse is being clicked by owner only
|
||||
if self.tamed and self.owner == player_name then
|
||||
|
||||
local inv = clicker:get_inventory()
|
||||
local tool = clicker:get_wielded_item()
|
||||
local item = tool:get_name()
|
||||
|
||||
-- detatch player already riding horse
|
||||
if self.driver and clicker == self.driver then
|
||||
|
||||
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
||||
|
||||
-- add saddle back to inventory
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker:get_pos(), "mobs:saddle")
|
||||
end
|
||||
|
||||
self.saddle = nil
|
||||
|
||||
-- attach player to horse
|
||||
elseif (not self.driver and not self.child
|
||||
and clicker:get_wielded_item():get_name() == "mobs:saddle")
|
||||
or self.saddle then
|
||||
|
||||
self.object:set_properties({stepheight = 1.1})
|
||||
mobs.attach(self, clicker)
|
||||
|
||||
-- take saddle from inventory
|
||||
if not self.saddle then
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
|
||||
self.saddle = true
|
||||
end
|
||||
|
||||
-- apply horseshoes
|
||||
if item:find("people:horseshoe") then
|
||||
|
||||
-- drop any existing shoes
|
||||
if self.shoed then
|
||||
minetest.add_item(self.object:get_pos(), self.shoed)
|
||||
end
|
||||
|
||||
local speed = shoes[item][1]
|
||||
local jump = shoes[item][2]
|
||||
local reverse = shoes[item][3]
|
||||
local overlay = shoes[item][4]
|
||||
|
||||
self.max_speed_forward = speed
|
||||
self.jump_height = jump
|
||||
self.max_speed_reverse = reverse
|
||||
self.accel = speed
|
||||
self.shoed = item
|
||||
|
||||
-- apply horseshoe overlay to current horse texture
|
||||
if overlay then
|
||||
self.texture_mods = "^" .. overlay
|
||||
self.object:set_texture_mod(self.texture_mods)
|
||||
end
|
||||
|
||||
-- show horse speed and jump stats with shoes fitted
|
||||
minetest.chat_send_player(player_name,
|
||||
S("Horse shoes fitted -")
|
||||
.. S(" speed: ") .. speed
|
||||
.. S(" , jump height: ") .. jump
|
||||
.. S(" , stop speed: ") .. reverse)
|
||||
|
||||
tool:take_item()
|
||||
|
||||
clicker:set_wielded_item(tool)
|
||||
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- used to capture horse with magic lasso
|
||||
if mobs:capture_mob(self, clicker, 25, 0, 25, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("people:ridereindeer", S("Ridable Reindeer"), "aridereindeer.png")
|
142
samfarmer.lua
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.samfarmer_drops = {
|
||||
"people:dog", "people:goat", "people:dogfoodsack", "people:ridepig", "people:rideelephant", "people:plough"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:samfarmer", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Medfarmer2.b3d",
|
||||
textures = {
|
||||
{"texturesamfarmer.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_farmerf",
|
||||
damage = "people_female5",
|
||||
death = "people_femaledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:feeder", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:farmergrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"default:coal_lump"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 80,
|
||||
walk_start = 300,
|
||||
walk_end = 400,
|
||||
punch_speed = 100,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
die_start = 200,
|
||||
die_end = 300,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_ingot" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.samfarmer_drops or mobs.samfarmer_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Farmer dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Farmer stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Farmer will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:samfarmer",
|
||||
nodes = {"default:junglewood"},
|
||||
neighbors = {"people:feeder"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:samfarmer", S("Farmer Jungle"), "asamfarmer.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:samfarmer", "people:samfarmer")
|
153
samsmith.lua
Normal file
@ -0,0 +1,153 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
|
||||
mobs.samsmith_drops = {
|
||||
"default:axe_steel", "default:axe_steel", "default:axe_steel",
|
||||
"default:axe_steel", "default:axe_mese", "default:axe_mese",
|
||||
"default:axe_diamond", "default:axe_diamond", "default:pick_bronze", "default:pick_bronze","default:pick_steel", "default:pick_steel","default:pick_mese", "default:pick_mese",
|
||||
"default:pick_diamond", "default:pick_diamond",
|
||||
"default:shovel_bronze", "default:shovel_bronze",
|
||||
"default:shovel_steel", "default:shovel_steel",
|
||||
"default:shovel_mese", "default:shovel_mese",
|
||||
"default:shovel_diamond", "default:shovel_diamond ",
|
||||
"default:sword_bronze", "default:sword_bronze", "default:sword_steel",
|
||||
"default:sword_steel", "default:sword_mese", "default:sword_mese",
|
||||
"default:sword_diamond", "default:sword_diamond"
|
||||
}
|
||||
|
||||
mobs:register_mob("people:samsmith", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
damage = 5,
|
||||
attack_type = "dogfight",
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
reach = 2,
|
||||
attack_monsters = true,
|
||||
attack_animals = false,
|
||||
attack_npc = false,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Medsmith2.b3d",
|
||||
textures = {
|
||||
{"texturesamsmith.png"},
|
||||
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "people_smith",
|
||||
damage = "people_male5",
|
||||
death = "people_maledeath",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 2,
|
||||
stepheight = 1,
|
||||
fear_height = 2,
|
||||
jump = true,
|
||||
jump_height = 3,
|
||||
stay_near = {{"people:forge", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 4},
|
||||
drops = { {name = "people:smithgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 3,
|
||||
light_damage = 0,
|
||||
follow = {"default:diamond"},
|
||||
view_range = 15,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
stand2_start = 100,
|
||||
stand2_end = 200,
|
||||
walk_speed = 100,
|
||||
walk_start = 200,
|
||||
walk_end = 300,
|
||||
punch_speed = 100,
|
||||
punch_start = 300,
|
||||
punch_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
-- right clicking with raw meat will give Igor more health
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- right clicking with gold lump drops random item from mobs.npc_drops
|
||||
if item:get_name() == "default:gold_ingot" then
|
||||
|
||||
if not mobs.is_creative(name) then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
local drops = self.samsmith_drops or mobs.samsmith_drops
|
||||
|
||||
minetest.add_item(pos, {
|
||||
name = drops[math.random(1, #drops)]
|
||||
})
|
||||
|
||||
minetest.chat_send_player(name, S("Blackmith dropped you an item for gold!"))
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- if owner switch between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Blacksmith stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
minetest.chat_send_player(name, S("Blacksmith will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
if not mobs.custom_spawn_people then
|
||||
mobs:spawn({
|
||||
name = "people:samsmith",
|
||||
nodes = {"default:junglewood"},
|
||||
neighbors = {"people:forge"},
|
||||
min_light = 0,
|
||||
interval = 30,
|
||||
chance = 1, -- 15000
|
||||
min_height = -25,
|
||||
max_height = 1000,
|
||||
})
|
||||
end
|
||||
-- register spawn egg
|
||||
mobs:register_egg("people:samsmith", S("Blacksmith Jungle"), "asamsmith.png")
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:samsmith", "people:samsmith")
|
154
samwarrior.lua
Normal file
@ -0,0 +1,154 @@
|
||||
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
-- Npc by TenPlus1
|
||||
|
||||
|
||||
mobs:register_mob("people:samwarrior", {
|
||||
type = "npc",
|
||||
passive = false,
|
||||
damage = 10,
|
||||
attack_type = "dogshoot",
|
||||
dogshoot_switch = 1,
|
||||
dogshoot_count_max = 12, -- shoot for 12 seconds
|
||||
dogshoot_count2_max = 3, -- dogfight for 3 seconds
|
||||
shoot_interval = 1.5,
|
||||
arrow = "people:spearfly",
|
||||
shoot_offset = 2,
|
||||
attacks_monsters = true,
|
||||
attack_npcs = false,
|
||||
owner_loyal = true,
|
||||
pathfinding = true,
|
||||
hp_min = 100,
|
||||
hp_max = 145,
|
||||
armor = 80,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "Warrior.b3d",
|
||||
drawtype = "front",
|
||||
textures = {
|
||||
{"texturesamwarrior.png"},
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
attack = "people_warrior3",
|
||||
random = "people_warrior2",
|
||||
damage = "people_male5",
|
||||
death = "people_warrior",
|
||||
distance = 10,
|
||||
},
|
||||
walk_velocity = 3,
|
||||
run_velocity = 4,
|
||||
jump = true,
|
||||
drops = { {name = "people:warriorgrave", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 2,
|
||||
light_damage = 0,
|
||||
follow = {"farming:baked_potato", "farming:sunflower_bread", "farming:pumpkin_bread", "farming:garlic_bread", "farming:tomato_soup", "pie:brpd_0", "farming:bread", "farming:bread_multigrain", "farming:spanish_potatoes", "farming:beetroot_soup", "farming:blueberry_pie", "farming:porridge", "farming:bibimbap", "farming:burger", "farming:paella", "farming:mac_and_cheese", "livingcaves:healingsoup", "farming:spaghetti", "animalworld:escargots", "farming:rhubarb_pie", "farming:potato_omlet", "farming:potato_salad"},
|
||||
view_range = 12,
|
||||
owner = "",
|
||||
order = "stand",
|
||||
fear_height = 3,
|
||||
stay_near = {{"people:weaponstand", "people:villagerbed", "xdecor:empty_shelf", "xdecor:intemframe", "xdecor:lantern", "xdecor:candle", "xdecor:multishelf", "xdecor:tv", "default:bookshelf", "vessels:shelf", "livingcaves:root_lamp", "default:chest", "default:mese_post_light_pine_wood", "default:meselamp", "default:mese_post_light_pine_wood", "default:mese_post_light", "default:mese_post_light_acacia_wood", "default:mese_post_light_aspen_wood", "default:mese_post_light_junglewood", "animalworld:crocodilestool", "animalworld:elephantstool", "animalworld:bearstool", "animalworld:gnustool", "animalworld:hippostool", "animalworld:monitorstool", "animalworld:ivorychair", "animalworld:sealstool", "animalworld:yakstool", "animalworld:tigerstool", "animalworld:muskoxstool"}, 5},
|
||||
animation = {
|
||||
speed_normal = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 100,
|
||||
walk_speed = 100,
|
||||
walk_start = 100,
|
||||
walk_end = 200,
|
||||
punch_start = 200,
|
||||
punch_end = 300,
|
||||
shoot_start = 300,
|
||||
shoot_speed = 80,
|
||||
shoot_end = 400,
|
||||
die_start = 300,
|
||||
die_end = 400,
|
||||
die_speed = 50,
|
||||
die_loop = false,
|
||||
die_rotate = true,
|
||||
},
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed to heal npc
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||
|
||||
-- capture npc with net or lasso
|
||||
if mobs:capture_mob(self, clicker, 0, 15, 25, false, nil) then return end
|
||||
|
||||
-- protect npc with mobs:protector
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
|
||||
|
||||
-- by right-clicking owner can switch npc between follow and stand
|
||||
if self.owner and self.owner == name then
|
||||
|
||||
if self.order == "follow" then
|
||||
|
||||
self.attack = nil
|
||||
self.order = "stand"
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
self:set_velocity(0)
|
||||
|
||||
minetest.chat_send_player(name, S("Warrior stands still."))
|
||||
else
|
||||
self.order = "follow"
|
||||
|
||||
minetest.chat_send_player(name, S("Warrior will follow you."))
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
do_punch = function(self, hitter,
|
||||
time_from_last_punch,
|
||||
tool_capabilities,
|
||||
direction)
|
||||
|
||||
-- Prevent friendly fire from killing each other :)
|
||||
local entity = hitter:get_luaentity()
|
||||
|
||||
if entity == "people:samwarrior" then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("people:samwarrior", S("Warrior Jungle"), "asamwarrior.png" )
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("people:samwarrior", "people:samwarrior")
|
||||
|
||||
mobs:register_arrow("people:spearfly", {
|
||||
visual = "sprite",
|
||||
visual_size = {x=.5, y=.5},
|
||||
textures = {"spearfly.png"},
|
||||
velocity = 8,
|
||||
drop = true,
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=13},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=13},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
end,
|
||||
})
|
BIN
screenshot.png
Normal file
After Width: | Height: | Size: 548 KiB |
18
spawnbooty.lua
Normal file
@ -0,0 +1,18 @@
|
||||
local S = minetest.get_translator("people")
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:cobble","default:mossycobble"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = -0,
|
||||
scale = 0.1,
|
||||
spread = {x = 50, y = 50, z = 50},
|
||||
seed = 50,
|
||||
octaves = 3,
|
||||
persist = 1,
|
||||
},
|
||||
y_max = 1000,
|
||||
y_min = -25,
|
||||
decoration = "people:bootynode"
|
||||
})
|
BIN
textures/amedwarrior.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
textures/amineshaft.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
textures/anordoctor.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
textures/anorfarmer.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
textures/anorinstructor.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
textures/anorminer.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
textures/anorsmith.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
textures/anorvillager.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
textures/anorwarrior.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
textures/apapdoctor.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
textures/apapvillager.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
textures/apirate.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
textures/aplough.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
textures/aplunderercrossbow.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
textures/aplundererflask.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
textures/aplundererstick.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
textures/arideelephant.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
textures/aridehorse.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
textures/arideostrich.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
textures/arideox.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
textures/aridepig.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
textures/aridereindeer.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
textures/asamfarmer.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
textures/asamsmith.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
textures/asamwarrior.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
textures/avillagerbed.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
textures/aweaponstand.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/azombie.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
textures/bolt.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
textures/flask.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
textures/people_bandage.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/people_bootynode_back.png
Normal file
After Width: | Height: | Size: 1.0 KiB |