execute unless entity @s[gamemode=creative] unless items entity @s weapon.mainhand *[custom_data~{wizard_battle:1b}] run item modify entity @s weapon.mainhand pctf:remove1
execute if items entity @s weapon.mainhand *[custom_data~{wizard_battle:1b}] run scoreboard players add @s spell_cooldown1 20
summon marker ~ ~1.6 ~ {Tags:["magic_proj","check_proj","magic_missile_scroll","new"],CustomName:'"magic_missile_scroll"'}
tag @s add temp
execute as @n[tag=magic_missile_scroll,tag=new] at @s rotated as @n[tag=temp] run tp @s ~ ~ ~ ~ ~
execute as @n[tag=magic_missile_scroll,tag=new] run scoreboard players operation @s ctf_ID = @n[tag=temp] ctf_ID
execute as @n[tag=magic_missile_scroll,tag=new] run scoreboard players operation @s real_ID = @n[tag=temp] real_ID
execute as @n[tag=magic_missile_scroll,tag=new] run scoreboard players set @s size 2
execute as @n[tag=magic_missile_scroll,tag=new] store result score @s generic_timer_max run scoreboard players set @s generic_timer 80
tag @s remove temp

tag @n[tag=new] remove new

execute store result score #rand temp run random value 1..7

playsound minecraft:item.bottle.fill_dragonbreath player @a ~ ~ ~ 1 0.75
execute if score #rand temp matches 1 run playsound minecraft:entity.mooshroom.convert player @a ~ ~ ~ 2 1.7
execute if score #rand temp matches 2 run playsound minecraft:entity.mooshroom.convert player @a ~ ~ ~ 2 1.75
execute if score #rand temp matches 3 run playsound minecraft:entity.mooshroom.convert player @a ~ ~ ~ 2 1.8
execute if score #rand temp matches 4 run playsound minecraft:entity.mooshroom.convert player @a ~ ~ ~ 2 1.85
execute if score #rand temp matches 5 run playsound minecraft:entity.mooshroom.convert player @a ~ ~ ~ 2 1.9
execute if score #rand temp matches 6 run playsound minecraft:entity.mooshroom.convert player @a ~ ~ ~ 2 1.95
execute if score #rand temp matches 7 run playsound minecraft:entity.mooshroom.convert player @a ~ ~ ~ 2 2

scoreboard players add @s spell_cooldown1 15