Hmm..... Rather than have The Enslaved a regular slave with a unique spell, make it it's own unitclass, create an effect promotion that applies to all D'teshi units, and on that promotion have a <pypostcombatwon> tag that will create an Enslaved after combat... Can even check for the proper techs. The raze city code, and the razed improvement code, should still spawn Enslaved as you have to tell it to use that unit specifically all ready... just gotta switch from UNIT_SLAVE to UNIT_ENSLAVED. And then purchased slaves will be just that, slaves.
I love that postcombatwon python call for promotions.... It allows you to do so many things without creating a whole host of UUs.
Code could be something like this... It's set up to check for the Slavery civic, that the opponent was living (No enslaving elementals......), and has a 3 in 4 chance of generating an Enslaved. Of course, that depends on them being an actual unit, rather than a spell allowed to D'teshi slaves.
Code:
def postCombatDteshiSlaveGeneration(pCaster, pOpponent):
pPlayer = gc.getPlayer(pCaster.getOwner())
if pPlayer.getCivics(gc.getInfoTypeForString('CIVICOPTION_LABOR')) == gc.getInfoTypeForString('CIVIC_SLAVERY'):
if pOpponent.isAlive:
iDteshiSlaveGenerationRnd = CyGame().getSorenRandNum(4, "Dteshi Slave Generation")
if iDteshiSlaveGenerationRnd <= 3:
newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_ENSLAVED'), pCaster.getX(), pCaster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
Edit: Now that this is for FF, should probably get it moved to the FF forum... Makes it easier for people to find.
Edit2: Should also auto apply to summons, so you wouldn't need the Fel Spirits promotion.