summon armor_stand ^ ^1 ^3 {Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["magus_ice_wall_marker"]}

setblock ^ ^ ^3 ice keep
setblock ^ ^1 ^3 ice keep
setblock ^ ^2 ^3 ice keep
setblock ^ ^3 ^3 ice keep
setblock ^ ^4 ^3 ice keep

setblock ^1 ^ ^3 ice keep
setblock ^1 ^4 ^3 ice keep

setblock ^2 ^ ^3 ice keep
setblock ^2 ^3 ^3 ice keep
setblock ^2 ^4 ^3 ice keep

setblock ^3 ^ ^3 ice keep
setblock ^3 ^3 ^3 ice keep
setblock ^3 ^4 ^3 ice keep

setblock ^4 ^ ^3 ice keep
setblock ^4 ^1 ^3 ice keep
setblock ^4 ^2 ^3 ice keep

setblock ^5 ^ ^3 ice keep
setblock ^5 ^1 ^3 ice keep
setblock ^5 ^4 ^3 ice keep

setblock ^-1 ^ ^3 ice keep
setblock ^-1 ^1 ^3 ice keep
setblock ^-1 ^3 ^3 ice keep

setblock ^-2 ^ ^3 ice keep
setblock ^-2 ^2 ^3 ice keep
setblock ^-2 ^3 ^3 ice keep
setblock ^-2 ^4 ^3 ice keep

setblock ^-3 ^ ^3 ice keep
setblock ^-3 ^1 ^3 ice keep
setblock ^-3 ^3 ^3 ice keep
setblock ^-3 ^4 ^3 ice keep

setblock ^-4 ^ ^3 ice keep
setblock ^-4 ^1 ^3 ice keep
setblock ^-4 ^3 ^3 ice keep
setblock ^-4 ^4 ^3 ice keep

setblock ^-5 ^ ^3 ice keep
setblock ^-5 ^3 ^3 ice keep
setblock ^-5 ^4 ^3 ice keep

execute if predicate kiwi2:chance_random_50 run setblock ^5 ^1 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^4 ^1 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^3 ^1 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^5 ^2 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^3 ^3 ^2 minecraft:ice keep

execute if predicate kiwi2:chance_random_50 run setblock ^-5 ^1 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-4 ^1 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-3 ^1 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-5 ^2 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-4 ^2 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-3 ^3 ^2 minecraft:ice keep

execute if predicate kiwi2:chance_random_50 run execute if predicate kiwi2:chance_random_50 run setblock ^7 ^1 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^6 ^1 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^2 ^1 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^6 ^2 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^2 ^3 ^2 minecraft:ice keep

execute if predicate kiwi2:chance_random_50 run setblock ^-7 ^1 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-6 ^1 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-6 ^2 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-2 ^2 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-7 ^3 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-6 ^3 ^2 minecraft:ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-2 ^3 ^2 minecraft:ice keep

execute if predicate kiwi2:chance_random_80 run setblock ^-5 ^4 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-5 ^5 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-5 ^6 ^3 ice keep

execute if predicate kiwi2:chance_random_80 run setblock ^-4 ^4 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-4 ^6 ^3 ice keep
execute if predicate kiwi2:chance_random_20 run setblock ^-4 ^7 ^3 ice keep

execute if predicate kiwi2:chance_random_80 run setblock ^-3 ^4 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-3 ^5 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-3 ^6 ^3 ice keep

execute if predicate kiwi2:chance_random_50 run setblock ^-2 ^5 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-2 ^6 ^3 ice keep
execute if predicate kiwi2:chance_random_20 run setblock ^-2 ^7 ^3 ice keep

execute if predicate kiwi2:chance_random_80 run setblock ^-1 ^4 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-1 ^5 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^-1 ^6 ^3 ice keep
execute if predicate kiwi2:chance_random_20 run setblock ^-1 ^7 ^3 ice keep

execute if predicate kiwi2:chance_random_80 run setblock ^ ^4 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^ ^5 ^3 ice keep
execute if predicate kiwi2:chance_random_20 run setblock ^ ^7 ^3 ice keep

execute if predicate kiwi2:chance_random_80 run setblock ^5 ^4 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^5 ^5 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^5 ^6 ^3 ice keep
execute if predicate kiwi2:chance_random_20 run setblock ^5 ^7 ^3 ice keep

execute if predicate kiwi2:chance_random_80 run setblock ^4 ^4 ^3 ice keep
execute if predicate kiwi2:chance_random_20 run setblock ^4 ^7 ^3 ice keep

execute if predicate kiwi2:chance_random_80 run setblock ^3 ^4 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^3 ^5 ^3 ice keep
execute if predicate kiwi2:chance_random_20 run setblock ^3 ^7 ^3 ice keep

execute if predicate kiwi2:chance_random_80 run setblock ^2 ^4 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^2 ^5 ^3 ice keep
execute if predicate kiwi2:chance_random_50 run setblock ^2 ^6 ^3 ice keep
execute if predicate kiwi2:chance_random_20 run setblock ^2 ^7 ^3 ice keep

execute if predicate kiwi2:chance_random_50 run setblock ^1 ^6 ^3 ice keep
execute if predicate kiwi2:chance_random_20 run setblock ^1 ^7 ^3 ice keep

playsound minecraft:block.respawn_anchor.set_spawn master @a ~ ~ ~ 10000 1
playsound minecraft:block.respawn_anchor.set_spawn master @a ~ ~ ~ 10000 0

schedule function kiwi2:upgrades/classes/magus/spells/tier_2/ice_wall_remove_water 300t