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

  1. //::///////////////////////////////////////////////
  2. //:: Wild Shape
  3. //:: NW_S2_WildShape
  4. //:: Copyright (c) 2001 Bioware Corp.
  5. //:://////////////////////////////////////////////
  6. /*
  7.     Allows the Druid to change into animal forms.
  8. */
  9. //:://////////////////////////////////////////////
  10. //:: Created By: Preston Watamaniuk
  11. //:: Created On: Jan 22, 2002
  12. //:://////////////////////////////////////////////
  13.  
  14. void main()
  15. {
  16.     //Declare major variables
  17.     int nSpell = GetSpellId();
  18.     object oTarget = GetSpellTargetObject();
  19.     effect eVis = EffectVisualEffect(VFX_IMP_POLYMORPH);
  20.     effect ePoly;
  21.     int nPoly;
  22.     int nMetaMagic = GetMetaMagicFeat();
  23.     int nDuration = GetLevelByClass(CLASS_TYPE_DRUID);
  24.     //Enter Metamagic conditions
  25.     if (nMetaMagic == METAMAGIC_EXTEND)
  26.     {
  27.         nDuration = nDuration *2; //Duration is +100%
  28.     }
  29.  
  30.     //Determine Polymorph subradial type
  31.     if(nSpell == 401)
  32.     {
  33.         nPoly = POLYMORPH_TYPE_BROWN_BEAR;
  34.         if (nDuration >= 12)
  35.         {
  36.             nPoly = POLYMORPH_TYPE_DIRE_BROWN_BEAR;
  37.         }
  38.     }
  39.     else if (nSpell == 402)
  40.     {
  41.         nPoly = POLYMORPH_TYPE_PANTHER;
  42.         if (nDuration >= 12)
  43.         {
  44.             nPoly = POLYMORPH_TYPE_DIRE_PANTHER;
  45.         }
  46.     }
  47.     else if (nSpell == 403)
  48.     {
  49.         nPoly = POLYMORPH_TYPE_WOLF;
  50.         
  51.         if (nDuration >= 12)
  52.         {
  53.             nPoly = POLYMORPH_TYPE_DIRE_WOLF;
  54.         }
  55.     }
  56.     else if (nSpell == 404)
  57.     {
  58.         nPoly = POLYMORPH_TYPE_BOAR;
  59.         if (nDuration >= 12)
  60.         {
  61.             nPoly = POLYMORPH_TYPE_DIRE_BOAR;
  62.         }
  63.     }
  64.     else if (nSpell == 405)
  65.     {
  66.         nPoly = POLYMORPH_TYPE_BADGER;
  67.         if (nDuration >= 12)
  68.         {
  69.             nPoly = POLYMORPH_TYPE_DIRE_BADGER;
  70.         }
  71.     }
  72.     ePoly = EffectPolymorph(nPoly);
  73.     //Fire cast spell at event for the specified target
  74.     SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_WILD_SHAPE, FALSE));
  75.  
  76.     //Apply the VFX impact and effects
  77.     ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
  78.     ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePoly, OBJECT_SELF, HoursToSeconds(nDuration));
  79. }
  80.