TIL that items created by itemcorpse cannot be used in reactions if the creature they came from was intelligent.
...
Maybe an itemcorpse that drops alongside the the creature, that boils at room temperature, and that has a compound interaction syndrome that specifically revives the corpse of the creature that died, transforms only that creature into a different non-sentient creature that instantly scuttles itself due to counting as a wagon?
The only problem is getting a necromancy interaction to target the corpse.
Sadly, I don't think this will work. Itemcorpse replaces the corpse with a single item, so there is nothing to animate (I just tried with a necromancer in arena - only severed parts were animateable).
You could also make the creature's sweat permanently change it into an unintelligent version of itself. This will make them unusable as learner creatures, but they still show up as mercs, and turn into something you can use the body parts of once killed. Potentially.
I haven't actually tested if sentients turned non-sentient can be butchered.
This
might work. Alternatively, it could be a syndrome that removes the [can_learn] tag. I could even give an interaction to my fort citizen race that strips [can_learn] from enemy combatants of the appropriate race, leaving visitors unaffected. Unfortunately, this will still leave a bit of wonkiness, but it is an option IF stripping can_learn also strips the appropriate flags from the dropped ITEMCORPSE item.
Actually, I have a better idea. I did a quick bit of looking through gm-editor and found the dead_dwarf flag. Flicking this off lets items be used. I might try to write a short lua script that executes through item-trigger and strips that flag. Shame I suck at both lua and dfhack*, but hey, this can't be *that* hard, right? Right?
AFAIK a boiling itemcorpse would negate any attempts to revive it. Are you attempting to do this in adventure mode or fort mode? The former may be more plausible to achieve.
Both, but Fort mode is the more important one.
*my net experience with lua and dfhack is fixing a couple of bugs in reaction-trigger and modifying it to take a -range and -ignoreWorker arg. I literally did this less than 48 hours ago.
EDIT
...
-- on execution, sets the dead_dwarf flag of an item to false
--written by thefriendlyhacker
local usage = [====[
modtools/strip-dead-dwarf-flag
=====================
This script sets the dead-dwarf flag of an item to false
Arguments::
-item id
specifies the item to be altered
]====]
local utils = require 'utils'
validArgs = validArgs or utils.invert({
'item',
'help',
})
local args = utils.processArgs({...}, validArgs)
if args.help then
print(usage)
return
end
local id=tonumber(args.item)
item=df.item.find(id)
item.flags.dead_dwarf=false
Added the necessary item-trigger commands to on-load and tested it in arena (for adv mode) and in a fortress mode save (by ganking a visiting scholar) and it works. The itemcorpse item got hauled to the corpse/refuse stockpile instead of my main stockpile* and there is a delay before the item is usable in adventure mode, but frankly I am filing those bugs under the priority of "I literally don't give a damn". It works. That is good enough.
*I don't know if it would have gotten shifted a second time or not. That fortress has way to many outstanding hauling jobs for me to be bothered waiting to find out.