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

  1. //::///////////////////////////////////////////////
  2. //:: Pulse: Charisma 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 eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
  29.     effect eHowl;
  30.     effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
  31.     ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
  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.  
  41.                //Fire cast spell at event for the specified target
  42.                 SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_ABILITY_DRAIN_CHARISMA));
  43.                 //Determine effect delay
  44.                 fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
  45.                 //Make a saving throw check
  46.                 if(!/*FortSave*/MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay))
  47.                 {
  48.                     //Set the Ability mod and change to supernatural effect
  49.                     eHowl = EffectAbilityDecrease(ABILITY_CHARISMA, nDamage);
  50.                     eHowl = SupernaturalEffect(eHowl);
  51.                     //Apply the VFX impact and effects
  52.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget));
  53.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
  54.                 }
  55.             }
  56.         }
  57.         //Get first target in spell area
  58.         oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
  59.     }
  60. }
  61.  
  62.  
  63.