NWNX:EE  8193.36.12
SkillRanks

Readme

Enhances and allows for manipulation of skill rank calculations including the ability to build custom skill related feats as well as modifying stock feats.

Plugin Sample Usage

To create a new skill feat, builders create a SkillFeat structure and run functions on the OnModuleLoad.

Example 1

The builder wants to create a new skill called Travel and wants to add Skill Focus and Epic Skill Focus feats.

  • Add the Travel skill definition to skills.2da
  • Add the Skill Focus Travel and Epic Skill Focus Travel to feat.2da
  • In the OnModuleLoad script enter the following:
    struct NWNX_SkillRanks_SkillFeat skillFeat;
    skillFeat.iSkill = 27; // The row number for the new Travel skill
    skillFeat.iFeat = 1801; // The row number for the Skill Focus Travel feat
    skillFeat.iModifier = 3;
    // Defining feats with the iFocusFeat setting helps with mass changing modifiers
    skillFeat.iFocusFeat = 1;
    skillFeat.iFeat = 1802; // The row number for the Epic Skill Focus Travel feat
    skillFeat.iModifier = 10;
    skillFeat.iFocusFeat = 2; // 2 for Epic Focus

Example 2

The builder doesn't like the restriction on the Trackless Step feat which inhibits the skill bonus while Underground even if the Natural flag is set.

Example 3

The builder has created a new feat called Doctor which counts the creature's Intelligence instead of Wisdom if higher when calculating their Heal skill.

Example 4

The builder has created a new feat called Moonlight Spy which gives a Listen, Search and Spot bonus of 3 plus 1 for every 2 levels of Assassin or Rogue when the player is outdoors at night time.

Example 5

The builder wants all Skill Focus feats to increase the modifier by 5 and all Epic Skill Focus feats to increase the modifier by 12.

  • Change the TLK reference in the feat.2da for all Skill Focus feats from 424 to a new custom TLK entry that states:
    Type of Feat: General
    Prerequisite: Able to use the skill.
    Specifics: A character with this feat is adept at a certain skill, gaining a +5 bonus on all checks with it.
    Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
  • Change the TLK reference in the feat.2da for all Skill Focus feats from 4063 to a new custom TLK entry that states:
    Type of Feat: General
    Prerequisite: 21st level, 20 ranks in the chosen skill.
    Specifics: The character gains a +12 bonus on all skill checks with the chosen skill.
    Use: Automatic.
  • In the OnModuleLoad script enter the following:
    NWNX_SkillRanks_SetSkillFeatFocusMod(5);
    NWNX_SkillRanks_SetSkillFeatFocusMod(12, TRUE);

Example 6

The builder has an area in her module called The Great Library where she wants all creatures to receive a bonus of 10 Lore whenever inside.

Files

file  nwnx_skillranks.nss
 

Classes

struct  NWNX_SkillRanks_SkillFeat
 A feat that manipulates skill ranks. More...
 

Functions

int NWNX_SkillRanks_GetSkillFeatCountForSkill (int iSkill)
 
struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_GetSkillFeat (int iSkill, int iFeat)
 Returns a skill feat. More...
 
struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_GetSkillFeatForSkillByIndex (int iSkill, int iIndex)
 Returns a skill feat by index. More...
 
void NWNX_SkillRanks_SetSkillFeat (struct NWNX_SkillRanks_SkillFeat skillFeat, int createIfNonExistent=FALSE)
 Modifies or creates a skill feat. More...
 
struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_AddSkillFeatClass (struct NWNX_SkillRanks_SkillFeat skillFeat, int iClass)
 Add classes to a skill feat instead of working with the NWNX_SkillRanks_SkillFeat::sClasses string. More...
 
void NWNX_SkillRanks_SetSkillFeatFocusModifier (int iModifier, int iEpic=FALSE)
 Change the modifier value for Skill Focus and Epic Skill Focus feats. More...
 
int NWNX_SkillRanks_GetBlindnessPenalty ()
 Gets the current penalty to Dexterity based skills when blind. More...
 
void NWNX_SkillRanks_SetBlindnessPenalty (int iModifier)
 Set the value the Dexterity based skills get decreased due to blindness. More...
 
int NWNX_SkillRanks_GetAreaModifier (object oArea, int iSkill)
 Get a skill modifier for an area. More...
 
void NWNX_SkillRanks_SetAreaModifier (object oArea, int iSkill, int iModifier)
 Sets a skill modifier for the area. More...
 

Function Documentation

◆ NWNX_SkillRanks_GetSkillFeatCountForSkill()

int NWNX_SkillRanks_GetSkillFeatCountForSkill ( int  iSkill)
Parameters
iSkillThe skill to check the feat count.
Returns
The count of feats for a specific skill.

Definition at line 145 of file nwnx_skillranks.nss.

◆ NWNX_SkillRanks_GetSkillFeat()

struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_GetSkillFeat ( int  iSkill,
int  iFeat 
)

Returns a skill feat.

