169 object->getPosition(x, y, z);
174 #define SQR(x) ((x) * (x)) 180 if (!object1 || !object2)
219 while ((
object = search->next())) {
239 size_t nth = MAX<int32>(ctx.
getParams()[2].getInt() - 1, 0);
244 std::list<Object *> objects;
245 while ((
object = search->next())) {
248 if (!nwnObject || (nwnObject == target) || (nwnObject->
getArea() != target->
getArea()))
256 if (type & objectType)
257 objects.push_back(nwnObject);
262 std::list<Object *>::iterator it = objects.begin();
263 for (
size_t n = 0; (n < nth) && (it != objects.end()); ++n)
266 if (it != objects.end())
281 size_t nth = MAX<int32>(ctx.
getParams()[2].getInt() - 1, 0);
286 std::list<Object *> objects;
287 while ((
object = search->next())) {
290 if (!nwnObject || (nwnObject == target) || (nwnObject->
getArea() != target->
getArea()))
293 objects.push_back(nwnObject);
298 std::list<Object *>::iterator it = objects.begin();
299 for (
size_t n = 0; (n < nth) && (it != objects.end()); ++n)
302 if (it != objects.end())
313 size_t nth = MAX<int32>(ctx.
getParams()[3].getInt() - 1, 0);
328 std::list<Object *> creatures;
329 while ((
object = search->next())) {
332 if (creature && (creature != target) && (creature->
getArea() == target->
getArea()))
333 creatures.push_back(creature);
338 std::list<Object *>::iterator it = creatures.begin();
339 for (
size_t n = 0; (n < nth) && (it != creatures.end()); ++n)
342 if (it != creatures.end())
353 float speed = ctx.
getParams()[1].getFloat();
354 float seconds = ctx.
getParams()[2].getFloat();
364 if (seconds < 0.0f) {
386 object->playAnimation(animation,
true, seconds, speed);
393 if (!
object || !moveTo)
399 jumpTo(
object, moveTo->getArea(), x, y, z);
409 if (!
object || !moveTo)
413 moveTo->getPosition(x, y, z);
415 jumpTo(
object, moveTo->getArea(), x, y, z);
void getWaypointByTag(Aurora::NWScript::FunctionContext &ctx)
void getLocation(Aurora::NWScript::FunctionContext &ctx)
Creature * getPC()
Return the currently playing PC.
void getName(Aurora::NWScript::FunctionContext &ctx)
void jumpTo(NWN::Object *object, Area *area, float x, float y, float z)
A container of Neverwinter Nights objects.
Object * getTriggerer() const
void getLocalInt(Aurora::NWScript::FunctionContext &ctx)
A class holding an UTF-8 string.
void setLocalObject(Aurora::NWScript::FunctionContext &ctx)
void jumpToLocation(Aurora::NWScript::FunctionContext &ctx)
static Creature * toCreature(Aurora::NWScript::Object *object)
Context of an NWScript function.
void getNearestObject(Aurora::NWScript::FunctionContext &ctx)
Area * getArea() const
Return the area this object is currently in.
void getLocalObject(Aurora::NWScript::FunctionContext &ctx)
Object * getCaller() const
void getLocalString(Aurora::NWScript::FunctionContext &ctx)
Basic Neverwinter Nights type definitions.
void setLocalFloat(Aurora::NWScript::FunctionContext &ctx)
static NWN::Object * toObject(::Aurora::NWScript::Object *object)
void getClickingObject(Aurora::NWScript::FunctionContext &ctx)
void playAnimation(Aurora::NWScript::FunctionContext &ctx)
void getEnteringObject(Aurora::NWScript::FunctionContext &ctx)
static Location * toLocation(Aurora::NWScript::EngineType *engineType)
A simple scoped smart pointer template.
A class able to sort objects by distance to a target object.
The context needed to run a Neverwinter Nights module.
void getIsObjectValid(Aurora::NWScript::FunctionContext &ctx)
static Aurora::NWScript::Object * getParamObject(const Aurora::NWScript::FunctionContext &ctx, size_t n)
const char * c_str() const
Return the (utf8 encoded) string data.
virtual void getPosition(float &x, float &y, float &z) const
Return the object's position within its area.
Utility templates and functions.
void getExitingObject(Aurora::NWScript::FunctionContext &ctx)
void setVector(float x, float y, float z)
ObjectSearch * findObjectsByTag(const Common::UString &tag) const
Return a search context to iterate over all objects with this tag.
ObjectSearch * findObjects() const
Return a search context to iterate over all objects.
bool empty() const
Is the string empty?
void getObjectType(Aurora::NWScript::FunctionContext &ctx)
const Common::UString & getName() const
A scoped plain pointer, allowing pointer-y access and normal deletion.
void warning(const char *s,...)
void getArea(Aurora::NWScript::FunctionContext &ctx)
void getPosition(Aurora::NWScript::FunctionContext &ctx)
An object in a Neverwinter Nights area.
void getNearestCreature(Aurora::NWScript::FunctionContext &ctx)
void getDistanceToObject(Aurora::NWScript::FunctionContext &ctx)
bool isAnimationLooping(Animation animation)
Return true if the specified animation allows looping.
void setLocalString(Aurora::NWScript::FunctionContext &ctx)
void getPosition(float &x, float &y, float &z) const
Return the location's position.
static Waypoint * toWaypoint(Aurora::NWScript::Object *object)
A creature in a Neverwinter Nights area.
Common::UString & getString()
void setLocalInt(Aurora::NWScript::FunctionContext &ctx)
The context handling the gameplay in Neverwinter Nights.
void jumpToObject(Aurora::NWScript::FunctionContext &ctx)
void getObjectByTag(Aurora::NWScript::FunctionContext &ctx)
ObjectType getType() const
Return the exact type of the object.
void clear()
Clear the string's contents.
Neverwinter Nights engine functions.
Module & getModule()
Return the module context.
void getTag(Aurora::NWScript::FunctionContext &ctx)
void getLocalFloat(Aurora::NWScript::FunctionContext &ctx)
void getNearestObjectByTag(Aurora::NWScript::FunctionContext &ctx)