Imported new lua-based spawner code from AtS