
# -> Set advancements
function overly_realistic:players/wisdom/scribing/set_advancements

# -> If current skill level = 0 then return
execute if score @s OverlyRealistic.Player.WisdomStats.Scribing matches ..0 run \
    return run \
        scoreboard players set @s OverlyRealistic.Player.WisdomStats.Scribing_XP 0

# -> Reset XP level
scoreboard players operation #or.XpLevelReset OverlyRealistic.General.ArbitraryData = @s OverlyRealistic.Player.WisdomStats.Scribing_XP_Max
scoreboard players operation #or.XpLevelReset OverlyRealistic.General.ArbitraryData /= #or.static_num_2 OverlyRealistic.General.ArbitraryData

scoreboard players operation @s OverlyRealistic.Player.WisdomStats.Scribing_XP = #or.XpLevelReset OverlyRealistic.General.ArbitraryData

# -> Reduce level
scoreboard players remove @s OverlyRealistic.Player.WisdomStats.Scribing 1

# -> Reduce XP cap
scoreboard players remove @s OverlyRealistic.Player.WisdomStats.Scribing_XP_Max 1200
