I’m working on trying to create a goblin “suicide bomber.” The basic idea is that he’s a weak fighter and easily killed. But when he dies he explodes and does massive damage in the area.
So I want to use an OnDeath script that casts a Fireball spell at his location.
I downloaded the module. But when I t tried to open it in the toolset I got an error message because it seems to be tied to a previous version of the CEP.
Could you just post a copy of the script in question? Thanks.
The creature has a local integer “explode” set to 1.
The following lines are added to the end of the standard OnDeath script nw_c2_default7:
if (GetLocalInt(OBJECT_SELF, "explode"))
bh_explode();
The function definition is
// Explode on death
void bh_explode(int nVFX = VFX_FNF_FIREBALL)
{
//Goes in OnDeath for the creature
//Script: xph_dth_bozak
//Author: Jesse Williams (Xepherys)
//Version: v0.2, 2002-06-21
//Usage: Caller explodes and damages nearby objects for d6 fire damage
//Notes: modified version of cal_explode by Albert Shih.
// Attempt at true representation of Bozak Draconian Death Throes
DestroyObject(OBJECT_SELF);
location lSelf = GetLocation(OBJECT_SELF);
object oChar = GetFirstObjectInShape(SHAPE_SPHERE, 5.0, lSelf);
int nDamage;
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(nVFX), lSelf, 1.5f);
do {
if (oChar != OBJECT_SELF)
if (!GetPlotFlag(oChar))
if (!GetIsDead(oChar))
{
location lChar = GetLocation(oChar);
nDamage = d6(1);
ApplyEffectToObject( DURATION_TYPE_INSTANT,
EffectDamage(nDamage, DAMAGE_TYPE_FIRE), oChar);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
EffectVisualEffect(VFX_FNF_FIREBALL), lChar, 1.5f);
}
} while ((oChar = GetNextObjectInShape(SHAPE_SPHERE, 10.0, lSelf))
!= OBJECT_INVALID);
}
I left comments in that credit earlier authors.
Beware of placing too many exploding creatures within the explosion zone - the chain reaction (as one explosion kills the next exploder) is quite amusing, but pretty soon the engine has a nervous breakdown.
I finally got a chance to sit down and work on this. I tested both Proleric’s script and Mmat’s suggestion of the Balor death script.
I decided to go with the Balor script. The reasons being:
1 - simplicity, because all I had to do was copy the Balor death script and lower the damage number.
2 - I wanted to include the Dodge bonus / magic resistance factor.
Thanks for all the help! It was really appreciated!