'Find all Scripts related to a particular object.
Args:
obj (Object): Object whose Scripts we are looking for.
key (str, optional): Script identifier - can be given as a
dbref or name string. If given, only scripts matching the
key on the object will be returned.
Returns:
matches (list): Matching scripts.'

@returns_typeclass_list
def get_all_scripts_on_obj(self, obj, key=None):

    if (not obj):
        return []
    player = (_GA(_GA(obj, '__dbclass__'), '__name__') == 'PlayerDB')
    if key:
        dbref = self.dbref(key)
        if (dbref or (dbref == 0)):
            if player:
                return self.filter(db_player=obj, id=dbref)
            else:
                return self.filter(db_obj=obj, id=dbref)
        elif player:
            return self.filter(db_player=obj, db_key=key)
        else:
            return self.filter(db_obj=obj, db_key=key)
    elif player:
        return self.filter(db_player=obj)
    else:
        return self.filter(db_obj=obj)
