execute if entity @a[nbt={Inventory:[{components:{"minecraft:custom_data":{questing:1}}}]}] run return run function ws:misc/mafia/quest/fail
execute unless score @s authority matches 10.. store result score @s questgive run random value 1..4
execute if score @s authority matches 10..34 store result score @s questgive run random value 1..8
execute if score @s authority matches 35..59 store result score @s questgive run random value 1..12
execute if score @s authority matches 60.. store result score @s questgive run random value 1..18
function ws:misc/mafia/quest/define
execute at @s run playsound minecraft:block.bell.resonate player @a[] ~ ~ ~ 1 2
tellraw @s {"translate":"mafia.get"}
scoreboard players set @s questgive 0