Categories:
functions triggers variables
Functions: all  aff  other  char  array  room  obj  quest  int  string  

Obj functions:

affect2str
affected
alias
appliestype2int
appliestype2str
carried_by
get_item_owner
get_obj_list
get_obj_list_room
get_obj_vis
in_obj
inroom
isobject
obj_to_char
obj_to_room
objadesc
objalias
objapplies_type
objapplies_val
objcond
objcondmax
objcontent
objcost
objcount
objdestroy
objempty
objexists
objflag
objgetid
objidexists
objinroom
objldesc
objlevel
objname
objnew
objowner
objtimer
objtotalcount
objtype
objtype2int
objtype2str
objval
objvnum
objwearflag
objwearflag2int
objwearflag2str
objweight
owned_by
ownobject
skill2str
unset
valid
wearobject
wearonslot
worn_by

affect2str
convert integer to affect name (18 => FLY)
Syntax:
(string) affect2str(int)

affected
check if char is affected by given skill
check if mob/obj is affected by given skill
check if object is affected by given skill
Syntax:
(int) affected(char, string)
(int) affected(string)
(int) affected(obj, string)

alias
return unique pointer to char
return unique pointer to object
Syntax:
(string) alias(char)
(string) alias(obj)
Examples:
mpforce @(alias(actor)) smile

appliestype2int
convert applies type to integer (MAXHIT => 13), see oedit
Syntax:
(int) appliestype2int(string)

appliestype2str
convert integer to applies type (13 => MAXHIT)
Syntax:
(string) appliestype2str(int)

carried_by
return char, who carries the object
Syntax:
(char) carried_by(obj)

get_item_owner
returns id of owner. If argument is string, tries to locate object with corresponding alias in [self] inventory
returns id of owner. If argument is string, tries to locate object with corresponding alias in [self] inventory
Syntax:
(int) get_item_owner(string)
(int) get_item_owner(obj)

get_obj_list
return array of objects with given alias, if second parameter is entered, return objects only from this char's inventory
return array of objects with given vnum, if second parameter is entered, return objects only from this char's inventory
Syntax:
(array) get_obj_list(string [, char])
(array) get_obj_list(int [, char])
Examples:
let objs = get_obj_list("ring")
foreach (objs as o)
say @(objname(o))
let objs = get_obj_list(3000)

get_obj_list_room
return array of objects in given room, if second parameter is entered, return objects only with given alias
Syntax:
(array) get_obj_list_room(int [, string])
Examples:
let objs = get_obj_list_room(3056) - get all items in room High Sanctuary
let objs = get_obj_list_room(3056, "ring") - get all items with alias ring from room High Sanctuary

get_obj_vis
return object anywhere with given name, visible to mob or character
Syntax:
(obj) get_obj_vis(string [, char])

in_obj
return object in which is obj
Syntax:
(obj) in_obj(obj)

inroom
return vnum of room char is in
vnum of room obj is in (can be in room/container/inventory/worn)
Syntax:
(int) inroom(char)
(int) inroom(obj)

isobject
test if variable is object
Syntax:
(int) isobject(variable)

obj_to_char
gives the object to char's inventory, return null when fail
put object to another object, return null when fail
Syntax:
(int) obj_to_char(obj, char)
(int) obj_to_char(obj, obj_to)

obj_to_room
put object to room, return null when fail
Syntax:
(int) obj_to_room(obj, vnum)

objadesc
return action description of given object (when you look at it)
return or set action description of given object (when you look at it)
Syntax:
(string) objadesc(vnum)
(string) objadesc(obj [, string])

objalias
return alias of given object
return or set alias of given object
Syntax:
(string) objalias(vnum)
(string) objalias(obj [, string])

objapplies_type
return applies type of object prototype, second parameter can be 0..5
return or set applies type of given object, second parameter can be 0..5
Syntax:
(int) objapplies_type(vnum, int)
(int) objapplies_type(obj, int [, int|string])
Examples:
objapplies_type(3000, 0) - gets first applies type of object vnum 3000
let type = objapplies_type(obj, 0)
objapplies_type(obj, 0, 8) - sets first applies type to LUCK (see oedit)
objapplies_type(obj, 0, "luck") - its the same like the first line
let apply_int = appliestype2int("luck") - sets apply_int to 8
let apply_str = appliestype2str(8) - sets apply_str to "LUCK"

