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

  1. //::///////////////////////////////////////////////
  2. //:: Pulse: Holy
  3. //:: NW_S1_PulsHoly
  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.  Undead are damaged, allies are healed.
  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.     float fDelay;
  21.     effect eVis = EffectVisualEffect(VFX_IMP_HEALING_M);
  22.     effect eVis2 = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
  23.     effect eHowl;
  24.     int nHD = GetHitDice(OBJECT_SELF);
  25.     int nDC = 10 + nHD;
  26.     effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_HOLY);
  27.     ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
  28.     //Get first target in spell area
  29.     object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
  30.     while(GetIsObjectValid(oTarget))
  31.     {
  32.  
  33.         //Determine effect delay
  34.         fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
  35.         //Roll the amount to heal or damage
  36.         nDamage = d4(nHD);
  37.         //If the target is not undead
  38.         if (GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
  39.         {
  40.             //Make a faction check
  41.             if(oTarget != OBJECT_SELF)
  42.             {
  43.                 if(GetIsFriend(oTarget))
  44.                 {
  45.                     //Fire cast spell at event for the specified target
  46.                     SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_HOLY, FALSE));
  47.                     //Set heal effect
  48.                     eHowl = EffectHeal(nDamage);
  49.                     //Apply the VFX impact and effects
  50.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
  51.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
  52.                 }
  53.             }
  54.         }
  55.         else
  56.         {
  57.             if(!GetIsReactionTypeFriendly(oTarget))
  58.             {
  59.                 //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
  60.                 nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_DIVINE);
  61.                 //Set damage effect
  62.                 eHowl = EffectDamage(nDamage, DAMAGE_TYPE_DIVINE) ;
  63.                 if(nDamage > 0)
  64.                 {
  65.                     //Fire cast spell at event for the specified target
  66.                     SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_HOLY));
  67.                     //Apply the VFX impact and effects
  68.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget));
  69.                     DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
  70.                 }
  71.             }
  72.         }
  73.         //Get next target in spell area
  74.         oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
  75.     }
  76. }
  77.  
  78.