Пример #1
0
void Functions::random(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = std::rand() % ctx.getParams()[0].getInt();
}
Пример #2
0
void Functions::getStringByStrRef(Aurora::NWScript::FunctionContext &ctx) {
	const uint32 strRef = (uint32) ctx.getParams()[0].getInt();
	const Aurora::LanguageGender gender = (Aurora::LanguageGender) ctx.getParams()[1].getInt();

	ctx.getReturn() = TalkMan.getString(strRef, gender);
}
Пример #3
0
void Functions::printInteger(Aurora::NWScript::FunctionContext &ctx) {
	status("Witcher: %d", ctx.getParams()[0].getInt());
}
Пример #4
0
void Functions::stringToInt(Aurora::NWScript::FunctionContext &ctx) {
	int32 i = 0;
	Common::parseString(ctx.getParams()[0].getString(), i);

	ctx.getReturn() = i;
}
Пример #5
0
void Functions::getStringLength(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = (int32) ctx.getParams()[0].getString().size();
}
Пример #6
0
void Functions::printToLogWindow(Aurora::NWScript::FunctionContext &ctx) {
	status("DragonAge: LOG(%s): %s", ctx.getParams()[1].getString().c_str(),
	       ctx.getParams()[0].getString().c_str());
}
Пример #7
0
void Functions::intToString(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = Common::composeString(ctx.getParams()[0].getInt());
}
Пример #8
0
void Functions::printObject(Aurora::NWScript::FunctionContext &ctx) {
	Aurora::NWScript::Object *object = ctx.getParams()[0].getObject();

	status("KotOR: object<%s,%p)", Aurora::NWScript::formatTag(object).c_str(), static_cast<void *>(object));
}
Пример #9
0
void Functions::printObject(Aurora::NWScript::FunctionContext &ctx) {
	Aurora::NWScript::Object *object = ctx.getParams()[0].getObject();

	status("DragonAge: object<%s,%p)", Aurora::NWScript::formatTag(object).c_str(), (void *) object);
}
Пример #10
0
void Functions::actionSpeakString(Aurora::NWScript::FunctionContext &ctx) {
	NWN2::Object *object = NWN2::ObjectContainer::toObject(ctx.getCaller());

	if (object)
		object->speakString(ctx.getParams()[0].getString(), ctx.getParams()[1].getInt());
}
Пример #11
0
void Functions::getStringByStrRef(Aurora::NWScript::FunctionContext &ctx) {
	const uint32 strRef = (uint32) ctx.getParams()[0].getInt();

	ctx.getReturn() = TalkMan.getString(strRef);
}
Пример #12
0
void Functions::vector(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn().setVector(ctx.getParams()[0].getFloat(),
	                          ctx.getParams()[1].getFloat(),
	                          ctx.getParams()[2].getFloat());
}
Пример #13
0
void Functions::floatToInt(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = (int32) ctx.getParams()[0].getFloat();
}
Пример #14
0
void Functions::intToFloat(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = (float) ctx.getParams()[0].getInt();
}
Пример #15
0
void Functions::printWarning(Aurora::NWScript::FunctionContext &ctx) {
	status("DragonAge: WARNING: %s", ctx.getParams()[0].getString().c_str());
}
Пример #16
0
void Functions::printResource(Aurora::NWScript::FunctionContext &ctx) {
	const bool prepend = ctx.getParams()[1].getInt() != 0;

	status("DragonAge: %s%s", prepend ? "PRINTRESOURCE" : "", ctx.getParams()[0].getString().c_str());
}
Пример #17
0
void Functions::DEBUG_printToScreen(Aurora::NWScript::FunctionContext &ctx) {
	status("DragonAge: DEBUG: %s", ctx.getParams()[0].getString().c_str());
}
Пример #18
0
void Functions::objectToString(Aurora::NWScript::FunctionContext &ctx) {
	Aurora::NWScript::Object *object = ctx.getParams()[0].getObject();

	ctx.getReturn() = Common::UString::format("object<%s,%p)", Aurora::NWScript::formatTag(object).c_str(),
	                                          (void *) object);
}
Пример #19
0
void Functions::musicBackgroundChangeNight(Aurora::NWScript::FunctionContext &ctx) {
	Area *area = NWN::ObjectContainer::toArea(getParamObject(ctx, 0));
	if (area)
		area->setMusicNightTrack(ctx.getParams()[1].getInt());
}
Пример #20
0
void Functions::vectorToString(Aurora::NWScript::FunctionContext &ctx) {
	float x, y, z;
	ctx.getParams()[0].getVector(x, y, z);

	ctx.getReturn() = Common::UString::format("%f %f %f", x, y, z);
}
Пример #21
0
void Functions::intToHexString(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = Common::UString::format("0x%08x", (uint32) ctx.getParams()[0].getInt());
}
Пример #22
0
void Functions::resourceToString(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = ctx.getParams()[0];
}
Пример #23
0
void Functions::stringToFloat(Aurora::NWScript::FunctionContext &ctx) {
	float f = 0;
	Common::parseString(ctx.getParams()[0].getString(), f);

	ctx.getReturn() = f;
}
Пример #24
0
void Functions::intToChar(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = Common::UString((uint32) (ctx.getParams()[0].getInt() & 0x7F), 1);
}
Пример #25
0
void Functions::getStringLowerCase(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = ctx.getParams()[0].getString().toLower();
}
Пример #26
0
void Functions::isStringEmpty(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = ctx.getParams()[0].getString().empty();
}
Пример #27
0
void Functions::writeTimestampedLogEntry(Aurora::NWScript::FunctionContext &ctx) {
	const Common::UString tstamp = Common::DateTime(Common::DateTime::kUTC).formatDateTimeISO('T', '-', ':');

	status("Witcher: %s: %s", tstamp.c_str(), ctx.getParams()[0].getString().c_str());
}
Пример #28
0
void Functions::getStringByStringId(Aurora::NWScript::FunctionContext &ctx) {
	const uint32 strRef = (uint32) ctx.getParams()[0].getInt();

	ctx.getReturn() = TalkMan.getString(strRef, Aurora::kLanguageGenderMale);
}
Пример #29
0
void Functions::printString(Aurora::NWScript::FunctionContext &ctx) {
	status("Witcher: %s", ctx.getParams()[0].getString().c_str());
}
Пример #30
0
void Functions::sqrt(Aurora::NWScript::FunctionContext &ctx) {
	ctx.getReturn() = sqrtf(ctx.getParams()[0].getFloat());
}