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

  1. //::///////////////////////////////////////////////
  2. //:: Pulse: Strength Drain
  3. //:: NW_S1_PulsDeath
  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.     int nDamage = GetHitDice(OBJECT_SELF)/5;
  21.     if (nDamage == 0)
  22.     {
  23.         nDamage = 1;
  24.     }
  25.     float fDelay;
  26.     int nHD = GetHitDice(OBJECT_SELF);
  27.     int nDC = 10 + nHD;
  28.     effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
  29.     ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
  30.     effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
  31.     effect eHowl;
  32.     //Get first target in spell area
  33.     object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
  34.     while(GetIsObjectValid(oTarget))
  35.     {
  36.         if(oTarget != OBJECT_SELF)
  37.         {
  38.             if(!GetIsReactionTypeFriendly(oTarget))
  39.             {
  40.                 //Fire cast spell at event for the specified target
  41.                 SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_ABILITY_DRAIN_STRENGTH));
  42.                 //Determine effect delay
  43.                 fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
  44.                 //Make a saving throw check
  45.                 if(!/*FortSave*/MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay))
  46.                 {
  47.                     //Set the Ability mod and change to supernatural effect
  48.                     eHowl = EffectAbilityDecrease(ABILITY_STRENGTH, nDamage);
  49.                     eHowl = SupernaturalEffect(eHowl);
  50.                     //Apply the VFX impact and effects
  51.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
  52.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
  53.                 }
  54.             }
  55.         }
  56.         //Get first target in spell area
  57.         oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
  58.     }
  59. }
  60.  
  61.