'Create and return a new object as a copy of the original object. All
will be identical to the original except for the arguments given
specifically to this method.
Args:
original_object (Object): The object to make a copy from.
new_key (str, optional): Name of the copy, if different
from the original.
new_location (Object, optional): Alternate location.
new_home (Object, optional): Change the home location
new_aliases (list, optional): Give alternate object
aliases as a list of strings.
new_destination (Object, optional): Used only by exits.
Returns:
copy (Object or None): The copy of `original_object`,
optionally modified as per the ingoing keyword
arguments.  `None` if an error was encountered.'

def copy_object(self, original_object, new_key=None, new_location=None, new_home=None, new_permissions=None, new_locks=None, new_aliases=None, new_destination=None):

    typeclass_path = original_object.typeclass_path
    if (not new_key):
        new_key = original_object.key
    if (not new_location):
        new_location = original_object.location
    if (not new_home):
        new_home = original_object.home
    if (not new_aliases):
        new_aliases = original_object.aliases.all()
    if (not new_locks):
        new_locks = original_object.db_lock_storage
    if (not new_permissions):
        new_permissions = original_object.permissions.all()
    if (not new_destination):
        new_destination = original_object.destination
    from evennia.utils import create
    from evennia.scripts.models import ScriptDB
    new_object = create.create_object(typeclass_path, key=new_key, location=new_location, home=new_home, permissions=new_permissions, locks=new_locks, aliases=new_aliases, destination=new_destination)
    if (not new_object):
        return None
    for attr in original_object.attributes.all():
        new_object.attributes.add(attr.key, attr.value)
    for (icmdset, cmdset) in enumerate(original_object.cmdset.all()):
        if (icmdset == 0):
            new_object.cmdset.add_default(cmdset)
        else:
            new_object.cmdset.add(cmdset)
    for script in original_object.scripts.all():
        ScriptDB.objects.copy_script(script, new_obj=new_object)
    return new_object
