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

  1. //::///////////////////////////////////////////////
  2. //:: Pulse: Cold
  3. //:: NW_S1_PulsCold
  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.  
  16. void main()
  17. {
  18.     //Declare major variables
  19.     int nDamage;
  20.     effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
  21.     effect eHowl;
  22.     float fDelay;
  23.     int nHD = GetHitDice(OBJECT_SELF);
  24.     int nDC = 10 + nHD;
  25.     effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_COLD);
  26.     ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
  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_COLD));
  37.                 //Roll the damage
  38.                 nDamage = d6(GetHitDice(OBJECT_SELF));
  39.                 //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
  40.                 nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_COLD);
  41.                 //Determine effect delay
  42.                 fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
  43.                 eHowl = EffectDamage(nDamage, DAMAGE_TYPE_COLD);
  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.                 }
  50.             }
  51.         }
  52.         //Get next target in spell area
  53.         oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
  54.     }
  55. }
  56.  
  57.  
  58.