Author Topic: Fearless NPC is being feared?  (Read 338 times)

Legacy_Capellan

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Fearless NPC is being feared?
« on: November 03, 2010, 12:51:12 am »


               I have this script temporarily set up on a switch.  Two NPCs are in range of the it, one has the feat Fearless, the other does not.  I pulled the MySavingThrow function out of a dragon fear script, and from the comments say it should:

//   Returns: 0 if the saving throw roll failed
//   Returns: 1 if the saving throw roll succeeded
//   Returns: 2 if the target was immune to the save type specified

Shouldn't the Fearless feat cause it to return 2?  Right now when I run it, both NPCs are able to be affected by the fear if they fail the will save.  Thanks for any advise anyone has. '<img'>

---------------------------------

#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"

void main()
{
    object oUser = GetLastUsedBy();

    effect eFear = EffectFrightened();
    effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
    effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
    effect eLink = EffectLinkEffects(eFear, eMind);
    eLink = EffectLinkEffects(eLink, eDur);
    float fDelay;

    int nclass = GetLevelByclass(class_TYPE_FIGHTER, oUser);
    int nCharisma = GetAbilityModifier(ABILITY_CHARISMA, oUser);
    int nDC = 10 + nclass + nCharisma;

    object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetLocation(oUser));

    while (GetIsObjectValid(oTarget)) {

        if (oTarget == oUser) {

        } else {

            fDelay = GetRandomDelay();
            if (!MySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR, oUser, fDelay)) {

                fDelay = GetRandomDelay();
                DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, 10.0));

        }


      }

      oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetLocation(oUser));

    }

}
               
               

               
            

Legacy_Balduvard

  • Full Member
  • ***
  • Posts: 126
  • Karma: +0/-0
Fearless NPC is being feared?
« Reply #1 on: November 03, 2010, 12:53:50 am »


               Fearless does not grant immunity to fear effects, it only grants a +2 bonus on saving throws against fear effects and spells.



If your NPC had the feat Aura of Courage, the script would return 2.
               
               

               
            

Legacy_Capellan

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Fearless NPC is being feared?
« Reply #2 on: November 03, 2010, 12:58:08 am »


               Whoops, I guess I was taking the feat name too literally and wasn't paying attention to its effects.  Thanks. '<img'>