NWNX:EE  8193.36.12
nwnx_skillranks.nss
Go to the documentation of this file.
1 #include "nwnx"
7 
8 const string NWNX_SkillRanks = "NWNX_SkillRanks";
9 
21 
33 
37 {
38  int iSkill;
39  int iFeat;
40 
42  int iModifier;
43 
47 
56  string sClasses;
57 
61 
64 
67 
71 
74 
81 };
82 
86 
92 
99 
103 void NWNX_SkillRanks_SetSkillFeat(struct NWNX_SkillRanks_SkillFeat skillFeat, int createIfNonExistent = FALSE);
104 
113 
120 void NWNX_SkillRanks_SetSkillFeatFocusModifier(int iModifier, int iEpic = FALSE);
121 
125 
130 
135 int NWNX_SkillRanks_GetAreaModifier(object oArea, int iSkill);
136 
141 void NWNX_SkillRanks_SetAreaModifier(object oArea, int iSkill, int iModifier);
142 
144 
146 {
147  string sFunc = "GetSkillFeatCountForSkill";
148 
150  NWNX_CallFunction(NWNX_SkillRanks, sFunc);
151 
152  return NWNX_GetReturnValueInt();
153 }
154 
156 {
157  string sFunc = "GetSkillFeatForSkillByIndex";
158 
159  NWNX_PushArgumentInt(iIndex);
161  NWNX_CallFunction(NWNX_SkillRanks, sFunc);
162 
163  struct NWNX_SkillRanks_SkillFeat skillFeat;
164 
165  skillFeat.iSkill = iSkill;
166  skillFeat.iFeat = NWNX_GetReturnValueInt();
167  skillFeat.iModifier = NWNX_GetReturnValueInt();
168  skillFeat.iFocusFeat = NWNX_GetReturnValueInt();
169  skillFeat.sClasses = NWNX_GetReturnValueString();
173  skillFeat.iDayOrNight = NWNX_GetReturnValueInt();
176 
177  return skillFeat;
178 }
179 
181 {
182  string sFunc = "GetSkillFeat";
183 
186  NWNX_CallFunction(NWNX_SkillRanks, sFunc);
187 
188  struct NWNX_SkillRanks_SkillFeat skillFeat;
189 
190  skillFeat.iSkill = iSkill;
191  skillFeat.iFeat = iFeat;
192  skillFeat.iModifier = NWNX_GetReturnValueInt();
193  skillFeat.iFocusFeat = NWNX_GetReturnValueInt();
194  skillFeat.sClasses = NWNX_GetReturnValueString();
198  skillFeat.iDayOrNight = NWNX_GetReturnValueInt();
201 
202  return skillFeat;
203 }
204 
205 void NWNX_SkillRanks_SetSkillFeat(struct NWNX_SkillRanks_SkillFeat skillFeat, int createIfNonExistent = FALSE)
206 {
207  string sFunc = "SetSkillFeat";
208 
209  NWNX_PushArgumentInt(createIfNonExistent);
216  // We only need to send the string from the point of the first set bit
217  NWNX_PushArgumentString(GetStringRight(skillFeat.sClasses,GetStringLength(skillFeat.sClasses)-FindSubString(skillFeat.sClasses,"1")));
218  NWNX_PushArgumentInt(skillFeat.iFocusFeat);
219  NWNX_PushArgumentInt(skillFeat.iModifier);
220  NWNX_PushArgumentInt(skillFeat.iFeat);
221  NWNX_PushArgumentInt(skillFeat.iSkill);
222  NWNX_CallFunction(NWNX_SkillRanks, sFunc);
223 }
224 
226 {
227  if (GetStringLength(skillFeat.sClasses) < 255)
228  {
229  int i;
230  string sPad;
231  for (i = 0; i < 255-GetStringLength(skillFeat.sClasses); i++) { sPad = sPad + "0"; }
232  skillFeat.sClasses = sPad + skillFeat.sClasses;
233  }
234  skillFeat.sClasses = GetStringLeft(skillFeat.sClasses, 254 - iClass) + "1" + GetStringRight(skillFeat.sClasses, iClass);
235  return skillFeat;
236 }
237 
238 void NWNX_SkillRanks_SetSkillFeatFocusModifier(int iModifier, int epicFocus = FALSE)
239 {
240  string sFunc = "SetSkillFeatFocusModifier";
241 
242  NWNX_PushArgumentInt(epicFocus);
243  NWNX_PushArgumentInt(iModifier);
244  NWNX_CallFunction(NWNX_SkillRanks, sFunc);
245 }
246 
248 {
249  string sFunc = "GetBlindnessPenalty";
250 
251  NWNX_CallFunction(NWNX_SkillRanks, sFunc);
252 
253  return NWNX_GetReturnValueInt();
254 }
255 
257 {
258  string sFunc = "SetBlindnessPenalty";
259 
260  NWNX_PushArgumentInt(iModifier);
261  NWNX_CallFunction(NWNX_SkillRanks, sFunc);
262 }
263 
264 int NWNX_SkillRanks_GetAreaModifier(object oArea, int iSkill)
265 {
266  string sFunc = "GetAreaModifier";
267 
268  NWNX_PushArgumentInt(iSkill);
270  NWNX_CallFunction(NWNX_SkillRanks, sFunc);
271 
272  return NWNX_GetReturnValueInt();
273 }
274 
275 void NWNX_SkillRanks_SetAreaModifier(object oArea, int iSkill, int iModifier)
276 {
277  string sFunc = "SetAreaModifier";
278 
279  NWNX_PushArgumentInt(iModifier);
280  NWNX_PushArgumentInt(iSkill);
282  NWNX_CallFunction(NWNX_SkillRanks, sFunc);
283 }
NWNX_SKILLRANKS_KEY_ABILITY_STRENGTH
const int NWNX_SKILLRANKS_KEY_ABILITY_STRENGTH
Strength.
Definition: nwnx_skillranks.nss:15
NWNX_GetReturnValueInt
int NWNX_GetReturnValueInt()
Returns the specified type from the c++ side.
Definition: nwnx.nss:94
NWNX_SkillRanks_GetSkillFeatForSkillByIndex
struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_GetSkillFeatForSkillByIndex(int iSkill, int iIndex)
Returns a skill feat by index.
Definition: nwnx_skillranks.nss:155
NWNX_SkillRanks_GetAreaModifier
int NWNX_SkillRanks_GetAreaModifier(object oArea, int iSkill)
Get a skill modifier for an area.
Definition: nwnx_skillranks.nss:264
NWNX_SkillRanks_SkillFeat::sClasses
string sClasses
255 char bitset string for skill ranks impacted by class levels (like Bardic Knowledge).
Definition: nwnx_skillranks.nss:56
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_SetSkillFeatFocusModifier
void NWNX_SkillRanks_SetSkillFeatFocusModifier(int iModifier, int iEpic=FALSE)
Change the modifier value for Skill Focus and Epic Skill Focus feats.
Definition: nwnx_skillranks.nss:238
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_KEY_ABILITY_CALC_MIN
const int NWNX_SKILLRANKS_KEY_ABILITY_CALC_MIN
Use the minimum value of the provided ability scores.
Definition: nwnx_skillranks.nss:29
NWNX_SkillRanks_GetSkillFeat
struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_GetSkillFeat(int iSkill, int iFeat)
Returns a skill feat.
Definition: nwnx_skillranks.nss:180
NWNX_GetReturnValueFloat
float NWNX_GetReturnValueFloat()
Returns the specified type from the c++ side.
Definition: nwnx.nss:99
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_CallFunction
void NWNX_CallFunction(string pluginName, string functionName)
Scripting interface to NWNX.
Definition: nwnx.nss:54
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_KEY_ABILITY_CALC_SUM
const int NWNX_SKILLRANKS_KEY_ABILITY_CALC_SUM
Use the sum of the provided ability scores.
Definition: nwnx_skillranks.nss:32
NWNX_GetReturnValueString
string NWNX_GetReturnValueString()
Returns the specified type from the c++ side.
Definition: nwnx.nss:109
NWNX_PushArgumentString
void NWNX_PushArgumentString(string value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:74
NWNX_SKILLRANKS_KEY_ABILITY_CALC_AVERAGE
const int NWNX_SKILLRANKS_KEY_ABILITY_CALC_AVERAGE
Use the average value of the provided ability scores.
Definition: nwnx_skillranks.nss:31
NWNX_SkillRanks_SkillFeat::iSkill
int iSkill
The skill this feat impacts.
Definition: nwnx_skillranks.nss:38
NWNX_PushArgumentObject
void NWNX_PushArgumentObject(object value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:69
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_GetBlindnessPenalty
int NWNX_SkillRanks_GetBlindnessPenalty()
Gets the current penalty to Dexterity based skills when blind.
Definition: nwnx_skillranks.nss:247
NWNX_PushArgumentInt
void NWNX_PushArgumentInt(int value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:59
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_GetSkillFeatCountForSkill
int NWNX_SkillRanks_GetSkillFeatCountForSkill(int iSkill)
Definition: nwnx_skillranks.nss:145
NWNX_SKILLRANKS_KEY_ABILITY_CONSTITUTION
const int NWNX_SKILLRANKS_KEY_ABILITY_CONSTITUTION
Constitution.
Definition: nwnx_skillranks.nss:17
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_SkillFeat::iFocusFeat
int iFocusFeat
Definition: nwnx_skillranks.nss:46
NWNX_SkillRanks_SetBlindnessPenalty
void NWNX_SkillRanks_SetBlindnessPenalty(int iModifier)
Set the value the Dexterity based skills get decreased due to blindness.
Definition: nwnx_skillranks.nss:256
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_KEY_ABILITY_DEXTERITY
const int NWNX_SKILLRANKS_KEY_ABILITY_DEXTERITY
Dexterity.
Definition: nwnx_skillranks.nss:16
NWNX_SkillRanks_SkillFeat::bBypassArmorCheckPenalty
int bBypassArmorCheckPenalty
This allows for feats that bypass the armor check penalty on skill rank calculations.
Definition: nwnx_skillranks.nss:73
NWNX_SKILLRANKS_KEY_ABILITY_CHARISMA
const int NWNX_SKILLRANKS_KEY_ABILITY_CHARISMA
Charisma.
Definition: nwnx_skillranks.nss:20
NWNX_SkillRanks_SkillFeat::iDayOrNight
int iDayOrNight
Definition: nwnx_skillranks.nss:70
NWNX_PushArgumentFloat
void NWNX_PushArgumentFloat(float value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:64
NWNX_SKILLRANKS_KEY_ABILITY_INTELLIGENCE
const int NWNX_SKILLRANKS_KEY_ABILITY_INTELLIGENCE
Intelligence.
Definition: nwnx_skillranks.nss:18