Page 1 of 1

Exploding Spawns

Posted: Sat Aug 05, 2006 3:05 am
by TripleAught
I pulled something from the NWLexicon, and since I know little about scripting, I thought I'd post here to let the experts handle it.

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));
  }
}

Posted: Sat Aug 05, 2006 3:55 am
by dougnoel
You can remove the plot bit. I would suggest just yanking the fireball spell code. You can change the damage type to whatever you want (divine if you want it to bypass all DR) and you're all set.

Posted: Sat Aug 05, 2006 4:07 am
by chilingsworth
umm... :shock:

*cringes in terror and is glad he tends to avoid combat*


*edit* serriously, this sounds like s cool idea, even if it is ebul. :)

Posted: Sat Aug 05, 2006 5:41 am
by jordenk
i was wondering how long itd take for this to come up.... haha guess ill just have to watch out for fat montsers....

Posted: Sun Aug 06, 2006 4:27 pm
by downsystem
There is a demon or devil on the elysia server that explodes when you kill it, or at least their was at one time. Its been some time since i went to fight it.

Posted: Sun Aug 06, 2006 5:58 pm
by Demonseed
downsystem wrote:There is a demon or devil on the elysia server that explodes when you kill it, or at least their was at one time. Its been some time since i went to fight it.
That would be a Balor. They all explode when they die

Posted: Sun Aug 06, 2006 6:10 pm
by Darkfire
on death epic hell ball :D

Thats one hell of an explosion :P :twisted:

Posted: Sun Aug 06, 2006 6:10 pm
by PsiOmega
It's all in the Balor (Lords) OnDead script named nw_s3_balordeth.nss.

The comments mentions cleaning un-droppable items, variables, etc. so I think it's worth a look.