KillAndExplode(object, int)

Kill and leave an exploding corpse.

void KillAndExplode(
    object oVictim,
    int nSpell = SPELL_FIREBALL
);

Parameters

oVictim

The object to slaughter.

nSpell

The SPELL_* to cast. (Default: SPELL_FIREBALL)


Description

Kill and leave an exploding corpse.

Despite the name, can be used in an OnDeath script; it won't kill the victim twice.

Any spell can be used.



Remarks

This function starts off with a call to KillAndReplaceDecorative. Which will kill oVictim and leave a purely decorative corpse (no name, not raiseable).

Next up, there is a 2 second delay before SetObjectIsDestroyable calling on oVictim. Which sets them to be destroyable.

Another 2 second pause then ExplodeObject is called and it is all over for oVictim as they explode gloriously thanks to the work of nSpell.


Requirements

#include "x0_i0_corpses"


Version

???

See Also

functions:  KillAndReplaceDecay | KillAndReplaceDecorative | KillAndReplaceLootable | KillAndReplaceRaiseable | KillAndReplaceSelectable
constants:  SPELL_*
categories:  Action on Object Functions


author: Mistress