Difference between revisions of "EffectConcealment"

From NWN Lexicon
Jump to: navigation, search
m (Remarks: grammar fix)
(EffectConcealment(int): Added missing nMissType parameter, reported by Daz in Discord)
 
Line 5: Line 5:
 
<nwscript>
 
<nwscript>
 
effect EffectConcealment(
 
effect EffectConcealment(
    int nPercentage
+
    int nPercentage,
 +
    int nMissType = MISS_CHANCE_TYPE_NORMAL
 
);
 
);
 
</nwscript>
 
</nwscript>
Line 14: Line 15:
  
 
1-100 inclusive
 
1-100 inclusive
 +
 +
''nMissType''
 +
 +
Refer to [[miss_chance_type | MISS_CHANCE_TYPE_* Constants]].
  
 
====Description====
 
====Description====
  
This function returns a new concealment effect. The nPercentage:int is simply the chance of discovery so a 0 concealment would be Shamu hiding in your tub and a 100 concealment would be a brine shrimp hiding in Shamu's tub.
+
This function returns a new concealment effect. The nPercentage:int is simply the chance of discovery so a 0 concealment would be Shamu hiding in your tub and a 100 concealment would be a brine shrimp hiding in Shamu's tub.  The nMissType:int parameter is one of a set of predefined constants specifying whether the concealment effect applies to melee attacks, ranged attacks, or both.
  
 
Concealment doesn't stack, only the highest applies, therefore Ghostly Visage doesn't stack with a monk's Perfect Body.
 
Concealment doesn't stack, only the highest applies, therefore Ghostly Visage doesn't stack with a monk's Perfect Body.
Line 25: Line 30:
 
====Remarks====
 
====Remarks====
  
Concealment should NOT be confused with [[EffectMissChance]] - this HELPS the creature targeted, and all attacks (physical ones, ranged or melee) which are targeted that the creature may miss if this is in effect.
+
Concealment should NOT be confused with [[EffectMissChance]]() - this HELPS the creature targeted, and all attacks (physical ones, ranged or melee) which are targeted that the creature may miss if this is in effect.
  
 
It is reported in the combat information as "Target Concealed: Miss".
 
It is reported in the combat information as "Target Concealed: Miss".
 
[[
 
[[
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 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 ([[GetFirstEffect]]()/[[GetNextEffect]]()). See the [[Effect tutorial]] for more details.
  
 
====Version====
 
====Version====
Line 55: Line 60:
  
 
{| class="seealso"
 
{| class="seealso"
 +
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 +
|
 +
[[EffectMissChance]]
 +
|-
 +
|-
 +
| width="1px" align="right" valign="top" | <font color="gray">constants: </font>
 +
|
 +
[[ miss_chance_type | MISS_CHANCE_TYPE_* Constants  ]]
 
|}
 
|}
  

Latest revision as of 15:10, 12 July 2019

EffectConcealment(int)

Returns a new effect object.

effect EffectConcealment(
    int nPercentage,
    int nMissType = MISS_CHANCE_TYPE_NORMAL
);

Parameters

nPercentage

1-100 inclusive

nMissType

Refer to MISS_CHANCE_TYPE_* Constants.

Description

This function returns a new concealment effect. The nPercentage:int is simply the chance of discovery so a 0 concealment would be Shamu hiding in your tub and a 100 concealment would be a brine shrimp hiding in Shamu's tub. The nMissType:int parameter is one of a set of predefined constants specifying whether the concealment effect applies to melee attacks, ranged attacks, or both.

Concealment doesn't stack, only the highest applies, therefore Ghostly Visage doesn't stack with a monk's Perfect Body.

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

Concealment should NOT be confused with EffectMissChance() - this HELPS the creature targeted, and all attacks (physical ones, ranged or melee) which are targeted that the creature may miss if this is in effect.

It is reported in the combat information as "Target Concealed: Miss". [[ 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 (GetFirstEffect()/GetNextEffect()). See the Effect tutorial for more details.

Version

1.62

Example

// We apply a 30% concealment to those who step into the trigger
// as the trigger is behind some cover or something...
 
void main()
{
    // Declare object and effect
    object oEnterer = GetEnteringObject();
    effect eConceal = EffectConcealment(30);
 
    // Apply the effect
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, oEnterer);
}

See Also

functions:

EffectMissChance

constants:

MISS_CHANCE_TYPE_* Constants


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