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

  1. //::///////////////////////////////////////////////
  2. //:: Pulse: Level Drain
  3. //:: NW_S1_PulsLvlDr
  4. //:: Copyright (c) 2001 Bioware Corp.
  5. //:://////////////////////////////////////////////
  6. /*
  7.     A wave of energy emanates from the creature which affects
  8.     all within 10ft.  Damage can be reduced by half for all
  9.     damaging variants.
  10. */
  11. //:://////////////////////////////////////////////
  12. //:: Created By: Preston Watamaniuk
  13. //:: Created On: May 14, 2000
  14. //:://////////////////////////////////////////////
  15. #include "NW_I0_SPELLS"
  16.  
  17. void main()
  18. {
  19.     //Declare major variables
  20.     effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
  21.     effect eHowl;
  22.     float fDelay;
  23.     int nHD = GetHitDice(OBJECT_SELF);
  24.     int nDC = 10 + nHD;
  25.     effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
  26.     ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetLocation(OBJECT_SELF));
  27.     object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
  28.     //Get first target in spell area
  29.     while(GetIsObjectValid(oTarget))
  30.     {
  31.         if(oTarget != OBJECT_SELF)
  32.         {
  33.             if(!GetIsReactionTypeFriendly(oTarget))
  34.             {
  35.                 fDelay = GetSpellEffectDelay(GetLocation(OBJECT_SELF), oTarget)/20;
  36.                 //Make a saving throw check
  37.                 if(!MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay))
  38.                 {
  39.                     //Apply the VFX impact and effects
  40.                     eHowl = EffectNegativeLevel(1);
  41.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
  42.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
  43.                 }
  44.             }
  45.         }
  46.         //Get next target in spell area
  47.         oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
  48.     }
  49. }
  50.  
  51.