Char functions:
ac
add
aff_new
affected
affflagged
age
alias
align
bank
cancelmindlock
cansee
canwear
cast_spell
cha
check_skill
clan
class
con
countbuffer
countfollowers
damlog
damroll
dex
exp
fighting
get_affects
get_attackers_count
get_char_room
get_char_room_list
get_char_room_vis
get_char_vis
get_group
get_group_head
get_item_owner
get_mob_num
get_obj_list
get_skill
getddesc
getldesc
getpath
gold
grouplevel
groupsize
has_gateway
height
heshe
hit
hit_percent
hitroll
hmhr
hshr
hunting
inroom
int
inventoryfree
inventorysize
is_dead
isblinded
iscasual
ischar
ischarmed
isevil
isfight
isflying
isfollow
isgood
isgrouped
isgrouphead
isimmort
ismentor
ismob
isneutral
isnoble
ispath
ispc
isplayer
isremort
issleeping
issneaking
isvirtual
iswalking
level
luck
mana
master
maxhit
maxmana
maxmove
memory
memorysize
mobcount
mobcountroom
mobcountzone
mobflagged
mobgetid
move
name
next_in_room
npcinroom
obj_to_char
objidexists
objowner
optimizeforceshape
ownobject
pcinroom
playerid
playername
pos
qpoints
race
randchar
randplayer
rank
real_hit_percent
reallevel
resist_XXX
ridden_by
riding
save_XXX
setddesc
setldesc
sex
spiritual_link_from
spiritual_link_to
str
style
valid
vnum
wearobject
wearonslot
weight
wimpy
wis
ac
return armor class of char
Syntax:
(int) ac(char)
add
return add_strength of char
Syntax:
(int) add(char)
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)
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])
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)) ...
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
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)
dex
return dexterity of char
Syntax:
(int) dex(char)
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_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
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])
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)
has_gateway
return 1 if char has death gateway open
Syntax:
(int) has_gateway(char)
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("")
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)
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)
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)
isevil
return 1 when char has evil alignment
Syntax:
(int) isevil(char)
isfight
return 1 when char is fighting
Syntax:
(int) isfight(char)
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)
ismentor
return true if char is in mentormode
Syntax:
(int) ismentor(char)
ismob
test if variable is mob
Syntax:
(int) ismob(variable)
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)
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)
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)
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)
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()
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)
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"))
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"))
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"])
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)
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)
randchar
return random char (can be mob) in room with given class, if class is not recognized, it is ignored
Syntax:
(char) randchar(string)
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
rank
return rank of char (0-5)
Syntax:
(int) rank(char)
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)
resist_XXX
return char's resist XXX (crush, slash, pierce, fire, cold, acid, mind, body)
Syntax:
(int) resist_XXX(char)
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)
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)
spiritual_link_from
returns the source of spiritual link to char
Syntax:
(char) spiritual_link_from(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)
style
return fighting style of char
Syntax:
(int) style(char)
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)
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)