the mysterious old man just popped up the random event, and he gave me a treasure chest which had a tooth half of a key in it… i was just curious what the chance % was to actually get that roll
I’m having trouble finding the drop table for the casket. The casket itself is a 76% chance, and I see a commented-out section of the code with drops for the casket which implies that a key half is 1/150 for each half, which would be about a 1% chance to get a key half from an old man, but that’s just from the commented-out section. The real drop table may be different.
thanks man i appreciate it! i knew it had to be some good luck
// i used this video. Osrs video from july 29 2020
// https://youtu.be/Tp2VxwIWMcQ
[opheld1,casket]
inv_delslot(inv, last_slot);
sound_synth(lever, 0, 0);
def_int $random = random(128);
// drop rates are from Casket - OSRS Wiki
// todo: find screenshots for these objbox’s
if ($random < 60) { // 10/128 coins for each
// 20, 40, 80, 160, 320, 640
inv_add(inv, coins, multiply(pow(2, add(random(6), 1)), 10)); // 2 ^ (random(6) + 1) * 10
~objbox(coins_250, “You open the casket. Inside you find some coins.”, 250, 0, divide(^objbox_height, 2));
} else if ($random < 92) { // 32/128 uncut sapphire
inv_add(inv, uncut_sapphire, 1);
~objbox(uncut_sapphire, “You open the casket. Inside you find an uncut|sapphire.”, 250, 0, divide(^objbox_height, 2));
} else if ($random < 108) { // 16/128 uncut emerald
inv_add(inv, uncut_emerald, 1);
~objbox(uncut_emerald, “You open the casket. Inside you find an uncut|emerald.”, 250, 0, divide(^objbox_height, 2));
} else if ($random < 116) { // 8/128 uncut ruby
inv_add(inv, uncut_ruby, 1);
~objbox(uncut_ruby, “You open the casket. Inside you find an uncut ruby.”, 250, 0, divide(^objbox_height, 2));
} else if ($random < 124) { // 8/128 cosmic talisman
inv_add(inv, cosmic_talisman, 1);
~objbox(cosmic_talisman, “You open the casket. Inside you find a cosmic talisman.”, 250, 0, 0);
} else if ($random < 126) { // 2/128 uncut diamond
inv_add(inv, uncut_diamond, 1);
~objbox(uncut_diamond, “You open the casket. Inside you find an uncut|diamond.”, 250, 0, divide(^objbox_height, 2));
} else if ($random < 127) { // 1/128 tooth half key
inv_add(inv, keyhalf1, 1);
~objbox(keyhalf1, “You open the casket. Inside you find half a key.”, 250, 0, 0);
} else if ($random < 128) { // 1/128 loop half of key
inv_add(inv, keyhalf2, 1);
~objbox(keyhalf2, “You open the casket. Inside you find half a key.”, 250, 0, 0);
code for casket from github
1/128 for specific, 1/64 overall seems