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...")
 
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{DISPLAYTITLE:EffectCurse(int, int, int, int, int, int)}}__NOTOC__
 +
Create a Curse effect.
 +
<nwscript>
 +
effect EffectCurse(
 +
    int nStrMod = 1,
 +
    int nDexMod = 1,
 +
    int nConMod = 1,
 +
    int nIntMod = 1,
 +
    int nWisMod = 1,
 +
    int nChaMod = 1
 +
);
 +
</nwscript>
  
 +
====Parameters====
  
 +
;nStrMod
 +
:strength penalty modifier (Default: 1)
  
 +
;nDexMod
 +
:dexterity penalty modifier (Default: 1)
  
=EffectCurse(int, int, int, int, int, int)=
+
;nConMod
 +
:constitution penalty modifier (Default: 1)
  
Create a Curse effect.
+
;nIntMod
 +
:intelligence penalty modifier (Default: 1)
  
[[effect | effect ]] EffectCurse(
+
;nWisMod
    [[int | int ]] nStrMod = 1,
+
:wisdom penalty modifier (Default: 1)
    [[int | int ]] nDexMod = 1,
 
    [[int | int ]] nConMod = 1,
 
    [[int | int ]] nIntMod = 1,
 
    [[int | int ]] nWisMod = 1,
 
    [[int | int ]] nChaMod = 1
 
);
 
  
====Parameters====
+
;nChaMod
 +
:charisma penalty modifier (Default: 1)
  
''nStrMod''
+
====Description====
  
strength modifier (Default: 1)
+
Returns a new effect object that when applied to a target will reduce their ability scores by the amounts given in the parameters.
  
''nDexMod''
+
A value of 0 means no decrease in that ability. So you can have a curse that only affects particular statistics if required.
  
dexterity modifier (Default: 1)
+
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.
  
''nConMod''
+
====Remarks====
  
constitution modifier (Default: 1)
+
Modifiers should be given in positive amounts, the script will apply them negatively, similar to [[EffectAbilityDecrease]].
  
''nIntMod''
+
Multiple applications of curse stacks and is essentially lots of ability decreases bundled up, see Effect Breakdown below for details.
  
intelligence modifier (Default: 1)
+
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|Effect Tutorial]] for more details.
  
''nWisMod''
+
====Effect Breakdown====
  
wisdom modifier (Default: 1)
+
This essentially creates 6 internally only accessible [[EffectAbilityDecrease]] effects, which share identical behaviour to them in regards to "stats capped at 3". This means you also can't put a negative value in to get a positive result, it caps at lowest of 1. It also means if you have [[immunity_type|IMMUNITY_TYPE_ABILITY_DECREASE]] at the point the curse is applied nothing happens (but the curse icon will still appear, if you lose the stat immunity nothing will happen either).
  
''nChaMod''
+
Since it hides the ability decreases internally there is no effect icon for ability decrease, just the curse icon.
  
charisma modifier (Default: 1)
+
Therefore [[GetEffectInteger]] may not truly accurately say what the decreases are - only the intended decreases not the actual ones. For instance if Strength is already at 3, and curse is meant to decrease it by 1 more, it will instead not decrease strength at all and if that strength is returned to normal it won't have any decrease applied from the curse.
  
<br />
+
If you use '''EffectCurse(0, 0, 0, 0, 0, 0);''' it will still apply (unless the creature has [[immunity_type|IMMUNITY_TYPE_CURSED]]) but essentially do nothing to stats except have a cool icon. This can be useful perhaps for displaying the PC has a cursed item equipped or some other geas or plot related curse instead of just ability changes.
  
====Description====
+
Most curses in Bioware spells are applied as [[SupernaturalEffect]], but they don't have to be - the effect isn't inherently defensive against [[EffectDispelMagicAll]]. Nothing other than this function EffectCurse applies curses in the engine (ie no On Hit effects) so it's entirely created by scripts.
  
Returns a new effect object that when applied to a target will reduce their ability scores by the amounts given in the parameters. <br /><br /> It is unknown (although likely) that curses do not stack, or at least the peanlties from more then 1 curse together, as how EffectAbilityDecrease. <br /><br /> A value of 0 should mean just no decrease in that ability. If all are 0, it is likely to return an invalid effect. <br /><br /> 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.
+
{| class="wikitable padding-5" border="1"
 
+
|-
<br /><br />
+
! style="text-align: left;" | nIndex
 
+
! style="text-align: left;" | Parameter Value
====Remarks====
+
! style="text-align: left;" class="unsortable" | Description and Notes
 +
|-
 +
! scope="row" colspan="3" style="text-align: left;" | [[GetEffectInteger]]
 +
|-
 +
| 0 || nStrMod || Amount to reduce strength by, or 0 for no change.
 +
|-
 +
| 1 || nDexMod || Amount to reduce dexterity by, or 0 for no change.
 +
|-
 +
| 2 || nConMod || Amount to reduce constitution by, or 0 for no change.
 +
|-
 +
| 3 || nIntMod || Amount to reduce intelligence by, or 0 for no change.
 +
|-
 +
| 4 || nWisMod || Amount to reduce wisdom by, or 0 for no change.
 +
|-
 +
| 5 || nChaMod || Amount to reduce charisma by, or 0 for no change.
 +
|}
  
