def from_dungeon_level(table, dungeon_level):
    """Returns the probablility of somthing spawning in a given dungeon level. 
    Table is formatted [[probability, lowest possible level], [probability, next lowest possible level], etc]"""
    if isinstance(table[0], int):
        return table[0]
    for (value, level) in reversed(table):
        if dungeon_level >= level:
            return value

    return 0