mirror of
https://github.com/minetest-mods/moreores.git
synced 2024-11-15 23:00:35 +01:00
add optional loot mod support
This commit is contained in:
parent
6a56592ecc
commit
3355729f06
|
@ -1,3 +1,4 @@
|
|||
default
|
||||
mg?
|
||||
intllib?
|
||||
intllib?
|
||||
loot?
|
7
init.lua
7
init.lua
|
@ -15,11 +15,8 @@ local modpath = minetest.get_modpath("moreores")
|
|||
local S, NS = dofile(modpath.."/intllib.lua")
|
||||
|
||||
dofile(modpath .. "/readsettings.lua")
|
||||
|
||||
-- `mg` support:
|
||||
if minetest.get_modpath("mg") then
|
||||
dofile(modpath .. "/mg.lua")
|
||||
end
|
||||
dofile(modpath .. "/loot.lua")
|
||||
dofile(modpath .. "/mg.lua")
|
||||
|
||||
-- Utility functions
|
||||
-- =================
|
||||
|
|
63
loot.lua
Normal file
63
loot.lua
Normal file
|
@ -0,0 +1,63 @@
|
|||
if not minetest.get_modpath("loot") then
|
||||
return
|
||||
end
|
||||
|
||||
if moreores.tin_enabled then
|
||||
loot.register_loot({
|
||||
weights = { generic = 500 },
|
||||
payload = {
|
||||
stack = ItemStack("moreores:tin_ingot"),
|
||||
min_size = 1,
|
||||
max_size = 10,
|
||||
},
|
||||
})
|
||||
|
||||
loot.register_loot({
|
||||
weights = { generic = 500 },
|
||||
payload = {
|
||||
stack = ItemStack("moreores:tin_lump"),
|
||||
min_size = 1,
|
||||
max_size = 10,
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
if moreores.silver_enabled then
|
||||
loot.register_loot({
|
||||
weights = { generic = 200, valuable = 200, },
|
||||
payload = {
|
||||
stack = ItemStack("moreores:silver_ingot"),
|
||||
min_size = 1,
|
||||
max_size = 10,
|
||||
},
|
||||
})
|
||||
|
||||
loot.register_loot({
|
||||
weights = { generic = 200, valuable = 200, },
|
||||
payload = {
|
||||
stack = ItemStack("moreores:silver_lump"),
|
||||
min_size = 1,
|
||||
max_size = 10,
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
if moreores.mithril_enabled then
|
||||
loot.register_loot({
|
||||
weights = { generic = 25, valuable = 25, },
|
||||
payload = {
|
||||
stack = ItemStack("moreores:mithril_ingot"),
|
||||
min_size = 1,
|
||||
max_size = 5,
|
||||
},
|
||||
})
|
||||
|
||||
loot.register_loot({
|
||||
weights = { generic = 25, valuable = 25, },
|
||||
payload = {
|
||||
stack = ItemStack("moreores:mithril_lump"),
|
||||
min_size = 1,
|
||||
max_size = 5,
|
||||
},
|
||||
})
|
||||
end
|
Loading…
Reference in New Issue
Block a user