def METHOD_NAME(self, autoctx):
    super().METHOD_NAME(autoctx)
    spell = self.spell
    if spell is None:
        autoctx.meta_queue(f"**Error**: Spell {self.id} not found.")
        return CastSpellResult(success=False)
    cast_level = self.level if self.level is not None else spell.level
    if not spell.level <= cast_level <= 9:
        autoctx.meta_queue(f"**Error**: Unable to cast {spell.name} at level {cast_level} (invalid level).")
        return CastSpellResult(success=False, spell_id=self.id)
    if autoctx.is_spell:
        autoctx.meta_queue(f"**Error**: Unable to cast another spell inside a spell.")
        return CastSpellResult(success=False, spell_id=self.id)
    dc_override = ab_override = spell_override = None
    if spell.automation and spell.automation.effects:
        # save old autoctx values
        old_ab_override = autoctx.ab_override
        old_dc_override = autoctx.dc_override
        old_spell_override = autoctx.evaluator.builtins.get("spell")
        old_level_override = autoctx.spell_level_override
        # parenting
        explicit_parent = None
        if self.parent is not None and (parent_ref := autoctx.metavars.get(self.parent, None)) is not None:
            if not isinstance(parent_ref, (IEffectMetaVar, aliasing.api.combat.SimpleEffect)):
                raise InvalidArgument(
                    f"Could not set IEffect parent: The variable `{self.parent}` is not an IEffectMetaVar "
                    f"(got `{type(parent_ref).__name__}`)."
                )
            # noinspection PyProtectedMember
            explicit_parent = parent_ref._effect
        autoctx.conc_effect = explicit_parent
        # run the spell using the given values
        if self.attack_bonus is not None:
            ab_override = autoctx.ab_override = autoctx.parse_intexpression(self.attack_bonus)
        if self.dc is not None:
            dc_override = autoctx.dc_override = autoctx.parse_intexpression(self.dc)
        if self.casting_mod is not None:
            spell_override = autoctx.evaluator.builtins["spell"] = autoctx.parse_intexpression(self.casting_mod)
        if self.level is not None:
            autoctx.spell_level_override = self.level
        autoctx.spell = spell
        results = self.run_children(spell.automation.effects, autoctx)
        # and restore them
        autoctx.ab_override = old_ab_override
        autoctx.dc_override = old_dc_override
        autoctx.evaluator.builtins["spell"] = old_spell_override
        autoctx.spell_level_override = old_level_override
        autoctx.spell = None
        # display higher level info
        if cast_level != spell.level and spell.higherlevels:
            autoctx.effect_queue(f"**At Higher Levels**: {smart_trim(spell.higherlevels)}")
    else:
        # copied from Spell.cast
        results = []
        autoctx.queue(smart_trim(spell.description))
        autoctx.push_embed_field(title=spell.name)
        # display higher level info
        if cast_level != spell.level and spell.higherlevels:
            autoctx.queue(smart_trim(spell.higherlevels))
            autoctx.push_embed_field(title="At Higher Levels")
    return CastSpellResult(
        success=True,
        spell_id=self.id,
        level_override=self.level,
        dc_override=dc_override,
        attack_bonus_override=ab_override,
        casting_mod_override=spell_override,
        children=results,
    )