'Tries to create the Character object. We also put an
attribute on ourselves to remember it.'

def func(self):

    self.character = None
    if utils.inherits_from(self.caller, 'evennia.objects.objects.Object'):
        self.character = self.caller
        if hasattr(self.caller, 'player'):
            self.caller = self.caller.player
    if (not self.args):
        self.caller.msg('Usage:    create    <character    name>')
        return
    charname = self.args.strip()
    old_char = managers.objects.get_objs_with_key_and_typeclass(charname, CHARACTER_TYPECLASS)
    if old_char:
        self.caller.msg(('Character    |c%s|n    already    exists.' % charname))
        return
    new_character = create_object(CHARACTER_TYPECLASS, key=charname)
    if (not new_character):
        self.caller.msg("|rThe    Character    couldn't    be    created.    This    is    a    bug.    Please    contact    an    admin.")
        return
    new_character.locks.add(('puppet:id(%i)    or    pid(%i)    or    perm(Immortals)    or    pperm(Immortals)' % (new_character.id, self.caller.id)))
    avail_chars = self.caller.db._character_dbrefs
    if avail_chars:
        avail_chars.append(new_character.id)
    else:
        avail_chars = [new_character.id]
    self.caller.db._character_dbrefs = avail_chars
    self.caller.msg(('|gThe    character    |c%s|g    was    successfully    created!' % charname))
