forked from VoxeLibre/VoxeLibre
69 lines
2.6 KiB
Lua
69 lines
2.6 KiB
Lua
local modname = minetest.get_current_modname()
|
|
local S = minetest.get_translator(modname)
|
|
local modpath = minetest.get_modpath(modname)
|
|
|
|
local function temple_placement_callback(pos,def, pr)
|
|
local hl = def.sidelen / 2
|
|
local p1 = vector.offset(pos,-hl,-hl,-hl)
|
|
local p2 = vector.offset(pos,hl,hl,hl)
|
|
--dont remove foliage - looks kind of nice for a jt
|
|
local chests = minetest.find_nodes_in_area(p1, p2, "mcl_chests:trapped_chest_small")
|
|
-- Add jungle temple loot into chests
|
|
for c=1, #chests do
|
|
local lootitems = mcl_loot.get_multi_loot({
|
|
{
|
|
stacks_min = 2,
|
|
stacks_max = 6,
|
|
items = {
|
|
{ itemstring = "mcl_mobitems:bone", weight = 20, amount_min = 4, amount_max=6 },
|
|
{ itemstring = "mcl_mobitems:rotten_flesh", weight = 16, amount_min = 3, amount_max=7 },
|
|
{ itemstring = "mcl_core:gold_ingot", weight = 15, amount_min = 2, amount_max = 7 },
|
|
--{ itemstring = "mcl_bamboo:bamboo", weight = 15, amount_min = 1, amount_max=3 }, --FIXME BAMBOO
|
|
{ itemstring = "mcl_core:iron_ingot", weight = 15, amount_min = 1, amount_max = 5 },
|
|
{ itemstring = "mcl_core:diamond", weight = 3, amount_min = 1, amount_max = 3 },
|
|
{ itemstring = "mcl_mobitems:saddle", weight = 3, },
|
|
{ itemstring = "mcl_core:emerald", weight = 2, amount_min = 1, amount_max = 3 },
|
|
{ itemstring = "mcl_books:book", weight = 1, func = function(stack, pr)
|
|
mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr)
|
|
end },
|
|
{ itemstring = "mcl_mobitems:iron_horse_armor", weight = 1, },
|
|
{ itemstring = "mcl_mobitems:gold_horse_armor", weight = 1, },
|
|
{ itemstring = "mcl_mobitems:diamond_horse_armor", weight = 1, },
|
|
{ itemstring = "mcl_core:apple_gold_enchanted", weight = 2, },
|
|
}
|
|
}}, pr)
|
|
mcl_structures.init_node_construct(chests[c])
|
|
local meta = minetest.get_meta(chests[c])
|
|
local inv = meta:get_inventory()
|
|
mcl_loot.fill_inventory(inv, "main", lootitems, pr)
|
|
end
|
|
-- TODO: initialize traps
|
|
end
|
|
|
|
mcl_structures.register_structure("jungle_temple",{
|
|
place_on = {"group:grass_block","group:dirt","mcl_core:dirt_with_grass"},
|
|
noise_params = {
|
|
offset = 0,
|
|
scale = 0.0000812,
|
|
spread = {x = 250, y = 250, z = 250},
|
|
seed = 31585,
|
|
octaves = 3,
|
|
persist = -0.2,
|
|
flags = "absvalue",
|
|
},
|
|
flags = "place_center_x, place_center_z",
|
|
solid_ground = true,
|
|
make_foundation = true,
|
|
y_offset = -5,
|
|
chunk_probability = 256,
|
|
y_max = mcl_vars.mg_overworld_max,
|
|
y_min = 1,
|
|
biomes = { "Jungle" },
|
|
sidelen = 18,
|
|
filenames = {
|
|
modpath.."/schematics/mcl_structures_jungle_temple.mts",
|
|
modpath.."/schematics/mcl_structures_jungle_temple_nice.mts",
|
|
},
|
|
after_place = temple_placement_callback
|
|
})
|