Sign in to follow this  
RetroMike

Would it be possible to make a fortune shovel?

Recommended Posts

RetroMike    4

Playing with the idea of a shovel that has a random chance to unearth different gems and stones, maybe up to 3, when used. Would this be possible? I was thinking a chance table like this, but I dunno how to implement it so it's called when you dig.

local function MakeLoot(inst)
    local possible_loot =
    {
        {chance = 0.2,  item = "rocks"},
        {chance = 0.1,  item = "flint"},
        {chance = 0.1,  item = "boneshard"},
        {chance = 0.05, item = "nitre"},
        {chance = 0.04, item = "goldnugget"},
        {chance = 0.03, item = "moonrocknugget"},
        {chance = 0.03, item = "marble"},
        {chance = 0.02, item = "bluegem"},
        {chance = 0.02, item = "redgem"},
        {chance = 0.02, item = "orangegem"},
        {chance = 0.02, item = "greengem"},
        {chance = 0.01, item = "purplegem"},
        {chance = 0.01, item = "yellowgem"},
        {chance = 0.01, item = "thulecite"},
    }

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this