Traps in NWN can actually be relatively advanced; although have their limits.
Trap XP System
A automatic trap XP system might be a good idea for disarming traps. There is no "On Recovered" only an OnDisarm event, which is set usually on the blueprints of the triggers. Traps placed by players don't set this event so it's relatively "safe".
However for traps in a module already placed these won't get the event set. It might be a script can set this event properly on all traps in the game.
Standardise trap script
The trap script should probably be all made into one file, eg; op_trap.nss - which deals with each type of trap based on the trap firing (which can be found by the object firing it's blueprint name). Or we run separate scripts with some include file for them to standardise.
Bugs
Some traps don't check if the people in a given area are friendly. Do reputation checks even work with traps? Need to test.
Some DC's are not really standardised or even consistent.
Any DelayCommand issued from the trap script may not fire since the trap object may disappear before it can be done - need to double check this. Possibly have a script execute on the area to apply the damage/vfx instead. It's one thing some traps lag a lot since a lot of VFX fire instantly.
Note that there are bugs around firing EffectDamage instantly from any script with a loop (the loop may reset due to other scripts being run) - and current traps commonly do this.
Trap Icons
There are several improvements that could be offered:
- Different icons for each trap difficulty meaning you can tell at a glance a deadly versus minor one in the inventory (there are potential caveats - like having to redo blueprints - but a minor issue - note the trap icons on placeables are separate and set in traps.2da)
Additional Trap Types and Difficulties
It would be good to add some easier and harder trap difficulties and flesh out all the options for them, as in having Epic versions of each trap type. This will also require item blueprints.
Some new trap types below would allow PCs to use additional trap types in perhaps more interesting ways as well.
Trap Types
iprp_trapcost.2da and versions are put into traps.2da / as blueprints.
ID | Name | Label | Cost | Default Versions Missing | Effect | Pathetic Spec | Minor Spec | Average Spec | Strong Spec | Deadly Spec | Expert Spec | Epic Spec | Godly Spec | Notes and Description |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 2258 | Spike | 0.2 | Epic | Piercing Damage on entering object only | DC 15 reflex adjusted 2d6 Piercing Damage Entering object only | DC 15 reflex adjusted 3d6 Piercing Damage Entering object only | DC 15 reflex adjusted 5d6 Piercing Damage Entering object only | DC 15 reflex adjusted 25d6 Piercing Damage Entering object only | Really odd how the DC doesn't increase past 15, although reflex adjusted damage does make it possible to still take quite a bit from the deadly one | ||||
2 | 2259 | Holy | 0.5 | Epic | Divine Damage on entering object only | 4d10 vs. Undead 2d4 vs. Other Entering object only | 5d10 vs. Undead 3d4 vs. Other Entering object only | 8d10 vs. Undead 6d4 vs. Other Entering object only | 1d12 vs. Undead 8d4 vs. Other Entering object only | Oddly no saving throw (the script suggests a "Attack roll" was going to be used but functionally the code isn't in use). | ||||
3 | 2260 | Tangle | 0.7 | Epic | EffectSlow in area | DC 20 reflex save 3 round duration Small radius size | DC 25 reflex save 4 round duration Small radius size | DC 30 reflex save 4 round duration Medium radius size | DC 35 reflex save 5 round duration Medium radius size | EffectSlow applied for 4 rounds on all people failing a reflex saving throw, in a medium radius around the target No reputation checks | ||||
4 | 2261 | BlobOfAcid | 1 | Epic | Acid Damage (always) EffectParalyze (reflex save) Entering target only | DC 15 reflex save 3d6 acid damage 2 round duration | DC 20 reflex save 5d6 acid damage 3 round duration | DC 25 reflex save 12d6 acid damage 4 round duration | DC 25 reflex save 18d6 acid damage 5 round duration | Oddly the Deadly trap doesn't have an increased saving throw | ||||
5 | 1028 | Fire | 1.4 | Fire damage in area (reflex adjusted) | DC 18 reflex adjusted 5d6 fire damage Small radius size | DC 20 reflex adjusted 8d6 fire damage Small radius size | DC 23 reflex adjusted 15d6 fire damage Medium radius size | DC 26 reflex adjusted 25d6 fire damage Medium radius size | DC 33 reflex adjusted 50d6 fire damage Medium radius size | This does GetIsReactionTypeFriendly, wonder if that works | ||||
6 | 1030 | Electrical | 1.8 | Electrical damage in area | ||||||||||
7 | 2262 | Gas | 2.5 | Epic | EffectPoison AOE which lasts a while | Really overpriced IMO | ||||||||
8 | 6617 | Frost | 0.4 | Cold damage and paralysis on entering object only | ||||||||||
9 | 6618 | Acid_Splash | 0.4 | Epic | Acid damage on entering object only | |||||||||
10 | 6619 | Sonic | 0.4 | Sonic Damage (always) EffectStunned (will save) Affects an area | ||||||||||
11 | 6620 | Negative | 0.5 | Epic | Heals undead always Negative damage on others always EffectAbilityDecrease - Strength on failed fortitude save Entering object only | |||||||||
Boulder | 1.5 | Bludgeoning damage vs. reflex adjusted Area of effect | Classic "rocks falls" trap. Spike trap variant. | |||||||||||
Swinging_Axes | 1.5 | Slashing damage vs. reflex adjusted (small) Area of effect or single target | Rocking those swinging blades! Spike trap variant. | |||||||||||
Dart | 0.1 | Piercing Damage | Comes from a given placeable, or creates a placeable to fire it from if not. | |||||||||||
Arrow | 0.4 | Piercing Damage | Comes from a given placeable, or creates a placeable to fire it from if not. | |||||||||||
Bolt | 0.4 | Piercing Damage | Comes from a given placeable, or creates a placeable to fire it from if not. | |||||||||||
Shuriken | 0.1 | Piercing Damage | Comes from a given placeable, or creates a placeable to fire it from if not. | |||||||||||
Dispel_Magic | 2.0 | EffectDispelMagicBest | Runs EffectDispelMagicBest(DC). This hopefully works from trap objects. If not a placeable could be created for the purpose of applying it. Might be applied in an area ala the spell. | |||||||||||
Dispel_Magic_All | 5.0 | EffectDispelMagicAll | Really crazy powerful this option... | |||||||||||
spell_magic_missile | 1.0 | Spells are hard to do:
We could for each one actually have a different spell cast in each "slot" but this is...somewhat difficult. The trap names would also need to be thematically similar. Mmmm. | ||||||||||||
spell_sleep | ||||||||||||||
spell_flame_arrow | ||||||||||||||
spell_negative_energy_burst | ||||||||||||||
spell_stinking_cloud | ||||||||||||||
spell_web | ||||||||||||||
spell_blindness_deafness | ||||||||||||||
Trap Difficulties
iprp_traps.2da line
ID | Name | Label | Cost | Notes |
---|---|---|---|---|
0 | 6606 | Minor | 0.4 | |
1 | 6607 | Average | 0.7 | |
2 | 6608 | Strong | 0.9 | |
3 | 6609 | Deadly | 1.4 | |
4 | 83333 | Epic | 2.8 | |
5 | tbc | Pathetic | 0.2 | Very limited damage and super low DCs |
6 | tbc | Expert | 2.2 | Between Deadly and Epic, top end of level 20's perhaps |
7 | tbc | Godly | 4.2 | Going beyond Epic...! |