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

abs
return absolute value of argument (argument if positive, -argument if negative)
Syntax:
(int) abs(int)

ac
return armor class of char
Syntax:
(int) ac(char)

add
return add_strength of char
Syntax:
(int) add(char)

aff_apply
return value of affect apply, returns 0 when apply not exists
Syntax:
(int) aff_apply(affect, string)
Examples:
let aff = aff_get(me, "fly")
let apply = aff_apply(aff, "armor") - returns -15

aff_apply_add
return and set or modify value of affect apply type
Syntax:
(int) aff_apply_add(affect, string, int)
Examples:
let aff = aff_get(me, "fly")
let apply = aff_apply_add(aff, "armor", -30) - sets armor to -30 for affect fly

aff_apply_remove
return and remove value of affect apply type
Syntax:
(int) aff_apply_remove(affect, string)
Examples:
let aff = aff_get(me, "fly")
let apply = aff_apply_remove(aff, "armor") - remove armor apply from affect fly and returns its value

aff_delete
delete affect from char
Syntax:
(int) aff_delete(aff [, message = 0])
Examples:
let aff = aff_new(me, "fly")
aff_delete(aff) - delete affect without message
aff_delete(aff, "Fly is down!") - delete affect with specific message

aff_duration
return or set affect duration
Syntax:
(int) aff_duration(affect [, int])
Examples:
let aff = aff_get(me, "fly")
let duration = aff_duration(aff) - returns duration of fly affect
aff_duration(aff, 100) - set affects duration to 100 ticks/miniticks...

aff_duration_type
return or set affect duration type
Syntax:
(int) aff_duration_type(affect [, int])
Examples:
let aff = aff_get(me, "fly")
let duration = aff_duration_type(aff) - returns duration of fly affect
aff_duration_type(aff, 1) - change type to minitick
0 Tick
1 MINITICK
2 COMBAT_ONLY
3 SUSTAINED
4 COMBAT_SUSPEND - only in combat
5 COMBAT - round

aff_flag
return if affect contain this flag
Syntax:
(int) aff_flag(affect, string)
Examples:
let aff = aff_get(me, "fly")
let contain = aff_flag(aff, "fly") - returns 1

aff_flag_add
sets flag to affect, returns 1 when flag was addes, 0 otherwise
Syntax:
(int) aff_flag_add(affect, string)
Examples:
let aff = aff_get(me, "fly")
aff_flag_add(aff, "sanct") - add sanct flag to fly affect

aff_flag_remove
remove flag from affect, returns 1 when flag was removed, 0 otherwise
Syntax:
(int) aff_flag_remove(affect, string)
Examples:
let aff = aff_get(me, "fly")
aff_flag_remove(aff, "fly") - remove fly flag to fly affect

aff_get
find and returns affect variable on char or null if affect not found
Syntax:
(aff) aff_get(char, string | int)
Examples:
let aff = aff_get(ch, "haste")

aff_level
return or set affect level
Syntax:
(int) aff_level(affect [, int])
Examples:
let aff = aff_get(me, "fly")
let lev = aff_level(aff) - returns level of fly affect
aff_lev(aff, 100) - set affects level to 100 ticks/miniticks...

aff_new
create and attach new affect to char, enter manacost for dispel purposes, if not
entered, affect can't be dispeled
create and attach new affect to char, enter manacost for dispel purposes, if not
entered, affect can't be dispeled. Affect originates from caster.
Syntax:
(aff) aff_new(char, string[, manacost])
(aff) aff_new(char, string, caster[, manacost])
Examples:
let aff = aff_new(me, "special_affect")
let aff = aff_new(me, "special_affect", actor)

aff_source
return or set affect source id (-vnum of mob, +playerid)
Syntax:
(int) aff_source(affect [, char | int])
Examples:
let aff = aff_get(me, "fly")
let source = aff_source(aff) - returns source of fly affect
aff_source(aff, -100) - set affects source to mob vnum 100
aff_source(aff, me)

