Skip to content

explode on death

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?

Comments

  • DJ_WoWDJ_WoW Member Posts: 48
    Gooday to ya,

    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
  • CyrusJVCyrusJV Member Posts: 36
    Hi, thanks for the reply. I tried this:

    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?
  • DJ_WoWDJ_WoW Member Posts: 48
    Gooday to ya

    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

  • CyrusJVCyrusJV Member Posts: 36
    Gooday to ya too. Its working!!! Thanks, my module is saved now.
Sign In or Register to comment.