2013-03-10 13:27:18 -04:00
|
|
|
--Spawn function
|
|
|
|
function def_spawn(pos)
|
2017-06-07 21:13:08 -07:00
|
|
|
minetest.add_entity(pos, "peaceful_npc:npc_def")
|
2013-03-10 15:45:18 -04:00
|
|
|
print("want to spawn npc_def at "..dump(pos))
|
|
|
|
if mode_debug == true then
|
|
|
|
minetest.chat_send_all("want to spawn npc_def at "..dump(pos))
|
|
|
|
end
|
2013-03-10 13:27:18 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
function fast_spawn(pos)
|
2017-06-07 21:13:08 -07:00
|
|
|
minetest.add_entity(pos, "peaceful_npc:npc_fast")
|
2013-03-10 15:45:18 -04:00
|
|
|
print("want to spawn npc_fast at "..dump(pos))
|
|
|
|
if mode_debug == true then
|
|
|
|
minetest.chat_send_all("want to spawn npc_fast at "..dump(pos))
|
|
|
|
end
|
2013-03-10 13:27:18 -04:00
|
|
|
end
|
|
|
|
|
2013-03-10 15:45:18 -04:00
|
|
|
function dwarf_spawn(pos)
|
2017-06-07 21:13:08 -07:00
|
|
|
minetest.add_entity(pos, "peaceful_npc:npc_dwarf")
|
2013-03-10 15:45:18 -04:00
|
|
|
print("want to spawn npc_dwarf at "..dump(pos))
|
|
|
|
if mode_debug == true then
|
|
|
|
minetest.chat_send_all("want to spawn npc_dwarf at "..dump(pos))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--Mapgen biomes
|
|
|
|
plaingen_biome = {
|
2013-03-10 13:27:18 -04:00
|
|
|
surface = "default:dirt_with_grass",
|
2013-03-10 15:45:18 -04:00
|
|
|
avoid_nodes = {"group:liquid", "group:tree"},
|
|
|
|
avoid_radius = 20,
|
|
|
|
rarity = 93,
|
2013-03-10 13:27:18 -04:00
|
|
|
max_count = 1,
|
|
|
|
min_elevation = -10,
|
|
|
|
max_elevation = 30,
|
|
|
|
}
|
|
|
|
|
2013-03-10 15:45:18 -04:00
|
|
|
forestgen_biome = {
|
|
|
|
surface = {"group:tree", "default:leaves"},
|
|
|
|
avoid_nodes = {"group:liquid"},
|
|
|
|
avoid_radius = 10,
|
|
|
|
rarity = 96,
|
|
|
|
max_count = 1,
|
|
|
|
min_elevation = 20,
|
|
|
|
max_elevation = 50,
|
|
|
|
}
|
|
|
|
|
|
|
|
beachgen_biome = {
|
2013-03-10 13:27:18 -04:00
|
|
|
surface = "default:sand",
|
2013-03-10 15:45:18 -04:00
|
|
|
avoid_nodes = {"group:liquid"},
|
2013-03-10 13:27:18 -04:00
|
|
|
avoid_radius = 1,
|
|
|
|
rarity = 90,
|
|
|
|
max_count = 1,
|
|
|
|
min_elevation = 0,
|
|
|
|
max_elevation = 10,
|
|
|
|
}
|
|
|
|
|
2013-03-10 15:45:18 -04:00
|
|
|
desertgen_biome = {
|
2013-03-10 13:27:18 -04:00
|
|
|
surface = { "default:desert_sand", "default:desert_stone"},
|
2013-03-10 15:45:18 -04:00
|
|
|
avoid_nodes = {"group:liquid"},
|
|
|
|
avoid_radius = 100,
|
|
|
|
rarity = 95,
|
2013-03-10 13:27:18 -04:00
|
|
|
max_count = 1,
|
|
|
|
min_elevation = 0,
|
2013-03-10 15:45:18 -04:00
|
|
|
max_elevation = 150,
|
2013-03-10 13:27:18 -04:00
|
|
|
}
|
|
|
|
|
2013-03-10 15:45:18 -04:00
|
|
|
cavegen_biome = {
|
|
|
|
surface = { "default:stone_with_iron", "default:stone_with_coal", "default:stone_with_mese"},
|
|
|
|
avoid_nodes = {"group:liquid"},
|
|
|
|
avoid_radius = 5,
|
|
|
|
rarity = 98,
|
|
|
|
max_count = 1,
|
|
|
|
min_elevation = -500,
|
|
|
|
max_elevation = -50,
|
|
|
|
check_air = true,
|
|
|
|
spawn_replace_node = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
--spawn definers
|
2015-08-09 10:57:49 -04:00
|
|
|
biome_lib:register_generate_plant(plaingen_biome, "def_spawn")
|
|
|
|
biome_lib:register_generate_plant(forestgen_biome, "def_spawn")
|
|
|
|
biome_lib:register_generate_plant(beachgen_biome, "fast_spawn")
|
|
|
|
biome_lib:register_generate_plant(desertgen_biome, "fast_spawn")
|
|
|
|
biome_lib:register_generate_plant(cavegen_biome, "dwarf_spawn")
|
2013-03-10 13:27:18 -04:00
|
|
|
|
|
|
|
print("Peaceful NPC spawning.lua loaded! By jojoa1997!")
|