aff_type
return name of the affect ("fly", "gouge" etc)
Syntax:
(string) aff_type(affect)
Examples:
let aff = aff_get(me, "fly")
let spellname = aff_type(aff) -- returns "fly"

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

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)

affflagged
return if char is affect flagged with given flag
Syntax:
(int) affflagged(string[, char])

age
return age of char
Syntax:
(int) age(char)

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

align
return or set char's alignment
Syntax:
(int) align(char [, newvalue])

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)

array_size
returns number of elements in array (non-recursive)
Syntax:
(int) array_size(array)
Examples:
let len = array_size(my.arr)

atoi
convert string to integer
Syntax:
(int) atoi(string)

attacktype2int
convert attack type string to integer (whip => 2)
Syntax:
(int) attacktype2int(string)

attacktype2str
convert integer to attack type (2 => whip)
Syntax:
(string) attacktype2str(int)

bank
return gold coins of char in bank
Syntax:
(int) bank(char)

cancelmindlock
cancels chars mind lock, return 1 if char had any mind lock
Syntax:
(int) cancelmindlock(char)

cansee
when only one parameter is entered return 1 if mob can see char,
when both parameters entered, function returns if first char can see second or item
Syntax:
(int) cansee(char [, char | obj])
Examples:
let can = cansee(actor) - test if I can see actor character
if (cansee(me, obj)) say I can see object @(objname(obj))

canwear
return if char can wear given object or object defined by it's vnum
Syntax:
(any) canwear(char, object | objectvnum)
Examples:
if (canwear(me, obj)) ...
if (canwear(me, 25500)) ...

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

cast_spell
cast spell, caster and target are type char, spell is int
Syntax:
(int) cast_spell(caster, target, object, spell, level)

cha
return charisma of char
Syntax:
(int) cha(char)

check_skill
return result of checkSkill function, return value is 0-200
Syntax:
(int) check_skill(char, int | string)
Examples:
if (check_skill(me, "kick")) mpskil kick

checkdt
check dt in next room, argument is direction
Syntax:
(char) checkdt(string)

clan
return clan number or 0 if char is not in clan
Syntax:
(int) clan(char)

class
return class of char (0-magic user, 1-cleric ...)
MAGIC_USER 0
CLERIC 1
THIEF 2
WARRIOR 3
NECROMANCER 4
PSIONIC 5
SORCERER 6
PRIEST 7
MONK 8
DRUID 9
ROGUE 10
ASSASSIN 11
NIGHTBLADE 12
FIGHTER 13
SWORDSMAN 14
SHAOLIN 15
NAZGHUL 16
ASTRALWALKER 17
RANGER 18
PALADIN 19
DARKPALADIN 20
DANCER 21
VAMPIRE 22
CONJURER 23
HELL_RAIDER 24
WARLOCK 25
SHADOWKNIGHT 26
SPIRITSEALER 27
ALCHEMIST 28
BATTLEMAGE 29
Syntax:
(int) class(char)

con
return constitution of char
Syntax:
(int) con(char)

countbuffer
return how many of my kin (vnum) this char killed?
Syntax:
(int) countbuffer(char)

countfollowers
return number of char's followers
Syntax:
(int) countfollowers(char)

damlog
return char's damlog value. pos must be < 29 (total number of dam messages) and >= 0.
Exceptions are special values -1 and -2 for skill damage and total damage. Positive
kPos values are count of respective messages (0 = misses), negative values are absolute
damage values.
Syntax:
(int) damlog(char [, pos = -2])

damroll
return damroll of char
Syntax:
(int) damroll(char)

default_value
returns variable value if variable is defined otherwise return default_value
Syntax:
(any) default_value(variable, default_value)
Examples:
say value: @(default_value(my.var, 0)) - says value of my.var or 0 if my.var is not set
let zone.count = default_value(zone.count, 0) + 1

dex
return dexterity of char
Syntax:
(int) dex(char)