Parameters
iSkillThe skill.
iFeatThe feat.
Returns
A constructed NWNX_SkillRanks_SkillFeat.

Definition at line 180 of file nwnx_skillranks.nss.

◆ NWNX_SkillRanks_GetSkillFeatForSkillByIndex()

struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_GetSkillFeatForSkillByIndex ( int  iSkill,
int  iIndex 
)

Returns a skill feat by index.

Remarks
Generally used in a loop with NWNX_SkillRanks_GetSkillFeatCountForSkill().
Parameters
iSkillThe skill.
iIndexThe index in the list of feats for the skill.
Returns
A constructed NWNX_SkillRanks_SkillFeat.

Definition at line 155 of file nwnx_skillranks.nss.

◆ NWNX_SkillRanks_SetSkillFeat()

void NWNX_SkillRanks_SetSkillFeat ( struct NWNX_SkillRanks_SkillFeat  skillFeat,
int  createIfNonExistent = FALSE 
)

Modifies or creates a skill feat.

Parameters
skillFeatThe defined NWNX_SkillRanks_SkillFeat.
createIfNonExistentTRUE to create if the feat does not exist.

Definition at line 205 of file nwnx_skillranks.nss.

◆ NWNX_SkillRanks_AddSkillFeatClass()

struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_AddSkillFeatClass ( struct NWNX_SkillRanks_SkillFeat  skillFeat,
int  iClass 
)

Add classes to a skill feat instead of working with the NWNX_SkillRanks_SkillFeat::sClasses string.

Manipulating the sClasses string in the NWNX_SkillRanks_SkillFeat struct can be difficult. This function allows the builder to enter one class at a time.

Parameters
skillFeatThe NWNX_SkillRanks_SkillFeat for which the sClasses field will be modifier.
iClassThe class to add to the Skill Feat.
Returns
The updated NWNX_SkillRanks_SkillFeat.

Definition at line 225 of file nwnx_skillranks.nss.

◆ NWNX_SkillRanks_SetSkillFeatFocusModifier()

void NWNX_SkillRanks_SetSkillFeatFocusModifier ( int  iModifier,
int  iEpic = FALSE 
)

Change the modifier value for Skill Focus and Epic Skill Focus feats.

The stock modifier on Skill Focus and Epic Skill Focus are 3 and 10 respectively, these can be changed with this function.

Parameters
iModifierThe new value for the feat modifier.
iEpicSet to TRUE to change the value for Epic Skill Focus.

Definition at line 238 of file nwnx_skillranks.nss.

◆ NWNX_SkillRanks_GetBlindnessPenalty()

int NWNX_SkillRanks_GetBlindnessPenalty ( )

Gets the current penalty to Dexterity based skills when blind.

Returns
The penalty to Dexterity when blind.

Definition at line 247 of file nwnx_skillranks.nss.

◆ NWNX_SkillRanks_SetBlindnessPenalty()

void NWNX_SkillRanks_SetBlindnessPenalty ( int  iModifier)

Set the value the Dexterity based skills get decreased due to blindness.

Remarks
Default is 4.
Parameters
iModifierThe penalty to Dexterity when blind.

Definition at line 256 of file nwnx_skillranks.nss.

◆ NWNX_SkillRanks_GetAreaModifier()

int NWNX_SkillRanks_GetAreaModifier ( object  oArea,
int  iSkill 
)

Get a skill modifier for an area.

Parameters
oAreaThe area.
iSkillThe skill to check.
Returns
The modifier to that skill in the area.

Definition at line 264 of file nwnx_skillranks.nss.

◆ NWNX_SkillRanks_SetAreaModifier()

void NWNX_SkillRanks_SetAreaModifier ( object  oArea,
int  iSkill,
int  iModifier 
)

Sets a skill modifier for the area.

Parameters
oAreaThe area.
iSkillThe skill to change.
iModifierThe modifier to the skill in the area.

Definition at line 275 of file nwnx_skillranks.nss.

Variable Documentation

◆ NWNX_SKILLRANKS_KEY_ABILITY_STRENGTH

const int NWNX_SKILLRANKS_KEY_ABILITY_STRENGTH = 1

Strength.

Definition at line 15 of file nwnx_skillranks.nss.

◆ NWNX_SKILLRANKS_KEY_ABILITY_DEXTERITY

const int NWNX_SKILLRANKS_KEY_ABILITY_DEXTERITY = 2

Dexterity.

Definition at line 16 of file nwnx_skillranks.nss.

◆ NWNX_SKILLRANKS_KEY_ABILITY_CONSTITUTION

const int NWNX_SKILLRANKS_KEY_ABILITY_CONSTITUTION = 4

Constitution.

Definition at line 17 of file nwnx_skillranks.nss.

◆ NWNX_SKILLRANKS_KEY_ABILITY_INTELLIGENCE

const int NWNX_SKILLRANKS_KEY_ABILITY_INTELLIGENCE = 8

Intelligence.

Definition at line 18 of file nwnx_skillranks.nss.

