Page tree
Skip to end of metadata
Go to start of metadata

NWN has a comprehensive and nuanced effects system. There are some very limited 2das related to effects - effecticons.2da and statescripts.2da.

This is a random assortment of notes which probably need fuller writeups with examples and more engine information.

Effect Engine Coding

Effects are a struct of information that are acted on by a variety of engine functions. If applied to an object in a script it is generally done instantly (during the script run time) such as EffectDamage changing the persons hit points immediately, and updating any appropriate other effects (eg; Endure Elements when interacting with EffectDamage using a fire type).

The NWNX project has some decompiled code for how an effect ht coded: https://github.com/nwnxee/unified/blob/master/Plugins/Effect/NWScript/nwnx_effect.nss#L10-L57

Effects also control internal things such as, say, racial bonuses to strength or the item properties system. These are hidden or accessed differently from nwscript.

Since they're structs, NWN2 has a function called GetEffectInteger(effect, index) that can retrieve properties of an effect, similar to the Item Property versions. This can be used to get things like "How much protection does the damage resistance applied from Endure Elements have left?" or "What type of invisibility is this effect?".

Effect Icons

Effect Icons are a really separate "effect" coded in the engine and linked to an ongoing created effect - eg; if you apply EffectParalyze() the effect icon for it is added as a linked effect to the Paralyze effect and thus sent to the client to display (and for Examine etc.).

The list is hardcoded currently in effecticons.2da

Effect Linking and Dispel Magic / RemoveEffect

Effects can also be linked with EffectLinkEffect which have a single Tag, Type (Magical, Supernatural etc.) Duration (Temporary or Permanent) as well as a single caster level and spell ID. If one effect is removed from the link all of them are removed.

This means things like Temporary Hit Points generally are applied separately else when lost the rest of the spells effects are also lost.

A spell may therefore even apply more than one linked effect, or have more than one effect applied separately.

When it comes to EffectDispelMagicAll(), it tests each effect link as one "effect" (so having a +1 attack bonus, +1 AC in the same effect link, it only does one test).

However some spells (such as Aid, Polymorph) apply a linked effect plus one separate effect - the separate one is thus tested separately, and removed separately (it does not, for instance, test one instance of one spell ID and remove all effects from that spell ID).

Additionally RemoveEffect should - although needs some testing on the nuances - remove the entire link of effects when called, updating the current effect loop (eg; looping and removing all EffectAbilityDecrease effects).

Engine Only Effects

There are a few effects the game does use which are not available in nwscript. Most can have a mimic made using other effect types.

Taunt Skill

Applied from the usable skill Taunt. This applies:

  • 30% arcane spell failure (yes, similar to armour!)
  • AC penalty of -1 to -6 depending on the taunt check
  • Has a custom icon

There are 3 ruleset.2da lines associated with the skill - the duration (def: 30.0), maximum AC penalty (6) and the arcane spell failure amount (30) applied.

The taunt effect is a single, special one, returning EFFECT_TYPE_INVALIDEFFECT. This appears to be applied as subtype "0" (invalid, or "not set", thus unaffected by dispel magic) effect with no SpellID, and the effect creator set to the user of the skill.

On Hit / On Monster Hit Item Properties

On Hit effects I think apply regardless of the damage done - they just occur if the target is hit, each time it is hit. For more information see the Fandom Wiki: https://nwn.fandom.com/wiki/On-hit

Need to investigate how GetFirstEffect() sees these - if it even can!

Wounding On Hit

The Wounding effect is used on weapons and will damage the person affected every round (6 second intervals) until healed. It is an untyped physical damage (Stoneskin will stop it but Immunity 100% to Bludgeoning etc. will not).

Removing it is done with EffectHeal usually. If the target hasn't got any healing potions? Sucks to be them...they'll just never be able to rest and...eventually die!

It's probably not a good idea to use this on creatures (if the player also dies and respawns and they're damaging a target - that continues on and can mess things up).

Vampiric Regeneration On Hit

This will apply EffectHeal on the person hitting a target (so always heals - undead are not for instance magically damaged instead), obviously can be replicated by spells.

Doom On Hit

"Doom" is not a single effect, but is rather a combination of -2 penalties to attack rolls and skills (similar to the spell doom, but lacking the penalty to magical damage and saving throws).

Vorpal and other On Hit (Stun, etc.) effects

These will be documented later - but tend to use EffectDeath, or EffectStun or similar. See nwn fandon liked above.

Poisons On Hit

Dynamic poisons from On Hit properties to a single ability score are not possible with EffectPoison.

Arcane Spell Failure

Applied as part of the Taunt effect (and also by item properties) you can't use this usually as a normal effect.

  • No labels