NWNX:EE  8193.36.12
nwnx_race_2da.nss
Go to the documentation of this file.
1 #include "nwnx_race"
5 
10 int NWNX_Race_GetModifierConstant(string raceMod);
11 
16 void NWNX_Race_LoadRacialModifiers(string sColumnName = "RacialModsTable");
17 
18 int NWNX_Race_GetModifierConstant(string raceMod)
19 {
20  if (raceMod == "AB") return NWNX_RACE_MODIFIER_AB;
21  else if (raceMod == "ABVSRACE") return NWNX_RACE_MODIFIER_ABVSRACE;
22  else if (raceMod == "AC") return NWNX_RACE_MODIFIER_AC;
23  else if (raceMod == "ACVSRACE") return NWNX_RACE_MODIFIER_ACVSRACE;
24  else if (raceMod == "CONCEALMENT") return NWNX_RACE_MODIFIER_CONCEALMENT;
25  else if (raceMod == "DMGIMMUNITY") return NWNX_RACE_MODIFIER_DMGIMMUNITY;
26  else if (raceMod == "DMGREDUCTION") return NWNX_RACE_MODIFIER_DMGREDUCTION;
27  else if (raceMod == "DMGRESIST") return NWNX_RACE_MODIFIER_DMGRESIST;
28  else if (raceMod == "FEAT") return NWNX_RACE_MODIFIER_FEAT;
29  else if (raceMod == "FEATUSAGE") return NWNX_RACE_MODIFIER_FEATUSAGE;
30  else if (raceMod == "IMMUNITY") return NWNX_RACE_MODIFIER_IMMUNITY;
31  else if (raceMod == "INITIATIVE") return NWNX_RACE_MODIFIER_INITIATIVE;
32  else if (raceMod == "MOVEMENTSPEED") return NWNX_RACE_MODIFIER_MOVEMENTSPEED;
33  else if (raceMod == "RACE") return NWNX_RACE_MODIFIER_RACE;
34  else if (raceMod == "REGENERATION") return NWNX_RACE_MODIFIER_REGENERATION;
35  else if (raceMod == "SAVE") return NWNX_RACE_MODIFIER_SAVE;
36  else if (raceMod == "SAVEVSRACE") return NWNX_RACE_MODIFIER_SAVEVSRACE;
37  else if (raceMod == "SAVEVSTYPE") return NWNX_RACE_MODIFIER_SAVEVSTYPE;
38  else if (raceMod == "SKILL") return NWNX_RACE_MODIFIER_SKILL;
39  else if (raceMod == "SPELLIMMUNITY") return NWNX_RACE_MODIFIER_SPELLIMMUNITY;
40  else if (raceMod == "SRCHARGEN") return NWNX_RACE_MODIFIER_SRCHARGEN;
41  else if (raceMod == "SRINCLEVEL") return NWNX_RACE_MODIFIER_SRINCLEVEL;
43 }
44 
45 void NWNX_Race_LoadRacialModifiers(string sColumnName = "RacialModsTable")
46 {
47  int iRaceRows = Get2DARowCount("racialtypes");
48  int iRace;
49  for (iRace = 0; iRace < iRaceRows; iRace++)
50  {
51  string sRaceModTable = Get2DAString("racialtypes", sColumnName, iRace);
52  if(sRaceModTable != "")
53  {
54  int iRaceModRows = Get2DARowCount(sRaceModTable);
55  int iRaceMod;
56  for (iRaceMod = 0; iRaceMod < iRaceModRows; iRaceMod++)
57  {
58  string sType = Get2DAString(sRaceModTable, "Type", iRaceMod);
59  string sParam1 = Get2DAString(sRaceModTable, "Param1", iRaceMod);
60  string sParam2 = Get2DAString(sRaceModTable, "Param2", iRaceMod);
61  string sParam3 = Get2DAString(sRaceModTable, "Param3", iRaceMod);
62  int iParam1 = sParam1 == "" ? 0xDEADBEEF : StringToInt(sParam1);
63  int iParam2 = sParam2 == "" ? 0xDEADBEEF : StringToInt(sParam2);
64  int iParam3 = sParam3 == "" ? 0xDEADBEEF : StringToInt(sParam3);
65  NWNX_Race_SetRacialModifier(iRace, NWNX_Race_GetModifierConstant(sType), iParam1, iParam2, iParam3);
66  }
67  }
68  }
69 }
NWNX_RACE_MODIFIER_SAVEVSTYPE
const int NWNX_RACE_MODIFIER_SAVEVSTYPE
Definition: nwnx_race.nss:31
NWNX_RACE_MODIFIER_SRINCLEVEL
const int NWNX_RACE_MODIFIER_SRINCLEVEL
Definition: nwnx_race.nss:35
NWNX_RACE_MODIFIER_INITIATIVE
const int NWNX_RACE_MODIFIER_INITIATIVE
Definition: nwnx_race.nss:25
NWNX_RACE_MODIFIER_DMGREDUCTION
const int NWNX_RACE_MODIFIER_DMGREDUCTION
Definition: nwnx_race.nss:20
NWNX_Race_LoadRacialModifiers
void NWNX_Race_LoadRacialModifiers(string sColumnName="RacialModsTable")
Loops through racialtypes.2da and checks for the column for racial modifications and sets them.
Definition: nwnx_race_2da.nss:45
NWNX_RACE_MODIFIER_SAVE
const int NWNX_RACE_MODIFIER_SAVE
Definition: nwnx_race.nss:29
NWNX_RACE_MODIFIER_AC
const int NWNX_RACE_MODIFIER_AC
Definition: nwnx_race.nss:16
NWNX_RACE_MODIFIER_SRCHARGEN
const int NWNX_RACE_MODIFIER_SRCHARGEN
Definition: nwnx_race.nss:34
NWNX_RACE_MODIFIER_FEAT
const int NWNX_RACE_MODIFIER_FEAT
Definition: nwnx_race.nss:22
NWNX_RACE_MODIFIER_DMGRESIST
const int NWNX_RACE_MODIFIER_DMGRESIST
Definition: nwnx_race.nss:21
NWNX_RACE_MODIFIER_AB
const int NWNX_RACE_MODIFIER_AB
Definition: nwnx_race.nss:14
NWNX_RACE_MODIFIER_IMMUNITY
const int NWNX_RACE_MODIFIER_IMMUNITY
Definition: nwnx_race.nss:24
NWNX_RACE_MODIFIER_DMGIMMUNITY
const int NWNX_RACE_MODIFIER_DMGIMMUNITY
Definition: nwnx_race.nss:19
NWNX_RACE_MODIFIER_SAVEVSRACE
const int NWNX_RACE_MODIFIER_SAVEVSRACE
Definition: nwnx_race.nss:30
NWNX_RACE_MODIFIER_SKILL
const int NWNX_RACE_MODIFIER_SKILL
Definition: nwnx_race.nss:32
NWNX_RACE_MODIFIER_RACE
const int NWNX_RACE_MODIFIER_RACE
Definition: nwnx_race.nss:27
NWNX_Race_GetModifierConstant
int NWNX_Race_GetModifierConstant(string raceMod)
Translate a modifier type from a string to its constant.
Definition: nwnx_race_2da.nss:18
NWNX_RACE_MODIFIER_FEATUSAGE
const int NWNX_RACE_MODIFIER_FEATUSAGE
Definition: nwnx_race.nss:23
NWNX_RACE_MODIFIER_SPELLIMMUNITY
const int NWNX_RACE_MODIFIER_SPELLIMMUNITY
Definition: nwnx_race.nss:33
NWNX_RACE_MODIFIER_REGENERATION
const int NWNX_RACE_MODIFIER_REGENERATION
Definition: nwnx_race.nss:28
NWNX_RACE_MODIFIER_CONCEALMENT
const int NWNX_RACE_MODIFIER_CONCEALMENT
Definition: nwnx_race.nss:18
NWNX_RACE_MODIFIER_INVALID
const int NWNX_RACE_MODIFIER_INVALID
Definition: nwnx_race.nss:13
NWNX_RACE_MODIFIER_ACVSRACE
const int NWNX_RACE_MODIFIER_ACVSRACE
Definition: nwnx_race.nss:17
NWNX_Race_SetRacialModifier
void NWNX_Race_SetRacialModifier(int iRace, int iMod, int iParam1, int iParam2=0xDEADBEEF, int iParam3=0xDEADBEEF)
Sets a racial modifier.
Definition: nwnx_race.nss:69
NWNX_RACE_MODIFIER_MOVEMENTSPEED
const int NWNX_RACE_MODIFIER_MOVEMENTSPEED
Definition: nwnx_race.nss:26
NWNX_RACE_MODIFIER_ABVSRACE
const int NWNX_RACE_MODIFIER_ABVSRACE
Definition: nwnx_race.nss:15