objapplies_val
return applies value of object prototype, second parameter can be 0..5
return or set applies value of given object, second parameter can be 0..5
Syntax:
(int) objapplies_val(vnum, int)
(int) objapplies_val(obj, int [, int])
Examples:
let val = objapplies_val(3000, 0) - gets first applies value of object vnum 3000
let val = objapplies_val(obj, 0) - gets value of first object applies
objapplies_val(obj, 0, 5) - sets first applies value to 5

objcond
return condition of given object
returns or set condition of given object
Syntax:
(int) objcond(vnum)
(int) objcond(obj [, int])

objcondmax
return maximum condition of given object
returns or set maximum condition of given object
Syntax:
(int) objcondmax(vnum)
(int) objcondmax(obj [,int])

objcontent
create array with all objects in given container and return their number
create array with all objects in given container and return that array
Syntax:
(int) objcontent(obj, string)
(array) objcontent(obj)
Examples:
let num = objcontent(container, "objs") - return number and list of objects in container
let items = objcontent(container)

objcost
return cost of given object
returns or set cost of given object
Syntax:
(int) objcost(vnum)
(int) objcost(obj [, int])

objcount
return number of objects with given vnum currently loaded
Syntax:
(int) objcount(vnum)

objdestroy
destroys object and return null
Syntax:
(null) objdestroy(obj)

objempty
check if object is empty (container)
Syntax:
(int) objempty(obj)

objexists
return 1 if given object exists (in mean in object file, not in world)
Syntax:
(string) objexists(vnum)

