Raid defs and spawn command

This commit is contained in:
PrairieWind 2022-10-20 13:17:19 -06:00
commit f551b51c14
1 changed files with 65 additions and 0 deletions

65
init.lua Normal file
View File

@ -0,0 +1,65 @@
-- mcl_raids
mcl_raids = {}
-- Define the amount of illagers to spawn each wave.
mcl_raids.wave_definitions = {
-- Pillager
{
illager_name = "mobs_mc:pillager",
wave_1 = 5,
wave_2 = 4,
wave_3 = 4,
wave_4 = 5,
wave_5 = 5,
extra_wave = 5,
},
-- Vindicator aka Angry Axeman
{
illager_name = "mobs_mc:vindicator",
wave_1 = 1,
wave_2 = 3,
wave_3 = 1,
wave_4 = 2,
wave_5 = 5,
extra_wave = 5,
},
--{"mobs_mc:ravager", 0, 0, 1, 0, 0, 2},
-- Witch
{
illager_name = "mobs_mc:witch",
wave_1 = 0,
wave_2 = 0,
wave_3 = 1,
wave_4 = 3,
wave_5 = 1,
extra_wave = 1,
},
-- Evoker
{
illager_name = "mobs_mc:evoker",
wave_1 = 0,
wave_2 = 0,
wave_3 = 0,
wave_4 = 0,
wave_5 = 1,
extra_wave = 1,
},
}
minetest.register_chatcommand("spawn_raid", {
privs = {
server = true,
},
func = function(name)
local wave = 1
local player = minetest.get_player_by_name(name)
local player_pos = player:get_pos()
for _, raiddefs in pairs(mcl_raids.wave_definitions) do
local wave_count = raiddefs.wave_1
for i = 0, wave_count do
minetest.add_entity(player_pos, raiddefs.illager_name)
end
end
end
})