home *** CD-ROM | disk | FTP | other *** search
/ PC Zone 125 / DPPCZ0203B.7z / DPPCZ0203B.ISO / Demos / Neverwinter / data1.cab / override / nw_s1_gazedeath.nss < prev    next >
Text File  |  2002-09-10  |  2KB  |  49 lines

  1. //::///////////////////////////////////////////////
  2. //:: Gaze: Death
  3. //:: NW_S1_GazeDeath
  4. //:: Copyright (c) 2001 Bioware Corp.
  5. //:://////////////////////////////////////////////
  6. /*
  7.     Cone shape that affects all within the AoE if they
  8.     fail a Will Save.
  9. */
  10. //:://////////////////////////////////////////////
  11. //:: Created By: Preston Watamaniuk
  12. //:: Created On: May 9, 2001
  13. //:://////////////////////////////////////////////
  14. #include "NW_I0_SPELLS"
  15.  
  16. void main()
  17. {
  18.     //Declare major variables
  19.     int nHD = GetHitDice(OBJECT_SELF);
  20.     int nDuration = 1 + (nHD / 3);
  21.     int nDC = 10 + ( nHD / 2 );
  22.     location lTargetLocation = GetSpellTargetLocation();
  23.     object oTarget;
  24.     effect eGaze = EffectDeath();
  25.     effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
  26.  
  27.     //Get first target in spell area
  28.     oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
  29.     while(GetIsObjectValid(oTarget))
  30.     {
  31.         if(!GetIsReactionTypeFriendly(oTarget) || oTarget != OBJECT_SELF)
  32.         {
  33.             //Fire cast spell at event for the specified target
  34.             SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_GAZE_DEATH));
  35.             //Determine effect delay
  36.             float fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
  37.             if(!MySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, OBJECT_SELF, fDelay))
  38.             {
  39.                 //Apply the VFX impact and effects
  40.                 DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
  41.                 DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
  42.             }
  43.         }
  44.         //Get next target in spell area
  45.         oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
  46.     }
  47. }
  48.  
  49.