execute if entity @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] run schedule function kiwi3:relics/ancient_grimoire/ancient_grimoire_soul_well_fx 1t
execute as @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] at @s if score @s ancient_grimoire_soul_well matches 341 run playsound minecraft:block.respawn_anchor.charge master @a[distance=..15] ~ ~ ~ 1 1
execute as @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] at @s if score @s ancient_grimoire_soul_well matches 301..341 run particle trial_spawner_detection_ominous ~ ~ ~ 1.5 0 1.5 0 5 force
execute as @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] at @s if score @s ancient_grimoire_soul_well matches 301..341 run particle soul_fire_flame ~ ~ ~ 1.5 0 1.5 0 5 force
execute as @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] at @s if score @s ancient_grimoire_soul_well matches 301 run playsound minecraft:block.respawn_anchor.deplete master @a[distance=..15] ~ ~ ~ 1 2
execute as @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] at @s if score @s ancient_grimoire_soul_well matches 301 run particle flash ~ ~ ~ 0 0 0 1 1
execute as @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] at @s if score @s ancient_grimoire_soul_well matches 1..301 as @e[tag=!boss_check,tag=!player_soul_well,tag=!forsaken_lich_soul_well,distance=..5] unless entity @s[type=!#enemy_mobs_only,tag=!wave_mob] at @s if block ~ ~0.1 ~ air run tp @s ~ ~-1 ~
execute as @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] at @s if score @s ancient_grimoire_soul_well matches 1..301 run particle sculk_soul ~ ~-0.05 ~ 1.5 0 1.5 0 5 force
execute as @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] at @s if score @s ancient_grimoire_soul_well matches 1..301 run particle soul_fire_flame ~ ~1.5 ~ 0.1 1.5 0.1 0 5 force
execute as @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] at @s if score @s ancient_grimoire_soul_well matches 1..301 run playsound minecraft:entity.evoker.prepare_attack master @a[distance=..5] ~ ~ ~ .1 .1
execute as @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] at @s if score @s ancient_grimoire_soul_well matches 1..301 as @e[tag=!boss_check,tag=!player_soul_well,tag=!forsaken_lich_soul_well,distance=..5] unless entity @s[type=!#enemy_mobs_only,tag=!wave_mob] run damage @s 2 magic
execute as @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] at @s if score @s ancient_grimoire_soul_well matches 1..341 run scoreboard players remove @s ancient_grimoire_soul_well 1
execute as @e[tag=player_soul_well,scores={ancient_grimoire_soul_well=0..341}] at @s if score @s ancient_grimoire_soul_well matches 1 run kill @s