Unstable Summon Weave (3.5e Feat)
From D&D Wiki
Unstable Summon Weave [Arcane]
At a cost of your summoned or risen creatures health, You may tie a spell to them, to be cast upon death, unsummon, reanimation, or deanimation.
Prerequisite: Any summon, create, or reanimate spell.
Benefit: Roll a d20 to determine what level spell you wish to weave into your creature.
Special: 1-2; Fail, 3-5; Cantrip, 6-10; up to a level 2 spell, 11-15; up to a level 4 spell, 16-17 up to a sixth level spell 18-19; up to an 8th level spell, 20; roll again, 1-19 will empower up to a 6th level spell, a second 20 will allow casting of a 9th level spell