Spectacular placeable destruction on death

What it does
Does what Ron Lindsay requested above: a spectacular destruction of an placeable upon the death of a npc

The Script
// Spectacular placeable destruction ondeath ver 0.1 // Emmanuel Lusinchi / Sentur Signe // 09/22/2002 // // // Destroy placeable on death of creature with visual feedback // This works even if Chunking is on and your creature get chunked // (the script 'un-chunk' it!) // How to use: // GIVE EXACTLY THE SAME TAG TO YOUR CREATURE AND THE PLACEABLE // MAKE SURE YOUR PLACEABLE IS NOT 'STATIC' (but PLOT is fine) // Put this script on the on-death event of your creature. // void main {   object oKiller = GetLastKiller; string sTagToDestroy = GetTag(OBJECT_SELF); object oTarget = GetObjectByTag(sTagToDestroy); effect eFireLash = EffectBeam(VFX_BEAM_FIRE_LASH, OBJECT_SELF, BODY_NODE_CHEST); effect eGore = EffectVisualEffect(VFX_COM_HIT_NEGATIVE); effect eRez = EffectResurrection; float fTime = 4.0f; ApplyEffectToObject(DURATION_TYPE_INSTANT, eRez, OBJECT_SELF); SetIsDestroyable(FALSE, FALSE, FALSE); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(FALSE,FALSE), OBJECT_SELF); ApplyEffectToObject(DURATION_TYPE_INSTANT, eGore, OBJECT_SELF); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFireLash, oTarget,fTime+0.5f); SpeakString("Ug... I... die. How can it be?!"); AssignCommand(oKiller, DelayCommand(fTime, SetPlotFlag(oTarget, FALSE))); AssignCommand(oKiller, DelayCommand(fTime+0.5f, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(2000), oTarget))); DelayCommand(fTime, SetIsDestroyable(TRUE, FALSE, FALSE)); }