#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#
#    This function has been created by Skilendarz Group.
#             https://skilendarz.com
#
#      GIVE MAP MAKERS THE CREDIT THEY DESERVE!
#             COPYING IS PROHIBITED!
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

scoreboard players add fireball time 1

execute if score fireball time matches 1 at @a[scores={wineffect_select=2}] run summon minecraft:fireball ~ ~10 ~5 {ExplosionPower:0,Motion:[0.0,-2.0,0.0]}
execute if score fireball time matches 1 at @a[scores={wineffect_select=2}] run spreadplayers ~ ~ 1 20 false @e[type=fireball,tag=!move,limit=1,sort=nearest]
execute if score fireball time matches 1 as @e[type=fireball,tag=!move] at @s run tp @s ~ 170 ~
execute if score fireball time matches 1 run tag @e[type=fireball,tag=!move] add move

execute as @e[type=fireball] run data merge entity @s {Motion:[0.0,-2.0,0.0]}

execute if score fireball time matches 6.. run scoreboard players set fireball time 0