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

  1. //::///////////////////////////////////////////////
  2. //:: Pulse: Lightning
  3. //:: NW_S0_CallLghtn.nss
  4. //:: Copyright (c) 2001 Bioware Corp.
  5. //:://////////////////////////////////////////////
  6. /*
  7.     All creatures within 10ft of the creature take
  8.     1d6 per HD up to 10d6
  9. */
  10. //:://////////////////////////////////////////////
  11. //:: Created By: Preston Watamaniuk
  12. //:: Created On: May 22, 2001
  13. //:://////////////////////////////////////////////
  14.  
  15. void main()
  16. {
  17.     //Declare major variables
  18.     int nDamage;
  19.     effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
  20.     effect eHowl = EffectVisualEffect(VFX_IMP_PULSE_COLD);
  21.     DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eHowl, GetLocation(OBJECT_SELF)));
  22.  
  23.     effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, OBJECT_SELF,BODY_NODE_CHEST);
  24.     float fDelay;
  25.     int nHD = GetHitDice(OBJECT_SELF);
  26.     int nDC = 10 + nHD;
  27.     //Get first target in spell area
  28.     object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
  29.     while(GetIsObjectValid(oTarget))
  30.     {
  31.         if(oTarget != OBJECT_SELF)
  32.         {
  33.             if(!GetIsReactionTypeFriendly(oTarget))
  34.             {
  35.                 //Fire cast spell at event for the specified target
  36.                 SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_LIGHTNING));
  37.                 //Roll the damage
  38.                 nDamage = d6(nHD);
  39.                 //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
  40.                 nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY);
  41.                 //Determine effect delay
  42.                 fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
  43.                 eHowl = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL);
  44.                 if(nDamage > 0)
  45.                 {
  46.                     //Apply the VFX impact and effects
  47.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
  48.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
  49.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oTarget, 0.5));
  50.                 }
  51.              }
  52.         }
  53.         //Get next target in spell area
  54.         oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
  55.     }
  56. }
  57.  
  58.