explode on death
CyrusJV
Member Posts: 36
Hi, I try to make a script that makes a creature explode (fireball) on death, and damaging anything close to it's corpse. I tried several times, without any luck. The idea is to fight the creature at long distance so you wont get hurt when it dies. Could some scripter please help me with this?
0
Comments
Try something like this in the OnDeathScript:
location lTarget = GetLocation(OBJECT_SELF);
effect eDamage, eVisual;
eDamage = EffectDamage(d6(3),DAMAGE_TYPE_FIRE);
eVisual = EffectVisualEffect(VFX_FNF_FIREBALL);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVisual, lTarget);
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget);
while (GetIsObjectValid(oTarget))
{if (oTarget != OBJECT_SELF && spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
DelayCommand(GetRandomDelay(0.4, 1.1), ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget));
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget);
}
DJ-WoW
void main()
{
location lTarget = GetLocation(OBJECT_SELF);
effect eDamage, eVisual;
eDamage = EffectDamage(d6(3),DAMAGE_TYPE_FIRE);
eVisual = EffectVisualEffect(VFX_FNF_FIREBALL);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVisual, lTarget);
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget);
while (GetIsObjectValid(oTarget))
{
if (oTarget != OBJECT_SELF && spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
DelayCommand(GetRandomDelay(0.4, 1.1), ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget));
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget);
}
}
But then the toolset gives error: "NO RIGHT BRACKET ON EXPRESSION" on line 11
Any idea what I do wrong?
Try adding this to the beginning of the script, before the void main() : its an include file that handles the spell scripting. I did not include that in the script. sorry.
#include "X0_I0_SPELLS"
void main()
DJ-WoW