67 {
"<Male/Female>" , 156, 157},
68 {
"<male/female>" , 4924, 4925},
69 {
"<Boy/Girl>" , 4860, 4861},
70 {
"<boy/girl>" , 4862, 4863},
71 {
"<Brother/Sister>" , 4864, 4865},
72 {
"<brother/sister>" , 4866, 4867},
73 {
"<He/She>" , 4869, 4870},
74 {
"<he/she>" , 4871, 4872},
75 {
"<Him/Her>" , 4873, 4874},
76 {
"<him/her>" , 4875, 4876},
77 {
"<His/Her>" , 4877, 4874},
78 {
"<his/her>" , 4878, 4876},
79 {
"<His/Hers>" , 4877, 4879},
80 {
"<his/hers>" , 4878, 4880},
81 {
"<Lad/Lass>" , 4881, 4882},
82 {
"<lad/lass>" , 4883, 4884},
83 {
"<Lord/Lady>" , 4885, 4886},
84 {
"<lord/lady>" , 4887, 4888},
85 {
"<Man/Woman>" , 4926, 4927},
86 {
"<man/woman>" , 4928, 4929},
87 {
"<Master/Mistress>", 4930, 4931},
88 {
"<master/mistress>", 4932, 4933},
89 {
"<Mister/Missus>" , 4934, 4935},
90 {
"<mister/missus>" , 4936, 4937},
91 {
"<Sir/Madam>" , 4939, 4940},
92 {
"<sir/madam>" , 4941, 4942},
93 {
"<bitch/bastard>" , 1757, 1739}
154 std::vector<byte> md5;
186 e.
add(
"Can't load module \"%s\"", module.
c_str());
198 hasXP |=
ConfigMan.getBool(
"NWN_hasXP1") ? 1 : 0;
199 hasXP |=
ConfigMan.getBool(
"NWN_hasXP2") ? 2 : 0;
200 hasXP |=
ConfigMan.getBool(
"NWN_hasXP3") ? 4 : 0;
204 for (
int i = 0; i < 16; i++, xp >>= 1, hasXP >>= 1)
205 if ((xp & 1) && !(hasXP & 1))
206 throw Common::Exception(
"Module requires expansion %d and we don't have it", i + 1);
210 const std::vector<Common::UString> &haks =
_ifo.
getHAKs();
212 for (std::vector<Common::UString>::const_iterator h = haks.begin(); h != haks.end(); ++h)
213 if (!
ResMan.hasArchive(*h +
".hak"))
277 e.
add(
"Can't load PC \"%s\"", bic.
c_str());
329 _pc->clearVariables();
349 float entryX, entryY, entryZ, entryDirX, entryDirY;
353 const float entryAngle = -
Common::rad2deg(atan2(entryDirX, entryDirY));
355 _pc->setPosition(entryX, entryY, entryZ);
356 _pc->setOrientation(0.0f, 0.0f, 1.0f, entryAngle);
372 if (!startMovie.
empty())
380 CameraMan.setPosition(entryX, entryY, entryZ + 1.8f);
381 CameraMan.setOrientation(90.0f, 0.0f, entryAngle);
386 GfxMan.resumeAnimations();
418 if (area ==
_areas.end() || !area->second) {
484 if (event->key.keysym.sym == SDLK_ESCAPE) {
493 if ((event->key.keysym.sym == SDLK_d) && (event->key.keysym.mod & KMOD_CTRL)) {
522 if (now < action->timestamp)
527 action->owner, action->triggerer);
593 const std::vector<Common::UString> &haks =
_ifo.
getHAKs();
595 for (
size_t i = 0; i < haks.size(); i++)
604 {
"textures_tpc.erf",
"tiles_tpc.erf",
"xp1_tex_tpc.erf",
"xp2_tex_tpc.erf" },
605 {
"textures_tpa.erf",
"tiles_tpc.erf",
"xp1_tex_tpc.erf",
"xp2_tex_tpc.erf" },
606 {
"textures_tpa.erf",
"tiles_tpb.erf",
"xp1_tex_tpb.erf",
"xp2_tex_tpb.erf" },
607 {
"textures_tpa.erf",
"tiles_tpa.erf",
"xp1_tex_tpa.erf",
"xp2_tex_tpa.erf" }
611 int level =
ConfigMan.getInt(
"texturepack", 1);
620 status(
"Loading texture pack %d", level);
627 if (oldTexturePack != -1)
634 for (
int i = 0; i < 4; i++)
641 status(
"Loading areas...");
643 const std::vector<Common::UString> &areas =
_ifo.
getAreas();
644 for (
size_t i = 0; i < areas.size(); i++) {
645 status(
"Loading area \"%s\" (%d / %d)", areas[i].c_str(), (
int)i, (
int)areas.size() - 1);
647 std::pair<AreaMap::iterator, bool> result;
649 result =
_areas.insert(std::make_pair(areas[i], (
Area *) 0));
654 result.first->second =
new Area(*
this, areas[i].c_str());
656 e.
add(
"Can't load area \"%s\"", areas[i].c_str());
686 return _ingameGUI->startConversation(conv, pc, obj, playHello);
694 _pc->getPosition(x, y, z);
712 AreaMap::iterator a =
_areas.find(area);
724 _pc->setPosition(x, y, z);
734 _pc->getPosition(x, y, z);
741 if (
_pc->getArea()) {
764 action.
state = state;
765 action.
owner = owner;
806 if (!description.
empty())
809 if (!description.
empty())
#define ResMan
Shortcut for accessing the sound manager.
void checkHAKs()
Do we have all HAKs needed for the module?
AreaMap _areas
The areas in the current module.
bool isSave() const
Is the module a save file?
void showMenu()
Show the ingame main menu.
Creature * getPC()
Return the currently playing PC.
void preparePremiumModule(const Common::UString &module)
Check if this is premium module, and if so, prepare its loading.
void playVideo(const Common::UString &video)
Play this video resource.
void add(const char *s,...) GCC_PRINTF(2
void unloadAreas()
Unload the areas.
void hashMD5(ReadStream &stream, std::vector< byte > &digest)
Hash the stream into an MD5 digest of 16 bytes.
#define TalkMan
Shortcut for accessing the talk manager.
const Common::UString & getResRef()
Return the area's resref (resource ID).
const Common::UString & getTLK() const
Return the custom TLK table this module uses.
void readScripts(const Aurora::GFF3Struct &gff)
A class holding an UTF-8 string.
void replaceModule()
Actually replace the currently running module.
void changeModule(const Common::UString &module)
Schedule a change to a new module.
void enterArea()
Enter a new area.
bool _exit
Should we exit the module?
#define TextureMan
Shortcut for accessing the texture manager.
void unloadHAKs()
Unload the HAKs required by the module.
static UString getExtension(const UString &p)
Return a file name's extension.
The global config manager.
void loadTLK()
Load the TLK used by the module.
void unload()
Unload a currently loaded IFO.
bool indexOptionalArchive(const Common::UString &file, uint32 priority, const std::vector< byte > &password, Common::ChangeID *changeID)
The Aurora texture manager.
Aurora::NWScript::ObjectReference owner
Common::UString _name
The object's display name.
void unloadTLK()
Unload the TLK used by the module.
A simple streaming file reading class.
Basic Neverwinter Nights type definitions.
void loadHAKs()
Load the HAKs required by the module.
#define ARRAYSIZE(x)
Macro which determines the number of entries in a fixed size array.
Neverwinter Nights installation version detection.
void movePC(const Common::UString &area)
Move the player character to this area.
const Common::UString & getDescription() const
Return the object's description.
void getEntryDirection(float &x, float &y) const
Return the entry direction.
void clear()
Clear the whole context.
void show()
Show the area.
void removeFocus()
Forcibly remove the focus from the currently highlighted object.
const Version & getGameVersion() const
void exit()
Exit the currently running module.
An area in Neverwinter Nights, holding all objects and room tiles within, as well as general area pro...
The NWN ingame GUI elements.
bool _running
Are we currently running a module?
const Common::UString & getString(Language language, LanguageGender gender=kLanguageGenderCurrent) const
Get the string of that language.
Exception that provides a stack of explanations.
const LocString & getDescription() const
Return the description.
void delayScript(const Common::UString &script, const Aurora::NWScript::ScriptState &state, Aurora::NWScript::Object *owner, Aurora::NWScript::Object *triggerer, uint32 delay)
void deindexResources(Common::ChangeID &changeID)
Remove previously added resources from the ResourceManager.
ChangeList _resHAKs
Resources added by the HAKs of the module.
Aurora::NWScript::ObjectReference triggerer
Keyboard key was pressed.
The context needed to run a Neverwinter Nights module.
Common::ChangeID _resModule
Resources added by the module.
void loadTexturePack()
Load the texture pack.
const std::vector< Common::UString > & getHAKs() const
Return the list of required HAK files.
Basic exceptions to throw.
void load(Common::SeekableReadStream *stream, bool repairNWNPremium=false)
Take over this stream and load an IFO out of it.
void load(const Common::UString &module)
Load a module.
Common::ScopedPtr< IngameGUI > _ingameGUI
The ingame GUI elements.
void indexMandatoryArchive(const Common::UString &file, uint32 priority, const std::vector< byte > &password, Common::ChangeID *changeID)
The context holding a Neverwinter Nights area.
const char * c_str() const
Return the (utf8 encoded) string data.
ActionQueue _delayedActions
Common::ChangeID _resTP[4]
#define ConfigMan
Shortcut for accessing the config manager.
void enter()
Enter the loaded module, starting it.
Utility templates and functions.
An IFO (module information) file, describing global module properties in many Aurora games...
The NWN ingame GUI elements.
Fake value for a module object.
Area * getCurrentArea()
Return the area the PC is currently in.
const Aurora::IFOFile & getIFO() const
Return the IFO of the currently loaded module.
bool operator<(const Action &s) const
The global events manager.
void addEvent(const Events::Event &event)
Add a single event for consideration into the area event queue.
Types and functions related to language.
Handling BioWare's ERFs (encapsulated resource file).
bool isLoaded() const
Is a module currently loaded and ready to run?
const std::vector< Common::UString > & getAreas() const
Return the list of areas in the module.
void loadModule(const Common::UString &module)
Load the actual module.
bool isRunning() const
Is a module currently running?
Area * _currentArea
The current area.
Aurora::IFOFile _ifo
The module's IFO.
bool empty() const
Is the string empty?
#define TwoDAReg
Shortcut for accessing the 2da registry.
Generic Aurora engines (debug) console.
void addObject(NWN::Object &object)
Add an object to this container.
Common::UString _newArea
The new area to enter.
void warning(const char *s,...)
Common::ScopedPtr< Creature > _pc
The player character we use.
Module(::Engines::Console &console, const Version &gameVersion)
#define EventMan
Shortcut for accessing the events manager.
void usePC(const Common::UString &bic, bool local)
Use this character as the player character.
void hide()
Hide the area.
static const char *const texturePacks[4][4]
Implementing the stream reading interfaces for files.
void loadAreas()
Load the areas.
bool _hasModule
Do we have a module?
void unloadModule()
Unload the module.
static Common::UString getDescriptionCampaign(Common::UString module)
#define LangMan
Shortcut for accessing the language manager.
static Common::UString getDescriptionExtra(Common::UString module)
const GFF3Struct * getGFF() const
Return the IFO's GFF struct.
The global talk manager for Aurora strings.
A creature in a Neverwinter Nights area.
void processEventQueue()
Process the current event queue.
const LocString & getName() const
Return the name of the module.
Common::UString _newModule
The module we should change to.
void status(const char *s,...)
void printf(const char *s,...) GCC_PRINTF(2
bool startConversation(const Common::UString &conv, Creature &pc, NWN::Object &obj, bool playHello=true)
Start a conversation.
bool processEvent(const Events::Event &event)
#define CameraMan
Shortcut for accessing the camera manager.
static float rad2deg(float rad)
Generic Aurora engines utility functions.
Common::ChangeID _resTLK
Resources added for the custom TLK.
void processEventQueue()
Process the current event queue.
void checkXPs()
Do we have all expansions needed for the module?
The context handling the gameplay in Neverwinter Nights.
void unloadPC()
Unload the PC.
static bool isPremiumModule(const Common::UString &module)
Is this module file (including extension) a premium module?
void removeObject(NWN::Object &object)
Remove an object from this container.
Manager for tokens in Aurora engines text strings.
const Common::UString & getTag() const
Return the module's tag.
Aurora::NWScript::ScriptState state
uint16 getExpansions() const
Return the list of required expansions.
void leave()
Leave the running module, quitting it.
void getEntryPosition(float &x, float &y, float &z) const
Return the entry position.
const Common::UString & getEntryArea() const
Return the entry area.
Engine utility class for free-roam camera handling.
void clear()
Clear the string's contents.
bool runScript(Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
void movedPC()
Notify the module that the PC was moved.
Hashing/digesting using the MD5 algorithm.
::Engines::Console * _console
const Common::UString & getStartMovie() const
Return the starting movie.
#define TokenMan
Shortcut for accessing the token manager.
void addEvent(const Events::Event &event)
Add a single event for consideration into the event queue.
const Version * _gameVersion
#define GfxMan
Shortcut for accessing the graphics manager.
The global resource manager for Aurora resources.
Utility class for manipulating file paths.
static const GenderToken kGenderTokens[]
const Common::UString & getName()
Return the area's localized name.
static UString changeExtension(const UString &p, const UString &ext="")
Change a file name's extension.
void unload(bool completeUnload=true)
Unload the whole shebang.
void unloadTexturePack()
Unload the texture pack.