164 object->getPosition(x, y, z);
169 #define SQR(x) ((x) * (x)) 175 if (!object1 || !object2)
214 while ((
object = search->next())) {
234 size_t nth = MAX<int32>(ctx.
getParams()[2].getInt() - 1, 0);
239 std::list<Object *> objects;
240 while ((
object = search->next())) {
243 if (!witcherObject || (witcherObject == target) || (witcherObject->
getArea() != target->
getArea()))
251 if (type & objectType)
252 objects.push_back(witcherObject);
257 std::list<Object *>::iterator it = objects.begin();
258 for (
size_t n = 0; (n < nth) && (it != objects.end()); ++n)
261 if (it != objects.end())
276 size_t nth = MAX<int32>(ctx.
getParams()[2].getInt() - 1, 0);
281 std::list<Object *> objects;
282 while ((
object = search->next())) {
285 if (!witcherObject || (witcherObject == target) || (witcherObject->
getArea() != target->
getArea()))
288 objects.push_back(witcherObject);
293 std::list<Object *>::iterator it = objects.begin();
294 for (
size_t n = 0; (n < nth) && (it != objects.end()); ++n)
297 if (it != objects.end())
308 size_t nth = MAX<int32>(ctx.
getParams()[3].getInt() - 1, 0);
323 std::list<Object *> creatures;
324 while ((
object = search->next())) {
327 if (creature && (creature != target) && (creature->
getArea() == target->
getArea()))
328 creatures.push_back(creature);
333 std::list<Object *>::iterator it = creatures.begin();
334 for (
size_t n = 0; (n < nth) && (it != creatures.end()); ++n)
337 if (it != creatures.end())
345 if (!
object || !moveTo)
351 jumpTo(
object, moveTo->getArea(), x, y, z);
361 if (!
object || !moveTo)
365 moveTo->getPosition(x, y, z);
367 jumpTo(
object, moveTo->getArea(), x, y, z);
ObjectType getType() const
Return the exact type of the object.
A container of The Witcher objects.
void setLocalFloat(Aurora::NWScript::FunctionContext &ctx)
void getNearestCreature(Aurora::NWScript::FunctionContext &ctx)
void getClickingObject(Aurora::NWScript::FunctionContext &ctx)
Area * getArea() const
Return the area this object is currently in.
void getLocation(Aurora::NWScript::FunctionContext &ctx)
Object * getTriggerer() const
A class holding an UTF-8 string.
An object within a Witcher area.
void getEnteringObject(Aurora::NWScript::FunctionContext &ctx)
Context of an NWScript function.
void getArea(Aurora::NWScript::FunctionContext &ctx)
void getLocalFloat(Aurora::NWScript::FunctionContext &ctx)
Object * getCaller() const
void getNearestObjectByTag(Aurora::NWScript::FunctionContext &ctx)
void getWaypointByTag(Aurora::NWScript::FunctionContext &ctx)
static Creature * toCreature(Aurora::NWScript::Object *object)
Basic The Witcher type definitions.
static Waypoint * toWaypoint(Aurora::NWScript::Object *object)
void getLocalObject(Aurora::NWScript::FunctionContext &ctx)
void setLocalString(Aurora::NWScript::FunctionContext &ctx)
virtual void getPosition(float &x, float &y, float &z) const
Return the object's position within its area.
void jumpTo(Witcher::Object *object, Area *area, float x, float y, float z)
Module & getModule()
Return the module context.
A simple scoped smart pointer template.
static Aurora::NWScript::Object * getParamObject(const Aurora::NWScript::FunctionContext &ctx, size_t n)
void jumpToObject(Aurora::NWScript::FunctionContext &ctx)
A creature in a The Witcher area.
Utility templates and functions.
An object in a The Witcher area.
void setVector(float x, float y, float z)
void getLocalString(Aurora::NWScript::FunctionContext &ctx)
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?
A scoped plain pointer, allowing pointer-y access and normal deletion.
void getTag(Aurora::NWScript::FunctionContext &ctx)
void setLocalInt(Aurora::NWScript::FunctionContext &ctx)
void getLocalInt(Aurora::NWScript::FunctionContext &ctx)
void getNearestObject(Aurora::NWScript::FunctionContext &ctx)
static Location * toLocation(Aurora::NWScript::EngineType *engineType)
void getName(Aurora::NWScript::FunctionContext &ctx)
void getPosition(float &x, float &y, float &z) const
Return the location's position.
The context needed to run a The Witcher module.
Common::UString & getString()
The Witcher engine functions.
void getIsObjectValid(Aurora::NWScript::FunctionContext &ctx)
void getDistanceToObject(Aurora::NWScript::FunctionContext &ctx)
void getExitingObject(Aurora::NWScript::FunctionContext &ctx)
void getObjectType(Aurora::NWScript::FunctionContext &ctx)
void jumpToLocation(Aurora::NWScript::FunctionContext &ctx)
The context handling the gameplay in The Witcher.
void getPosition(Aurora::NWScript::FunctionContext &ctx)
void setLocalObject(Aurora::NWScript::FunctionContext &ctx)
void getObjectByTag(Aurora::NWScript::FunctionContext &ctx)
void clear()
Clear the string's contents.
static Witcher::Object * toObject(::Aurora::NWScript::Object *object)
A class able to sort objects by distance to a target object.