I want to create spawns that when they are damaged, they explode. Easy enough. But I want the explosion to be damaging to an area around them.
Gurky was mentioning that there is a spawn_explode function that you can use in the DM client, is that something that could be built into a script?
Here's what I pulled out of the Lexicon, can someone show me what I would need to add for the damage part. And I don't think that I need the Plot bit, can I remove those pieces?
Code: Select all
// Kill a creature in an explosion of gore.
//
// oVictim is the target of the effect
// If bAffectPlot is TRUE, then the script will work on
// creatures with the plot flag set.
//
// Written by Celowin
// Last Updated: 7/23/02
//
void BloodExplode(object oVictim = OBJECT_SELF, int bAffectPlot = FALSE)
{
if ((!GetPlotFlag(oVictim) || bAffectPlot) && (GetObjectType(oVictim) == OBJECT_TYPE_CREATURE))
// If the victim doesn't have the plot flag, it works
// If bAffectPlot is TRUE, it works
// Only works on creatures
{
// Create the effects: the explosion, and the death
effect eBloodShower = EffectVisualEffect(VFX_COM_CHUNK_RED_LARGE);
effect eDeath = EffectDeath();
// Make sure the victim can be killed
SetPlotFlag(oVictim, FALSE);
// Apply the effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oVictim);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eBloodShower, GetLocation(oVictim));
}
}