2024-10-12 16:49:57 -04:00
|
|
|
local rpc = net.new_rpc_namespace()
|
|
|
|
|
|
|
|
ModLuaFileAppend("data/scripts/biomes/temple_shared.lua", "mods/quant.ew/files/system/stevari/append.lua")
|
|
|
|
|
|
|
|
rpc.opts_everywhere()
|
|
|
|
function rpc.spawn_stevari(pos_x, pos_y)
|
|
|
|
if( GlobalsGetValue( "TEMPLE_PEACE_WITH_GODS" ) == "1" ) then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
local guard_spawn_id = EntityGetClosestWithTag( pos_x, pos_y, "guardian_spawn_pos" )
|
|
|
|
local guard_x = pos_x
|
|
|
|
local guard_y = pos_y
|
|
|
|
|
|
|
|
if( guard_spawn_id ~= 0 ) then
|
|
|
|
guard_x, guard_y = EntityGetTransform( guard_spawn_id )
|
|
|
|
|
|
|
|
EntityKill( guard_spawn_id )
|
|
|
|
end
|
|
|
|
|
2024-10-13 18:58:22 -04:00
|
|
|
if ctx.is_host then
|
|
|
|
EntityLoad( "data/entities/misc/spawn_necromancer_shop.xml", guard_x, guard_y )
|
|
|
|
else
|
|
|
|
EntityLoad( "mods/quant.ew/files/system/stevari/spawn_necromancer_shop.xml", guard_x, guard_y )
|
|
|
|
end
|
2024-10-12 16:49:57 -04:00
|
|
|
end
|
|
|
|
|
2024-11-17 17:10:57 +03:00
|
|
|
util.add_cross_call("ew_spawn_stevari", function(x, y)
|
2024-10-12 16:49:57 -04:00
|
|
|
rpc.spawn_stevari(x, y)
|
2024-10-13 18:58:22 -04:00
|
|
|
end)
|
|
|
|
|
|
|
|
return {}
|