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

  1. //::///////////////////////////////////////////////
  2. //:: Pulse: Disease
  3. //:: NW_S1_PulsDis
  4. //:: Copyright (c) 2001 Bioware Corp.
  5. //:://////////////////////////////////////////////
  6. /*
  7.     A wave of disease spreads out from the creature
  8.     and infects all those within 10ft
  9. */
  10. //:://////////////////////////////////////////////
  11. //:: Created By: Preston Watamaniuk
  12. //:: Created On: Aug 14, 2000
  13. //:://////////////////////////////////////////////
  14.  
  15. void main()
  16. {
  17.     //Declare major variables
  18.     int nDamage = d6(GetHitDice(OBJECT_SELF));
  19.     int nRacial = GetRacialType(OBJECT_SELF);
  20.     int nDisease;
  21.     float fDelay;
  22.     effect eDisease;
  23.     effect ePulse = EffectVisualEffect(266);
  24.     ApplyEffectAtLocation(DURATION_TYPE_INSTANT, ePulse, GetLocation(OBJECT_SELF));
  25.  
  26.     //Determine the disease type based on the Racial Type
  27.     switch (nRacial)
  28.     {
  29.         case RACIAL_TYPE_VERMIN:
  30.             nDisease = DISEASE_VERMIN_MADNESS;
  31.         break;
  32.         case RACIAL_TYPE_UNDEAD:
  33.             nDisease = DISEASE_FILTH_FEVER;
  34.         break;
  35.         case RACIAL_TYPE_OUTSIDER:
  36.             nDisease = DISEASE_DEMON_FEVER;
  37.         break;
  38.         case RACIAL_TYPE_MAGICAL_BEAST:
  39.             nDisease = DISEASE_SOLDIER_SHAKES;
  40.         break;
  41.         case RACIAL_TYPE_ABERRATION:
  42.             nDisease = DISEASE_BLINDING_SICKNESS;
  43.         break;
  44.         default:
  45.             nDisease = DISEASE_MINDFIRE;
  46.         break;
  47.     }
  48.     effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NATURE);
  49.     ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
  50.     //Get first target in spell area
  51.     object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
  52.     while(GetIsObjectValid(oTarget))
  53.     {
  54.         if(oTarget != OBJECT_SELF)
  55.         {
  56.             if(!GetIsReactionTypeFriendly(oTarget))
  57.             {
  58.                 //Fire cast spell at event for the specified target
  59.                 SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_DISEASE));
  60.                 //Determine effect delay
  61.                 fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
  62.                 eDisease = EffectDisease(nDisease);
  63.                 //Apply the VFX impact and effects
  64.                 DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDisease, oTarget));
  65.             }
  66.         }
  67.         //Get next target in spell area
  68.         oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF));
  69.     }
  70. }
  71.  
  72.  
  73.