If you want a more robust alternative, you could check for SPRITE_IS_DEADDEMOGORGON in the area script and create the objects accordingly; the problem is that you couldn't reliably drop them in the right place.
if this means that demogorgon actually plays his dying animation (don't remember) even scripted via Kill() like SCS Sarevok than you could try, Argent77, patching his CRE file like this:
COPY_EXISTING ~nameOfDemorgon.cre~ ~override~
LPF ADD_CRE_EFFECT
INT_VAR
opcode = 232 /*Cast Spell on Condition*/
target = 1 /*Self*/
parameter2 = 16 /*Target dies*/
timing = 9 /*Instant/Permanent*/
STR_VAR
resource = "SPELL"
END
BUT_ONLY
where the SPELL resource is used to spawn invisible creature at the same spot and run a script that drops an item. Unfortunately there is no opcode that could be used to directly drop an item iirc.
Can't promiss that it will work but this way you wouldn't need to worry about other mods overwriting the same script slot in Demogorgon file without checking if the slot is already occupied.
edit: corrected mistake, you actually need additional SPL and EFF to spawn that CRE without graphical effects. Here are all required files: https://dl.dropboxus...3122/invcre.zip
edit2: alternatively if the death animation doesn't play you can use this condition instead:
COPY_EXISTING ~nameOfDemorgon.cre~ ~override~
LPF ADD_CRE_EFFECT
INT_VAR
opcode = 232 /*Cast Spell on Condition*/
target = 1 /*Self*/
parameter2 = 19 /*Target HP < 'Special'*/
timing = 9 /*Instant/Permanent*/
special = 30
STR_VAR
resource = "SPELL"
END
BUT_ONLY
and than in the script assigned to invisible cre limit amount of item spawns to only 1 via variable check.
Edited by K4thos, 07 February 2017 - 08:12 PM.