◆ NWNX_SKILLRANKS_KEY_ABILITY_WISDOM

const int NWNX_SKILLRANKS_KEY_ABILITY_WISDOM = 16

Wisdom.

Definition at line 19 of file nwnx_skillranks.nss.

◆ NWNX_SKILLRANKS_KEY_ABILITY_CHARISMA

const int NWNX_SKILLRANKS_KEY_ABILITY_CHARISMA = 32

Charisma.

Definition at line 20 of file nwnx_skillranks.nss.

◆ NWNX_SKILLRANKS_KEY_ABILITY_CALC_MIN

const int NWNX_SKILLRANKS_KEY_ABILITY_CALC_MIN = 64

Use the minimum value of the provided ability scores.

Definition at line 29 of file nwnx_skillranks.nss.

◆ NWNX_SKILLRANKS_KEY_ABILITY_CALC_MAX

const int NWNX_SKILLRANKS_KEY_ABILITY_CALC_MAX = 128

Use the maximum value of the provided ability scores.

Definition at line 30 of file nwnx_skillranks.nss.

◆ NWNX_SKILLRANKS_KEY_ABILITY_CALC_AVERAGE

const int NWNX_SKILLRANKS_KEY_ABILITY_CALC_AVERAGE = 256

Use the average value of the provided ability scores.

Definition at line 31 of file nwnx_skillranks.nss.

◆ NWNX_SKILLRANKS_KEY_ABILITY_CALC_SUM

const int NWNX_SKILLRANKS_KEY_ABILITY_CALC_SUM = 512

Use the sum of the provided ability scores.

Definition at line 32 of file nwnx_skillranks.nss.

NWNX_SkillRanks_SkillFeat::iFeat
int iFeat
The feat.
Definition: nwnx_skillranks.nss:39
NWNX_SkillRanks_SkillFeat::fClassLevelMod
float fClassLevelMod
Definition: nwnx_skillranks.nss:60
NWNX_SkillRanks_SkillFeat::iAreaFlagsForbidden
int iAreaFlagsForbidden
Used for feats like Stonecunning or Trackless Step which restrict skill modifiers by area types.
Definition: nwnx_skillranks.nss:66
NWNX_SkillRanks_GetSkillFeat
struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_GetSkillFeat(int iSkill, int iFeat)
Returns a skill feat.
Definition: nwnx_skillranks.nss:180
NWNX_SkillRanks_SkillFeat::iAreaFlagsRequired
int iAreaFlagsRequired
Used for feats like Stonecunning or Trackless Step which restrict skill modifiers by area types.
Definition: nwnx_skillranks.nss:63
NWNX_SKILLRANKS_KEY_ABILITY_CALC_MAX
const int NWNX_SKILLRANKS_KEY_ABILITY_CALC_MAX
Use the maximum value of the provided ability scores.
Definition: nwnx_skillranks.nss:30
NWNX_SkillRanks_SkillFeat::iSkill
int iSkill
The skill this feat impacts.
Definition: nwnx_skillranks.nss:38
NWNX_SkillRanks_SkillFeat::iKeyAbilityMask
int iKeyAbilityMask
Bitmask of abilities and method to calculate the ability modifier for a skill.
Definition: nwnx_skillranks.nss:80
NWNX_SkillRanks_SetAreaModifier
void NWNX_SkillRanks_SetAreaModifier(object oArea, int iSkill, int iModifier)
Sets a skill modifier for the area.
Definition: nwnx_skillranks.nss:275
NWNX_SkillRanks_SkillFeat
A feat that manipulates skill ranks.
Definition: nwnx_skillranks.nss:36
NWNX_SkillRanks_SkillFeat::iModifier
int iModifier
Skill feat bonus/penalty.
Definition: nwnx_skillranks.nss:42
NWNX_SKILLRANKS_KEY_ABILITY_WISDOM
const int NWNX_SKILLRANKS_KEY_ABILITY_WISDOM
Wisdom.
Definition: nwnx_skillranks.nss:19
NWNX_SkillRanks_AddSkillFeatClass
struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_AddSkillFeatClass(struct NWNX_SkillRanks_SkillFeat skillFeat, int iClass)
Add classes to a skill feat instead of working with the NWNX_SkillRanks_SkillFeat::sClasses string.
Definition: nwnx_skillranks.nss:225
NWNX_SkillRanks_SetSkillFeat
void NWNX_SkillRanks_SetSkillFeat(struct NWNX_SkillRanks_SkillFeat skillFeat, int createIfNonExistent=FALSE)
Modifies or creates a skill feat.
Definition: nwnx_skillranks.nss:205
NWNX_SkillRanks_SkillFeat::iDayOrNight
int iDayOrNight
Definition: nwnx_skillranks.nss:70
NWNX_SKILLRANKS_KEY_ABILITY_INTELLIGENCE
const int NWNX_SKILLRANKS_KEY_ABILITY_INTELLIGENCE
Intelligence.
Definition: nwnx_skillranks.nss:18