execute store result score #random temp run random value 1..9

execute if score .wizard_battle settings matches 1 store result score #random temp run random value 1..4

clear @s *[custom_data={wizard_battle:1b}]

execute if score #random temp matches 1..2 run function pctf:logic/items/lucky_block/outcomes/positive/team/upgrade/types/armor
execute if score #random temp matches 3..4 run function pctf:logic/items/lucky_block/outcomes/positive/team/enchant/types/armor
execute if score #random temp matches 5..6 run function pctf:logic/items/lucky_block/outcomes/positive/team/upgrade/types/melee
execute if score #random temp matches 7..8 run function pctf:logic/items/lucky_block/outcomes/positive/team/enchant/types/melee
execute if score #random temp matches 9 run function pctf:logic/items/lucky_block/outcomes/positive/team/enchant/types/ranged