scoreboard players set @s spell_cost_current 600
scoreboard players operation @s spell_cost_current /= @s mana_efficiency
execute if score @s magus_mana_bar < @s spell_cost_current run function kiwi2:upgrades/classes/magus/spells/not_enough_mana_warning

execute store result storage kiwi:magus_y_level_storage pos.y double 1 run data get entity @s Pos[1] 1
execute unless score @s magus_mana_bar < @s spell_cost_current run particle flame ~ ~1 ~ 0.5 0.5 0.5 0.1 50
execute unless score @s magus_mana_bar < @s spell_cost_current run summon area_effect_cloud ^ ^ ^10 {Particle:{type:"flame"},Radius:4f,Duration:200,Tags:["player_magus_lava_geyser"]}
execute unless score @s magus_mana_bar < @s spell_cost_current run schedule function kiwi2:upgrades/classes/magus/spells/tier_4/geyser/geyser_fx 1t
execute as @e[type=area_effect_cloud,tag=player_magus_lava_geyser] at @s run spreadplayers ~ ~ 1 1 false @s

execute unless score @s magus_mana_bar < @s spell_cost_current run playsound minecraft:block.trial_spawner.spawn_item master @a[distance=..12] ~ ~ ~ 1 1
execute unless score @s magus_mana_bar < @s spell_cost_current run scoreboard players operation @s magus_mana_bar -= @s spell_cost_current