doorflagged
doorflagged(room_vnum, direction, spell_name)
Check if door from given room to given direction has given flag, i.e. "closed",
"locked", "hidden" etc
Return value is 1 if it does, 0 if not. If there is no door then returns 0,
check if exit is there at all with exit(dir) function.
Example: doorflagged(inroom(me), "north", "closed")
Syntax:
(int) doorflagged(int, str, str)

exit
return vnum of room that exit leads to, from another room if specified
Syntax:
(int) exit(string[, room])

exitaffected
exitaffected(room_vnum, direction, spell_name)
Check if exit from given room to given direction is affected by given spell
Return value is duration of the affect, 0 if not found
Example: exitaffected(inroom(me), "north", "firewall")
Syntax:
(int) exitaffected(int, str, str)

exp
return experience of char
Syntax:
(int) exp(char)

fighting
return whos char fighting
Syntax:
(char) fighting(char)

get_affects
return array of all affects char currently has on them
Syntax:
(array) get_affects(char)

get_attackers_count
return number of chars who attacked char in argument and with level between two additional arguments
Syntax:
(array) get_attackers_count(char, int, int)
Examples:
let num = get_attackers_count(me, 61, 64)
say @(num) player with level between 61 and 64 attacked me

get_char_room
return char with given name in the same room as mob
Syntax:
(char) get_char_room(string)

get_char_room_list
With single argument it returns array of chars in the given room.
With more arguments it creates array with all chars in given room in a variable
of the name as per the second argument and return their number.
When third parameter is entered, select only player in the same group as given char.
Syntax:
(char|array) get_char_room_list(int[, string[, char]])
Examples:
let num = get_char_room_list(3056, "chars") - return number of chars at high healer and create array "chars" with pointers on them
let arr = get_char_room_list(3056) - return array of all chars at high healer
let num = get_char_room_list(3056, "chard", fighting(me)) - returns only chars in group who fights me

get_char_room_vis
return char with given name in the same room as mob, mob must be able to to see target
Syntax:
(char) get_char_room_vis(string)

get_char_vis
return char anywhere with given name, visible to mob
Syntax:
(char) get_char_vis(string)

get_group
return list of chars in same group as argument
Syntax:
(array) get_group(char)
Examples:
let group = get_group(me)
foreach (group as member)
say Hello @(member)

get_group_head
returns head of the group or char if char is not in group
Syntax:
(char) get_group_head(char)

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_mob_num
return char with given vnum
Syntax:
(char) get_mob_num(vnum)

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])

get_rand_exit
returns random exit ("north", "south", ...), argument can be combined (separate by space) from: noground, nowater, noair, nodt, noabyss, noswamp, nochall, noclan, noclosedi, nonstandard, stayzone, nomob, nodoorclosed
when no exit exists returns ""
Syntax:
(string) get_rand_exit(string)

get_skill
returns how much char knows the skill, return value is 0-100
Syntax:
(int) get_skill(char, int | string)
Examples:
if (get_skill(me, "kick")) say I know how to kick

get_zone_number
return zone number
Syntax:
(int) get_zone_number(int)
Examples:
let num = get_zone_number(3056) - returns 30

get_zone_tier
return zone tier name
Syntax:
(string) get_zone_tier(int)
Examples:
let tier = get_zone_tier(30) - returns "Normal" -mid tier name

getddesc
return description of char (when looking at char)
Syntax:
(array) getddesc(char)

getldesc
return long desc of char (what you see in room)
Syntax:
(string) getldesc(char)

