| These constants can be used anywhere in a program. |
| Type |
Name |
Description |
| char |
NULLCHAR |
A placeholder for a character. |
| obj |
NULLOBJ |
A placeholder for an object. |
| bool |
TRUE |
A true value. |
| bool |
FALSE |
A false value. |
| function int abs
(int value)
|
|
Returns the absolute value of a given number.
|
| function act
(string string, char ch, obj obj, char ch2, int type)
|
Sends an action string out. This string does text replacements on the
following codes:
- $n - first character's name
- $N - second character's name
- $p - object's short description
- $e/E - He/She/It - for first or second character
- $s/S - His/Her/Its - for first or second character
- $m/M - Him/Her/Its - for first or second character
The first character must be valid. The object and second character are not
required to be valid unless a code refers to them. To indicate an unused
character or object, use the NULLOBJ or NULLCHAR constants.
|
(Show Constants)
- ACT_TO_ALL send text to everyone in the room
- ACT_TO_CHAR send text to the first character only
- ACT_TO_NOTVICT send text to everyone in the room except for the first and second characters.
- ACT_TO_UNSEENNOTVICT send text to everyone in the room who can see the first character, except for the first and second characters.
- ACT_TO_ROOM send text to everyone in the room except the first character.
- ACT_TO_UNSEENROOM send text to everyone in the room who can see the first character except the first character.
- ACT_TO_VICT send text to the second character only.
- ACT_TO_UNSEENVICT send text to the second character only, if they can see the first character.
- ACT_TO_WORLD send text to all connected players.
- ACT_TO_AREA send text to all connected players in the area.
- ACT_TO_BOTH send text to both ch and ch2, and no one else.
(Hide Constants)
|
| function bool add_achievement
(char ch, int id)
|
|
This function records that the player has achieved this achievement
specified by the achievement id. It returns FALSE if it is not a
valid achievement, if the character is not a player, or if the achievement
cannot be set (for instance, if it's an invalid ID, or if the player already
has that achievement.
|
| function add_cash
(char ch, int silver, int gold, int plat)
|
|
This adds the specified amount of money to the character. The amounts may
be negative, but the character may never have less than zero in any coin
denomination.
|
| function bool affect_add
(char ch, string spellname, int level, int where, int location, int modifier, int bitvector, int duration)
|
|
This attempts to add an affect to a character. The name must be an existing
spell or skillname, although "reserved" will work if it needs to. The level
is the affect level.
WHERE refers to which type of flags are being used, the TO variables.
Location is which stat to modify, one of the APPLY variables.
Modifier is the amount to modify the named stat by, which can be positive
or negative. Flags are the specific flags to set, determined by the WHERE
setting. The available flags follow, and multiple flags of the same type
can be selected using the bitwise OR operator. Duration is how long the
affect will remain with the character. It returns TRUE if successful,
FALSE if not. It can fail if the victim already has the named affect,
or if any of the parameters are invalid.
Flags: These are the assorted flags. They can have bitwise operators
performed against them.
|
(Show Constants)
|
| function string affect_get_first
(char ch)
|
|
This returns the name of the first affect on the character.
|
| function string affect_get_next
(char ch, string name)
|
|
This returns the name of the next affect on the character, after the one
named.
|
| function int affect_getval
(char ch, string name, int value)
|
|
This returns information about an affect on a character. If there is no
such affect, the return is 0.
|
(Show Constants)
|
| function bool affect_has
(char ch, string name)
|
|
This returns TRUE if the character has the named affect, or FALSE otherwise.
|
| function bool affect_remove
(char ch, string name)
|
|
This function removes the named affect from a character, returning TRUE if
successful, and FALSE if not. Please use can_remove_affect where appropriate
to determine is this is an affect tthat should be removed.
|
| function char area_first_char
(area area, bool pc)
|
|
This returns the first character in the area specified. This may return
an invalid handle, if there are no characters in the area.
|
| function string area_getstring
(area area, int val)
|
|
This function returns information about an area. It can also be accessed
via the dot syntax (area.name)
|
(Show Constants)
- AREA_STRING_NAME Area name
- AREA_STRING_DESC Area description
(Hide Constants)
|
| function int area_getval
(area area, int val)
|
|
This function returns information about an area. It can also be
accessed via the . syntax (area.level)
|
(Show Constants)
- AREA_VAL_VNUM_BASE Base VNUM for the area
- AREA_VAL_LEVEL Average Mob level
- AREA_VAL_NPLAYERS Number of players currently in the area
- AREA_VAL_FLAGS Area Flags:
(Show values)
- AREA_HIDDEN
- AREA_LAWLESS
- AREA_DRY
- AREA_WET
- AREA_FREEZING
- AREA_COLD
- AREA_WARM
- AREA_HOT
- AREA_NO_QUEST
- AREA_NO_CONT
- AREA_ANTRIPPA
- AREA_ANY_CONT
- AREA_GRIFTMIRE
- AREA_LENSMOOR
- AREA_BATTLEFIELD
- AREA_NO_REVENGE
- AREA_PLAYERHOMES
- AREA_DENTERRA
- AREA_NO_GATE
- AREA_HERO
- AREA_CASTLE_DONE
- AREA_NO_RPEDIT
- AREA_NO_SHOWLINKS
(Hide values)
- AREA_VAL_KILLS Number of Mobs killed in this area
- AREA_VAL_CONTINENT Continent where this area is located
- AREA_VAL_AGE Time since last area reset
- AREA_VAL_RESET_COUNT Number of times the area has reset since last reboot
- AREA_VAL_AREAQUEST_FINAL Final areaquest state.
- AREA_VAL_RECALL Recall vnum, or 0
- AREA_VAL_MORGUE Morgue vnum, or 0
- AREA_LAST_ROOM_VNUM Final used room vnum, or 0
- AREA_LAST_OBJ_VNUM Final used obj vnum, or 0
- AREA_LAST_MOB_VNUM Final used mob vnum, or 0
- AREA_LAST_VEHICLE_VNUM Final used vehicle vnum, or 0
- AREA_LAST_ACHIEVEMENT Final used Achievement
- AREA_VAL_AREASTATE0 The Areastate 0 for the area.
- AREA_VAL_AREASTATE1 The Areastate 1 for the area.
- AREA_VAL_AREASTATE2 The Areastate 2 for the area.
- AREA_VAL_AREASTATE3 The Areastate 3 for the area.
- AREA_VAL_AREASTATE4 The Areastate 4 for the area.
- AREA_VAL_AREASTATE5 The Areastate 5 for the area.
- AREA_VAL_AREASTATE6 The Areastate 6 for the area.
- AREA_VAL_AREASTATE7 The Areastate 7 for the area.
- AREA_VAL_AREASTATE8 The Areastate 8 for the area.
- AREA_VAL_AREASTATE9 The Areastate 9 for the area.
(Hide Constants)
|
| function char area_next_char
(area area, char ach, bool pc)
|
|
This returns the next character in the area specified. This may return
an invalid handle, if there are no more characters in the area.
|
| function int area_next_shop
(area area, int last_shop)
|
|
Returns the vnum of the next mob shop after last_shop, in the area, or 0.
This function will find the first shop if last_shop is set to 0.
|
| function int area_setval
(area area, int val, int newvalue)
|
|
This function sets non-persistant data on an area. It returns the newly set value,
or a -1 on failure.
|
(Show Constants)
- AREA_VAL_AREASTATE0 The Areastate 0 for the area.
- AREA_VAL_AREASTATE1 The Areastate 1 for the area.
- AREA_VAL_AREASTATE2 The Areastate 2 for the area.
- AREA_VAL_AREASTATE3 The Areastate 3 for the area.
- AREA_VAL_AREASTATE4 The Areastate 4 for the area.
- AREA_VAL_AREASTATE5 The Areastate 5 for the area.
- AREA_VAL_AREASTATE6 The Areastate 6 for the area.
- AREA_VAL_AREASTATE7 The Areastate 7 for the area.
- AREA_VAL_AREASTATE8 The Areastate 8 for the area.
- AREA_VAL_AREASTATE9 The Areastate 9 for the area.
(Hide Constants)
|
| function bool areaquest
(char ch, room room, int cstate, int nstate)
|
|
This function sets a character's areaquest state. The area is the area that
the room is part of. The current state must be equal to the character's
progress on this quest, or the function returns FALSE. If successful, it
returns TRUE and sets the character's quest state to the newstate value.
If the newstate is -1, the function rewards the character for completing
the quest.
|
| function int atoi
(string string)
|
|
Returns the integer that corresponds to a text string. If the string is
not a number, it returns 0.
|
| function special call
(int vnum, int type, special caller, string argument, int ret_type)
|
|
This function executes another lensc program, and waits for that program to
finish executing before continuing.
The caller must match the expected caller type that the called program
expects (char or obj). The argument is the string argument passed to the
second program, and the vnum is the vnum of the program to call.
The called program may specify a value to return to the calling program
with the END keyword. The returned value's type must match the RETURNTYPE
variable.
In the case that the called program fails to specify a return value, or the
called program fails unexepectedly, or that the called program returns a
value of the wrong type, a 0 will be returned, which is treated as an invalid
value for type other than int or bool.
See also: Launch
|
(Show Constants)
- LENSC_TYPE_BOOL
- LENSC_TYPE_INT
- LENSC_TYPE_STRING
- LENSC_TYPE_CHAR
- LENSC_TYPE_OBJ
(Hide Constants)
|
| function bool can_move_vehicle
(vehicle veh, int dir)
|
|
This function returns TRUE if the vehicle can move in the specified direction, and FALSE
otherwise.
|
(Show Constants)
- DIR_NORTH
- DIR_EAST
- DIR_SOUTH
- DIR_WEST
- DIR_UP
- DIR_DOWN
- DIR_NORTHWEST
- DIR_NORTHEAST
- DIR_SOUTHWEST
- DIR_SOUTHEAST
(Hide Constants)
|
| function bool can_remove_affect
(string name)
|
|
Returns TRUE or FALSE based on whether the named affect can normally be
dispelled. For mobs that provide named affect removal, this should be used
to ensure that players don't get around internal limits.
|
| function bool ch_can_specialize
(char ch, int spec)
|
|
Returs TRUE if the character is qualified to use the specialization,
FALSE for mobs and if the character does not have the prerequisites.
|
(Show Constants)
- SP_WEAPONMASTER
- SP_HEALER
- SP_ILLUSIONS
- SP_NECROMANCER
- SP_THIEF
- SP_ENCHANTER
- SP_ASSASSIN
- SP_SORCERER
- SP_PROTECTOR
- SP_CONJURER
- SP_DIVINER
- SP_BARBARIAN
- SP_MAGICIAN
- SP_PSIONIC
- SP_DRUID
- SP_BARD
- SP_CRAFTER
- SP_WITCH
- SP_PALADIN
- SP_ANIMAL
- SP_GLAMOUR
- SP_ALL
(Hide Constants)
|
| function bool ch_check_morale
(char ch)
|
|
Checks the character's morale, returns TRUE if they should be fleeing.
|
| function ch_clear_memory
(char ch, int id)
|
|
This function clears a memory that was set with the ch_set_memory function.
It is important to clean up memory data that you no longer need, so, for
example, if you are remembering the state of a quest, and the quest is
completed, clear that memory.
|
| function bool ch_deduct
(char ch, int type, int amount)
|
|
Deducts some number of points from a PC's account. Either deducts
the whole amount, or none at all (no partials). Returns TRUE
if deducted, FALSE if not deducted (or used on an NPC).
|
(Show Constants)
- DEDUCT_RP_ACCOUNT
- DEDUCT_STATUS_ACCOUNT
- DEDUCT_PRACTICE
- DEDUCT_TRAIN
- DEDUCT_QP
(Hide Constants)
|
| function obj ch_first_carrying
(char ch)
|
|
This returns the first object in the list of character's possessions.
No checks are made for whether it is inventory or worn, visible or not.
|
| function int ch_get_hero_level
(char ch)
|
|
Returns the character's hero or sage level. Returns 0 for mobs, non-heros.
|
| function char ch_get_master
(char ch)
|
|
Returns the character that this character is charmed to obey. Can return an invalid
handle if the character is not charmed, or has no master.
|
| function string ch_get_memory_string
(char ch, int id)
|
|
This function retrieves the string stored with the designated ID, or
an empty string if no memory exists with that ID.
|
| function int ch_get_memory_value
(char ch, int id)
|
|
This function retrieves the number stored with the designated ID, or
0 if no memory exists with that ID.
|
| function char ch_get_mount
(char ch)
|
|
Returns a handle to the character this character is riding. May return
an invalid handle.
|
| function char ch_get_pet
(char ch)
|
|
Returns the pet of the character. Not necessarily a valid char.
|
| function int ch_getareaquest
(char ch, room room)
|
|
This function returns the character's areaquest state for the given room.
Mob's and invalid rooms return -1.
|
| function string ch_getextra
(char ch, string keyword)
|
|
This function returns the extra data string associated with the given
keyword. For players, or non-existant keyword matches, it returns an
invalid handle.
|
| function string ch_getstring
(char ch, int string)
|
|
This function is used to retreive a string from a character. It can also be accessed via
the dot syntax (ch.name)
|
(Show Constants)
- CHAR_STRING_NAME Character's name/keywords
- CHAR_STRING_SHORT Character's short_desc
- CHAR_STRING_LONG Character's long_desc (deprecated)
- CHAR_STRING_ROOM Character's room desc
- CHAR_STRING_DISGUISE Character's disguise
- CHAR_STRING_DESC Character's description
- CHAR_STRING_DEITY The god the character follows name, 'None' or 'Outcast' are possible.
- CHAR_STRING_RACE The race the character is.
- CHAR_STRING_SPEC A PC's specialization, or an NPC's spec_fun
- CHAR_STRING_GUILD A PC's Guild
- CHAR_STRING_CLAN The Clan of the character - mobs can have these
- CHAR_STRING_PREFIX A PC's prefix
(Hide Constants)
|
| function int ch_getval
(char ch, int val)
|
|
This function is used to retreive a value from a character. It can also be
accessed via the dot syntax (ch.willpower)
The following constants are used to specify which value is desired:
|
(Show Constants)
|
| function bool ch_grant_xp
(char ch, int amount)
|
|
Grants XP to a character. Wiznet logged. Returns TRUE
if grant is successful, FALSE otherwise.
|
| function int ch_has_advantage
(char ch, int ad)
|
|
This function is used to query whether a character has a
certain advantage. NPC's always return FALSE.
The following constants are used to specify which advantage is being queried:
|
(Show Constants)
- AD_ID_ONE_HAND
- AD_ID_LAME
- AD_ID_COWARDLY
- AD_ID_ONE_EYE
- AD_ID_SLOW_LEARNER
- AD_ID_FAST_LEARNER
- AD_ID_AWARENESS
- AD_ID_LEGENDARY
- AD_ID_UNKNOWN
- AD_ID_PSI_APTITUDE
- AD_ID_MAGIC_APTITUDE
- AD_ID_CRAFT_APTITUDE
- AD_ID_MAGIC_RESISTANT
- AD_ID_MAGIC_SUSCEPTIBLE
- AD_ID_OVERCONFIDENT
- AD_ID_LUCKY
- AD_ID_UNLUCKY
- AD_ID_NATURAL_LEADER
- AD_ID_MUTE
- AD_ID_ALCOHOLIC
- AD_ID_EIDETIC_MEMORY
- AD_ID_FAST_HEALING
- AD_ID_SLOW_HEALING
- AD_ID_FAST_MANA
- AD_ID_SLOW_MANA
- AD_ID_TOUGHNESS
- AD_ID_COMBAT_REFLEXES
- AD_ID_ANIMAL_EMPATHY
- AD_ID_INSOMNIA
- AD_ID_OLD
- AD_ID_ATTRACTIVE
- AD_ID_UNATTRACTIVE
- AD_ID_STRONG_WILLED
- AD_ID_WEAK_WILLED
(Hide Constants)
|
| function bool ch_heal
(char ch, int type, int amount)
|
|
Heals the specific attribute by amount specified. Cannot take negative values.
Returns TRUE if character is at max value. Can query if character is maxed by
using amount of 0, and checking return value.
|
(Show Constants)
- HEAL_HP Heals Hit Points
- HEAL_MANA Heals Mana Points
- HEAL_MOVE Heals Vitality points
- HEAL_VITALITY Heals Vitality points
- HEAL_MORALE Heals Morale
- HEAL_WILL Heals Willpower
- HEAL_PERCENT_HP Heals Hit Points as a percent of character's total
- HEAL_PERCENT_MANA Heals Mana Points as a percent of character's total
- HEAL_PERCENT_MOVE Heals Vitality Points as a percent of character's total
- HEAL_PERCENT_VITALITY Heals Vitality Points as a percent of character's total
- HEAL_PERCENT_WILL Heals Willpower as a percent of character's total
- HEAL_HUNGER Heals hunger (has no effect on NPCs)
- HEAL_THIRST Heals thirst (has no effect on NPCs)
(Hide Constants)
|
| function room ch_in_room
(char ch)
|
|
This function returns the room that the character is in.
|
| function bool ch_is_defending
(char ch)
|
|
Returns TRUE if character is in defend mode.
|
| function char ch_is_fighting
(char ch)
|
|
Returns a handle to whoever this character is fighting. The handle is
invalid if the character is not fighting.
|
| function bool ch_is_flying
(char ch, bool ride)
|
|
Returns TRUE if the character is flying, FALSE if not.
Ride variable specifies if you want to know whether they're
flying on their own, or if they're riding a flying mount.
|
| function char ch_is_following
(char ch)
|
|
Returns a handle to whoever this character is following. The handle is
invalid if the character is not following anyone.
|
| function bool ch_is_fpk
(char ch)
|
|
Returns TRUE if the player is FPK. FALSE otherwise.
|
| function bool ch_is_hero
(char ch)
|
|
Returns TRUE if the character is a HERO, FALSE otherwise.
|
| function bool ch_is_mob
(char ch)
|
|
Returns TRUE if the character is a mob, FALSE if the character is a player.
|
| function bool ch_is_pet
(char ch)
|
|
Returns TRUE if the character is a 'pet' and FALSE otherwise.
|
| function bool ch_is_pk
(char ch)
|
|
Returns TRUE if the player is PK. FALSE otherwise.
|
| function bool ch_is_remort
(char ch)
|
|
Returns TRUE if the player is a remort. FALSE otherwise.
|
| function bool ch_is_sage
(char ch)
|
|
Returns TRUE if the character is a SAGE, FALSE otherwise.
|
| function bool ch_is_subduing
(char ch)
|
|
Returns TRUE if character is in subdue mode.
|
| function ch_modify_morale
(char ch, int mod)
|
|
Changes the character's morale by the set amount, paying attention to maximums and minimums.
|
| function obj ch_on_obj
(char ch)
|
|
This returns the handle to the object the character is currently on
(furniture), or an invalid handle if not on anything.
|
| function ch_set_memory
(char ch, int id, int value, string string)
|
|
This function sets a memory on a character. This memory will remain on the
character until explicitly cleared with ch_clear_memory. The ID specified
is a unique identifier that will be used to reference this memory. You
should use a number that would be a valid vnum in the zone you are working
with. The memory will remember both a number and a string. If you do not
need to use a string, set the string variable to "". If you do not need to
use a number, use a 0.
If the character already has a memory with the specified ID, it will be
overwritten with the new value.
|
| function bool ch_setstring
(char ch, int string, string text)
|
|
This function is used to set a string on a mob.
This returns TRUE if the string was successfully set, and FALSE if it was
not (including if the character was a player).
|
(Show Constants)
- CHAR_STRING_NAME Character's name/keywords
- CHAR_STRING_SHORT Character's short_desc
- CHAR_STRING_LONG Character's long_desc (deprecated)
- CHAR_STRING_LONG Character's room_desc
- CHAR_STRING_DESC Character's description
- CHAR_STRING_GUILD A PC's Guild
(Hide Constants)
|
| function int ch_skill_taught_cost
(char ch, int sk)
|
|
Returns the base cost to teach a given skill. Returns -1 if ch is not a mob,
does not teach the specified skill.
|
| function int ch_skill_taught_first
(char ch)
|
|
Returns skill number of first skill this mob teaches. Returns -1
if checking PCs, or non-teacher NPCs.
|
| function int ch_skill_taught_next
(char ch, int sk_last)
|
|
Returns skill number of next skill this mob teaches, after the one specified.
Returns -1 if checking PCs, non-teacher NPCs, sk_last is not taught, or no
more skills are taught.
|
| function ch_skip_attack
(char ch, int num_attacks)
|
|
Forces the character so lose attacks as if using a powerful spell. Has no effect if
character is not currently in combat.
|
| function bool ch_to_obj
(char ch, obj obj, int pos)
|
|
This function is used to place characters on furniture, or in specific
positions. The item, which may be NULLOBJ, must be either furniture or
furncont if provided. Positions possible are:
This returns TRUE if the position was set, and FALSE if it was not (for any
reason).
|
(Show Constants)
- POS_STANDING
- POS_RESTING
- POS_SITTING
- POS_LAYING
- POS_STUNNED
- POS_SLEEPING
(Hide Constants)
|
| function change_align
(char ch, int change)
|
|
Alters the character's alignment by the specified amount. This amount
should be unmodified - as internal code handles adjusting it for the
character's current alignment. Internal code will also force any results
of an alignment change to occur.
|
| function int clan_getval
(string clanname, int val)
|
|
Gets info about a clan. Returns -1 for invalid requests.
|
(Show Constants)
- CLAN_BANK Amount in the bank
- CLAN_HALL_VNUM Clanhall Vnum
- CLAN_PK Is the clan PK?
(Hide Constants)
|
| function char create_mob
(int vnum, room room)
|
|
This creates a new mob with the given vnum, in the specified room. The mob
runs its INIT action, if any. No message is generated by this function.
|
| function obj create_obj
(int vnum, room room)
|
|
This creates the object with the given vnum in the room specified. No
messages are presented, so the object can be moved to a character or
container after creation. The function returns a handle to the new object.
|
| function vehicle create_vehicle
(int vnum, room room)
|
|
This creates a new vehicle with the given vnum, in the specified room. If the vehicle
is set for random movement, it will be started. A handle to the vehicle is returned, but
can be invalid if the vehicle fails to create.
|
| function bool dam_mana
(char ch, int dam)
|
|
Subtracts amount from player's mana. Will not go below zero mana, and
cannot use negative amounts. Returns TRUE if successful, FALSE otherwise.
|
| function bool dam_will
(char ch, int dam)
|
|
This function lowers the character's willpower by the amount specified.
|
| function bool deduct_money
(char ch, int cost)
|
|
This function removes the amount of money, specified in silver, from
the character. It returns TRUE if successful. If it returns FALSE, the
character did not have enough. Before using this function, you should
make sure the character has enough cash on them with the ch_get_value
(CHAR_VALUE_CASH) function.
|
| function disturb
(char ch)
|
|
This disturbs the character, interrupting any continued actions they
may be working on.
|
| function bool equip_char
(char ch, obj obj, int wear_loc)
|
|
This takes an item in a character's inventory and equips it to a wear
location. The item must be in the character's inventory, and they may
not have anything else equipped to that location, or this function will
fail. Try checking get_obj_worn to ensure that the wear location is available
prior to calling this function. Wear locations are:
Returns TRUE if successful, FALSE otherwise.
|
(Show Constants)
- WEAR_FINGER_L
- WEAR_FINGER_R
- WEAR_NECK_1
- WEAR_NECK_2
- WEAR_BODY
- WEAR_HEAD
- WEAR_LEGS
- WEAR_FEET
- WEAR_HANDS
- WEAR_ARMS
- WEAR_SHIELD
- WEAR_ABOUT
- WEAR_WAIST
- WEAR_WRIST_L
- WEAR_WRIST_R
- WEAR_WIELD
- WEAR_HOLD
- WEAR_FLOAT
- WEAR_SECONDARY
- WEAR_MEDAL
- WEAR_EARS
- WEAR_EYES
(Hide Constants)
|
| function bool exit_closed
(exit ext)
|
|
Returns TRUE if the exit is closed, FALSE otherwise.
|
| function exit exit_exist
(room pRoom, int dir)
|
|
This function returns the exit in the specified direction in the given room.
The return is invalid if no exit is available in that direction.
Exit directions are:
DIR_NORTH - north
DIR_EAST - east
DIR_SOUTH - south
DIR_WEST - west
DIR_UP - up
DIR_DOWN - down
|
| function string exit_getstring
(exit exit, int val)
|
|
Returns exit strings.
|
(Show Constants)
- EXIT_STRING_NAME
- EXIT_STRING_DESC
(Hide Constants)
|
| function int exit_getval
(exit ext, int val)
|
|
Returns exit information. 0 If no information is available.
|
(Show Constants)
- EXIT_VAL_INFO Exit Flags:
(Show values)
- EX_ISDOOR
- EX_CLOSED
- EX_LOCKED
- EX_HIDDEN
- EX_VERY_HIDDEN
- EX_PICKPROOF
- EX_NOPASS
- EX_DAILY
- EX_NOCLOSE
- EX_NOLOCK
- EX_WINDOW
- EX_FULLMOON
- EX_DAY
- EX_NIGHT
- EX_NO_MOB
- EX_FALL
- EX_NO_VEHICLE
- EX_ONLY_VEHICLE
- EX_TO_GRID
- EX_AUTO_CLOSE
- EX_BLOCKED
- EX_AUTO_LOCK
- EX_SLOW
- EX_FLY
- EX_NOBASH
- EX_ASTRAL
- EX_WINDOWDOOR
- EX_MAGELOCKED
- EX_KNOCKPROOF
(Hide values)
- EXIT_VAL_SIZE Exit Size, one of:
(Show values)
- SIZE_TINY
- SIZE_SMALL
- SIZE_MEDIUM
- SIZE_LARGE
- SIZE_HUGE
- SIZE_GIANT
- SIZE_ANY
(Hide values)
- EXIT_VAL_KEY Exit's Key Vnum
(Hide Constants)
|
| function bool exit_locked
(exit ext)
|
|
Returns TRUE if the exit is locked, FALSE otherwise.
|
| function room exit_to
(exit ext)
|
|
This function returns the room where the exit leads to. Any valid exit
is defined to have a valid room associated with it, however, exits to
the wilderness should be used as soon as found, as wilderness rooms can
shift.
|
| function obj extract_object
(obj obj)
|
|
This function removes an object from the game. It returns the handle to the
removed object so that it can be invalidated. If it is not invalidated, the
program will terminate abnormally as there is a broken handle.
invalidate extract_object(object);
|
| function bool fatigue
(char ch, int dam)
|
|
This function lowers the character's vitality by the amount specified.
|
| function string first_word
(string p, int first)
|
|
This function takes a string and removes the first word (space or quote
separated). The constant determies what is returned:
|
(Show Constants)
- WORD_FIRST return the first word / quote block
- WORD_REST return everything after the first word
(Hide Constants)
|
| function game_clear_memory
(int id)
|
|
This function clears a memory that was set with the game_set_memory function.
It is important to clean up memory data that you no longer need, so, for
example, if you are remembering the state of a quest, and the quest is
completed, clear that memory.
|
| function string game_get_memory_string
(int id)
|
|
This function retrieves the string stored with the designated ID, or
an empty string if no memory exists with that ID.
|
| function int game_get_memory_value
(int id)
|
|
This function retrieves the number stored with the designated ID, or
0 if no memory exists with that ID.
|
| function game_set_memory
(int id, int value, string string)
|
|
This function sets a memory on the game. This memory will remain on the
game until explicitly cleared with game_clear_memory. The ID specified
is a unique identifier that will be used to reference this memory. You
should use a number that would be a valid vnum in the zone you are working
with. The memory will remember both a number and a string. If you do not
need to use a string, set the string variable to "". If you do not need to
use a number, use a 0.
If the game already has a memory with the specified ID, it will be
overwritten with the new value.
|
| function string get_achievement_string
(int id)
|
|
This function returns the achievement string associated with the
achievement ID specified. It returns an invalid string if there
is no such achievement.
|
| function area get_area_by_name
(string string)
|
|
Returns a handle to the area specified by the string. May return an invalid handle.
This function will check both the area name, and the area's filename.
|
| function area get_area_by_vnum
(int vnum)
|
|
This returns a handle to an area based on a vnum.
|
| function int get_base_skill
(char ch, string skillname)
|
|
This returns the character's current skill (0 to 100) rating in the
named skill.
|
| function char get_char_in_room
(room room, string string)
|
|
This function looks for a character in the specified room, which has
keywords matching name. This function can return an invalid character,
if none are found, so your program should check for that before using
that value.
|
| function char get_char_room
(char ch, string arg)
|
|
This function looks for a character in the same room as ch, which has
keywords matching name. This function can return an invalid character,
if none are found, so your program should check for that before using
that value. It does not find characters that ch cannot see.
|
| function char get_char_world
(char ch, string arg)
|
|
This function looks for a character anywhere in the world, which has
keywords matching name. This function can return an invalid character,
if none are found, so your program should check for that before using
that value. It does not find characters that ch cannot see.
|
| function string get_line
(char ch, string prompt)
|
|
This puts the character in the editor and prompts them to enter a line
of text. The program suspends while waiting for input. If used on a mob,
or in the debugger, a substitute result string is used, as the editor is
unusable. There is a 2 minute timeout on responses allowed.
|
| function string get_line_timeout
(char ch, string prompt, int timeout)
|
|
This puts the character in the editor and prompts them to enter a line
of text. The program suspends while waiting for input. If used on a mob,
or in the debugger, a substitute result string is used, as the editor is
unusable. You can specify, in seconds, how long before the input times out.
|
| function obj get_obj_carry
(char ch, string str)
|
|
This functions finds an item in a character's inventory that matches the
name provided. It will not find items the character cannot see.
|
| function obj get_obj_in_obj
(char ch, string str, obj cont)
|
|
This functions finds an item in a container that matches the name provided.
It will not find items the character cannot see.
|
| function obj get_obj_room
(char ch, string str)
|
|
This function returns the item in the room that the character is in, that
the character can see, and that matches the given keyword(s). The returned
object may be invalid, indicating nothing was found.
|
| function obj get_obj_world
(char ch, string argument)
|
|
This returns a handle to an area based on a vnum.
|
| function obj get_obj_worn
(char ch, int wear_loc)
|
|
This functions finds an item worn in the specified position.
|
(Show Constants)
- WEAR_FINGER_L
- WEAR_FINGER_R
- WEAR_NECK_1
- WEAR_NECK_2
- WEAR_BODY
- WEAR_HEAD
- WEAR_LEGS
- WEAR_FEET
- WEAR_HANDS
- WEAR_ARMS
- WEAR_SHIELD
- WEAR_ABOUT
- WEAR_WAIST
- WEAR_WRIST_L
- WEAR_WRIST_R
- WEAR_WIELD
- WEAR_HOLD
- WEAR_FLOAT
- WEAR_SECONDARY
- WEAR_MEDAL
- WEAR_EARS
- WEAR_EYES
(Hide Constants)
|
| function char get_oif_ch
()
|
|
Don't use this, it is only for enabling the object version of lif.
|
| function room get_random_room_area
(char ch, area pArea, bool noport)
|
|
This function returns a room handle to a random room to a area
specified by pArea, that the character can see. The handle returned
is guaranteed to be a valid room, but may be Limbo if no valid room
is found.
If no area is specified (using a null handle), then the area that the
character is currently in will be used.
If noport is FALSE, any non mob-chute room is a possible choice. If TRUE,
only rooms that aren't teleport safe will be returned.
|
| function int get_reaction
(char ch, char victim)
|
|
This function will return the numerical reaction (-100 to 100, where
-100 is want to kill, and 100 is love) that the ch has towards the victim.
|
| function room get_room_by_vnum
(int vnum)
|
|
This returns the room refered to by the given vnum. It can return an
invalid room, so this must be checked.
|
| function int get_skill
(char ch, string skillname)
|
|
This returns the character's current skill (0 to 100) rating in the
named skill.
|
| function string get_skill_by_sn
(int sn)
|
|
Returns a string that is the name of the skill with the specified
number. Will return an empty string if the specified number is too low
or too high, or if there is no skill with that number.
|
(Show Constants)
- SKILL_BASE The lowest number for a learnable skill (below this are internal skill numbers)
- MAX_SKILL The highest allowed skill number
(Hide Constants)
|
| function int get_systime
()
|
|
Returns current system timestamp.
|
| function string get_text
(char ch)
|
|
This puts the character in the editor, and returns the edited text block.
As with get_line, this doesn't work for mobs, or for the debugger.
|
| function string get_text_ext
(char ch, string init_text)
|
|
This puts the character in the editor, and returns the edited text block.
As with get_line, this doesn't work for mobs, or for the debugger.
|
| function vehicle get_vehicle_from_room
(room pRoom)
|
|
This function returns a handle to the vehicle associated with the room specified.
This will return an invalid handle if the room is not associated with the
vehicle as either a default room, or the entry or bridge room of a ROOMS vehicle.
|
| function vehicle get_vehicle_in_room
(char ch, string argument)
|
|
This function returns a handle to a vehicle that the character can see in the room.
It can return an invalid handle.
|
| function room get_wilderness_room
(int x, int y, int z)
|
|
Returns the wilderness room at the specified coordinates. Use this fairly
quickly, as the Wilderness shifts based on usage, and if you get a room,
and don't use it, the room won't be invalid, but it won't be where you
expect it to be. This can return an invalid room handle if the coordinates
supplied are invalid.
|
| function char group_first_char
(int group_id)
|
|
Returns the leader of the group, or an invalid handle if no group is found or no leader exists.
|
| function int group_get_info
(int group_id, int query)
|
|
Returns info about the group. Returns -1 if no such group, or an invalid request.
|
(Show Constants)
- GROUP_LEVEL Level the group quests at.
- GROUP_DIFFICULTY Difficulty setting for the group.
- GROUP_SIZE Number of people in the group.
(Hide Constants)
|
| function char group_next_char
(int group_id, char group_member)
|
|
Returns the next member of the group, or an invalid handle if no group is found or no more characters
are in the group.
|
| function bool has_achievement
(char ch, int id)
|
|
This function checks to see if the player in question has accomplished
the specified achievement.
|
| function bool has_mastered
(char ch, int spec)
|
|
This function returns TRUE if a character has mastered the
named spec, and FALSE otherwise.
Specs are:
|
(Show Constants)
- SP_WEAPONMASTER
- SP_HEALER
- SP_ILLUSIONS
- SP_NECROMANCER
- SP_THIEF
- SP_ENCHANTER
- SP_ASSASSIN
- SP_SORCERER
- SP_PROTECTOR
- SP_CONJURER
- SP_DIVINER
- SP_BARBARIAN
- SP_MAGICIAN
- SP_PSIONIC
- SP_DRUID
- SP_BARD
- SP_CRAFTER
- SP_WITCH
- SP_PALADIN
- SP_ANIMAL
- SP_GLAMOUR
(Hide Constants)
|
| function heal_effect
(char ch, char caster, int level, int potency)
|
|
Invokes the heal code. This includes position updates, combat damage removal where
appropriate, and messages about changed status.
ch is the character to be healer, caster is the character doing the healing (can be the same as ch).
Level is the level of the healing, potency equates to how powerful the effect is:
Cure Light: 1
Cure Serious: 2
Cure Critical: 3
Heal: 4
True Heal: 5
|
| function char hurt
(char ch, int dam, int dt, bool safe)
|
|
This function deals dam hitpoints of damage to ch, of a specified type of
damage. It returns the character, so that they can be invalidated. If they're
not invalidated, and this function kills them, the program execution will
stop. The safe parameter will ensure that they are not killed.
Example: invalidate hurt(ch,50,DAM_FIRE,FALSE);
|
(Show Constants)
- DAM_BASH
- DAM_PIERCE
- DAM_SLASH
- DAM_FIRE
- DAM_COLD
- DAM_LIGHTNING
- DAM_ACID
- DAM_POISON
- DAM_NEGATIVE
- DAM_HOLY
- DAM_ENERGY
- DAM_MENTAL
- DAM_DISEASE
- DAM_DROWNING
- DAM_LIGHT
- DAM_MAGIC
- DAM_CHARM
- DAM_SOUND
- DAM_BLIND
(Hide Constants)
|
| function bool interpret
(char ch, string text)
|
|
This function makes a character perform the command listed as if they had
typed it. It returns TRUE if the action was successful, and FALSE if not.
This function always results in the lensc program suspending until the next
pulse in case a character died as a result of the action.
|
| function char is_bound
(char ch)
|
|
Returns the handle to the character this character is bound to, or an
invalid handle if not bound.
|
| function bool is_disabled
(char ch1, char ch2)
|
|
Checks to see if ch1 is disabled by ch2. Returns TRUE if disabled, FALSE
if not. Mob's are never disabled, and never disable anyone.
|
| function bool is_enabled
(char ch1, char ch2)
|
|
Checks to see if ch1 is enabled by ch2. Returns TRUE if enabled, FALSE
if not. Mob's are never enabled, and never enable anyone.
|
| function int is_immune
(char ch, int dam_type, obj weapon, bool spell)
|
|
This function tests whether a character is immune, resistant, or vulnerable
to a certain damage type. If an object is specified, immunity to weapons,
and the object's material will be checked. If spell is TRUE, immunity to
magic will also be checked.
|
(Show Constants)
- DAM_BASH
- DAM_PIERCE
- DAM_SLASH
- DAM_FIRE
- DAM_COLD
- DAM_LIGHTNING
- DAM_ACID
- DAM_POISON
- DAM_NEGATIVE
- DAM_HOLY
- DAM_ENERGY
- DAM_MENTAL
- DAM_DISEASE
- DAM_DROWNING
- DAM_LIGHT
- DAM_SOUND
- DAM_BLIND
- DAM_CHARM
- DAM_SUMMON
- DAM_FLEE
- DAM_BIND
- DAM_BLIND
- DAM_SCRY
- DAM_QUEST
(Hide Constants)
|
| function int is_immune2
(char ch, int dam_type, int material, bool spell)
|
|
This function tests whether a character is immune, resistant, or vulnerable
to a certain damage type. If an object is specified, immunity to weapons,
and the object's material will be checked. If spell is TRUE, immunity to
magic will also be checked.
|
(Show Constants)
- DAM_BASH
- DAM_PIERCE
- DAM_SLASH
- DAM_FIRE
- DAM_COLD
- DAM_LIGHTNING
- DAM_ACID
- DAM_POISON
- DAM_NEGATIVE
- DAM_HOLY
- DAM_ENERGY
- DAM_MENTAL
- DAM_DISEASE
- DAM_DROWNING
- DAM_LIGHT
- DAM_SOUND
- DAM_BLIND
- DAM_CHARM
- DAM_SUMMON
- DAM_FLEE
- DAM_BIND
- DAM_BLIND
- DAM_SCRY
- DAM_QUEST
- MAT_NONE
- MAT_STEEL
- MAT_IRON
- MAT_BONE
- MAT_WOOD
- MAT_FABRIC
- MAT_GOLD
- MAT_SILVER
- MAT_BRONZE
- MAT_COPPER
- MAT_STONE
- MAT_LEATHER
- MAT_GRAIN
- MAT_IRON_ORE
- MAT_COPPER_ORE
- MAT_SILVER_ORE
- MAT_GOLD_ORE
- MAT_WOOL
- MAT_PAPER
- MAT_HERBS
- MAT_GEMS
- MAT_GLASS
- MAT_PEWTER
- MAT_TIN
- MAT_WAX
- MAT_BRASS
- MAT_CLAY
- MAT_METAL
- MAT_ARCADIUM
- MAT_INDURIUM
- MAT_LEAD
- MAT_SHELL
- MAT_PLATINUM
- MAT_TIN_ORE
- MAT_PLATINUM_ORE
- MAT_INDURIUM_ORE
- MAT_LEAD_ORE
- MAT_SAND
- MAT_ZINC
- MAT_ZINC_ORE
- MAT_REEDS
- MAT_MEAT
- MAT_FUR
- MAT_DIRT
- MAT_COAL
- MAT_ICE
- MAT_ETHER
- MAT_FEATHER
- MAT_FRUIT
- MAT_VEGETABLE
- MAT_PLANT
(Hide Constants)
|
| function int is_immune3
(char ch, int dam_type, obj weapon, bool spell, int dam_loc)
|
|
This function tests whether a character is immune, resistant, or vulnerable
to a certain damage type. If an object is specified, immunity to weapons,
and the object's material will be checked. If spell is TRUE, immunity to
magic will also be checked. It also allows you to specify a location.
|
(Show Constants)
- DAM_BASH
- DAM_PIERCE
- DAM_SLASH
- DAM_FIRE
- DAM_COLD
- DAM_LIGHTNING
- DAM_ACID
- DAM_POISON
- DAM_NEGATIVE
- DAM_HOLY
- DAM_ENERGY
- DAM_MENTAL
- DAM_DISEASE
- DAM_DROWNING
- DAM_LIGHT
- DAM_SOUND
- DAM_BLIND
- DAM_CHARM
- DAM_SUMMON
- DAM_FLEE
- DAM_BIND
- DAM_BLIND
- DAM_SCRY
- DAM_QUEST
- LOC_UNDEF No specific location
- LOC_HEAD Head
- LOC_TORSO Torso
- LOC_VITAL Vitals
- LOC_ARM Arms
- LOC_LEG Legs
- LOC_HAND Hands
- LOC_FOOT Feet
- LOC_WING Wings
- LOC_TRUNK Trunk
- LOC_ROOT Roots
- LOC_BRANCH Branch
- LOC_SHIELD Shield
- LOC_BACK Back
- LOC_TAIL Tail
(Hide Constants)
|
| function bool is_name
(string str, string namelist)
|
|
This returns TRUE if name is found in the keyword list. This is standard
keyword matching as used by the rest of the mud.
|
| function bool is_safe
(char ch, char victim, int flags)
|
|
Checks to see if victim is safe from ch. TRUE means that ch is not allowed
to attack victim for some reason. The flags can be OR'ed together if needed,
or left 0 if none are required.
|
(Show Constants)
- SAFE_AREA Safe for area spells
- SAFE_SHOW Show a message why the attack is disallowed to the attacker
- SAFE_CAN_FIGHT Safe for initial combat attack
(Hide Constants)
|
| function bool is_valid_area
(area p)
|
|
Checks validity of an area variable. Returns TRUE is valid, FALSE otherwise.
|
| function bool is_valid_char
(char p)
|
|
Checks validity of a char. Returns TRUE is valid, FALSE otherwise.
|
| function bool is_valid_exit
(exit p)
|
|
Checks validity of an exit. Returns TRUE is valid, FALSE otherwise.
|
| function bool is_valid_obj
(obj p)
|
|
Checks validity of an obj variable. Returns TRUE is valid, FALSE otherwise.
|
| function bool is_valid_room
(room p)
|
|
Checks validity of a room. Returns TRUE is valid, FALSE otherwise.
|
| function bool is_valid_vehicle
(obj p)
|
|
Checks validity of a vehicle variable. Returns TRUE is valid, FALSE otherwise.
|
| function bool language_known
(char ch, int lang)
|
|
Returns TRUE if the characters knows the language, FALSE if not.
Languages are:
|
(Show Constants)
- LANGUAGE_LENSMOOR
- LANGUAGE_ANTRIPPA
- LANGUAGE_ENT
- LANGUAGE_GNOME
- LANGUAGE_ELF
- LANGUAGE_SELKIE
- LANGUAGE_XORRTO
- LANGUAGE_FAE
- LANGUAGE_ALAEMN
- LANGUAGE_ORC
- LANGUAGE_HAIK
- LANGUAGE_GANDOR
- LANGUAGE_GOBLIN
- LANGUAGE_SKULK
- LANGUAGE_QUICKLING
- LANGUAGE_ARACHNAIA
- LANGUAGE_CAT
- LANGUAGE_NYMPH
- LANGUAGE_CENTAUR
- LANGUAGE_THIEF
- LANGUAGE_MERCHANT
- LANGUAGE_DRAGON
- LANGUAGE_TROLL
- LANGUAGE_SIGN
- LANGUAGE_GOETIC
- LANGUAGE_ELDAK
- LANGUAGE_GENIE
- LANGUAGE_DENTERRA
- LANGUAGE_KHEPRIS
(Hide Constants)
|
| function bool launch
(int vnum, int type, special caller, string argument)
|
|
This function executes another lensc program, and then continues execution
of the current program immediately. The caller must match the expected
caller type that the called program expects (char or obj). The argument
is the string argument passed to the second program, and the vnum is the
vnum of the program to launch.
|
(Show Constants)
- LENSC_TYPE_CHAR Char
- LENSC_TYPE_OBJ Object
(Hide Constants)
|
| function int lensc_is_ch_run
(char target, int vnum)
|
|
This function returns a count of how many times this character is running a
program with the specified vnum. This can be useful in restricting the number
of simultaneous runnings of the same program.
|
| function int lensc_is_obj_run
(obj target, int vnum)
|
|
This function returns a count of how many times this object is running a
program with the specified vnum. This can be useful in restricting the number
of simultaneous runnings of the same program.
|
| function string map_at
(int x, int y, int z)
|
|
Returns a string that holds the map at the requested coordinates in the
wilderness.
|
| function int max
(int n1, int n2)
|
|
This function returns the larger of two numbers.
|
| function int min
(int n1, int n2)
|
|
This function returns the smaller of two numbers.
|
| function string mob_first_extra
(char ch)
|
|
This returns the keyword for the first extra description for the mob prototype.
An empty string is returned if there are no extra descriptions, or for PCs.
|
| function bool mob_has_shop
(char ch)
|
|
Returns TRUE if the mob owns a shop (not a spec_ type shop),
FALSE if not (or if the 'mob' is actually a player).
|
| function string mob_next_extra
(char ch, string last_keyword)
|
|
This returns the next available keyword for extra descriptions on the
mob's prototype. An empty string is returned if there are no extra
descriptions, or if a PC is used.
|
| function int mob_setval
(char ch, int val, int setto)
|
|
This function is used to set a value on a mob. The setto variable holds
the desired value for the specified variable. The function returns the
new value for the specified stat. This may not be what you requested, as
some internal limits apply. In case of an invalid request, the return
value will be 0.
The following constants are used to specify which value is desired:
|
(Show Constants)
- CHAR_VAL_STR Current Strength
- CHAR_VAL_INT Current Intelligence
- CHAR_VAL_WIS Current Wisdom
- CHAR_VAL_DEX Current Dexterity
- CHAR_VAL_CON Current Constitution
- CHAR_VAL_CHA Current Charisma
- CHAR_VAL_HP Current Hit Points
- CHAR_VAL_MAX_HP Maximum Hit Points
- CHAR_VAL_MANA Current Mana
- CHAR_VAL_MAX_MANA Maximum Mana
- CHAR_VAL_TIRED Deprecated, use Vitality
- CHAR_VAL_VITALITY Current Vitality (0-100)
- CHAR_VAL_WILLPOWER Current Willpower (0-100)
- CHAR_VAL_GOLD Gold carried
- CHAR_VAL_PLAT Platinum carried
- CHAR_VAL_SILVER Silver carried
- CHAR_VAL_HITROLL Mob's Hitroll modifier
- CHAR_VAL_DAMROLL Mob's Damroll modifier
- CHAR_VAL_SAVES Mob's Saving Throw Modifier
- CHAR_VAL_SAVE_MOD Mobs target's Saving Throw Modifier
- CHAR_VAL_ALIGN Character's alignment (-1000 to 1000)
- CHAR_VAL_POSITION Character's current position
(Show values)
- POS_STANDING
- POS_SITTING
- POS_LAYING
- POS_SLEEPING
- POS_STUNNED
- POS_DEAD
(Hide values)
- CHAR_VAL_SEX Character's sex
(Show values)
- SEX_NEUTRAL
- SEX_MALE
- SEX_FEMALE
(Hide values)
(Hide Constants)
|
| function string mobchat
(char ch, char victim, string phrase)
|
|
This returns what a mob would say to the person they are speaking to,
given a specific input.
|
| function int modify_reaction
(char ch, char victim, int amount)
|
|
This function will modify the numerical reaction (-100 to 100) that the
ch has towards the target. It will return the resulting reaction.
|
| function bool move_char
(char ch, int dir)
|
|
This uses the mud's internal character movement code to move a character in
a direction. It returns TRUE if succesful (the char moved) and FALSE
otherwise. All move costs, movement verbs and messages, and validity-of-move
are handled. Exit directions are:
|
(Show Constants)
- DIR_NORTH
- DIR_EAST
- DIR_SOUTH
- DIR_WEST
- DIR_UP
- DIR_DOWN
- DIR_NORTHWEST
- DIR_NORTHEAST
- DIR_SOUTHWEST
- DIR_SOUTHEAST
(Hide Constants)
|
| function move_char_to_room
(char ch, room room)
|
|
This function moves the specified character to the specified room. No
messages are created for those in the room newly entered, or left. The
character does not auto-look either, if you want them to see the new room,
you need to do an interpret(ch,"look auto"). Used on a mounted character,
this moves the mount too.
|
| function move_obj_to_char
(obj obj, char ch)
|
|
This function moves the specified item to the specified character's inventory.
|
| function move_obj_to_obj
(obj obj, obj cont)
|
|
This function moves the specified item to the specified container.
|
| function move_obj_to_room
(obj obj, room room)
|
|
This function moves the specified item to the specified room.
|
| function bool move_vehicle
(vehicle vehicle, int door)
|
|
This function moves the vehicle in the direction specified. It returns TRUE if the move
was successful, and FALSE if it was not.
|
(Show Constants)
- DIR_NORTH
- DIR_EAST
- DIR_SOUTH
- DIR_WEST
- DIR_UP
- DIR_DOWN
- DIR_NORTHWEST
- DIR_NORTHEAST
- DIR_SOUTHWEST
- DIR_SOUTHEAST
(Hide Constants)
|
| function char obj_carried_by
(obj obj)
|
|
Returns the character carrying the item. If the item is not in an inventory,
the returned value is invalid. Does not check nested contents of containers.
|
| function obj obj_first_content
(obj obj)
|
|
This returns the first object located inside the calling object.
If the calling object contains nothing, it is an invalid object.
|
| function string obj_first_extra
(obj obj, bool proto)
|
|
This returns the keyword for the first extra description on the object.
If proto is set, it will look at the object definition, otherwise it will
look at the specific object.
An empty string is returned if there are no extra descriptions.
|
| function string obj_getextra
(obj obj, string keyword)
|
|
This function returns the extra description string associated with the
given keyword. For non-existant keyword matches, it returns an invalid
handle.
|
| function string obj_getstring
(obj obj, int val)
|
|
A function to return a string from an item. It can also be accessed via the
dot syntax (obj.name)
|
(Show Constants)
- OBJ_STRING_NAME The item's keyword list
- OBJ_STRING_SHORT_DESCR The item's short description
- OBJ_STRING_ROOM_DESCR The item's room description
- OBJ_STRING_LONG_DESCR The item's room description (deprecated)
- OBJ_STRING_SPEC The items's spec_proc
(Hide Constants)
|
| function int obj_getval
(obj obj, int val)
|
|
A function to return a value from an object. It can also be accessed
via the dot syntax (obj.vnum)
|
(Show Constants)
|
| function obj obj_in_obj
(obj obj)
|
|
This returns the object that contains the calling object. If the object
is not in a container, the return value is invalid.
|
| function room obj_in_room
(obj obj)
|
|
This returns the room that the object is in. If the object isn't in a room
(in inventory or a container) it is an invalid room.
|
| function bool obj_interpret
(obj obj, string argument, char ch)
|
|
This forces the object to interpret the string as if in an obj action.
Returns TRUE if successful, FALSE otherwise.
The ch parameter is optional, but required by some interpreted object
commands. Supply an invalid character if not using.
|
| function obj obj_next_content
(obj obj)
|
|
This returns the next object in whichever list the calling object is in.
For instance, if the object is in a room, this function will return the
next thing in the room. If the object is in a container, it will return
the next item in the container. This will return an invalid value if there
is nothing else in the list.
|
| function string obj_next_extra
(obj obj, string last_keyword, bool proto)
|
|
This returns the next available keyword for extra descriptions on the object.
If proto is set, it will look at the object definition, otherwise, it will
look at the item specified.
An empty string is returned if there are no extra descriptions.
|
| function int obj_queryaffect
(obj obj, int querytype, int query_subtype)
|
|
This returns information about affects on an item. These queries require a subtype parameter,
to specify which affect to return information about, if possible.
|
(Show Constants)
- AFFECT_MODIFIER Which stat is modified by the affect. Supply one of the following as subtype:
(Show values)
- APPLY_STR Modifier to Strength
- APPLY_INT Modifier to Intelligence
- APPLY_WIS Modifier to Wisdom
- APPLY_DEX Modifier to Dexterity
- APPLY_CON Modifier to Constitution
- APPLY_CHA Modifier to Charisma
- APPLY_AC Modifier to Armour
- APPLY_HITROLL Modifier to Hit Roll
- APPLY_DAMROLL Modifier to Damage
- APPLY_SAVES Modifier to Saving Throw
- APPLY_SAVE_MOD Modifier to Opponent's Saving Throw
- APPLY_WILLMOD Modifier to Willpower regen
- APPLY_HIT Modifer to Max HP
- APPLY_MANA Modifer to Max Mana
- APPLY_VITALITY Modifer to Vitality
- APPLY_MORALE Modifer to Morale
(Hide values)
- AFFECT_FLAGS What flags this affect provides. Supply one of the following as subtype:
(Show values)
|
| function bool obj_setextra
(obj obj, string keyword, string desc, bool replace)
|
|
This sets a descriptive keyword on an item. If replace is TRUE, it will
overwrite any current description using that keyword. If replace is FALSE,
it will not set the new data. The function returns TRUE if the extra
description is set, and FALSE if it is not. If replace is TRUE, and
the string is empty (""), the extra will be removed from the object, although
not from the object's prototype.
|
| function bool obj_setstring
(obj obj, int val, string text)
|
|
A function to set a string for an item. The string set is based on the
constant input value:
The function returns TRUE if the string is set successfully, FALSE otherwise.
|
(Show Constants)
- OBJ_STRING_NAME The item's keyword list
- OBJ_STRING_SHORT_DESCR The item's short description
- OBJ_STRING_ROOM_DESCR The item's room description
- OBJ_STRING_LONG_DESCR The item's room description (deprecated)
(Hide Constants)
|
| function bool obj_setval
(obj obj, int val, int nv)
|
|
A function to set a value for an item. The value to set is specified by
the constant input. The new Value to set is specified as NewValue. Possible
values to set are:
|
(Show Constants)
- OBJ_VAL_CONDITION The item's current condition
- OBJ_VAL_SIZE The object's size (0-5, or 6 for Any)
- OBJ_VAL_V0 The object's 0 Value - Treasure and Trash items only
- OBJ_VAL_V1 The object's 1 Value - Treasure and Trash items only
- OBJ_VAL_V2 The object's 2 Value - Treasure and Trash items only
- OBJ_VAL_V3 The object's 3 Value - Treasure and Trash items only
- OBJ_VAL_V4 The object's 4 Value - Treasure and Trash items only
- OBJ_VAL_WEIGHT The object's weight, in tenths of pounds.
- OBJ_VAL_WEAPON_TYPE The type of weapon, weapons only.
(Show values)
- WEAPON_EXOTIC
- WEAPON_SWORD
- WEAPON_DAGGER
- WEAPON_SPEAR
- WEAPON_MACE
- WEAPON_AXE
- WEAPON_FLAIL
- WEAPON_WHIP
- WEAPON_POLEARM
- WEAPON_BOW
- WEAPON_SLING
(Hide values)
- OBJ_VAL_WEAPON_FLAGS The weapon's flags, weapons only.
(Show values)
- WEAPON_FLAMING
- WEAPON_FROST
- WEAPON_VAMPIRIC
- WEAPON_SHARP
- WEAPON_VORPAL
- WEAPON_TWO_HANDS
- WEAPON_SHOCKING
- WEAPON_POISON
- WEAPON_THROWABLE
- WEAPON_HOLY
- WEAPON_UNHOLY
- WEAPON_ENERGYDRAIN
- WEAPON_FORCEGOOD
- WEAPON_FORCENEUTRAL
- WEAPON_FORCEEVIL
- WEAPON_FORCECHAOS
- WEAPON_BASTARD
- WEAPON_BOOMERANG
- WEAPON_ACIDIC
- WEAPON_DOUBLE_ENDED
- WEAPON_BREAKER
- WEAPON_ELEMENTAL
(Hide values)
(Hide Constants)
|
| function string ocean_name
(int x, int y)
|
|
Returns the name for the body of water at the coordinate specified.
|
| function pause
(int delay)
|
|
This function pauses execution for the specified amount of seconds,
before executing the next command.
|
| function bool quest_award
(char ch, int amount)
|
|
This gives the player some quest points. Any award over 10 points will be
trigger a BUG message - be reasonable. It returns FALSE if it fails for
some reason, TRUE normally.
|
| function int random
(int from, int to)
|
|
This function returns an integer value between low and high inclusive.
|
| function int random_curve
(int avg, int curve)
|
|
Returns a random number with the specified average value, based
on a probability curve from 0 to 10. 0 is a flat curve (will
always return the average), while 10 is any number from 1 to 2*average.
The intermediate values create random distributions that (from 1 to 9)
get progressively more diverse.
|
| function int range
(int min, int num, int max)
|
|
Returns a number in the range from low to high. If value falls between
low and high, value is returned, otherwise the upper or lower limit
specified is returned.
|
| function bool remove_achievement
(char ch, int id)
|
|
This function removes the specified achievement from the player. It
returns FALSE if the player does not have the achievement set, or if
the character is not a player.
|
| function restore_char
(char ch)
|
|
Performs a restore on the character.
|
| function int rev_dir
(int dir)
|
|
This function returns the opposite direction from the input.
|
(Show Constants)
- DIR_NORTH
- DIR_EAST
- DIR_SOUTH
- DIR_WEST
- DIR_UP
- DIR_DOWN
- DIR_NORTHWEST
- DIR_NORTHEAST
- DIR_SOUTHWEST
- DIR_SOUTHEAST
(Hide Constants)
|
| function bool reward_player
(char ch, int type, int amount)
|
|
This function will award a number of Questpoints, trains, or practices to
the specified player. Will return TRUE if successful, FALSE if not (if ch is
a mob, for example)
|
(Show Constants)
- REWARD_QPS Award Quest Points
- REWARD_PRACS Award Practices
- REWARD_TRAINS Award Trains
(Hide Constants)
|
| function bool room_damage_all
(room room, int dam_amount, int dam_type, bool killable)
|
|
This function will deal damage to everyone in the specified room.
Returns TRUE if anyone died (causing potentially invalid handles), FALSE
otherwise.
|
(Show Constants)
- DAM_BASH
- DAM_PIERCE
- DAM_SLASH
- DAM_FIRE
- DAM_COLD
- DAM_LIGHTNING
- DAM_ACID
- DAM_POISON
- DAM_NEGATIVE
- DAM_HOLY
- DAM_ENERGY
- DAM_MENTAL
- DAM_DISEASE
- DAM_DROWNING
- DAM_LIGHT
- DAM_MAGIC
- DAM_CHARM
- DAM_SOUND
- DAM_BLIND
(Hide Constants)
|
| function char room_first_char
(room room)
|
|
This returns the first character in the room. It is not required to be a
valid character.
|
| function obj room_first_content
(room room)
|
|
This returns the first object in the list of objects in the room. It is
not required to be a valid object.
|
| function string room_first_extra
(room room, bool proto)
|
|
This returns the keyword for the first extra description in the room.
If proto is set, it will look only at extras on the room definition,
otherwise it will look at the active room only.
An empty string is returned if there are no extra descriptions.
|
| function area room_getarea
(room room)
|
|
This returns the area that the room is located in.
|
| function string room_getextra
(room room, string keyword)
|
|
This function returns the extra description string associated with the
given keyword. For non-existant keyword matches, it returns an invalid
handle.
|
| function string room_getstring
(room room, int val)
|
|
This returns a text string from the room. It can also be accessed via the
dot syntax (room.name)
|
(Show Constants)
- ROOM_STRING_NAME The name of the room
- ROOM_STRING_DESC The description of the room
- ROOM_STRING_OWNER The owner field of the room
- ROOM_STRING_CLAN The clan field of the room
- ROOM_STRING_SPEC The special routine for the room
(Hide Constants)
|
| function int room_getval
(room room, int val)
|
|
This returns a value about the room. It can also be accessed via the
dot syntax (room.vnum) Room values accessible are:
|
(Show Constants)
- ROOM_VAL_VNUM The vnum of the room
- ROOM_VAL_HEAL The heal rate in the room
- ROOM_VAL_MANA The mana rate in the room
- ROOM_VAL_SECTOR The sector type of the room
(Show values)
- SECT_INSIDE
- SECT_CITY
- SECT_FIELD
- SECT_FOREST
- SECT_HILLS
- SECT_MOUNTAIN
- SECT_WATER_SWIM
- SECT_WATER_NOSWIM
- SECT_UNDERWATER
- SECT_AIR
- SECT_DESERT
- SECT_ICE
- SECT_OCEAN
- SECT_VEHICLE
- SECT_SWAMP
(Hide values)
- ROOM_VAL_TIME The time of day, from 0 to 23
- ROOM_VAL_DAY The day of the week, from 0 to 34
- ROOM_VAL_MONTH The month from 0 to 16
- ROOM_VAL_FLAGS The Room Flags
(Show values)
- ROOM_DARK
- ROOM_NOSCRY
- ROOM_NO_MOB
- ROOM_INDOORS
- ROOM_QUIET
- ROOM_NOFLEE
- ROOM_NO_PORT_IN
- ROOM_LABORATORY
- ROOM_MOB_CHUTE
- ROOM_PRIVATE
- ROOM_SAFE
- ROOM_SOLITARY
- ROOM_PET_SHOP
- ROOM_NO_PORT_OUT
- ROOM_NO_BUILDING
- ROOM_GODS_ONLY
- ROOM_HEROES_ONLY
- ROOM_NO_LOGIN
- ROOM_JAIL
- ROOM_NOSCOUT
- ROOM_NO_FLY
- ROOM_HOME
- ROOM_NO_MESSENGER
- ROOM_MISTY
- ROOM_NO_TRACK
- ROOM_PUBLIC
- ROOM_NO_MAGIC
- ROOM_LIGHT
- ROOM_PERSIST
- ROOM_CRAFTS
- ROOM_ROLEPLAY
(Hide values)
- ROOM_VAL_NPLAYERS The number of players in the room
- ROOM_VAL_NMOBS The number of mobs in the room
- ROOM_VAL_NOBJS The number of objects in the room
- ROOM_VAL_SIZE The size of the room
- ROOM_VAL_MOON The phase of the moon, see PHASE_ values
(Show values)
- MOON_PHASE_FULL
- MOON_PHASE_WANING
- MOON_PHASE_NEW
- MOON_PHASE_WAXING
- MOON_PHASE_ECLIPSE
(Hide values)
- ROOM_VAL_SUN The position of the sun. See SUN_ values. Note, the sun position changes with seasons, so there are more daylight hours during the summer.
(Show values)
- SUN_DARK
- SUN_RISE
- SUN_LIGHT
- SUN_SET
(Hide values)
- ROOM_VAL_SEASON The current season, see SEASON_ values
(Show values)
- SEASON_SPRING
- SEASON_SUMMER
- SEASON_AUTUMN
- SEASON_WINTER
(Hide values)
- ROOM_VAL_WEATHER The current weather, see SKY_ values
(Show values)
- SKY_CLOUDLESS
- SKY_CLOUDY
- SKY_RAINING
- SKY_SNOW
- SKY_LIGHTNING
(Hide values)
- ROOM_VAL_CONTINENT The continent where this room is, see CONT_ values
(Show values)
- CONT_LENSMOOR
- CONT_ANTRIPPA
- CONT_DENTERRA
- CONT_NONE
- CONT_GRIFTMIRE
- CONT_ANY
(Hide values)
- ROOM_VAL_X X coordinate, -1 if not a wilderness room.
- ROOM_VAL_Y Y coordinate, -1 if not a wilderness room.
- ROOM_VAL_Z Z coordinate, -1 if not a wilderness room.
- ROOM_VAL_AFFECTS Affects on the room
(Show values)
- INT_ROOM_MAGIC_DARK Darkness
- INT_ROOM_BARRED Barred
- INT_ROOM_SOUL_DRAIN Soul Drain
- INT_ROOM_SMOKE Smokescreen
- INT_ROOM_HEALING_LIGHT Healing Light
- INT_ROOM_SEALED Planar Seal
- INT_ROOM_HUSH Hush
- INT_ROOM_CONSECRATE Consecrate Area
- INT_ROOM_PRIVACY Privacy
(Hide values)
(Hide Constants)
|
| function char room_next_char
(char ch)
|
|
This returns the next char in the room. This is not required to be a valid
character. The current character being evaluated must be passed to this
function.
|
| function string room_next_extra
(room room, string last_keyword, bool proto)
|
|
This returns the next available keyword for extra descriptions in the room.
An empty string is returned if there are no extra descriptions.
|
| function room_sendtext
(room room, string text)
|
|
This sends the specified string to all characters in the room.
|
| function bool room_setextra
(room room, string keyword, string desc, bool replace)
|
|
This sets a descriptive keyword on a room. If replace is TRUE, it will
overwrite any current description using that keyword. If replace is FALSE,
it will not set the new data. The function returns TRUE if the extra
description is set, and FALSE if it is not. If replace is TRUE, and
the string is empty (""), the extra will be removed from the object, although
not from the object's prototype.
|
| function string room_setstring
(room room, int val, string new_string, int duration)
|
|
This sets a text string in a room. It returns the new string. Duration is in
minutes.
Room strings accessible are:
|
(Show Constants)
- ROOM_STRING_NAME The name of the room
- ROOM_STRING_DESC The description of the room
(Hide Constants)
|
| function int room_setval
(room room, int val, int new_value)
|
|
This sets a value about the room, and returns the new value.
Modifiable room values are:
|
(Show Constants)
- ROOM_VAL_HEAL The heal rate in the room
- ROOM_VAL_MANA The mana rate in the room
- ROOM_VAL_SECTOR The sector type of the room
(Show values)
- SECT_INSIDE
- SECT_CITY
- SECT_FIELD
- SECT_FOREST
- SECT_HILLS
- SECT_MOUNTAIN
- SECT_WATER_SWIM
- SECT_WATER_NOSWIM
- SECT_UNDERWATER
- SECT_AIR
- SECT_DESERT
- SECT_ICE
- SECT_OCEAN
- SECT_VEHICLE
- SECT_SWAMP
(Hide values)
- ROOM_VAL_FLAGS Room Flags
(Show values)
- ROOM_DARK
- ROOM_NOSCRY
- ROOM_NO_MOB
- ROOM_INDOORS
- ROOM_QUIET
- ROOM_NOFLEE
- ROOM_NO_PORT_IN
- ROOM_LABORATORY
- ROOM_MOB_CHUTE
- ROOM_PRIVATE
- ROOM_SAFE
- ROOM_SOLITARY
- ROOM_PET_SHOP
- ROOM_NO_PORT_OUT
- ROOM_NO_BUILDING
- ROOM_GODS_ONLY
- ROOM_HEROES_ONLY
- ROOM_NO_LOGIN
- ROOM_JAIL
- ROOM_NOSCOUT
- ROOM_NO_FLY
- ROOM_HOME
- ROOM_NO_MESSENGER
- ROOM_MISTY
- ROOM_NO_TRACK
- ROOM_PUBLIC
- ROOM_NO_MAGIC
- ROOM_LIGHT
- ROOM_PERSIST
- ROOM_CRAFTS
- ROOM_ROLEPLAY
(Hide values)
(Hide Constants)
|
| function int round
(int numerator, int denomenator)
|
|
This function divides the numerator by the denomenator, rounding fractions
1/2 or greater up.
|
| function bool saving_throw
(int level, char caster, char victim, int dam_type)
|
|
This gives a character a saving throw, returning TRUE if they successfully
save, and FALSE if they do not. The CASTER can be invalid in cases where no
one is creating the attack. LEVEL is the level of the attack. DAM_TYPE can
be one of:
|
(Show Constants)
- DAM_BASH
- DAM_PIERCE
- DAM_SLASH
- DAM_FIRE
- DAM_COLD
- DAM_LIGHTNING
- DAM_ACID
- DAM_POISON
- DAM_NEGATIVE
- DAM_HOLY
- DAM_ENERGY
- DAM_MENTAL
- DAM_DISEASE
- DAM_DROWNING
- DAM_LIGHT
- DAM_CHARM
- DAM_SOUND
- DAM_BLIND
- DAM_MAGIC
- DAM_SUMMON
(Hide Constants)
|
| function send_channel
(string text, int chan)
|
|
Sends the string to one of the game's automated channels:
|
(Show Constants)
- CHANNEL_QUEST
- CHANNEL_GAMES
- CHANNEL_WIZNET
- CHANNEL_INFO
(Hide Constants)
|
| function send_note
(string to, string from, string subject, string text, int type)
|
|
Posts a note to the specified board.
|
(Show Constants)
- NOTE_NOTE Note Board
- NOTE_CHATTER Chatter Board
- NOTE_WORLD World Board
- NOTE_TYPO Typo Board
(Hide Constants)
|
| function sendt
(char ch, string txt)
|
|
This sends the string of text to the character.
|
| function bool set_busy
(char ch, int delay)
|
|
Sets a character as busy for the specified amount of time (seconds).
The function returns TRUE if the full time was spent busy, or FALSE
if the character is disturbed.
|
| function int shop_getval
(int vnum, int type)
|
|
Gets values related to a shop owned by mob with stated vnum. -1 is returned
for any non-shop vnum queried.
|
(Show Constants)
- SHOP_VAL_BUYPERCENT
- SHOP_VAL_SELLPERCENT
- SHOP_VAL_BUYTYPE1
- SHOP_VAL_BUYTYPE2
- SHOP_VAL_BUYTYPE3
- SHOP_VAL_BUYTYPE4
- SHOP_VAL_BUYTYPE5
(Show values)
- ITEM_LIGHT
- ITEM_SCROLL
- ITEM_WAND
- ITEM_STAFF
- ITEM_PART
- ITEM_TREASURE
- ITEM_ARMOR
- ITEM_POTION
- ITEM_CLOTHING
- ITEM_FURNITURE
- ITEM_TRASH
- ITEM_SKILLBONUS
- ITEM_CONTAINER
- ITEM_DRINK_CON
- ITEM_KEY
- ITEM_FOOD
- ITEM_MONEY
- ITEM_INSTRUMENT
- ITEM_CORPSE_NPC
- ITEM_CORPSE_PC
- ITEM_FOUNTAIN
- ITEM_PILL
- ITEM_SWITCH
- ITEM_MAP
- ITEM_PORTAL
- ITEM_GEM
- ITEM_JEWELRY
- ITEM_CASTER
- ITEM_SALVE
- ITEM_COMPONENT
- ITEM_FURNCONT
- ITEM_TOOL
- ITEM_MATERIAL
- ITEM_WEAPON
(Hide values)
- SHOP_VAL_OPENHOUR
- SHOP_VAL_CLOSEHOUR
- SHOP_VAL_SHOPFLAGS
(Show values)
(Hide Constants)
|
| function bool skill_check
(char ch, string skillname)
|
|
This checks a character's skill, returning TRUE on successful skill use,
and FALSE otherwise. Unknown skills return FALSE always.
|
| function string skill_getname
(int sn)
|
|
Returns the name of the skill with specified id, or "reserved" if no such skill.
|
| function int skill_getval
(int sn, int val)
|
|
Returns information about a skill. Returns -1 if an invalid option is selected, or the
skill does not exist.
|
(Show Constants)
- SKILL_LEVEL The Level of the skill
- SKILL_PREREQUISITE The skill number of the prerequisite skill (or -1)
- SKILL_FLAGS
(Show values)
- SK_CRAFT
- SK_RELIGION
- SK_DISPEL
- SK_NOTEACH
- SK_NODECREASE
- SK_SPECONLY
- SK_NOSHOW
- SK_NOCRAFT
- SK_OLC
- SK_NOWARD
- SK_ENCHANT
- SK_NOSUSTAIN
- SK_LEVELMANA
- SK_DENTERRAN
- SK_IMMSPELL
- SK_POWERFUL
- SK_NOCOMBAT
- SK_NOMOB
(Hide values)
- SKILL_ATTACK_COST Attack cost to cast this spell
- SKILL_TYPE
(Show values)
- SKILL_TYPE_SKILL
- SKILL_TYPE_SPELL
- SKILL_TYPE_PSI
(Hide values)
- SKILL_DIFFICULTY
(Show values)
- SKILL_TYPE_SELF Self-taught skill
- SKILL_TYPE_EASY
- SKILL_TYPE_MID
- SKILL_TYPE_HARD
- SKILL_TYPE_RACE Racial skill
(Hide values)
- SKILL_SPEC Specialization(s), multiple of:
(Show values)
- SP_WEAPONMASTER
- SP_HEALER
- SP_ILLUSIONS
- SP_NECROMANCER
- SP_THIEF
- SP_ENCHANTER
- SP_ASSASSIN
- SP_SORCERER
- SP_PROTECTOR
- SP_CONJURER
- SP_DIVINER
- SP_BARBARIAN
- SP_MAGICIAN
- SP_PSIONIC
- SP_DRUID
- SP_BARD
- SP_CRAFTER
- SP_WITCH
- SP_PALADIN
- SP_ANIMAL
- SP_GLAMOUR
(Hide values)
(Hide Constants)
|
| function int spec_get_next_skill
(int spec, int last_sn)
|
|
Returns the next skill number in a specialization. Use -1 as a last_sn to get the first
skill in the spec. Returns -1 when there are no more skills.
|
(Show Constants)
- SP_WEAPONMASTER
- SP_HEALER
- SP_ILLUSIONS
- SP_NECROMANCER
- SP_THIEF
- SP_ENCHANTER
- SP_ASSASSIN
- SP_SORCERER
- SP_PROTECTOR
- SP_CONJURER
- SP_DIVINER
- SP_BARBARIAN
- SP_MAGICIAN
- SP_PSIONIC
- SP_DRUID
- SP_BARD
- SP_CRAFTER
- SP_WITCH
- SP_PALADIN
- SP_ANIMAL
- SP_GLAMOUR
(Hide Constants)
|
| function start_vehicle
(vehicle vehicle)
|
|
This function starts a vehicle moving on its own. If the vehicle is not
set as either Random, or Path (or if there is no path defined), this function
will fail, and produce a bug warning on wiznet.
|
| function bool stat_check
(char ch, int st)
|
|
This checks a character's stat, returning TRUE if it passes the check,
and FALSE otherwise.
|
(Show Constants)
- CHAR_VAL_STR Current Strength
- CHAR_VAL_INT Current Intelligence
- CHAR_VAL_WIS Current Wisdom
- CHAR_VAL_DEX Current Dexterity
- CHAR_VAL_CON Current Constitution
- CHAR_VAL_CHA Current Charisma
(Hide Constants)
|
| function string string_in_string
(string instring, string target)
|
|
Returns the string that starts at the first occurance of target in
instring.
|
| function int string_index_of
(string instring, string target, int start_offset)
|
|
Returns the character position (as a 0-based index) of the target
string within the input string. If not found, returns -1.
Start_offset can be used to specify a starting position to begin looking
from. Use 0 to start at the beginning of the string.
|
| function bool string_is_empty
(string p)
|
|
Checks to see if there are any characters in a string variable. Returns TRUE
if there are not, FALSE otherwise;
|
| function int string_length
(string string)
|
|
Returns the number of characters in a string.
|
| function string string_pad
(string input_string, int padwidth, string padchar, int padtype, bool color)
|
|
Takes the input string and pads it to the desired width with the padchar.
If input_string is longer than padwidth, simply returns input string.
Padchar must be a single character. If padchar is more than one character,
this function will return an empty string.
If color is TRUE, then padding will be done ignoring color codes. If color
is FALSe, padding will count color codes in the final total.
|
(Show Constants)
- WRAP_LEFT Pad chars inserted after input string
- WRAP_RIGHT Pad chars inserted before input string
- WRAP_CENTER Pad chars inserted half before, half after input string
(Hide Constants)
|
| function string string_prefix
(string string, int count)
|
|
Returns the string composing the first count characters in the input string.
|
| function string string_replace
(string instring, string target, string replacement)
|
|
Returns a string where every occurance of 'target' in the original string
is replaced with the replacement string.
|
| function string string_substring
(string instring, int start, int end)
|
|
Returns the substring from characters start to end. If either are out of
the string's bounds, returns an empty string. Start and End are 0-based
indexes.
|
| function string string_suffix
(string string, int count)
|
|
Returns the string composing the last count characters in the input string.
|
| function int string_to_lensc_const
(string string)
|
|
This function will return the INT value that matches the
lensc constant specified in the string. If none matches,
it will return 0.
|
| function string strip_colour
(string string)
|
|
Returns a new string that contains the input string, minus any colour codes.
|
| function string translate
(string text, int language)
|
|
Returns a string that contains the specified text converted into
what someone who doesn't know that language would see.
Languages are:
|
(Show Constants)
- LANGUAGE_LENSMOOR
- LANGUAGE_ANTRIPPA
- LANGUAGE_ENT
- LANGUAGE_GNOME
- LANGUAGE_ELF
- LANGUAGE_SELKIE
- LANGUAGE_XORRTO
- LANGUAGE_FAE
- LANGUAGE_ALAEMN
- LANGUAGE_ORC
- LANGUAGE_HAIK
- LANGUAGE_GANDOR
- LANGUAGE_GOBLIN
- LANGUAGE_SKULK
- LANGUAGE_QUICKLING
- LANGUAGE_ARACHNAIA
- LANGUAGE_CAT
- LANGUAGE_NYMPH
- LANGUAGE_CENTAUR
- LANGUAGE_THIEF
- LANGUAGE_MERCHANT
- LANGUAGE_DRAGON
- LANGUAGE_TROLL
- LANGUAGE_SIGN
- LANGUAGE_GOETIC
- LANGUAGE_ELDAK
- LANGUAGE_GENIE
- LANGUAGE_KHEPRIS
- LANGUAGE_DENTERRA
(Hide Constants)
|
| function bool unequip_char
(char ch, obj obj)
|
|
"This function takes an item that a character is currently wearing and
returns it to their inventory. Try checking get_obj_worn to get the object
handle for the object at the required location. Returns TRUE if successful,
FALSE otherwise."
|
| function update_last_quest_time
()
|
|
Sets the Last Quest Ended time to the current time. This is the field displayed in Quest Info.
|
| function room vehicle_bridge_room
(vehicle veh)
|
|
This returns the bridge room for the vehicle. This will be a NULL
handle if the vehicle is not set for DRIVEing.
|
| function room vehicle_entry_room
(vehicle veh)
|
|
This returns the entry room for the vehicle.
|
| function string vehicle_getstring
(vehicle veh, int val)
|
|
This function returns information about a vehicle. It can also be accessed
via the dot syntax (vehicle.name)
|
(Show Constants)
- VEHICLE_STRING_NAME Vehicle Name
- VEHICLE_STRING_SHORT Vehicle Short Desc
- VEHICLE_STRING_LONG Vehicle Long Desc
- VEHICLE_STRING_VERB Vehicle Movement Verb
(Hide Constants)
|
| function int vehicle_getval
(vehicle veh, int val)
|
|
This function returns information about a vehicle. It can also be accessed
via the dot syntax (vehicle.type)
|
(Show Constants)
- VEHICLE_VAL_TYPE Vehicle Type:
(Show values)
- VEHICLE_ANY Vehicle can move anywhere
- VEHICLE_LAND Vehicle can move only on land
- VEHICLE_WATER Vehicle can move only on water
- VEHICLE_AIR Vehicle can move only in the air
(Hide values)
- VEHICLE_VAL_LOC_X Vehicle Location X (-1 if not in wilderness)
- VEHICLE_VAL_LOC_Y Vehicle Location Y (-1 if not in wilderness)
- VEHICLE_VAL_LOC_Z Vehicle Location Z (-1 if not in wilderness)
- VEHICLE_VAL_FLAGS Vehicle Flags:
(Show values)
- VEHICLE_INHERIT
- VEHICLE_DRIVE
- VEHICLE_PATH
- VEHICLE_EMBARK
- VEHICLE_CLOSABLE
- VEHICLE_WILDERNESS
- VEHICLE_RANDOM
- VEHICLE_ROOMS
- VEHICLE_STAY_AREA
- VEHICLE_SHOW_MAP
- VEHICLE_CRAFTABLE
(Hide values)
- VEHICLE_VAL_CLOSED Vehicle is closed (1 is yes, 0 is no)
(Hide Constants)
|
| function room vehicle_in_room
(vehicle veh)
|
|
This returns the room that the vehicle is in.
|
| function bool vehicle_setstring
(vehicle veh, int val, string new_string)
|
|
This function sets one or more of the vehicle's strings. It returns TRUE if the string
was successfully changed, or FALSE if not.
|
(Show Constants)
- VEHICLE_STRING_SHORT Vehicle Short Desc
- VEHICLE_STRING_LONG Vehicle Long Desc
- VEHICLE_STRING_VERB Vehicle Movement Verb
(Hide Constants)
|
| function int vehicle_setval
(vehicle veh, int val, int new_value)
|
|
This function sets information about a vehicle. It will return the new value of the
specified field.
|
(Show Constants)
- VEHICLE_VAL_CLOSED Vehicle is closed (1 is yes, 0 is no)
(Hide Constants)
|
| function wait
()
|
|
This function suspends program execution until the next pulse.
|
| function string wordwrap
(string text, int mode)
|
|
This function wraps a block of text, according to the wrap mode selected.
The wrapped text is returned as a new string. Wrap modes are:
|
(Show Constants)
- WRAP_LEFT
- WRAP_RIGHT
- WRAP_CENTER
- WRAP_FULL
(Hide Constants)
|
| function char world_first_char
(bool pc)
|
|
This function returns the first character in the world. If pc is TRUE,
it returns the first player, otherwise, mobs are included in the list.
This function can - but it is very unlikely - return an invalid handle.
|
| function char world_next_char
(char ch, bool pc)
|
|
This function returns the next character in the world, based on the
character passed to this function. If pc is TRUE, it returns only PC's,
otherwise, mobs are included in the list. This function can return an
invalid handle.
|
Special Functions
| function string instring
(int timeout)
|
|
This function allows a mobact or an objact to send text to the program.
This text is then treated as a string in the program, as the return value for
this function. If no input is found before the timeout expires (in seconds)
then the function returns an empty string.
|
|