execute at @e[tag=ng+portal] run tp @e[tag=clone1] ~2 ~1 ~2 180 0
execute at @e[tag=ng+portal] run tp @e[tag=clone2] ~-2 ~1 ~2 180 0
execute at @e[tag=ng+portal] run tp @e[tag=clone3] ~-2 ~1 ~-2 180 0
execute at @e[tag=ng+portal] run tp @e[tag=clone4] ~2 ~1 ~-2 180 0
execute at @e[tag=ng+portal] run tp @e[tag=clone5] ~ ~1 ~ 180 0
execute at @e[tag=ng+portal] run playsound minecraft:entity.evoker.cast_spell hostile @a ~ ~1 ~ 1 .8
tp @e[tag=ngboss] @e[tag=ngbossclone,limit=1,sort=random]
execute at @e[tag=ngboss,limit=1] run tag @e[tag=ngbossclone,limit=1,sort=nearest] add replaceclone
execute as @e[tag=replaceclone] at @s run tp @s ~ -100 ~
kill @e[tag=replaceclone]
tag @e remove clone1
tag @e remove clone2
tag @e remove clone3
tag @e remove clone4
tag @e remove clone5

execute as @e[tag=ngboss] run data merge entity @s {NoAI:0b,Invulnerable:0b}
execute as @e[tag=ngbossclone] run data merge entity @s {NoAI:0b,Invulnerable:0b}
schedule function survivalplus:finale/boss/cycle 20s replace
execute if entity @e[tag=ngboss,tag=lowhp] run schedule function survivalplus:finale/boss/cycle 8s replace