getpath
return next direction in path to char
returns "" (already there), "north", "east" ...
Flags can be space-separated list of keywords to override default behavior:
"through_doors" (default to mob's passdoor ability),
"ignore_notrack" (default false)
and "through_secret" (default true). Prefix flag with "no" to reverse,
i.e. "nothrough_secret" to prevent tracking through secret exits.
Syntax:
(string) getpath(char[, flags])

getpathroom
returns first room on the path to target room
Flags can be space-separated list of keywords to override default behavior:
"through_doors" (default to mob's passdoor ability),
"ignore_notrack" (default false)
and "through_secret" (default true). Prefix flag with "no" to reverse,
i.e. "nothrough_secret" to prevent tracking through secret exits.
Syntax:
(string) getpathroom(vnum[, flags])

gold
return gold coins of char (not in bank)
Syntax:
(int) gold(char)

grouplevel
return max level in group char is in or 0
Syntax:
(int) grouplevel(char)

groupsize
return size of group char is in or 0
Syntax:
(int) groupsize(char)

handbook
Returns handbook value for specified stat for given slot, level and class.
Level can be specified either as number (1-60) or as rank or legendary
specification (R5, L2, E9 etc)
When asking for spellflash handbook value, fifth argument is required
as the spell name and class has to be specific class, i.e. not just "caster".
Please note that spellflash values are in tenths of percent.
Weapon average stat is either 'avg' or 'avg2h', for single-handed or two-handed
weapons, respectively.
Syntax:
(int) handbook(string slot, string level, string class, string stat)
Examples:
let value = handbook("elbow", "R4", "shaolin", "luck")
let value = handbook("light", 55, "necromancer", "maxmana")

has_gateway
return 1 if char has death gateway open
Syntax:
(int) has_gateway(char)

has_skill_class
Check if skill has given skill class, like "nature", "arcane" or so.
Skill is given as number so attacktype or other automatic variable can
be used directly.
Syntax:
(int) has_skill_class(int, str)

has_skill_flag
Check if skill has given flag, like "negative_buf", "nbenchant" or so.
Skill is given as number so attacktype or other automatic variable can
be used directly.
Syntax:
(int) has_skill_flag(int, str)

has_spell_routine
Check if spell has given routine, like "areaspell", "enchant" or so.
Skill is given as number so attacktype or other automatic variable can
be used directly.
Syntax:
(int) has_spell_routine(int, str)

height
return height of char
Syntax:
(int) height(char)

heshe
return "he", "she", "it" depend on char's sex
Syntax:
(string) heshe(char)

hit
return hitpoints of char
Syntax:
(int) hit(char)

hit_percent
return % of maxhit char currently has, takes fooled eyes etc. into account
Syntax:
(int) hit_percent(char)

hitroll
return hitroll of char
Syntax:
(int) hitroll(char)

hmhr
return "him", "her", "it" depend on char's sex
Syntax:
(string) hmhr(char)

hshr
return "his", "her", "its" depend on char's sex
Syntax:
(string) hshr(char)

hunting
who the mob is currently hunting
Syntax:
(char) hunting()
Examples:
let hunted = hunting("")

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)

int
return inteligence of char
Syntax:
(int) int(char)

invalid
return invalid value, useful for making variable invalid, to remove variable use unset
Syntax:
(char) invalid()

inventoryfree
return number of free slots in inventory
return number of free slots in inventory
Syntax:
(int) inventoryfree()
(int) inventoryfree(char)

inventorysize
return number of items in inventory
return number of items in inventory
Syntax:
(int) inventorysize()
(int) inventorysize(char)

is_dead
returns 1 if char is dead
Syntax:
(char) is_dead(char)

is_melee_attack
check if attacktype is melee attack, usable on attacktype (in damage trigger)
Syntax:
(int) is_melee_attack(int)

is_spell_damage
check if spell is direct damage spell, usable on attacktype (in damage trigger) and spellnum in spell trigger
Syntax:
(int) is_spell_damage(int)

is_spell_remote
check if spell is remote, usable on attacktype (in damage trigger) and spellnum in spell trigger
Syntax:
(int) is_spell_remote(int)

is_spell_roomspell
check if spell is roomspell, usable on attacktype (in damage trigger) and spellnum in spell trigger
Syntax:
(int) is_spell_roomspell(int)

is_spell_zonespell
check if spell is zonespell, usable on attacktype (in damage trigger) and spellnum in spell trigger
Syntax:
(int) is_spell_zonespell(int)

isabbrev
returnss 1 if str1 is an abbreviation of str2
Syntax:
(int) isabbrev(string str1, string str2)
Examples:
let tok = isabbrev("lis", "list") - returns 1

isaff
test if variable is affect
Syntax:
(int) isaff(variable)

isarray
test if variable is array
Syntax:
(int) isarray(variable)

isblinded
return 1 when char is blind
Syntax:
(int) isblinded(char)

iscasual
return 1 when char is casual
Syntax:
(int) iscasual(char)

ischar
test if variable is player or mob
Syntax:
(int) ischar(variable)

ischarmed
return 1 when char is charmed
Syntax:
(int) ischarmed(char)

isday
check if is day
Syntax:
(int) isday(any)

isdefined
this function takes any type of argument. Only useful
for testing if variable is defined or not
Syntax:
(int) isdefined(variable)

isevent
return if event is active
Syntax:
(int) isevent()

isevil
return 1 when char has evil alignment
Syntax:
(int) isevil(char)

isfight
return 1 when char is fighting
Syntax:
(int) isfight(char)

isfightturn
return 1 if combat round is in progress, 0 otherwise
Syntax:
(int) isfightturn()
Examples:
if (isfightturn("")) say turn

isflying
return 1 when char is flying
Syntax:
(int) isflying(char)

isfollow
return 1 when char is following (has master in same room)
Syntax:
(int) isfollow(char)

isgood
return 1 when char has good alignment
Syntax:
(int) isgood(char)

isgrouped
return 1 when char is in group
Syntax:
(int) isgrouped(char)

isgrouphead
return 1 when char is head of group or is alone
Syntax:
(int) isgrouphead(char)

isimmort
return 1 when char is immortal
Syntax:
(int) isimmort(char)

isint
test if variable is integer
Syntax:
(int) isint(variable)

ismentor
return true if char is in mentormode
Syntax:
(int) ismentor(char)

ismob
test if variable is mob
Syntax:
(int) ismob(variable)

isname
provides direct access to isname call that is at the heart of many alias-based
searching (get_obj_in_list_vis etc...)
*
Syntax:
(int) isname(string searchstring, string namelist)
Examples:
let withraw = isname("silvertail_ho", objalias(82326))

isneutral
return 1 when char has neutral alignment
Syntax:
(int) isneutral(char)

isnoble
return 1 when char is casual (formerly noble)
Syntax:
(int) isnoble(char)

isnull
test if variable is null, not defined but exists
Syntax:
(int) isnull(variable)

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

ispath
return next direction (in number) in path to char
-1 already there, 0 no path, 1-6 direction (neswud)
Flags can be space-separated list of keywords to override default behavior:
"through_doors" (default to mob's passdoor ability),
"ignore_notrack" (default false)
and "through_secret" (default true). Prefix flag with "no" to reverse,
i.e. "nothrough_secret" to prevent tracking through secret exits.
Syntax:
(int) ispath(char[ , flags])

ispc
return 1 when char is player (no mob)
Syntax:
(int) ispc(char)

isplayer
test if variable is player
Syntax:
(int) isplayer(variable)

isremort
return 1 when char is remort
Syntax:
(int) isremort(char)

issleeping
return 1 when char is sleeping
Syntax:
(int) issleeping(char)

issneaking
return 1 when char is sneaking
Syntax:
(int) issneaking(char)

isstring
test if variable is string
Syntax:
(int) isstring(variable)

isvirtual
return 1 when char is virtual mob
Syntax:
(int) isvirtual(char)

iswalking
return 1 when char is walking (not flying)
Syntax:
(int) iswalking(char)

itoa
convert int to string
Syntax:
(string) itoa(int)

level
return effective level of char
Syntax:
(int) level(char)

luck
return luck of char
Syntax:
(int) luck(char)

mana
return manapoints of char
Syntax:
(int) mana(char)

master
return master of char if charmed
Syntax:
(char) master(char)

max
return maximum of given values, number of parameters can be at most 5
Syntax:
(int) max(int, int, ...)

maxhit
return maximum hitpoints of char
Syntax:
(int) maxhit(char)

maxmana
return maximum manapoints of char
Syntax:
(int) maxmana(char)

maxmove
return maximum movepoints of char
Syntax:
(int) maxmove(char)

memory
return NUMth position from mobs memory
Syntax:
(char) memory(num)

memorysize
return number of records in mob's memory
Syntax:
(int) memorysize()

min
return minimum of given values, number of parameters can be at most 5
Syntax:
(int) min(int, int, ...)

mobcount
return number of mobs with given vnum currently loaded
Syntax:
(int) mobcount(vnum)

mobcountroom
return number of mobs with given vnum in given room, if second parameter is missing it takes actual room char is standing
Syntax:
(int) mobcountroom(vnum[, roomvnum])
Examples:
let count = mobcountroom(123) - number of mob with vnum 123 in same room
let count = mobcountroom(123, 0) - number of mob with vnum 123 in void (room vnum 0)

mobcountzone
return number of mobs with given vnum in this zone
Syntax:
(int) mobcountzone(vnum)

mobflagged
return if mob has given mob flag
Syntax:
(int) mobflagged(string[, mob])

mobgetid
returns unique mob id in format XXXXXXXX-XXXXXXXX
Syntax:
(string) mobgetid(obj)
Examples:
let id = mobgetid(obj)

move
return movepoints of char
Syntax:
(int) move(char)

name
return name of player or short_desc of mob
Syntax:
(string) name(char)

next_in_room
return next character after argument (useful with get_char_room)
Syntax:
(char) next_in_room(char)
Examples:
for (ch=get_char_room("1."); valid(ch); ch=next_in_room(ch)) ...

npcinroom
return number of mobs in given room
Syntax:
(int) npcinroom(vnum)

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])

