Example #1
0
void Functions::playSound(Aurora::NWScript::FunctionContext &ctx) {
	Witcher::Object *object = Witcher::ObjectContainer::toObject(ctx.getCaller());

	if (object)
		object->playSound(ctx.getParams()[0].getString());
	else
		::Engines::playSound(ctx.getParams()[0].getString(), Sound::kSoundTypeSFX);

	unimplementedFunction(ctx);
}
Example #2
0
void Functions::playSoundByStrRef(Aurora::NWScript::FunctionContext &ctx) {
	Witcher::Object *object = Witcher::ObjectContainer::toObject(ctx.getCaller());

	const Common::UString sound = TalkMan.getSoundResRef((uint32) ctx.getParams()[0].getInt());

	// TODO: Run as action
	// bool runAsAction = ctx.getParams()[1].getInt() != 0;

	if (object)
		object->playSound(sound);
	else
		::Engines::playSound(sound, Sound::kSoundTypeVoice);
}