82 for (; ab < 6; ++ab) {
89 for (std::vector<uint8>::iterator s =
_skills.begin(); s !=
_skills.end(); ++s, ++skillID)
108 for (
size_t lvl = 0; lvl <
_spells.size(); ++lvl) {
109 for (
size_t s = 0; s <
_spells[lvl].size(); ++s)
171 warning(
"Setting invalid race: %d", race);
183 for (
size_t it = 0; it < twodaFeatRace.
getRowCount(); ++it) {
200 for (
size_t it = 0; it < twodaClsFeat.
getRowCount(); ++it) {
202 if (rowFeat.
getInt(
"List") != 3)
219 std::vector<uint8> racialAbilities) {
243 std::vector<uint32> packFeats;
245 std::list<FeatItem> availFeats;
246 uint8 normalFeats, bonusFeats;
248 while (normalFeats + bonusFeats != 0) {
249 for (std::vector<uint32>::iterator pF = packFeats.begin(); pF != packFeats.end(); ++pF) {
250 if (normalFeats + bonusFeats == 0)
252 for (std::list<FeatItem>::iterator aF = availFeats.begin(); aF != availFeats.end(); ++aF) {
253 if (*pF != (*aF).featId)
257 if (bonusFeats > 0 && (*aF).list > 0) {
263 if ((normalFeats > 0 && (*aF).list == 0) ||
264 (normalFeats > 0 && (*aF).list < 2 && bonusFeats == 0)) {
277 if (rowClass.
getInt(
"SpellCaster") > 0) {
278 if (rowClass.
getString(
"SpellGainTable") ==
"CLS_SPGN_WIZ" &&
286 }
else if (rowClass.
getString(
"SpellGainTable") ==
"CLS_SPGN_CLER" &&
290 }
else if (!rowClass.
empty(
"SpellKnownTable")) {
320 if (
_spells.size() < spellLevel + 1)
321 _spells.resize(spellLevel + 1);
323 _spells[spellLevel].push_back(spell);
356 if (row.
empty(
"FEAT"))
359 if (!row.
getInt(
"ALLCLASSESCANUSE") && !isClassFeat)
382 if (!row.
empty(
"OrReqFeat0")) {
384 if (!row.
empty(
"OrReqFeat1")) {
386 if (!row.
empty(
"OrReqFeat2")) {
388 if (!row.
empty(
"OrReqFeat3")) {
390 if (!row.
empty(
"OrReqFeat4"))
413 if (!row.
empty(
"REQSKILL")) {
419 if (!row.
empty(
"REQSKILL2")) {
428 if (!row.
getInt(
"GAINMULTIPLE"))
465 int8 modifier = (totalAbility - totalAbility % 2) / 2;
487 if (row.
empty(
"School"))
510 feats.push_back(featID);
520 for (
size_t r = 0; r < twodaPckSkills.
getRowCount(); ++r)
538 std::map<uint32, Common::UString> spellCasterClass;
539 spellCasterClass[1] =
"Bard";
540 spellCasterClass[2] =
"Cleric";
541 spellCasterClass[3] =
"Druid";
542 spellCasterClass[6] =
"Paladin";
543 spellCasterClass[7] =
"Ranger";
544 spellCasterClass[9] =
"Wiz_Sorc";
545 spellCasterClass[10] =
"Wiz_Sorc";
548 for (
size_t r = 0; r < twodaPckSpells.
getRowCount(); ++r) {
553 if (spells.size() < spellLevel + 1)
554 spells.resize(spellLevel + 1);
556 spells[spellLevel].push_back(spellIndex);
567 availRank += (
int8) rowClass.
getInt(
"SkillPointBase");
576 return (
uint8) availRank;
588 for (
size_t s = 0; s < twoDaSkillsClass.
getRowCount(); ++s) {
590 size_t skillIndex = skillsClassRow.
getInt(
"SkillIndex");
597 bool classSkill = skillsClassRow.
getInt(
"ClassSkill") != 0;
603 skillName +=
" " +
TalkMan.getString(52951);
605 maxRank = (maxRank - maxRank % 2) / 2;
614 skill.
name = skillName;
616 skill.
help = helpText;
618 skills.push_back(skill);
650 for (
size_t it = 0; it < twodaFeats.
getRowCount(); ++it) {
665 if (!featRow.
empty(
"MASTERFEAT"))
668 feats.push_back(feat);
673 for (
size_t it = 0; it < twodaClsFeat.
getRowCount(); ++it) {
687 for (std::list<FeatItem>::iterator f = feats.begin(); f != feats.end(); ++f) {
688 if (
id != (*f).featId)
708 if (!featRow.
empty(
"MASTERFEAT"))
711 feats.push_back(feat);
An inventory item in Neverwinter Nights.
Class to hold the two-dimensional array of a 2DA file.
void setGender(Gender gender)
Set the creature's gender.
Handling version V3.2/V3.3 of BioWare's GFFs (generic file format).
void setSkill(size_t skillIndex, uint8 rank)
uint8 getHitDice() const
Returns the number of hit dice, which is effectively the total number of levels.
void setAbility(Ability ability, uint8 score)
Set the creature's ability score.
#define TalkMan
Shortcut for accessing the talk manager.
const Common::UString & getString(size_t column) const
Return the contents of a cell as a string.
void getPrefDomains(uint8 &domain1, uint8 &domain2)
std::vector< std::vector< uint16 > > _spells
A class holding an UTF-8 string.
bool getAlign(uint8 &goodness, uint8 &lawfulness) const
void setSoundSet(uint32 soundSet)
Set the creature's sound set.
void setRace(uint32 race)
Set the creature's race.
void setAlign(uint8 goodness, uint8 lawfulness)
std::vector< uint32 > _classFeats
uint8 computeAvailSkillRank()
Common::UString description
const Creature & getCharacter()
void setNotUsedSkills(uint8 notUsedSkills)
bool hasFeat(uint32 feat) const
Does the creature have this feat?
void setPackage(uint8 package)
void setColorTatto1(uint32 colorTattoo1)
Set the creature's color tattoo 1.
const GFF3Struct & getTopLevel() const
Returns the top-level struct.
void setColorHair(uint32 colorHair)
Set the creature's color hair.
size_t getRowCount() const
Return the number of rows in the array.
void setSoundSet(uint32 soundSetID)
void setPhenotype(uint32 phenotype)
Set the creature's phenotype.
void setLawChaos(uint8 lawfulness)
Set the creature's law-chaos alignment.
uint8 getTotalAbility(Ability ability) const
std::vector< uint32 > _normalFeats
The context needed to run a Neverwinter Nights module.
void setColorSkin(uint32 colorSkin)
Set the creature's color skin.
void setClass(uint32 classId)
uint8 getAbility(Ability ability) const
Utility templates and functions.
void getPrefFeats(std::vector< uint32 > &feats)
void setSchool(uint32 classID, uint8 school)
Set the creature's school.
Handling BioWare's 2DAs (two-dimensional array).
void setPortrait(const Common::UString &portrait)
Set the creature's portrait.
void setRace(uint32 race)
int8 getAbilityModifier(Ability ability)
A GFF (generic file format) V3.2/V3.3 file, found in all Aurora games except Sonic Chronicles: The Da...
void getPrefSkills(std::vector< uint8 > &skills)
void setFeat(uint32 feat)
Append a feat to the creature.
void setDomains(uint32 classID, uint8 domain1, uint8 domain2)
Set clerical domains.
uint16 getClassLevel(uint32 classID) const
Get the creature's level for this class.
#define TwoDAReg
Shortcut for accessing the 2da registry.
void setHead(uint32 headID)
Set the creature's head.
bool hasPrereqFeat(uint32 featId, bool isClassFeat)
void useCharacter(Module *module)
bool hasFeat(uint32 featId) const
void warning(const char *s,...)
void changeClassLevel(uint32 classID, int16 levelChange)
Set the creature's level for this class.
int32 getInt(size_t column) const
Return the contents of a cell as an int.
void getFeatItems(std::list< FeatItem > &feats, uint8 &normalFeats, uint8 &bonusFeats)
std::vector< uint8 > _abilities
void setSpell(size_t spellLevel, uint16 spell)
void usePC(const Common::UString &bic, bool local)
Use this character as the player character.
static const uint32 kRaceInvalid
uint8 getPrefSpellSchool()
void setKnownSpell(uint32 classID, size_t spellLevel, uint16 spell)
Set a creature's known spell.
void setPortrait(const Common::UString &portrait)
void getPrefSpells(std::vector< std::vector< uint16 > > &spells)
bool empty(size_t column) const
Check if the cell is empty.
std::vector< uint8 > _racialAbilities
uint32 getRace() const
Return the creature's race value.
const TwoDARow & getRow(size_t row) const
Get a row.
void setGender(Gender gender)
void setGoodEvil(uint8 goodness)
Set the creature's good-evil alignment.
The global talk manager for Aurora strings.
A creature in a Neverwinter Nights area.
Item template (user), GFF.
uint8 getSpellSchool() const
void setDomains(uint8 domain1, uint8 domain2)
static const uint32 kFieldIDInvalid
std::vector< uint32 > _racialFeats
void setFeat(uint32 feat)
void setColorTatto2(uint32 colorTattoo2)
Set the creature's color tatto 2.
void setStartingPackage(uint8 package)
Set the creature's starting package.
void setSpellSchool(uint8 spellSchool)
uint8 list
The kind of list the feat belongs to: 0 (general feat), 2 (bonus feat), 1 (both)
void setAppearance(uint32 appearanceID)
Set the creature's appearance.
The character choices in the character generator.
std::vector< uint8 > _skills
void addEquippedItem(Item *item)
Add an equippement to the creature.
void setAbilities(std::vector< uint8 > abilities, std::vector< uint8 > racialAbilities)
void getSkillItems(std::vector< SkillItem > &skills)
size_t headerToColumn(const Common::UString &header) const
Translate a column header to a column index.
void getFeats(std::vector< uint32 > &feats)
void setSkillRank(size_t skill, uint8 rank)
Set the creature's skill rank.