EffectDeaf()

From NWN Lexicon
Jump to: navigation, search

Returns a new effect object.

Description

Create a Deaf effect.

The game has these direct effects in NWN:

  • 20% arcane spell failure (yes, affecting Stomatic spells, not Verbal spells, and not affecting divine casters)
  • Listen checks fail

There is none of these effects:

  • Verbal components having 20% spell failure
  • Immunity to sonic damage or other similar things

Deafness will not stack, and only 20% spell failure will apply - of course, this is obviously the case, you cannot be made more deaf!

The target this effect is applied to must be a creature for it to work. This effect should not be applied instantly, only temporarily or permanently.


Remarks

Deafness is specifically for the effects above, no sounds are not heard by the PC (which would be cool if they were not heard!). There is in fact no real way to simulate this except possibly in singleplayer by turning off all ambient sounds, even then player generated sounds still play.

The PC can also still hear things spoken normally by PC's around them. Obviously, it is a game, and taking away that functionality for one effect would never be a good idea.

Effect functions are Constructors, which are special methods that help construct effect "objects". You can declare and link effects, and apply them using an ApplyEffectToObject() Command. Once applied, each effect can be got separately via looping valid effects on the target (GetFirst/NextEffect()). See the Effect Tutorial for more details.


Effect Breakdown

NWN:EE fixes the listen checks still working, so deafness sort of has some benefit now; for instance previously if you were invisible you could be heard (within a short distance) making you appear. If deaf you now no longer can even hear them, and they can run around you all day and you'll be fully invisible.

There are no integers set to get with GetEffectInteger or similar, since the two real effects are applied as "internal" effects:

  • It will set an internal state of "~AISTATE_CREATURE_USE_EARS" which presumably stops the listen checks
  • It will also set a 20% arcane spell failure (which we cannot set using a script effect)

Plus an icon will be applied.


Version

NWN:EE has the patch note: "EffectDeaf() should now work properly for perception."

Example

// Sample code for applying deafness to a target
 
void main()
{
    // This is the Object to apply the effect to.
    object oTarget = OBJECT_SELF;
 
    // Create the effect to apply
    effect eDeaf = EffectDeaf();
 
    // Create the visual portion of the effect. This is instantly
    // applied and not persistent with whether or not we have the
    // above effect.
    effect eVis = EffectVisualEffect(VFX_IMP_BLIND_DEAF_M);
 
    // Apply the visual effect to the target
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
    // Apply the effect to the object   
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDeaf, oTarget);
}

See Also



 author: Michael Nork, editor: Jasperre, additional contributor(s): Jasperre