NWNX:EE  8193.36.12
Feat

Readme

This plugin allows for the builder to define many traits for feats.

Environmental Variables

  • NWNX_FEAT_SHOW_EFFECT_ICON - Helpful when debugging, this shows the effect's icon (the red and green squares). Some builders may even wish this permanently.
  • NWNX_FEAT_CUSTOM_SPELL_ID - A custom spell id given to all effects created by this plugin.

Setup

Adding new feats is beyond the scope of this documentation. The builder should know how to add new feats by adding a new entry in the feat.2da as well as adding the appropriate TLK reference identifiers for that new feat then adjusting the appropriate columns for that feat.

Once your feat has been added (or it's also fine to modify existing feats) builders run the NWNX_Feat_SetFeatModifier() as illustrated below. The builder can use as many modifiers as they wish for one feat including the same modifiers with different parameters.

The NWNX_Feat plugin does not provide modifications to skill ranks, use the NWNX_SkillRanks plugin for changing those.

The 2da Method

To use the 2da method, the builder must create a new column at the end of the feat.2da named FeatModsTable. This column should then be populated with a string value that references another 2da file in which we will define our feat modifiers. Once that is done the builder needs to include nwnx_feat_2da and make sure to run NWNX_Feat_LoadFeatModifiers() in their OnModuleLoad script.

For example, we've inserted a new feat called Fireproof into feat.2da at line 1200. In the FeatModsTable column we enter FEATMOD_FIREPRF (Remember maximum 16 characters, case insensitive)

We will now create and define our featmod_fireprf.2da file and enter appropriate lines for each modifier we want our feat to grant. The end result will look something like this:

2DA V2.0
LABEL Type Param1 Param2 Param3 Param4
0 SaveVsFire SAVEVSTYPE 0 7 2 ****
1 FireResist DMGRESIST 256 10 **** ****
2 CombustImmunity SPELLIMMUNITY 518 **** **** ****

Feat Modifiers

These commands should be ran on_module_load.


AB

The AB entry is used to modify an attack bonus. Note: this is not a change to the base attack bonus, it's added on top of that.

  • Param1 = Modifier value (+/-)

Example script on_module_load

ABILITY

The ABILITY entry is used to modify an ability bonus.

  • Param1 = ABILITY_ constant
  • Param2 = Modifier value (+/-)

Example script on_module_load

ABVSRACE

The ABVSRACE entry is used to modify the attack bonus versus another race.

  • Param1 = Racial ID from racialtypes.2da
  • Param2 = Modifier value (+/-)

Example script on_module_load

AC

The AC entry is used to modify the base AC.

  • Param1 = Modifier value (+/-)

Example script on_module_load

ACVSRACE

The ACVSRACE entry is used to modify the base AC versus another race.

  • Param1 = Racial ID from racialtypes.2da
  • Param2 = Modifier value (+/-)

Example script on_module_load

ARCANESPELLFAILURE

The ARCANESPELLFAILURE can modify the arcane spell failure for the creature.

  • Param1 = The percentage change to their failure (-100/+100)

Example script on_module_load

BONUSSPELL

The BONUSSPELL entry is used to grant additional spell slots to a class at a level. Param1 is the Class constant ID, param2 is the level and param3 is the amount of spells gained.

  • Param1 = The spellcasting class for which the bonus spells will apply.
  • Param2 = The spell level (0-9)
  • Param3 = Amount of bonus spells (+)

Example script on_module_load

CONCEALMENT

The CONCEALMENT entry is used to grant an innate concealment.

  • Param1 = Modifier value (1-100)

Example script on_module_load

DAMAGE

The DAMAGE entry gives a damage increase or decrease, as per the EffectDamageIncrease(/Decrease) effect

  • Param1 = The damage type. Must be a single DAMAGE_TYPE_* constant per-call, although you can do multiple calls on the same feat to add further damage types
  • Param2 = DAMAGE_BONUS_* constant group, from iprp_damagecost.2da. Negative values result in a DamageDecrease, including relevent limitations of that Effect.

Example script on_module_load
NWNX_Feat_SetFeatModifier(2150, NWNX_FEAT_MODIFIER_DAMAGE, DAMAGE_TYPE_FIRE, 10); //2d6 Fire Damage
NWNX_Feat_SetFeatModifier(2150, NWNX_FEAT_MODIFIER_DAMAGE, DAMAGE_TYPE_COLD, 5); //Additionally +5 Cold damage

DMGREDUCTION

The DMGREDUCTION entry gives an innate damage reduction

  • Param1 = Points to soak (+)
  • Param2 = Level of soak (+)

Example script on_module_load

DMGRESIST

The DMGRESIST entry gives an innate resistance to damage types

  • Param1 = The damage type, can be a single Damage Type integer or multiple Damage Type integers summed. You can also just do each on its own line if you'd prefer. Hex can be used for the scripting method if preferred.
  • Param2 = Points to resist (+)

Example script on_module_load
NWNX_Feat_SetFeatModifier(2150, NWNX_FEAT_MODIFIER_DMGRESIST, DAMAGE_TYPE_FIRE & DAMAGE_TYPE_COLD, 5);

DMGIMMUNITY

The DMGIMMUNITY entry gives an innate immunity to damage types

  • Param1 = The damage type, can be a single Damage Type integer or multiple Damage Type integers summed. You can also just do each on its own line if you'd prefer. Hex can be used for the scripting method if preferred.
  • Param2 = Percentage to resist (+/-)

Example script on_module_load

HASTE

The HASTE entry is used to grant haste.

  • No parameters required

Example script on_module_load

IMMUNITY

The IMMUNITY entry is used to grant a total immunity to a variety of effects.

  • Param1 = The IMMUNITY_TYPE_ constant value

Example script on_module_load

MOVEMENTSPEED

The MOVEMENTSPEED can modify the speed by default.

  • Param1 = The percentage change to their speed (-99/+99)

Example script on_module_load

REGENERATION

The REGENERATION entry is used to grant innate regeneration.

  • Param1 = How many hitpoints to increase (+)
  • Param2 = How often in seconds to increase the hitpoints (+)

Example script on_module_load

SAVE

The SAVE entry is used to modify base save values.

  • Param1 = 0-3 meaning SAVING_THROW_ALL, SAVING_THROW_FORT, SAVING_THROW_REFLEX or SAVING_THROW_WILL
  • Param2 = Modifier value (+/-)

Example script on_module_load
NWNX_Feat_SetFeatModifier(2150, NWNX_FEAT_MODIFIER_SAVE, SAVING_THROW_FORT, -2);

SAVEVSRACE

The SAVEVSRACE entry is used to modify base save values vs a specific race. Param1 is the Save constant ID and param2 is the target race constant ID and param3 is the modifier.

  • Param1 = 0-3 meaning SAVING_THROW_ALL, SAVING_THROW_FORT, SAVING_THROW_REFLEX or SAVING_THROW_WILL
  • Param2 = Racial ID from racialtypes.2da
  • Param3 = Modifier value (+/-)

Example script on_module_load
NWNX_Feat_SetFeatModifier(2150, NWNX_FEAT_MODIFIER_SAVEVSRACE, SAVING_THROW_ALL, RACIAL_TYPE_UNDEAD, 5);

SAVEVSTYPE

The SAVEVSTYPE entry is used to modify base save values vs a specific type. Param1 is the Save constant ID and param2 is the Saving Throw Type constant ID and param3 is the modifier.

  • Param1 = 0-3 meaning SAVING_THROW_ALL, SAVING_THROW_FORT, SAVING_THROW_REFLEX or SAVING_THROW_WILL
  • Param2 = A SAVING_THROW_TYPE_ constant
  • Param3 = Modifier value (+/-)

Example script on_module_load
NWNX_Feat_SetFeatModifier(2150, NWNX_FEAT_MODIFIER_SAVEVSTYPE, SAVING_THROW_REFLEX, SAVING_THROW_TYPE_TRAP, 3);

SAVEVSTYPERACE

The SAVEVSTYPERACE entry is used to modify base save values vs a specific type versus a specific race. Param1 is the Save constant ID and param2 is the Saving Throw Type constant ID and param3 is the Racial Type constant ID and param4 is the modifier.

  • Param1 = 0-3 meaning SAVING_THROW_ALL, SAVING_THROW_FORT, SAVING_THROW_REFLEX or SAVING_THROW_WILL
  • Param2 = A SAVING_THROW_TYPE_ constant
  • Param3 = A RACIAL_TYPE_ constant
  • Param4 = Modifier value (+/-)

Example script on_module_load
NWNX_Feat_SetFeatModifier(2150, NWNX_FEAT_MODIFIER_SAVEVSTYPE, SAVING_THROW_ALL, SAVING_THROW_TYPE_SPELLS, RACIAL_TYPE_DRAGON, 3);

SEEINVISIBLE

The SEEINVISIBLE entry is used to grant See Invisibility.

  • No parameters required

Example script on_module_load

SPELLIMMUNITY

The SPELLIMMUNITY entry is used to grant a total immunity to specific spells. Note: Only spells that can be resisted can have immunities.

Example script on_module_load

SRCHARGEN

The SRCHARGEN entry is used to award a default spell resistance on character creation.

  • Param1 = Modifier value (+)
  • Param2 (Optional) = Maximum value all Spell Resistance racial values can reach

Example script on_module_load

SRINCLEVEL

The SRINCLEVEL entry is used to award a spell resistance racial bonus as the creature's level increases.

  • Param1 = Amount of points to increment (+)
  • Param2 = Level per increment (+)
  • Param3 = Level at which the incremental gains begin (+)

Example script on_module_load

SPELLSAVEDC

The SPELLSAVEDC entry is used to modify a creature's spell DCs.

  • Param1 = Modifier value (+/-)

Example script on_module_load

SPELLSAVEDCFORSCHOOL

The SPELLSAVEDCFORSCHOOL entry is used to modify a creature's spell DCs for a spell school.

  • Param1 = A SPELL_SCHOOL_ constant
  • Param2 = Modifier value (+/-)

Example script on_module_load

SPELLSAVEDCFORSPELL

The SPELLSAVEDCFORSPELL entry is used to modify a creature's spell DCs for an individual spell.

  • Param1 = A SPELL_ constant
  • Param2 = Modifier value (+/-)

Example script on_module_load

TRUESEEING

The TRUESEEING entry is used to grant True Seeing.

  • No parameters required

Example script on_module_load

ULTRAVISION

The ULTRAVISION entry is used to grant Ultravision.

  • No parameters required

Example script on_module_load

VISUALEFFECT

The VISUALEFFECT entry is used to grant a Visual Effect to the feat holder.

  • Param1 = The visual effect constant from visualeffects.2da (Duration Effects)

Example script on_module_load

Files

file  nwnx_feat.nss
 
file  nwnx_feat_2da.nss
 Parse a column in the feat.2da to load the modifiers.
 

Functions

void NWNX_Feat_SetFeatModifier (int iFeat, int iMod, int iParam1=0xDEADBEEF, int iParam2=0xDEADBEEF, int iParam3=0xDEADBEEF, int iParam4=0xDEADBEEF)
 Sets a feat modifier. More...
 
int NWNX_Feat_GetModifierConstant (string featMod)
 Translate a modifier type from a string to its constant. More...
 
void NWNX_Feat_LoadFeatModifiers (string sColumnName="FeatModsTable")
 Loops through feat.2da and checks for the column for feat modifications and sets them. More...
 

Function Documentation

◆ NWNX_Feat_SetFeatModifier()

void NWNX_Feat_SetFeatModifier ( int  iFeat,
int  iMod,
int  iParam1 = 0xDEADBEEF,
int  iParam2 = 0xDEADBEEF,
int  iParam3 = 0xDEADBEEF,
int  iParam4 = 0xDEADBEEF 
)

Sets a feat modifier.

Parameters
iFeatThe Feat constant or value in feat.2da.
iModThe feat modifier to set.
iParam1,iParam2,iParam3,iParam4The parameters for this feat modifier.

Definition at line 54 of file nwnx_feat.nss.

◆ NWNX_Feat_GetModifierConstant()

int NWNX_Feat_GetModifierConstant ( string  featMod)

Translate a modifier type from a string to its constant.

Parameters
featModThe string representation of the constant.
Returns
The constant for the feat modifier.

Definition at line 17 of file nwnx_feat_2da.nss.

◆ NWNX_Feat_LoadFeatModifiers()

void NWNX_Feat_LoadFeatModifiers ( string  sColumnName = "FeatModsTable")

Loops through feat.2da and checks for the column for feat modifications and sets them.

Parameters
sColumnNameThe column name in the feat.2da that defines the 2da for the feat mods.

Definition at line 52 of file nwnx_feat_2da.nss.

Variable Documentation

◆ NWNX_FEAT_MODIFIER_INVALID

const int NWNX_FEAT_MODIFIER_INVALID = 0

Definition at line 13 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_AB

const int NWNX_FEAT_MODIFIER_AB = 1

Definition at line 14 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_ABILITY

const int NWNX_FEAT_MODIFIER_ABILITY = 2

Definition at line 15 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_ABVSRACE

const int NWNX_FEAT_MODIFIER_ABVSRACE = 3

Definition at line 16 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_AC

const int NWNX_FEAT_MODIFIER_AC = 4

Definition at line 17 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_ACVSRACE

const int NWNX_FEAT_MODIFIER_ACVSRACE = 5

Definition at line 18 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_ARCANESPELLFAILURE

const int NWNX_FEAT_MODIFIER_ARCANESPELLFAILURE = 6

Definition at line 19 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_CONCEALMENT

const int NWNX_FEAT_MODIFIER_CONCEALMENT = 7

Definition at line 20 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_DMGIMMUNITY

const int NWNX_FEAT_MODIFIER_DMGIMMUNITY = 8

Definition at line 21 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_DMGREDUCTION

const int NWNX_FEAT_MODIFIER_DMGREDUCTION = 9

Definition at line 22 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_DMGRESIST

const int NWNX_FEAT_MODIFIER_DMGRESIST = 10

Definition at line 23 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_IMMUNITY

const int NWNX_FEAT_MODIFIER_IMMUNITY = 11

Definition at line 24 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_MOVEMENTSPEED

const int NWNX_FEAT_MODIFIER_MOVEMENTSPEED = 12

Definition at line 25 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_REGENERATION

const int NWNX_FEAT_MODIFIER_REGENERATION = 13

Definition at line 26 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_SAVE

const int NWNX_FEAT_MODIFIER_SAVE = 14

Definition at line 27 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_SAVEVSRACE

const int NWNX_FEAT_MODIFIER_SAVEVSRACE = 15

Definition at line 28 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_SAVEVSTYPE

const int NWNX_FEAT_MODIFIER_SAVEVSTYPE = 16

Definition at line 29 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_SAVEVSTYPERACE

const int NWNX_FEAT_MODIFIER_SAVEVSTYPERACE = 17

Definition at line 30 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_SPELLIMMUNITY

const int NWNX_FEAT_MODIFIER_SPELLIMMUNITY = 18

Definition at line 31 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_SRCHARGEN

const int NWNX_FEAT_MODIFIER_SRCHARGEN = 19

Definition at line 32 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_SRINCLEVEL

const int NWNX_FEAT_MODIFIER_SRINCLEVEL = 20

Definition at line 33 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_SPELLSAVEDC

const int NWNX_FEAT_MODIFIER_SPELLSAVEDC = 21

Definition at line 34 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_BONUSSPELL

const int NWNX_FEAT_MODIFIER_BONUSSPELL = 22

Definition at line 35 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_TRUESEEING

const int NWNX_FEAT_MODIFIER_TRUESEEING = 23

Definition at line 36 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_SEEINVISIBLE

const int NWNX_FEAT_MODIFIER_SEEINVISIBLE = 24

Definition at line 37 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_ULTRAVISION

const int NWNX_FEAT_MODIFIER_ULTRAVISION = 25

Definition at line 38 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_HASTE

const int NWNX_FEAT_MODIFIER_HASTE = 26

Definition at line 39 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_VISUALEFFECT

const int NWNX_FEAT_MODIFIER_VISUALEFFECT = 27

Definition at line 40 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSCHOOL

const int NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSCHOOL = 28

Definition at line 41 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSPELL

const int NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSPELL = 29

Definition at line 42 of file nwnx_feat.nss.

◆ NWNX_FEAT_MODIFIER_DAMAGE

const int NWNX_FEAT_MODIFIER_DAMAGE = 30

Definition at line 43 of file nwnx_feat.nss.

NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSPELL
const int NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSPELL
Definition: nwnx_feat.nss:42
NWNX_FEAT_MODIFIER_SEEINVISIBLE
const int NWNX_FEAT_MODIFIER_SEEINVISIBLE
Definition: nwnx_feat.nss:37
NWNX_FEAT_MODIFIER_SAVEVSTYPE
const int NWNX_FEAT_MODIFIER_SAVEVSTYPE
Definition: nwnx_feat.nss:29
NWNX_FEAT_MODIFIER_DMGREDUCTION
const int NWNX_FEAT_MODIFIER_DMGREDUCTION
Definition: nwnx_feat.nss:22
NWNX_FEAT_MODIFIER_SAVEVSRACE
const int NWNX_FEAT_MODIFIER_SAVEVSRACE
Definition: nwnx_feat.nss:28
NWNX_FEAT_MODIFIER_SPELLIMMUNITY
const int NWNX_FEAT_MODIFIER_SPELLIMMUNITY
Definition: nwnx_feat.nss:31
NWNX_FEAT_MODIFIER_HASTE
const int NWNX_FEAT_MODIFIER_HASTE
Definition: nwnx_feat.nss:39
NWNX_FEAT_MODIFIER_CONCEALMENT
const int NWNX_FEAT_MODIFIER_CONCEALMENT
Definition: nwnx_feat.nss:20
NWNX_FEAT_MODIFIER_AC
const int NWNX_FEAT_MODIFIER_AC
Definition: nwnx_feat.nss:17
NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSCHOOL
const int NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSCHOOL
Definition: nwnx_feat.nss:41
NWNX_FEAT_MODIFIER_IMMUNITY
const int NWNX_FEAT_MODIFIER_IMMUNITY
Definition: nwnx_feat.nss:24
NWNX_FEAT_MODIFIER_SRCHARGEN
const int NWNX_FEAT_MODIFIER_SRCHARGEN
Definition: nwnx_feat.nss:32
NWNX_FEAT_MODIFIER_DMGIMMUNITY
const int NWNX_FEAT_MODIFIER_DMGIMMUNITY
Definition: nwnx_feat.nss:21
NWNX_FEAT_MODIFIER_ARCANESPELLFAILURE
const int NWNX_FEAT_MODIFIER_ARCANESPELLFAILURE
Definition: nwnx_feat.nss:19
NWNX_FEAT_MODIFIER_ULTRAVISION
const int NWNX_FEAT_MODIFIER_ULTRAVISION
Definition: nwnx_feat.nss:38
NWNX_FEAT_MODIFIER_REGENERATION
const int NWNX_FEAT_MODIFIER_REGENERATION
Definition: nwnx_feat.nss:26
NWNX_FEAT_MODIFIER_DAMAGE
const int NWNX_FEAT_MODIFIER_DAMAGE
Definition: nwnx_feat.nss:43
NWNX_FEAT_MODIFIER_SAVE
const int NWNX_FEAT_MODIFIER_SAVE
Definition: nwnx_feat.nss:27
NWNX_FEAT_MODIFIER_MOVEMENTSPEED
const int NWNX_FEAT_MODIFIER_MOVEMENTSPEED
Definition: nwnx_feat.nss:25
NWNX_FEAT_MODIFIER_DMGRESIST
const int NWNX_FEAT_MODIFIER_DMGRESIST
Definition: nwnx_feat.nss:23
NWNX_FEAT_MODIFIER_VISUALEFFECT
const int NWNX_FEAT_MODIFIER_VISUALEFFECT
Definition: nwnx_feat.nss:40
NWNX_FEAT_MODIFIER_SPELLSAVEDC
const int NWNX_FEAT_MODIFIER_SPELLSAVEDC
Definition: nwnx_feat.nss:34
NWNX_FEAT_MODIFIER_BONUSSPELL
const int NWNX_FEAT_MODIFIER_BONUSSPELL
Definition: nwnx_feat.nss:35
NWNX_FEAT_MODIFIER_TRUESEEING
const int NWNX_FEAT_MODIFIER_TRUESEEING
Definition: nwnx_feat.nss:36
NWNX_FEAT_MODIFIER_ABVSRACE
const int NWNX_FEAT_MODIFIER_ABVSRACE
Definition: nwnx_feat.nss:16
NWNX_Feat_SetFeatModifier
void NWNX_Feat_SetFeatModifier(int iFeat, int iMod, int iParam1=0xDEADBEEF, int iParam2=0xDEADBEEF, int iParam3=0xDEADBEEF, int iParam4=0xDEADBEEF)
Sets a feat modifier.
Definition: nwnx_feat.nss:54
NWNX_FEAT_MODIFIER_AB
const int NWNX_FEAT_MODIFIER_AB
Definition: nwnx_feat.nss:14
NWNX_FEAT_MODIFIER_ABILITY
const int NWNX_FEAT_MODIFIER_ABILITY
Definition: nwnx_feat.nss:15
NWNX_FEAT_MODIFIER_ACVSRACE
const int NWNX_FEAT_MODIFIER_ACVSRACE
Definition: nwnx_feat.nss:18
NWNX_FEAT_MODIFIER_SRINCLEVEL
const int NWNX_FEAT_MODIFIER_SRINCLEVEL
Definition: nwnx_feat.nss:33