optimizeforceshape
return [pierce, slash, crush] ratios of force shape after optimizing for char
Syntax:
(array) optimizeforceshape(char)
Examples:
let shape = optimizeforceshape(fighting(me))
say pierce=@(shape["pierce"]) slash=@(shape["slash"]) crush=@(shape["crush"])

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)

pcinroom
return number of players in given room or in rooms
Syntax:
(int) pcinroom(vnum [, lastvnum])

playerid
return player id, -1 when char is mob
return id of player with given name
Syntax:
(any) playerid(char)
(int) playerid(string)
Examples:
say Krystl's Id: @(playerid("krystl"))

playername
return name of player with given id
Syntax:
(string) playername(int)

pos
return position of char
DEAD 0
MORTALLYW 1 (mortally wounded)
INCAP 2 (incapacitated)
STUNNED 3
SLEEPING 4
RESTING 5
SITTING 6
FIGHTING 7
STANDING 8
FLYING 9
Syntax:
(int) pos(char)

qpoints
return number of quest points of char
Syntax:
(int) qpoints(char)

questcompleted
return number of char's completed quests of the given vnum
Syntax:
(int) questcompleted(char, vnum)

questcompletetime
return time when quest wad completed or 0, time is in seconds from 1.1.1970
Syntax:
(int) questcompletetime(char, vnum)

