NWNX:EE  8193.36.12
nwnx_feat_2da.nss
Go to the documentation of this file.
1 #include "nwnx_feat"
5 
10 int NWNX_Feat_GetModifierConstant(string featMod);
11 
15 void NWNX_Feat_LoadFeatModifiers(string sColumnName = "FeatModsTable");
16 
17 int NWNX_Feat_GetModifierConstant(string featMod)
18 {
19  if (featMod == "AB") return NWNX_FEAT_MODIFIER_AB;
20  else if (featMod == "ABILITY") return NWNX_FEAT_MODIFIER_ABILITY;
21  else if (featMod == "ABVSRACE") return NWNX_FEAT_MODIFIER_ABVSRACE;
22  else if (featMod == "AC") return NWNX_FEAT_MODIFIER_AC;
23  else if (featMod == "ACVSRACE") return NWNX_FEAT_MODIFIER_ACVSRACE;
24  else if (featMod == "ARCANESPELLFAILURE") return NWNX_FEAT_MODIFIER_ARCANESPELLFAILURE;
25  else if (featMod == "BONUSSPELL") return NWNX_FEAT_MODIFIER_BONUSSPELL;
26  else if (featMod == "CONCEALMENT") return NWNX_FEAT_MODIFIER_CONCEALMENT;
27  else if (featMod == "DMGREDUCTION") return NWNX_FEAT_MODIFIER_DMGREDUCTION;
28  else if (featMod == "DMGRESIST") return NWNX_FEAT_MODIFIER_DMGRESIST;
29  else if (featMod == "DMGIMMUNITY") return NWNX_FEAT_MODIFIER_DMGIMMUNITY;
30  else if (featMod == "IMMUNITY") return NWNX_FEAT_MODIFIER_IMMUNITY;
31  else if (featMod == "HASTE") return NWNX_FEAT_MODIFIER_HASTE;
32  else if (featMod == "MOVEMENTSPEED") return NWNX_FEAT_MODIFIER_MOVEMENTSPEED;
33  else if (featMod == "REGENERATION") return NWNX_FEAT_MODIFIER_REGENERATION;
34  else if (featMod == "SAVE") return NWNX_FEAT_MODIFIER_SAVE;
35  else if (featMod == "SAVEVSRACE") return NWNX_FEAT_MODIFIER_SAVEVSRACE;
36  else if (featMod == "SAVEVSTYPE") return NWNX_FEAT_MODIFIER_SAVEVSTYPE;
37  else if (featMod == "SAVEVSTYPERACE") return NWNX_FEAT_MODIFIER_SAVEVSTYPERACE;
38  else if (featMod == "SEEINVISIBLE") return NWNX_FEAT_MODIFIER_SEEINVISIBLE;
39  else if (featMod == "SPELLIMMUNITY") return NWNX_FEAT_MODIFIER_SPELLIMMUNITY;
40  else if (featMod == "SRCHARGEN") return NWNX_FEAT_MODIFIER_SRCHARGEN;
41  else if (featMod == "SRINCLEVEL") return NWNX_FEAT_MODIFIER_SRINCLEVEL;
42  else if (featMod == "SPELLSAVEDC") return NWNX_FEAT_MODIFIER_SPELLSAVEDC;
43  else if (featMod == "TRUESEEING") return NWNX_FEAT_MODIFIER_TRUESEEING;
44  else if (featMod == "ULTRAVISION") return NWNX_FEAT_MODIFIER_ULTRAVISION;
45  else if (featMod == "VISUALEFFECT") return NWNX_FEAT_MODIFIER_VISUALEFFECT;
46  else if (featMod == "SPELLSAVEDCFORSCHOOL") return NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSCHOOL;
47  else if (featMod == "SPELLSAVEDCFORSPELL") return NWNX_FEAT_MODIFIER_SPELLSAVEDCFORSPELL;
48 
50 }
51 
52 void NWNX_Feat_LoadFeatModifiers(string sColumnName = "FeatModsTable")
53 {
54  int iFeatRows = Get2DARowCount("feat");
55  int iFeat;
56  for (iFeat = 0; iFeat < iFeatRows; iFeat++)
57  {
58  string sFeatModTable = Get2DAString("feat", sColumnName, iFeat);
59  if(sFeatModTable != "")
60  {
61  int iFeatModRows = Get2DARowCount(sFeatModTable);
62  int iFeatMod;
63  for (iFeatMod = 0; iFeatMod < iFeatModRows; iFeatMod++)
64  {
65  string sType = Get2DAString(sFeatModTable, "Type", iFeatMod);
66  string sParam1 = Get2DAString(sFeatModTable, "Param1", iFeatMod);
67  string sParam2 = Get2DAString(sFeatModTable, "Param2", iFeatMod);
68  string sParam3 = Get2DAString(sFeatModTable, "Param3", iFeatMod);
69  string sParam4 = Get2DAString(sFeatModTable, "Param4", iFeatMod);
70  int iParam1 = sParam1 == "" ? 0xDEADBEEF : StringToInt(sParam1);
71  int iParam2 = sParam2 == "" ? 0xDEADBEEF : StringToInt(sParam2);
72  int iParam3 = sParam3 == "" ? 0xDEADBEEF : StringToInt(sParam3);
73  int iParam4 = sParam4 == "" ? 0xDEADBEEF : StringToInt(sParam4);
74  NWNX_Feat_SetFeatModifier(iFeat, NWNX_Feat_GetModifierConstant(sType), iParam1, iParam2, iParam3, iParam4);
75  }
76  }
77  }
78 }
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_LoadFeatModifiers
void NWNX_Feat_LoadFeatModifiers(string sColumnName="FeatModsTable")
Loops through feat.2da and checks for the column for feat modifications and sets them.
Definition: nwnx_feat_2da.nss:52
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_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_INVALID
const int NWNX_FEAT_MODIFIER_INVALID
Definition: nwnx_feat.nss:13
NWNX_FEAT_MODIFIER_SAVEVSTYPERACE
const int NWNX_FEAT_MODIFIER_SAVEVSTYPERACE
Definition: nwnx_feat.nss:30
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_GetModifierConstant
int NWNX_Feat_GetModifierConstant(string featMod)
Translate a modifier type from a string to its constant.
Definition: nwnx_feat_2da.nss:17
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