objflag
return if object has extra flag defined by string (flags like in oedit), example "SOULBOUND" etc...
return if object has extra flag defined by string (flags like in oedit), example "SOULBOUND" etc..., or set/remove flag (when third parameter is "yes", "no", "set", "unset" or "toggle"
Syntax:
(int) objflag(vnum, string)
(int) objflag(obj, string[, string])
Examples:
if (objflag(1, "SOULBOUND")) say item vnum 1 has soulbound flag
if (objflag(obj, "SOULBOUND")) say object @(name(obj)) has SOULBOUND flag set
objflag(obj, "!RENT", "yes") sets !RENT flag for object

objgetid
returns unique object id in format XXXXXXXX/XXXXXXXX
Syntax:
(string) objgetid(obj)
Examples:
let id = objgetid(obj)

objidexists
return if object with id exist on world or in rent, soulbount item is never found
Syntax:
(int) objidexists(string)
Examples:
say objexist: @(objidexists("ABCDEFGH/12345678"))

objinroom
number of objects of specified vnum in same room (just on the ground!), if vnum is 0 it returns count of all objects on the ground
Syntax:
(int) objinroom(vnum)

objldesc
return long description of given object (when it lier on the ground)
return or set long description of given object (when it lies on the ground)
Syntax:
(string) objldesc(vnum)
(string) objldesc(obj [, string])

objlevel
return required level to use object for class defined by string ("Mu", "Ps"...) or integer (from class function)
returns or set required level to use object for class defined by string, example "Mu" or "Ps"
Syntax:
(int) objlevel(vnum, string | int)
(int) objlevel(obj, string [, int])

objname
return name of given object (sdesc)
return or set name of given object (sdesc)
Syntax:
(string) objname(vnum)
(string) objname(obj [, string])

objnew
create a new object of vnum vnum and return it, object is created in mob's inventory or at room, when -1 is entered, new non-prototyped object is created
Syntax:
(obj) objnew(vnum)

objowner
returns or sets id of object owner, second parameter can be player's name or his ID
Syntax:
(int) objowner(obj [, int|string])
Examples:
let owner = objowner(obj) - get owner of given object (0-no owner)
owner(obj, "andy") - set owner of object
owner(obj, playerid("andy"))

objtimer
return timer of given object
returns or set timer of given object
Syntax:
(int) objtimer(vnum)
(int) objtimer(obj [, int])

objtotalcount
return number of objects with given vnum already existing
Syntax:
(int) objtotalcount(vnum)

objtype
return type of given object
return or set type of given object
Syntax:
(int) objtype(vnum)
(int) objtype(obj [, int|string])
Examples:
let type = objtype(obj) - return type of object obj
objtype(obj, 1) - set object type to light
objtype(obj, "light") - same as above

objtype2int
convert object type to integer (LIGHT => 1), see oedit
Syntax:
(int) objtype2int(string)

objtype2str
convert integer to object type (1 => LIGHT)
Syntax:
(string) objtype2str(int)

objval
return value of object with given vnum, second parameter can be 0..3
return or set value of given object, second parameter can be 0..3
Syntax:
(int) objval(vnum, int)
(int) objval(obj, int [, int])
Examples:
objval(3000, 0) - return first value of object with vnum 3000 (on armors it's armor class)
objval(obj, 0, 5) - sets first value to 5 (on armors it's armor class)

objvnum
return vnum of given object
Syntax:
(int) objvnum(obj)

objwearflag
check or set object's wear flag, bit can be number from oedit or string (eg. "finger"). Third parameter can be set, unset or toggle
TAKE 1
FINGER 2
NECK 3
BODY 4
HEAD 5
LEGS 6
FEET 7
HANDS 8
ARMS 9
SHIELD 10
ABOUT 11
WAIST 12
WRIST 13
WIELD 14
HOLD 15
ELBOW 16
KNEE 17
NEARBY 18
RANK-SIGN 19
Syntax:
(any) objwearflag(obj, int|string [, string])
Examples:
let onwield = objwearflag(my.obj, objwearflag2int("wield")) - set 1 if object can be wield
let onwield = objwearflag(my.obj, "wield") - same as above

objwearflag2int
convert wearflag string to integer (TAKE => 0), see oedit
Syntax:
(int) objwearflag2int(string)

objwearflag2str
convert wearflag int to string (0 => TAKE)
Syntax:
(string) objwearflag2str(int)

objweight
return weight of given object
returns or set weight of given object
Syntax:
(int) objweight(vnum)
(int) objweight(obj [, int])

owned_by
returns char who has this object (worn, carried, in inventory, in box...)
returns null when object is lying on the ground etc.
Syntax:
(char) owned_by(obj)

ownobject
return Number of object with given vnum in char's inventory. If vnum is -2 it returns count of object regardless of vnum (size of inventory). Vnum -1 is for ad hoc items that are not made from prototype (e.g. scraps).
return Number of object with given vnum in mob's inventory. If vnum is -2 it returns count of object regardless of vnum (size of inventory)
Syntax:
(int) ownobject(char, vnum)
(int) ownobject(vnum)

skill2str
convert integer to skill/spell name (1 => ARMOR)
Syntax:
(string) skill2str(int)

unset
unsets variable
unsets char's variable
unsets variable
unsets object's variable
Syntax:
(null) unset(variable)
(int) unset(char, string [, index1 [, index2 ...]])
(int) unset(string [, index1 [, index2...]])
(int) unset(obj, string [, index1 [, index2 ...]])
Examples:
unset(zone.name) - unsets zone variable name
unset(zone.name[1]) - unsets zone variable name[1]
unset(zone.name[1][2]) - unsets zone variable name[1][2]
unset(me, "zone.name") - unsets zone variable name
unset(me, "my.name", 1) - unsets mobs variable name[1]
unset(me, "my.name", 1, 2) - unsets mobs variable name[1][2]
unset("zone.name") - unsets zone variable name
unset("my.name", 1) - unsets mobs/object (depend where script runnning) variable name[1]
unset("my.name", 1, 2) - unsets mobs/object (depend where script runnning) variable name[1][2]
unset(me, "zone.name") - unsets zone variable name
unset(me, "my.name", 1) - unsets obj variable name[1]
unset(me, "my.name", 1, 2) - unsets obj variable name[1][2]

valid
test if variable is still valid
test if string is valid
return allways 1 when argument is int
test if object is valid
test if affect is valid
test if array is valid
Syntax:
(int) valid(char)
(int) valid(string)
(int) valid(int)
(int) valid(obj)
(int) valid(aff)
(int) valid(array)
Examples:
if (valid(ch)) ...

wearobject
returns slot on which this object is worn (or 0 if not found) the slot number is +1 from what wearonslot() or zedit uses
returns slot on which this object is worn (or 0 if not found) the slot number is +1 from what wearonslot() or zedit uses
Syntax:
(int) wearobject(char, vnum)
(int) wearobject(vnum)

wearonslot
returns object worn on char's slot
returns object worn on slot
Syntax:
(obj) wearonslot(char, vnum)
(obj) wearonslot(int)

worn_by
return char, who wears the object
Syntax:
(char) worn_by(obj)