questinprogress
return 1 when quest is in progress
Syntax:
(int) questinprogress(char, vnum)

questrejected
return if quest vnum is in state rejected
Syntax:
(int) questrejected(char, vnum)

race
return race of char, -1 if no race
HUMAN 0
ELF 1
DWARF 2
HOBBIT 3
ORC 4
MINOTAUR 5
FAERIE 6
TROLL 7
GNOME 8
GOBLIN 9
OGRE 10
PIXIE 11
DRYAD 12
WRAITH 13
ETHEREAL 14
AASIMAR 15
BEASTOLK 16
DRACONIAN 17
TIEFLING 18
Syntax:
(int) race(char)

race2int
convert race name to int (human => 0, tiefling => 18)
Syntax:
(int) race2int(string)

race2str
convert race number to string (0 => human, 19 => tiefling, bad input => "none")
Syntax:
(string) race2str(int)

randchar
return random char (can be mob) in room with given class, if class is not recognized, it is ignored
Syntax:
(char) randchar(string)

random
return random number <0-num>
Syntax:
(int) random(num)

random_coloring
Adds random coloring to uncolored text by adding random color code from
colorlist in front of each letter in text. It is possible to make some
color appear more often by repeating it in colorlist, i.e. colorlist
in the form "rww" would have white twice as often as red, on average,
whereas "rw" would have red and white with the same probability.
Syntax:
(string) random_coloring(string text, string colorlist)
Examples:
let colored_name = random_coloring(name(me), "grwc")