Modifiers should be given in positive amounts, the script will apply them negatively. <br /><br /> 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.
+
====Known Bugs====
  
<br />
+
It shares remarks/bugs with [[EffectAbilityDecrease]] where larger ability decreases are capped, but weirdly are not if there is enough "space" before it gets to the minimum value of 3.
  
 
====Version====
 
====Version====
Line 62: Line 91:
 
====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.
+
{
</font>    <font color="#0000ff">object</font> oTarget = <font color="#0000ff">OBJECT_SELF</font>;
+
    // This is the Object to apply the effect to.
+
    object oTarget = OBJECT_SELF;
    <font color="#007f00">// 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>);
+
    // Create the effect to apply
+
    effect eCurse = EffectCurse(1, 1, 1, 1, 1, 1);
    <font color="#007f00">// 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
+
    // Create the visual portion of the effect. This is instantly
</font>    <font color="#007f00">// above effect.
+
    // applied and not persistent with whether or not we have the
</font>    <font color="#0000ff">effect</font> eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
+
    // above effect.
+
    effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
    <font color="#007f00">// Apply the visual effect to the target
+
 
</font>    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
+
    // Apply the visual effect to the target
    <font color="#007f00">// Apply the effect to the object   
+
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
</font>    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCurse, oTarget);
+
    // Apply the effect to the object   
}
+
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCurse, oTarget);
 +
}
 +
</nwscript>
  
 
====See Also====
 
====See Also====
  
 
{| class="seealso"
 
{| class="seealso"
|}
+
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 +
|[[  EffectAbilityDecrease]]
 +
|-
 +
| width="1px" align="right" valign="top" | <font color="gray">constants: </font>
 +
|[[ ability | ABILITY_* Constants  ]]
 +
|}<br />
  
<br />
 
 
----
 
----
 
<font color="gray">  author: John Shuell, editor: Jasperre, additional contributor(s): Jasperre</font><br />  <br />
 
<font color="gray">  author: John Shuell, editor: Jasperre, additional contributor(s): Jasperre</font><br />  <br />
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Effects_Functions]]
 
[[Category:Effects_Functions]]

Latest revision as of 17:34, 25 February 2021

Create a Curse effect.

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

Parameters

nStrMod
strength penalty modifier (Default: 1)
nDexMod
dexterity penalty modifier (Default: 1)
nConMod
constitution penalty modifier (Default: 1)
nIntMod
intelligence penalty modifier (Default: 1)
nWisMod
wisdom penalty modifier (Default: 1)
nChaMod
charisma penalty 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.

A value of 0 means no decrease in that ability. So you can have a curse that only affects particular statistics if required.

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

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

Multiple applications of curse stacks and is essentially lots of ability decreases bundled up, see Effect Breakdown below for details.

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

This essentially creates 6 internally only accessible EffectAbilityDecrease effects, which share identical behaviour to them in regards to "stats capped at 3". This means you also can't put a negative value in to get a positive result, it caps at lowest of 1. It also means if you have IMMUNITY_TYPE_ABILITY_DECREASE at the point the curse is applied nothing happens (but the curse icon will still appear, if you lose the stat immunity nothing will happen either).

Since it hides the ability decreases internally there is no effect icon for ability decrease, just the curse icon.

Therefore GetEffectInteger may not truly accurately say what the decreases are - only the intended decreases not the actual ones. For instance if Strength is already at 3, and curse is meant to decrease it by 1 more, it will instead not decrease strength at all and if that strength is returned to normal it won't have any decrease applied from the curse.

If you use EffectCurse(0, 0, 0, 0, 0, 0); it will still apply (unless the creature has IMMUNITY_TYPE_CURSED) but essentially do nothing to stats except have a cool icon. This can be useful perhaps for displaying the PC has a cursed item equipped or some other geas or plot related curse instead of just ability changes.

Most curses in Bioware spells are applied as SupernaturalEffect, but they don't have to be - the effect isn't inherently defensive against EffectDispelMagicAll. Nothing other than this function EffectCurse applies curses in the engine (ie no On Hit effects) so it's entirely created by scripts.

nIndex Parameter Value Description and Notes
GetEffectInteger
0 nStrMod Amount to reduce strength by, or 0 for no change.
1 nDexMod Amount to reduce dexterity by, or 0 for no change.
2 nConMod Amount to reduce constitution by, or 0 for no change.
3 nIntMod Amount to reduce intelligence by, or 0 for no change.
4 nWisMod Amount to reduce wisdom by, or 0 for no change.
5 nChaMod Amount to reduce charisma by, or 0 for no change.

Known Bugs

It shares remarks/bugs with EffectAbilityDecrease where larger ability decreases are capped, but weirdly are not if there is enough "space" before it gets to the minimum value of 3.

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 persistent with whether 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

functions: EffectAbilityDecrease
constants: ABILITY_* Constants


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