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

  1. //::///////////////////////////////////////////////
  2. //:: Stinking Cloud On Enter
  3. //:: NW_S1_Stink_A.nss
  4. //:: Copyright (c) 2001 Bioware Corp.
  5. //:://////////////////////////////////////////////
  6. /*
  7.     Those within the area of effect must make a
  8.     fortitude save or be dazed.
  9. */
  10. //:://////////////////////////////////////////////
  11. //:: Created By: Preston Watamaniuk
  12. //:: Created On: May 17, 2001
  13. //:://////////////////////////////////////////////
  14.  
  15. #include "NW_I0_SPELLS"    
  16. void main()
  17. {
  18.     //Declare major variables
  19.     effect eStink = EffectDazed();
  20.     effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
  21.     effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
  22.     effect eLink = EffectLinkEffects(eMind, eStink);
  23.     eLink = EffectLinkEffects(eLink, eDur);
  24.  
  25.     effect eVis = EffectVisualEffect(VFX_IMP_DAZED_S);
  26.     effect eFind;
  27.     object oTarget;
  28.     object oCreator;
  29.     float fDelay;
  30.     //Get the first object in the persistant area
  31.     oTarget = GetEnteringObject();
  32.     if(GetRacialType(oTarget) != RACIAL_TYPE_VERMIN)
  33.     {
  34.         if(GetIsEnemy(oTarget))
  35.         {
  36.             //Fire cast spell at event for the specified target
  37.             SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_STINKING_CLOUD));
  38.             //Make a Fort Save
  39.             if(!MySavingThrow(SAVING_THROW_FORT, oTarget, 14, SAVING_THROW_TYPE_POISON))
  40.             {
  41.                fDelay = GetRandomDelay(0.25, 1.0);
  42.                //Apply the VFX impact and linked effects
  43.                DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
  44.                DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2)));
  45.             }
  46.         }
  47.     }
  48. }
  49.