randplayer
return random player (no mob) in room with given class, if class is not recognized, it is ignored
possible parameters:
  <class> - include this class
  world - get player from all world, not just room
  noimm - do not include immortals
  nomortal - do not include mortals
  RX+ - include only player with rank X and more (X=0..5)
  RX- - include only player with rank X and less
  X+ - include only player with efflevel X and more
  X- - include only player with efflevel X and less
Syntax:
(char) randplayer(string)
Examples:
let c = randplayer("priest") - get random priest in the room
let c = randplayer("priest monk") - get random priest or monk in the room
let c = randplayer("world") - get random player on the world
let c = randplayer("world priest fighter") - get random priest or fighter on the world
let c = randplayer("world R5+ 150+") - get random player on the world with rank 5 and more and efflevel 150 and more

randroom
return random room, argument can be combined (separate by space) from: noground, nowater, noair, nodt, noabyss, noswamp, nochall, noclan, noclosedi, nonstandard
Syntax:
(int) randroom(string)

rank
return rank of char (0-5)
Syntax:
(int) rank(char)

raw_colors
Returns a string with color codes displayed.
Syntax:
(string) raw_colors(string str)

real_hit_percent
return % of maxhit char currently has, regardless of fooled eyes etc
Syntax:
(int) real_hit_percent(char)

reallevel
return level of char (not effective level)
Syntax:
(int) reallevel(char)

replace
replaces substring from first string with second string
replaces all occurrences defined by second string with third string
Syntax:
(string) replace(string, int, int, string)
(string) replace(string, string, string)
Examples:
let s = replace("abcdef", 0, 3, "123") - returns "123def"
let s = replace("abcdef", 0, 3, "") - returns "def"
let s = replace("abcdef", "abc", "123") - returns "123def"
let s = replace("abcdef", "abc", "") - returns "def"

resist_XXX
return char's resist XXX (crush, slash, pierce, fire, cold, acid, mind, body)
Syntax:
(int) resist_XXX(char)

reversedir
Get the direction that is reverse to the input
Example: reversedir("north") returns "south"
Returns invalid if the input is invalid
Syntax:
(int) reversedir(string)

ridden_by
return whos riding this char
Syntax:
(char) ridden_by(char)

riding
return steed of this char, or (invalid) if none
Syntax:
(char) riding(char)

roomaffected
Check if room is affected by given spell
Return value is duration of the affect, 0 if not found
Example: roomaffected(inroom(me), spell2int("sun burst"))
Syntax:
(int) roomaffected(int, int)

roomdesc
return or set room description of given room \n is replaced by newline
Syntax:
(string) roomdesc(vnum [, new_desc])
Examples:
roomdesc(inroom(me), "This is first line of new description\nThis is second\n")

roomexists
return true if room of this vnum exists, false if not
Syntax:
(string) roomexists(vnum)

roomflagged
check if room is flagged with given flag
Syntax:
(char) roomflagged(string[, int])

roomname
return or set name of given room
Syntax:
(string) roomname(vnum [, new_name])

roomoutside
returns 0 if inside, 1 if outside
Syntax:
(int) roomoutside(vnum)

roomsector
returns sector type of the given room
Syntax:
(int) roomsector(vnum [, new_sector])

save_XXX
return char's save XXX (enchant, spell, breath, paralyze, dispel)
Syntax:
(int) save_XXX(char)

