execute store result score world BossRoll run random value 1..2

# Undead Knight
execute if score world WaveCounter matches 19 if score world BossRoll matches 1 run tellraw @a [{"bold":true,"color":"#32806D","italic":false,"obfuscated":true,"text":"X"},{"bold":false,"color":"#57DEBE","italic":false,"obfuscated":false,"text":" A chill settles in the air...the dead do not rest. "},{"bold":true,"color":"#32806D","italic":false,"obfuscated":true,"text":"X"}]
execute if score world WaveCounter matches 19 if score world BossRoll matches 1 run playsound minecraft:entity.allay.death master @a 0 1 0 10000 .75 .5
execute if score world WaveCounter matches 19 if score world BossRoll matches 1 run playsound minecraft:entity.allay.ambient_without_item master @a 0 1 0 1 .1 1

# Ravager Beast
execute if score world WaveCounter matches 19 if score world BossRoll matches 2 run tellraw @a [{"bold":true,"color":"#6e4740","italic":false,"obfuscated":true,"text":"X"},{"bold":false,"color":"#865f59","italic":false,"obfuscated":false,"text":" War horns blare in the distance.... "},{"bold":true,"color":"#6e4740","italic":false,"obfuscated":true,"text":"X"}]
execute if score world WaveCounter matches 19 if score world BossRoll matches 2 run playsound minecraft:event.mob_effect.raid_omen master @a 0 1 0 10 1.5
execute if score world WaveCounter matches 19 if score world BossRoll matches 2 run playsound minecraft:event.raid.horn master @a 0 1 0 1000 0.5

# Goliath Man-Eater
execute if score world WaveCounter matches 39 run tellraw @a [{"bold":true,"color":"#bb2b15","italic":false,"obfuscated":true,"text":"X"},{"bold":false,"color":"#ac3300","italic":false,"obfuscated":false,"text":" The ground groans with a primal hunger... "},{"bold":true,"color":"#bb2b15","italic":false,"obfuscated":true,"text":"X"}]
execute if score world WaveCounter matches 39 run playsound entity.parrot.imitate.spider master @a 0 1 0 1000000 0
execute if score world WaveCounter matches 39 run playsound entity.phantom.bite master @a 0 1 0 1000000 0
execute if score world WaveCounter matches 39 run playsound entity.ravager.attack master @a 0 1 0 1000000 0

# Cinderstorm
execute if score world WaveCounter matches 59 run tellraw @a [{"bold":true,"color":"#bb2b15","italic":false,"obfuscated":true,"text":"X"},{"bold":false,"color":"#c97106","italic":false,"obfuscated":false,"text":" The horizon blisters. A storm is coming... "},{"bold":true,"color":"#bb2b15","italic":false,"obfuscated":true,"text":"X"}]
execute if score world WaveCounter matches 59 run playsound block.portal.ambient master @a 0 1 0 1000000 0
execute if score world WaveCounter matches 59 run playsound minecraft:ambient.soul_sand_valley.mood master @a 0 1 0 1000000 2
execute if score world WaveCounter matches 59 run playsound minecraft:ambient.soul_sand_valley.mood master @a 0 1 0 1000000 2
execute if score world WaveCounter matches 59 run playsound minecraft:ambient.soul_sand_valley.mood master @a 0 1 0 1000000 2
execute if score world WaveCounter matches 59 run playsound minecraft:ambient.soul_sand_valley.mood master @a 0 1 0 1000000 2
execute if score world WaveCounter matches 59 run playsound minecraft:ambient.soul_sand_valley.mood master @a 0 1 0 1000000 2
execute if score world WaveCounter matches 59 run playsound minecraft:entity.blaze.shoot master @a 0 1 0 1000000 0

# Forsaken Lich
execute if score world WaveCounter matches 79 run tellraw @a [{"bold":true,"color":"red","obfuscated":true,"text":"X"},{"bold":false,"color":"#E0332D","obfuscated":false,"text":" An ancient evil has awakened. Shackles groan under forgotten magic. "},{"bold":true,"color":"red","obfuscated":true,"text":"X"}]
execute if score world WaveCounter matches 79 run playsound minecraft:block.chain.break master @a 0 1 0 10000 .1
execute if score world WaveCounter matches 79 run playsound minecraft:entity.ravager.attack master @a 0 1 0 10000 .1

# Phantom Sovereign
execute if score world WaveCounter matches 99 run tellraw @a [{"bold":true,"color":"#2d0a87","obfuscated":true,"text":"X"},{"bold":false,"color":"#4512c7","obfuscated":false,"text":" The night sky warps. There's a presence in the stars... "},{"bold":true,"color":"#2d0a87","obfuscated":true,"text":"X"}]
execute if score world WaveCounter matches 99 run playsound minecraft:entity.ender_dragon.flap master @a 0 1 0 100 0.1 1