'create the new character'

def func(self):

    player = self.player
    if (not self.args):
        self.msg('Usage:    @charcreate    <charname>    [=    description]')
        return
    key = self.lhs
    desc = self.rhs
    charmax = (_MAX_NR_CHARACTERS if (_MULTISESSION_MODE > 1) else 1)
    if ((not player.is_superuser) and (player.db._playable_characters and (len(player.db._playable_characters) >= charmax))):
        self.msg(('You    may    only    create    a    maximum    of    %i    characters.' % charmax))
        return
    from evennia.objects.models import ObjectDB
    typeclass = settings.BASE_CHARACTER_TYPECLASS
    if ObjectDB.objects.filter(db_typeclass_path=typeclass, db_key__iexact=key):
        self.msg(("|rA    character    named    '|w%s|r'    already    exists.|n" % key))
        return
    start_location = ObjectDB.objects.get_id(settings.START_LOCATION)
    default_home = ObjectDB.objects.get_id(settings.DEFAULT_HOME)
    permissions = settings.PERMISSION_PLAYER_DEFAULT
    new_character = create.create_object(typeclass, key=key, location=start_location, home=default_home, permissions=permissions)
    new_character.locks.add(('puppet:id(%i)    or    pid(%i)    or    perm(Immortals)    or    pperm(Immortals)' % (new_character.id, player.id)))
    player.db._playable_characters.append(new_character)
    if desc:
        new_character.db.desc = desc
    elif (not new_character.db.desc):
        new_character.db.desc = 'This    is    a    Player.'
    self.msg(('Created    new    character    %s.    Use    |w@ic    %s|n    to    enter    the    game    as    this    character.' % (new_character.key, new_character.key)))
