execute store result score rand temp run random value 1..8

execute if score rand temp matches 1 run function pctf:logic/items/scrolls/fireball/give
execute if score rand temp matches 2 run function pctf:logic/items/scrolls/frost_ray/give
execute if score rand temp matches 3 run function pctf:logic/items/scrolls/poison_ray/give
execute if score rand temp matches 4 run function pctf:logic/items/scrolls/magic_missile/give
execute if score rand temp matches 5 run function pctf:logic/items/scrolls/ethereal_blade/give
execute if score rand temp matches 6 run function pctf:logic/items/scrolls/inferno_ray/give
execute if score rand temp matches 7 run function pctf:logic/items/scrolls/shadow_burst/give
execute if score rand temp matches 8 run function pctf:logic/items/scrolls/soul_beam/give

execute store result score rand temp run random value 1..5
execute if score rand temp matches 1..2 run function pctf:logic/items/scrolls/shield/give
execute if score rand temp matches 3..4 run function pctf:logic/items/scrolls/parry/give
execute if score rand temp matches 5 run function pctf:logic/items/scrolls/invulnerability/give

execute store result score rand temp run random value 1..5
execute if score rand temp matches 1 run function pctf:logic/items/scrolls/black_hole/give
execute if score rand temp matches 2 run function pctf:logic/items/scrolls/blink/give
execute if score rand temp matches 3 run function pctf:logic/items/scrolls/silence_beam/give
execute if score rand temp matches 4 run function pctf:logic/items/scrolls/time_warp/give
execute if score rand temp matches 5 run function pctf:logic/items/scrolls/illusory_bridge/give