xoreos  0.0.5
functions_conversation.cpp
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #include "src/common/util.h"
26 
27 #include "src/aurora/talkman.h"
28 
30 
31 #include "src/engines/nwn2/game.h"
35 
37 
38 namespace Engines {
39 
40 namespace NWN2 {
41 
44 
45  if (object)
46  object->speakString(ctx.getParams()[0].getString(), ctx.getParams()[1].getInt());
47 }
48 
51  if (!object)
52  return;
53 
54  // TODO: Volume
55  const uint32 strRef = (uint32) ctx.getParams()[0].getInt();
56  const uint32 volume = (uint32) ctx.getParams()[1].getInt();
57 
58  object->speakString(TalkMan.getString(strRef).c_str(), volume);
59 }
60 
63  if (!object)
64  return;
65 
66  const Common::UString &dlg = ctx.getParams()[0].getString();
68 
69  object->speakOneLiner(dlg, tokenTarget);
70 }
71 
72 } // End of namespace NWN2
73 
74 } // End of namespace Engines
void speakOneLinerConversation(Aurora::NWScript::FunctionContext &ctx)
The context handling the gameplay in Neverwinter Nights 2.
#define TalkMan
Shortcut for accessing the talk manager.
Definition: talkman.h:111
static NWN2::Object * toObject(::Aurora::NWScript::Object *object)
A class holding an UTF-8 string.
Definition: ustring.h:48
Context of an NWScript function.
An object within a NWN2 area.
Definition: object.h:58
The context needed to run a Neverwinter Nights 2 module.
Neverwinter Nights 2 engine functions.
A container of Neverwinter Nights 2 objects.
Utility templates and functions.
void speakString(const Common::UString &string, uint32 volume)
Speak the specified string.
Definition: object.cpp:245
void speakString(Aurora::NWScript::FunctionContext &ctx)
void speakStringByStrRef(Aurora::NWScript::FunctionContext &ctx)
uint32_t uint32
Definition: types.h:204
The global talk manager for Aurora strings.
static Aurora::NWScript::Object * getParamObject(const Aurora::NWScript::FunctionContext &ctx, size_t n)
Definition: functions.cpp:118
An object in a Neverwinter Nights 2 area.