Difference between revisions of "EffectCurse"

From NWN Lexicon
Jump to: navigation, search
(Created page with " =EffectCurse(int, int, int, int, int, int)= Create a Curse effect. effect  EffectCurse(      int  nStrMod = 1,     [[int | i...")
 
Line 7: Line 7:
 
Create a Curse effect.
 
Create a Curse effect.
  
 +
<nwscript>
 
  [[effect | effect ]] EffectCurse(
 
  [[effect | effect ]] EffectCurse(
 
      [[int | int ]] nStrMod = 1,
 
      [[int | int ]] nStrMod = 1,
Line 15: Line 16:
 
      [[int | int ]] nChaMod = 1
 
      [[int | int ]] nChaMod = 1
 
  );
 
  );
 +
</nwscript>
  
 
====Parameters====
 
====Parameters====
Line 62: Line 64:
 
====Example====
 
====Example====
  
<font color="#007f00">// Sample code for applying a Curse of 1 of every stat to a target
+
<nwscript>
  </font>
+
// Sample code for applying a Curse of 1 of every stat 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> eCurse = EffectCurse(<font color="#7f007f">1</font>, <font color="#7f007f">1</font>, <font color="#7f007f">1</font>, <font color="#7f007f">1</font>, <font color="#7f007f">1</font>, <font color="#7f007f">1</font>);
+
    effect eCurse = EffectCurse(1, 1, 1, 1, 1, 1);
 
   
 
   
     <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_REDUCE_ABILITY_SCORE);
+
    effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
 
   
 
   
     <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, eCurse, oTarget);
+
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCurse, oTarget);
 
  }
 
  }
 +
</nwscript>
  
 
====See Also====
 
====See Also====

Revision as of 21:34, 25 August 2012



EffectCurse(int, int, int, int, int, int)

Create a Curse effect.

 [[effect | effect ]] EffectCurse(
     [[int | int ]] nStrMod = 1,
     [[int | int ]] nDexMod = 1,
     [[int | int ]] nConMod = 1,
     [[int | int ]] nIntMod = 1,
     [[int | int ]] nWisMod = 1,
     [[int | int ]] nChaMod = 1
 );

Parameters

nStrMod

strength modifier (Default: 1)

nDexMod

dexterity modifier (Default: 1)

nConMod

constitution modifier (Default: 1)

nIntMod

intelligence modifier (Default: 1)

nWisMod

wisdom modifier (Default: 1)

nChaMod

charisma modifier (Default: 1)


Description

Returns a new effect object that when applied to a target will reduce their ability scores by the amounts given in the parameters.

It is unknown (although likely) that curses do not stack, or at least the peanlties from more then 1 curse together, as how EffectAbilityDecrease.

A value of 0 should mean just no decrease in that ability. If all are 0, it is likely to return an invalid effect.

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



Remarks

Modifiers should be given in positive amounts, the script will apply them negatively.

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 Curse of 1 of every stat to a target
 
 void main()
 {
     // This is the Object to apply the effect to.
     object oTarget = OBJECT_SELF;
 
     // Create the effect to apply
     effect eCurse = EffectCurse(1, 1, 1, 1, 1, 1);
 
     // 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_REDUCE_ABILITY_SCORE);
 
     // Apply the visual effect to the target
     ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
     // Apply the effect to the object   
     ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCurse, oTarget);
 }

See Also



 author: John Shuell, editor: Jasperre, additional contributor(s): Jasperre