Lua API
On this page

WorldObject

Inherits from

Represents an ingame weenie object. All selectable (and some non-selectable) objects are weenies.

Fields:

AllItemIds number[]

read only

List of weenie ids contained with this item. It also returns item ids contained within containers within this container.

AllItems WorldObject[]

read only

List of weenies contained with this item. It also returns items contained within containers within this container.

AmmoType AmmoType

read only

The type of ammo this is, only applicable if its projectile ammo todo: what defines something being projectile ammo?

Burden number

read only

Burden

ClassId number

read only

Weenie ClassId

ClothingPriority CoverageMask

read only

Equipment coverage priority

CombatMode CombatMode

read only

The combat mode the weenie is in, only applies to creatures.

CombatUse WieldType

read only

The type of wieldable item this is

Container WorldObject

read only

The container weenie this weenie is inside. null if none

ContainerId number

read only

the container id this is inside, 0 if none.

ContainerIds number[]

read only

child container ids, including foci (assuming this item is a container)

ContainerProperties ContainerProperties

read only

Type of container

Containers WorldObject[]

read only

List of child container weenies, including foci

CooldownTimeoutMilliseconds number

read only

The number of milliseconds until the shared cooldown for this item is expired, or 0 if it is not on cooldown.

CreatedAt DateTime

The date this weenie was created at, in memory.

CreateFlags WeenieHeaderFlag

read only

Weenie creation header flags. These are flags for if data fields are present during a weenie description

CreateFlags2 WeenieHeaderFlag2

read only

More weenie creation header flags. These are flags for if data fields are present during a weenie description

CurrentWieldedLocation EquipMask

read only

If this item is wielded, the slots it currently covers

EnchantmentIds LayeredSpellId[]

read only

List of layered spell ids of active enchantments this item has.

Equipment WorldObject[]

read only

List of weenies equipped to this weenie.

EquipmentIds number[]

read only

item ids equipped to this weenie

HasAppraisalData boolean

read only

Wether or not this weenie has appraisal data from the server.

IconEffects IconHighlight

read only

Icon effects, like border highlights

Id number

The id of this weenie object

Items WorldObject[]

read only

child item weenies, excluding containers // equipped (assuming this item is a container) (not recursive, meaning it doesn't include child container items, just non-container items contained directly in this container)

LastAccessTime DateTime

Last time this weenie received data from the server

LastAppraisalResponse DateTime

read only

The last time we got appraisal data from the server

Material MaterialType

read only

Material

Name string

read only

The name of this weenie object.

ObjectClass ObjectClass

read only

ObjectClass, for decal compatibility / familiarity (also a bit more granular than ObjectType)

ObjectDescriptionFlag ObjectDescriptionFlag

read only

Object description

ObjectType ObjectType

read only

Type of object this is

PhysicsState PhysicsState

read only

Physics State

RadarBehavior RadarBehavior

read only

Radar Behavior

RadarColor RadarColor

read only

Radar blip color

ServerPosition Position

read only

Last position the server reported this weenie at, only applies to items in the landscape

SpellId number

read only

The spell id of this item, like for built-in wand spells

SpellIds LayeredSpellId[]

read only

List of layered spell ids this item has. (this is not active spells, these are spells that the item contains)

Stance MotionStance

The stance the weenie is in, only applies to creatures.

TargetType ObjectType

read only

Type of items that this can be used on?

ValidWieldedLocations EquipMask

read only

The valid locations this item can be wielded to

WeenieClassId number

read only

The class id for this weenie

Wielder WorldObject

read only

The weenie wielding this weenie, null if none

WielderId number

read only

the id of the object wielding this item, 0 if none

Events:

OnDestroyed ObjectReleasedEventArgs

Fired when this WorldObject is being destroyed, like when the client forgets about it.

OnPositionChanged ServerPositionChangedEventArgs

Fired when this weenie's position is updated by the server

Methods:

AddToSalvage(options?: ActionOptions = nil, callback?: fun(SalvageAddAction) : nil = nil) : SalvageAddAction

Adds a salvageable weenie to the salvage panel.

Parameters:
NameTypeDefaultSummary
optionsActionOptionsnil

Action options

callbackfun(SalvageAddAction) : nil nil

Called when the action completes

AddToTrade(options?: ActionOptions = nil, callback?: fun(TradeAddAction) : nil = nil) : TradeAddAction

Adds the specified object id to your side of the trade window

Parameters:
NameTypeDefaultSummary
optionsActionOptionsnil

Action options

callbackfun(TradeAddAction) : nil nil

Called when the action completes

Appraise(options?: ActionOptions = nil, callback?: fun(ObjectAppraiseAction) : nil = nil) : ObjectAppraiseAction

Request assessment data for a n object

Parameters:
NameTypeDefaultSummary
optionsActionOptionsnil

Action options

callbackfun(ObjectAppraiseAction) : nil nil

Called when the action completes

DistanceTo2D(other: WorldObject) : number

Get the 2d distance from one weenie to another weenie

Parameters:
NameTypeDefaultSummary
otherWorldObject

The weenie to get the distance to from this one

Returns:number

DistanceTo2d(otherId: number) : number

Get the 2d distance from one weenie to another weenie Id

Parameters:
NameTypeDefaultSummary
otherIdnumber

The id of the other weenie to get the distance to from this one

Returns:number

DistanceTo3D(other) other WorldObject

DistanceTo3D(otherId) otherId number

Drop(options,callback) options ActionOptions , callback function

GetPropertyKeys(source)

GetTopmostParent()

Give(targetId,options,callback) targetId number , options ActionOptions , callback function

HasValue(key) key StringId

HasValue(key) key Int64Id

HasValue(key) key IntId

HasValue(key) key FloatId

HasValue(key) key BoolId

HasValue(key) key InstanceId

HasValue(key) key DataId

Inscribe(inscription,options,callback) inscription string , options ActionOptions , callback function

IsOnSharedCooldown()

Move(targetId,slot,stack,options,callback) targetId number , slot number , stack boolean , options ActionOptions , callback function

Salvage(options,callback) options ActionOptions , callback function

Select(options,callback) options ActionOptions , callback function

ToString()

Use(options,callback) options ActionOptions , callback function

UseOn(targetId,options,callback) targetId number , options ActionOptions , callback function

Value(key,default) key IntId , default number

Value(key,default) key Int64Id , default number

Value(key,default) key StringId , default string

Value(key,default) key BoolId , default boolean

Value(key,default) key FloatId , default number

Value(key,default) key InstanceId , default number

Value(key,default) key DataId , default number

Wield(slot,options,callback) slot EquipMask , options ActionOptions , callback function