
# -> Intelligence gain RNG
execute if predicate overly_realistic:player/misc/intelligence_gain_rare_rng run \
    function overly_realistic:players/intelligence/add_1_intelligence

# -> Reset globalized value
scoreboard players set #or.wisdom_stat_max_dura_buff OverlyRealistic.General.ArbitraryData 0

# -> If player does not have any blacksmithing level then return
execute unless score @s OverlyRealistic.Player.WisdomStats.Blacksmithing matches 1.. run \
    return fail

# --> Blacksmithing buffs

# -> Level 1
execute if score @s OverlyRealistic.Player.WisdomStats.Blacksmithing matches 1 \
    store result score #or.wisdom_stat_max_dura_buff OverlyRealistic.General.ArbitraryData run \
        return run \
            random value 10..20

# -> Level 2
execute if score @s OverlyRealistic.Player.WisdomStats.Blacksmithing matches 2 \
    store result score #or.wisdom_stat_max_dura_buff OverlyRealistic.General.ArbitraryData run \
        return run \
            random value 40..70

# -> Level 3
execute if score @s OverlyRealistic.Player.WisdomStats.Blacksmithing matches 3 \
    store result score #or.wisdom_stat_max_dura_buff OverlyRealistic.General.ArbitraryData run \
        return run \
            random value 100..200

# -> Level 4
execute if score @s OverlyRealistic.Player.WisdomStats.Blacksmithing matches 4 \
    store result score #or.wisdom_stat_max_dura_buff OverlyRealistic.General.ArbitraryData run \
        return run \
            random value 250..450

# -> Level 5
execute if score @s OverlyRealistic.Player.WisdomStats.Blacksmithing matches 5 \
    store result score #or.wisdom_stat_max_dura_buff OverlyRealistic.General.ArbitraryData run \
        return run \
            random value 500..1200
