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

  1. //::///////////////////////////////////////////////
  2. //:: Blade Barrier: Heartbeat
  3. //:: NW_S0_BladeBarA.nss
  4. //:: Copyright (c) 2001 Bioware Corp.
  5. //:://////////////////////////////////////////////
  6. /*
  7.     Creates a wall 10m long and 2m thick of whirling
  8.     blades that hack and slice anything moving into
  9.     them.  Anything caught in the blades takes
  10.     2d6 per caster level.
  11. */
  12. //:://////////////////////////////////////////////
  13. //:: Created By: Preston Watamaniuk
  14. //:: Created On: July 20, 2001
  15. //:://////////////////////////////////////////////
  16.  
  17. #include "NW_I0_SPELLS"    
  18. void main()
  19. {
  20.     //Declare major variables
  21.     object oTarget;
  22.     effect eDam;
  23.     effect eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED);
  24.     int nMetaMagic = GetMetaMagicFeat();
  25.     int nLevel = GetCasterLevel(GetAreaOfEffectCreator());
  26.     //Make level check
  27.     if (nLevel > 20)
  28.     {
  29.         nLevel = 20;
  30.     }
  31.     oTarget = GetFirstInPersistentObject();
  32.     while(GetIsObjectValid(oTarget))
  33.     {
  34.         if(!GetIsReactionTypeFriendly(oTarget, GetAreaOfEffectCreator()))
  35.         {
  36.             //Fire spell cast at event
  37.             SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_BLADE_BARRIER));
  38.             //Make SR Check
  39.             if (!MyResistSpell(GetAreaOfEffectCreator(), oTarget) && oTarget != GetAreaOfEffectCreator())
  40.             {
  41.                 //Roll Damage
  42.                 int nDamage = d6(nLevel);
  43.                    //Enter Metamagic conditions
  44.                 if(nMetaMagic == METAMAGIC_MAXIMIZE)
  45.                 {
  46.                     nDamage = nLevel * 6;//Damage is at max
  47.                 }
  48.                 else if (nMetaMagic == METAMAGIC_EMPOWER)
  49.                 {
  50.                     nDamage = nDamage + (nDamage/2);
  51.                 }
  52.                 if(MySavingThrow(SAVING_THROW_REFLEX, oTarget, GetSpellSaveDC()))
  53.                 {
  54.                     nDamage = d6();
  55.                 }
  56.                 //Set damage effect
  57.                 eDam = EffectDamage(nDamage, DAMAGE_TYPE_SLASHING);
  58.                 //Apply damage and VFX
  59.                 ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
  60.                 ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
  61.             }
  62.         }
  63.         oTarget = GetNextInPersistentObject();
  64.      }
  65. }
  66.  
  67.