1. SPS Accounts:
    Do you find yourself coming back time after time? Do you appreciate the ongoing hard work to keep this community focused and successful in its mission? Please consider supporting us by upgrading to an SPS Account. Besides the warm and fuzzy feeling that comes from supporting a good cause, you'll also get a significant number of ever-expanding perks and benefits on the site and the forums. Click here to find out more.
    Dismiss Notice
Dismiss Notice
You are currently viewing Boards o' Magick as a guest, but you can register an account here. Registration is fast, easy and free. Once registered you will have access to search the forums, create and respond to threads, PM other members, upload screenshots and access many other features unavailable to guests.

BoM cultivates a friendly and welcoming atmosphere. We have been aiming for quality over quantity with our forums from their inception, and believe that this distinction is truly tangible and valued by our members. We'd love to have you join us today!

(If you have any problems with the registration process or your account login, please contact us. If you've forgotten your username or password, click here.)

Cast Chain Lightning on Death

Discussion in 'Neverwinter Nights (Classic)' started by Ignatiuz, Feb 3, 2004.

  1. Ignatiuz Gems: 1/31
    Latest gem: Turquoise


    Joined:
    Jul 30, 2002
    Messages:
    21
    Likes Received:
    0
    [​IMG] Hi, I was thinking of making one of my creature be able to cast chain lightning so as to cause some grief to whoever that murder it.

    With my little scripting experience, I came up with this:

    void main()
    {
    object oTarget = GetLastKiller();
    ActionCastSpellAtObject(SPELL_CHAIN_LIGHTNING, oTarget, METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);
    }

    I placed the script in the creature's onDeath.
    Obviously it's not working.
    Can anyone advise?
     
  2. NeoXro Gems: 1/31
    Latest gem: Turquoise


    Joined:
    Feb 1, 2004
    Messages:
    22
    Likes Received:
    0
    If your creature is dead, he can't cast spells, right? Make something else cast the spell at the killer... or use ApplyEffectToObject...
     
  3. ArtEChoke Gems: 17/31
    Latest gem: Star Diopside


    Joined:
    Jul 12, 2001
    Messages:
    916
    Likes Received:
    0
    I'm at work right now, so I can't be too specific... but I believe "ActionCastSpellAtObject" actually causes the dying critter to try to cast the spell, and as NeoXro said, if its dead, it ain't casting.

    However, there is another function (looking it up now, will edit shortly.) which will trigger a spell effect without it needing to be cast (so to speak..).

    EDIT: hmm I didn't come up with much, I'm not sure.. but you might be able to use ApplyEffectToObject, wish I had the toolset in front of me...
     
  4. fade Gems: 13/31
    Latest gem: Ziose


    Joined:
    May 4, 2003
    Messages:
    544
    Likes Received:
    0
    You could use the type of script that prevent certain characters from dieing before you talk to them. Have that kick in, have the creature cast chain lightning and then proceed to kill it.
     
  5. NeoXro Gems: 1/31
    Latest gem: Turquoise


    Joined:
    Feb 1, 2004
    Messages:
    22
    Likes Received:
    0
    That would have a totally different effect... what he wants is a contingency to go off on death... I would suggest to use ApplyEffectToObject targeting every PC in the area, then use VFX_BEAM_LIGHTNING effect on everyone and apply electrical damage (include save throw possibilities if you want)
     
  6. Alavin

    Alavin If I wanted your view, I'd read your entrails Veteran

    Joined:
    Aug 26, 2003
    Messages:
    930
    Likes Received:
    0
    Alternatively, use the CreateObject script to create a custom creature with no graphics on it in the OnDeath script. To define the location, use this:

    location lSpawn = GetLocation(OBJECT_SELF);

    then use this location to create the creature. In it's OnSpawn script, get it to cast Chain Lightning. This is a little more complicated than the other suggestions, but follows exactly what you wanted.
     
  7. Ignatiuz Gems: 1/31
    Latest gem: Turquoise


    Joined:
    Jul 30, 2002
    Messages:
    21
    Likes Received:
    0
    [​IMG] Thanks for all the advices!
    I'll go try out the solutions.
    You guys rocks.
     
Sorcerer's Place is a project run entirely by fans and for fans. Maintaining Sorcerer's Place and a stable environment for all our hosted sites requires a substantial amount of our time and funds on a regular basis, so please consider supporting us to keep the site up & running smoothly. Thank you!

Sorcerers.net is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to products on amazon.com, amazon.ca and amazon.co.uk. Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.