setddesc
set description of mob (when looking at char)
Can only be used on mobs.
Backslash characters in the string are converted to newlines, this allows
creation of multiline descriptions.
Syntax:
(string) setddesc(char, str)

setldesc
set long desc of mob (what you see in room)
Can only be used on mobs.
Syntax:
(string) setldesc(char, str)

sex
return sex of char
Syntax:
(string) sex(char)

shuffle
Return shuffled indexes of the array.
Note: this does NOT actually shuffle the input array, it leaves it untouched but
returns shuffled indexes.
*
Example: ar[0] = "a", ar[1] = "b", ar[2] = "c"
let indexes = shuffle(ar)
Possible result: indexes[0] = 2, indexes[1] = 2, indexes[2] = 0
Access to shuffled data: ar[indexes[0]], ar[indexes[1]], ...

This also works with arrays that are indexed by non-contiguous sequence,
even with arrays indexed by non-numbers.
The return value is an array indexed by numbers from 0 to size-1, with values
being indexes into original array, which may be strings, or really anything
that can be used as index.
Syntax:
(array) shuffle(array)

skill2int
convert skill/spell name to integer (ARMOR => 1), like show skillnum
Syntax:
(int) skill2int(string)

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

sort
upwardly sort array and returns length of index array, it is stable sorting
Note: this does NOT actually sort the input array, it leaves it untouched but
returns sorted indexes in the second argument
Syntax:
(int) sort(array, indexorder)
Examples:
let len = sort(my.arr, indexorder)
for (i=0; i<len; i++) say value: @(my.arr[indexorder[i]])
when my.arr[1]=10, my.arr[2]=3 and my.arr[3]=5 returns value 3 and creates array indexorder with values [2, 3, 1]

spiritual_link_from
returns the source of spiritual link to char
Syntax:
(char) spiritual_link_from(char)

spiritual_link_percent
returns the strength of char's spiritual link
Syntax:
(int) spiritual_link_percent(char)

spiritual_link_to
returns the target of char's spiritual link
Syntax:
(char) spiritual_link_to(char)

str
return strength of char
Syntax:
(int) str(char)

str_split
returns array of tokens of given text
Syntax:
(array) str_split(string delimiter, string text)
Examples:
let tok = str_split(" ", "This is some text") - returns array("This", "is", "some", "text")

strip_colors
Returns a string with color codes removed.
Syntax:
(string) strip_colors(string str)

strlen
return length od given string
Syntax:
(char) strlen(string)

style
return fighting style of char
Syntax:
(int) style(char)

style2int
convert shaolin/monk style name to integer ("smiling buddha" => 1)
Syntax:
(int) style2int(string)

style2str
convert style number to string (1 => smiling buddha)
Syntax:
(string) style2str(int)

substr
returns substring of given string starting at given index and given characters long
Syntax:
(string) substr(string, int, int)
Examples:
let s = substr("abcdef", 0, 3) - returns "abc"

time
return time, arguments: y, m, d, h, w (day of week), s (sunlight), r real time (IRL) in seconds from 1.1.1970, p pulse
Syntax:
(int) time(string)

trigtype2int
convert trigger name to integer ("greet" => 1)
Syntax:
(int) trigtype2int(string)

trigtype2str
convert trigger number to string (1 => greet)
Syntax:
(string) trigtype2str(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]

update_supracooling
Enable supracooling if not enabled and update charging state
Return "charging" or "discharging" according to new state
Syntax:
(string) update_supracooling()

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)) ...

vnum
return mob vnum (-1 when char is player)
Syntax:
(int) vnum(char)

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)

weather
returns weather in target room, returns one of "cloudless", "cloudy", "rainy", "storm", "unknown"
Syntax:
(string) weather(vnum)

weight
return weight of char
Syntax:
(int) weight(char)

wimpy
return wimpy level of char
Syntax:
(int) wimpy(char)

wis
return wisdom of char
Syntax:
(int) wis(char)

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