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

  1. //::///////////////////////////////////////////////
  2. //:: Slow
  3. //:: NW_S0_Slow.nss
  4. //:: Copyright (c) 2001 Bioware Corp.
  5. //:://////////////////////////////////////////////
  6. /*
  7.     Character can take only one partial action
  8.     per round.
  9. */
  10. //:://////////////////////////////////////////////
  11. //:: Created By: Preston Watamaniuk
  12. //:: Created On: May 29, 2001
  13. //:://////////////////////////////////////////////
  14. //:: VFX Pass By: Preston W, On: June 25, 2001
  15.  
  16. #include "NW_I0_SPELLS"    
  17. void main()
  18. {
  19.     //Declare major variables
  20.     object oTarget;
  21.     effect eSlow = EffectSlow();
  22.     effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
  23.     effect eLink = EffectLinkEffects(eSlow, eDur);
  24.  
  25.     effect eVis = EffectVisualEffect(VFX_IMP_SLOW);
  26.     effect eImpact = EffectVisualEffect(VFX_FNF_LOS_NORMAL_30);
  27.     int nMetaMagic = GetMetaMagicFeat();
  28.     //Determine spell duration as an integer for later conversion to Rounds, Turns or Hours.
  29.     int nDuration = GetCasterLevel(OBJECT_SELF);
  30.     int nLevel = nDuration;
  31.     int nCount = 0;
  32.     location lSpell = GetSpellTargetLocation();
  33.  
  34.     //Metamagic check for extend
  35.     if (nMetaMagic == METAMAGIC_EXTEND)
  36.     {
  37.         nDuration = nDuration *2;    //Duration is +100%
  38.     }
  39.     ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetSpellTargetLocation());
  40.     //Declare the spell shape, size and the location.  Capture the first target object in the shape.
  41.     oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lSpell);
  42.     //Cycle through the targets within the spell shape until an invalid object is captured or the number of
  43.     //targets affected is equal to the caster level.
  44.     while(GetIsObjectValid(oTarget) || nCount == nLevel)
  45.     {
  46.         if(!GetIsFriend(oTarget))
  47.         {
  48.             //Fire cast spell at event for the specified target
  49.             SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SLOW));
  50.             if (!MyResistSpell(OBJECT_SELF, oTarget) && !/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC()))
  51.             {
  52.                 //Apply the slow effect and VFX impact
  53.                 ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
  54.                 ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
  55.                 //Count the number of creatures affected
  56.                 nCount++;
  57.             }
  58.         }
  59.         //Select the next target within the spell shape.
  60.         oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lSpell);
  61.     }
  62. }
  63.  
  64.