Difference between revisions of "EffectStunned"

From NWN Lexicon
Jump to: navigation, search
(Created page with " =EffectStunned()= Returns a Stunned effect. effect  EffectStunned(); ====Description==== Create a Stun effect. <br /><br /> This is a mind-e...")
 
Line 7: Line 7:
 
Returns a Stunned effect.
 
Returns a Stunned effect.
  
 +
<nwscript>
 
  [[effect | effect ]] EffectStunned();
 
  [[effect | effect ]] EffectStunned();
 +
</nwscript>
  
 
====Description====
 
====Description====
Line 27: Line 29:
 
====Example====
 
====Example====
  
<font color="#007f00">// Sample code for applying a stunning effect to a target
+
<nwscript>
  </font>
+
// Sample code for applying a stunning effect to a target
  <font color="#0000ff">void</font> main()
+
   
 +
  void main()
 
  {
 
  {
     <font color="#007f00">// This is the Object to apply the effect to.
+
     // This is the Object to apply the effect to.
</font>    <font color="#0000ff">object</font> oTarget = <font color="#0000ff">OBJECT_SELF</font>;
+
    object oTarget = OBJECT_SELF;
 
   
 
   
     <font color="#007f00">// Create the effect to apply
+
     // Create the effect to apply
</font>    <font color="#0000ff">effect</font> eStun = EffectStunned();
+
    effect eStun = EffectStunned();
 
   
 
   
     <font color="#007f00">// Create the visual portion of the effect. This is instantly
+
     // Create the visual portion of the effect. This is instantly
</font>    <font color="#007f00">// applied and not persistant with wether or not we have the
+
    // applied and not persistant with wether or not we have the
</font>    <font color="#007f00">// above effect.
+
    // above effect.
</font>    <font color="#0000ff">effect</font> eVis = EffectVisualEffect(VFX_IMP_STUN);
+
    effect eVis = EffectVisualEffect(VFX_IMP_STUN);
 
   
 
   
     <font color="#007f00">// Apply the visual effect to the target
+
     // Apply the visual effect to the target
</font>    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
+
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
     <font color="#007f00">// Apply the effect to the object   
+
     // Apply the effect to the object   
</font>    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eStun, oTarget);
+
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eStun, oTarget);
 
  }
 
  }
 +
</nwscript>
  
 
====See Also====
 
====See Also====

Revision as of 21:35, 25 August 2012



EffectStunned()

Returns a Stunned effect.

Description

Create a Stun effect.

This is a mind-effecting effect, and so immunity to mind effects prevents this from working. Stunning basically makes the mind of the target stop working, stunning what they are doing - they lose 2 dexterity, have -2 AC, and they can take no action whatsoever and are prone to attacks.

However, Andrei's testing says that they lose all thier dexterity bonus to thier AC (not displayed) but no -2 to AC.

The target this effect is applied to must be a creature for it to work. The target this effect is applied to must be a creature for it to work.



Remarks

Stunning keeps a creature in one place. They cannot move - even functions like JumpToLocation() will fail, as if they were petrified or paralyzed.

Stunning can be countered with Immunity: Stun, and Immunity: Mind Spells.

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 seperately via. looping valid effects on the target (GetFirst/NextEffect()). See the Effect Tutorial for more details.


Version

1.62

Example

 // Sample code for applying a stunning effect to a target
 
 void main()
 {
     // This is the Object to apply the effect to.
     object oTarget = OBJECT_SELF;
 
     // Create the effect to apply
     effect eStun = EffectStunned();
 
     // Create the visual portion of the effect. This is instantly
     // applied and not persistant with wether or not we have the
     // above effect.
     effect eVis = EffectVisualEffect(VFX_IMP_STUN);
 
     // Apply the visual effect to the target
     ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
     // Apply the effect to the object   
     ApplyEffectToObject(DURATION_TYPE_PERMANENT, eStun, oTarget);
 }

See Also

functions: 

ApplyEffectToObject



 author: Brett Lathrope, editor: Jasperre, additional contributor(s): Jasperre, Andrei Hajdukewycz