126 (*m)->setPosition(x, y, z);
134 (*m)->setOrientation(x, y, z, angle);
147 (*m)->drawBound(enabled);
308 if (appearance.
getInt(
"BodyType") == 1) {
322 float x, y, z, angle;
334 _ids.push_back((*m)->getID());
351 load(creature, utc ? &utc->getTopLevel() : 0);
357 load(gff->getTopLevel(), 0);
383 float bearingX = instance.
getDouble(
"XOrientation");
384 float bearingY = instance.
getDouble(
"YOrientation");
449 for (Aurora::GFF3List::const_iterator s = skills.begin(); s != skills.end(); ++s) {
461 for (Aurora::GFF3List::const_iterator f = feats.begin(); f != feats.end(); ++f) {
507 std::vector<Class> &classes,
uint8 &hitDice) {
516 for (Aurora::GFF3List::const_iterator c = cClasses.begin(); c != cClasses.end(); ++c) {
517 classes.push_back(
Class());
521 classes.back().classID = cClass.
getUint(
"Class");
522 classes.back().level = cClass.
getUint(
"ClassLevel");
524 hitDice += classes.back().level;
535 classID =
_classes[position].classID;
540 for (std::vector<Class>::const_iterator c =
_classes.begin(); c !=
_classes.end(); ++c)
541 if (c->classID == classID)
577 for (std::vector<uint32>::const_iterator f =
_feats.begin(); f !=
_feats.end(); ++f)
int64 getSint(const Common::UString &field, int64 def=0) const
uint16 getClassLevel(uint32 classID) const
Get the creature's level for this class.
Handling version V3.2/V3.3 of BioWare's GFFs (generic file format).
bool isClickable() const
Can the player click the object?
Neverwinter Nights 2 utility functions.
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
static const uint32 kSubRaceInvalid
uint8 _appearanceHead
The model variant used for the head.
int32 _baseHP
The creature's base maximum health points.
bool hasFeat(uint32 feat) const
Does the creature have this feat?
const Common::UString & getString(size_t column) const
Return the contents of a cell as a string.
bool getBool(const Common::UString &field, bool def=false) const
A class holding an UTF-8 string.
uint8 getGoodEvil() const
void reset(PointerType o=0)
Resets the pointer with the new value.
The global config manager.
void init()
Init the creature.
static const uint32 kClassInvalid
static Aurora::GFF3File * openPC(const Common::UString &bic, bool local)
void load(const Aurora::GFF3Struct &creature)
Load from a creature instance.
bool hasField(const Common::UString &field) const
Does this specific field exist?
void setSubRace(uint32 subRace)
Set the creature's subrace.
virtual void getOrientation(float &x, float &y, float &z, float &angle) const
Return the object's orientation.
uint32 getGender() const
Get the creature's gender.
std::vector< uint32 > _feats
The creature's feats.
A simple streaming file reading class.
uint32 _soundSet
The object's sound set, as an index into soundset.2da.
uint32 _appearanceID
The creature's general appearance.
uint64 getUint(const Common::UString &field, uint64 def=0) const
void loadModel()
Load the creature's model.
bool click(Object *triggerer=0)
The creature was clicked.
int32 _currentHP
The creature's current health points.
Aurora::GFF3File * loadOptionalGFF3(const Common::UString &gff3, Aurora::FileType type, uint32 id, bool repairNWNPremium)
Load a GFF3, but return 0 instead of throwing on error.
Common::UString _name
The object's display name.
An object within a NWN2 area.
void readVarTable(const Aurora::GFF3List &varTable)
Read the object's variable table.
Common::UString _lastName
The creature's last name.
void loadProperties(const Aurora::GFF3Struct &gff)
Load general creature properties.
A simple scoped smart pointer template.
bool loadArmorModel(const Common::UString &body, const Common::UString &armor, uint8 visualType, uint8 variation)
uint8 getAbility(Ability ability) const
Return a creature's ability score.
bool _usable
Is the object usable?
void unloadModel()
Unload the creature's model.
std::list< uint32 > _ids
The object's model IDs.
void leave()
The cursor left the creature.
uint8 getHitDice() const
Returns the number of hit dice, which is effectively the total number of levels.
A creature in a Neverwinter Nights 2 area.
const char * c_str() const
Return the (utf8 encoded) string data.
void replaceAll(uint32 what, uint32 with)
Replace all occurrences of a character with another character.
Common::UString getBaseModel(const Common::UString &base)
static UString format(const char *s,...) GCC_PRINTF(1
Print formatted data into an UString object, similar to sprintf().
void highlight(bool enabled)
(Un)Highlight the creature.
uint32 _age
The creature's age.
#define ConfigMan
Shortcut for accessing the config manager.
void readScripts(const Aurora::GFF3Struct &gff)
uint32 getRace() const
Return the creature's race value.
Utility templates and functions.
uint8 _appearanceFHair
The model variant used for female hair.
void hide()
Hide the creature's model.
void loadCharacter(const Common::UString &bic, bool local)
Load from a character file.
double getDouble(const Common::UString &field, double def=0.0) const
Handling BioWare's 2DAs (two-dimensional array).
uint32 getAge() const
Return the creature's age.
A GFF (generic file format) V3.2/V3.3 file, found in all Aurora games except Sonic Chronicles: The Da...
bool _isDM
Is the creature a DM?
bool _isPC
Is the creature a PC?
Common::UString _conversation
The object's default conversation.
bool empty() const
Is the string empty?
#define TwoDAReg
Shortcut for accessing the 2da registry.
uint8 _goodEvil
The creature's good/evil value (0-100).
Common::UString _deity
The creature's deity.
int8 getSkillRank(uint32 skill) const
Return the creature's rank in this skill.
void setGender(uint32 gender)
Set the creature's gender.
void warning(const char *s,...)
uint32 _gender
The creature's gender.
int32 getInt(size_t column) const
Return the contents of a cell as an int.
bool isPC() const
Is the creature a player character?
std::vector< const GFF3Struct * > GFF3List
void getClass(uint32 position, uint32 &classID, uint16 &level) const
Get the creature's class and level at that class slot position.
bool isDM() const
Is the creature a dungeon master?
bool loadHairModel(uint8 appearance)
Implementing the stream reading interfaces for files.
uint8 _lawChaos
The creature's law/chaos value (0-100).
uint32 _xp
The creature's experience.
uint8 _hitDice
The creature's hit dice.
virtual void setOrientation(float x, float y, float z, float angle)
Set the object's orientation.
Basic type definitions to handle files used in BioWare's Aurora engine.
const GFF3List & getList(const Common::UString &field) const
uint8 _appearanceMHair
The model variant used for male hair.
uint32 _subRace
The creature's subrace.
int32 getCurrentHP() const
Return the current HP this creature has.
int32 _bonusHP
The creature's bonus health points.
virtual void setPosition(float x, float y, float z)
Set the object's position within its area.
std::vector< Class > _classes
The creature's classes.
const GFF3Struct & getStruct(const Common::UString &field) const
std::vector< int8 > _skills
The creature's skills.
static const uint32 kFieldIDInvalid
void enter()
The cursor entered the creature.
uint8 _abilities[kAbilityMAX]
The creature's abilities.
virtual void getPosition(float &x, float &y, float &z) const
Return the object's position within its area.
const Common::UString & getLastName() const
Return the creature's last name.
void show()
Show the creature's model.
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
bool _static
Is the object static?
void setRace(uint32 race)
Set the creature's race.
static float rad2deg(float rad)
Generic Aurora engines utility functions.
Common::UString _firstName
The creature's first name.
bool runScript(Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
uint32 getSubRace() const
Return the creature's subrace value.
bool loadHeadModel(uint8 appearance)
Graphics::Aurora::Model * loadModelObject(const Common::UString &resref, const Common::UString &texture)
static const uint32 kBICID
void setOrientation(float x, float y, float z, float angle)
Set the creature's orientation.
bool isFemale() const
Is the creature female, do we need female dialogs tokens?
int32 getMaxHP() const
Return the max HP this creature can have.
uint8 getLawChaos() const
static void loadClasses(const Aurora::GFF3Struct &gff, std::vector< Class > &classes, uint8 &hitDice)
Load the creature's classes.
Creature template (user), GFF.
Creature()
Create a dummy creature instance.
void setPosition(float x, float y, float z)
Set the creature's position.
const Common::UString & getDeity() const
Get the creature's deity.
bool hasScript(Script script) const
uint32 _race
The creature's race.
Common::UString _description
The object's description.
static const uint32 kRaceInvalid
uint32 getXP() const
Return the creature's XP.
Generic Aurora engines model functions.
const Common::UString & getFirstName() const
Return the creature's first name.