Mob commands
Default the mob command will use the mob that is running the mobprog. Directly after the mob command you can use switches to search for another mob. It duplicates some of the char commands to make writing mobprogs easier.
mob ?-mob? ?-target? ?-second? ?-last? ?-find <charid>? ?-set <slot>? ?-get <slot>? <option> ?<arg> <arg> ...?
Switches:
Switch | Description |
---|---|
-mob | Execute command on the mob that is running the mobprog (default) |
-target | The remembered mob. (Doesn’t work if it is a char) |
-last | Command will be done on the mob that did a command last time |
-second | If secondary char is a mob, this switch can be used to access this char. |
-find <charid> | Execute the command on the mob with the given <charid> |
-set <slot> | Store the resulting char/mob in a memory slot. (0<=slot<=4) Slots are reset when the trigger ends |
-get <slot> | Recall a char/mob from a memory slot. |
mob Command Reference
- act
- affects
- around
- assist
- at
- cansee
- cast
- delay
- descr
- drunk
- echo
- exists
- extract
- extradescr
- fighting
- flee
- fullname
- give
- goto
- hasbeenkilledby
- he
- him
- his
- hpcnt
- hunting
- id
- impinvis
- isactive
- iscarrying
- iswearing
- kill
- leave
- level
- longdescr
- mob
- money
- name
- namespace
- oload
- peace
- pet
- position
- property
- remember
- remove
- restore
- sex
- short
- stats
- timer
- triggers
- unequip
mob act to format arg1 arg2 minposition
The mob act command will be the main command for displaying texts. This command will take care of things like invisibility or blindness. It is wise to use this command for all messages that contain the mobs name in it. It is the same as the act_new function in the C code of the mud.
to can have the following values:
- toroom
- Send to all chars in room except the mob.
- tonotvict
- Send to all chars in room except the mob and arg2.
- tovict
- Send only to arg2 (and then only if arg2 != mob). Arg2 should be a charid.
- tochar
- Send only to the mob who is calling the command.
- toall
- Send to all chars in the room.
format This is a format string, with formatting specifications introduced by '$' (just as 'printf' introduces its formatting sequences with '%'). Typically this is a complete sentence with a subject and an object. Normally TCL also expands the $ sequences to variable names. To prevent this always specify the format string between curly brackets { }. Here are all the '$' sequences supported by 'act':
- $t
- Result is the arg1 argument interpreted as a string.
- $T
- Result is the arg2 argument interpreted as a string.
- $n
- Result is the name of the mob. If the mob is not visible to the target character, result is the string 'someone'.
- $N
- Result is the name of arg2 (considered as a victim). If arg2 is not visible to the target character, result is the string 'someone'.
- $e
- Result is 'he', 'she', or 'it', depending on the sex of mob.
- $E
- Result is 'he', 'she', or 'it', depending on the sex of arg2 (considered as a victim).
- $m
- Result is 'him', 'her', or 'it', depending on the sex of mob.
- $M
- Result is 'him', 'her', or 'it', depending on the sex of arg2 (considered as a victim).
- $s
- Result is 'his', 'her', or 'its', depending on the sex of mob.
- $S
- Result is 'his', 'her', or 'its', depending on the sex of arg2 (considered as a victim).
- $p
- Result is the short description of arg1 (considered as an object). If arg1 is invisible to the target character, result is the string 'something'.
- $P
- Result is the short description of arg2 (considered as an object). If arg2 is invisible to the target character, result is the string 'something'.
- $d
- Result is the first word in arg2, considered as a string. If arg2 is empty, result is the string 'door'. This is meant for extracting the name from a door's keyword list, but may be used in general for other keyword lists.
arg1 arg2 The first argument is optional and only has to be supplied when a $ sequence is used that needs the first argument. The second argument must always be supplied. If it isn't needed an empty string can be given.
minposition The message will only be send if the mob has at least the minimum position (optional argument). The positions are:
- dead
- mort
- incap
- stun
- sleep
- rest (default)
- sit
- fight
- stand
An example for the mob act function:
mob act tovict {$n hopes you’ll behave.} [char id]
mob listaff
Returns a list of lists with the affects on the mob. The second level list consists of the following fields:
- where
- Where does the affect go? (obj affect immunities resistance ...)
- type
- Skill/spell this affect belongs to or reserved if is added manually
- level
- Level of the affect
- duration
- Number of ticks an affect will be active
- location
- What field does this affect modify
- modifier
- Delta of the modification
- vector
- What does this affect give you. (see 'flags for' in set affect)
mob around TCL-script
This command executes the TCL-script in all surrounding rooms. This will mostly be used in combination with the act command.
mob assist charid
This command will help the charid in its current fight.
mob at location TCL-script
Execute TCL program while mob is at another location.
mob at 3001 {
! smile
! say "Try to catch me!"
}
mob cansee charid
Returns true if the mob can see charid. This routine will not check if charid is in the same room as the mob.
mob cast -noisy -speechonly spell target
Lets the mobile to cast spells. Beware, this does only crude validity checking and does not use up any mana. All spells are available regardless of the race or other abilities of the mobile. Casting the spell occurs silently when -noisy isn't supplied, but spell effects are displayed normally. If -speechonly is supplied, all the mob does is say the spell. (speechonly implies noisy) Use this instead of [! say] to take the listeners magic_lore into account.
-noisy is available since March 9th 2000.
mob delay number
Without arguments it returns the current delay timer. By specifying "cancel" as number the delay is canceled. With arguments it sets the delay timer. mob delay sets the time in PULSE_MOBILE after which the mobiles delay trigger is activated. If the mobile has a program defined for delay trigger, the program is executed when the timer expires.
mob hasdelay
Returns true if this mob has a mobprog pending.
mob descr new description
Returns the description of the mob. Or sets it if new description is supplied.
mob drunk text text text ...
Let the mob say this text as if it was drunk.
Usage:
proc greet {} { mob drunk More beer! }addtrigger 1 greet {greet} {trig true}
mob echo text text text ...
Sends the text directly to this mob.
mob exists
Returns true if the mob exists. This is the only command that will not result in an error and the script aborting if there is no mob found. Useful for testing if a trigger has a -second mob.
mob extract
Removes this mob from the game. When executing mob commands will generate error messages most of the time.
mob extradescr list|add|mod|del keyword description
- list
- lists all extra-description-keywords associated with the mob. Keywords belonging to the database mob are ignored. The keyword description are not needed.
- add|mod
- Add's or changes a description. mod will add a keyword if it doesn't exist yet and add will modify an already existing keyword. (yes, add==mod) Both parameters are mandatory.
- del
- Removes an extra-description. Only the keyword parameter is needed.
mob fighting -id|-vnum|-name
Returns the id (or vnum or name) of whoever the mob is fighting. If the mob is not fighting 0 (or in case of -name an empty string) is returned. If the mob is fighting a PC and -vnum is specified 0 is returned.
mob flee
Causes a mobile to unconditionally flee from combat. Can be used for example with the hit point percentage trigger to simulate "wimpy" behavior.
mob fullname new full name
Returns the full name of the mob. Or sets it if new full name is supplied.
mob give -loud object id char id
Transfers the ownership of an object from the mob to a mob/player
mob goto location
The mob goes to the specified location. No messages are displayed.
mob hasbeenkilledby
Returns true if the mob (or an instance) has already been killed once by the character.
mob he
Returns he/she or it depending on sex.
mob him
Returns him/her or it depending on sex.
mob his
Returns his/hers or its depending on sex.
mob hpcnt
Returns percentage of hitpoints left.
mob hunt charid
Hunts a mob or character. Returns -2 if the char doesn't exist, returns -1 if no path was found or the numerical value of the exit when it was found (see also: directionname in the misc-section). NOTICE: this command doesn't move the mob, it only returns the direction to the target.
mob walk -room -mob -char -global id
Walks to a mob, character or a room. If the target is a mob or a char -global makes the search go beyond area boundris, the flag has no affect when used with -room. Returns false if the id does not exist. See also the walked-trigger.
mob hunt_type
Returns either 'none','find','kill','room','unknown' depending on which (and if) the mob is hunting
mob hunt_id
Returns the id of the char/mob (or vnum of the room) the mob is hunting
It helps to add ‘g:’ in front of the id to search the whole mud. eg mob hunt g:[char id]
mob id
Returns the id of the mob.
mob vnum
Returned the vnum of the mob
mob impinvis boolean
Set the AFF_IMPINVISIBLE flag. With argument true the impinvisible flag will be set. Otherwise it will be removed. This command returns the new status of the impinvis flag. Without arguments it will just return the status.
mob isactive
Returns true if the mob isn't sleeping (or dieing)
mob iscarrying objid
Returns true if mob is carrying object with objid.
mob iswearing objid
Returns true if the mob is wearing the object with given objectid.
mob kill charid
Mob will kill char with charid.
Won’t attack NPCs, works only on players.
mob leave
Let the mob leave in a random direction.
mob level new level
Returns (or sets) the level of the mob. Setting the level will influence the armor-class, damage, hit- and dam-roll, hitpoints, mana, and movement of the mob
mob longdescr new long description
Returns the long description of the mob. If a new long description has been specified, it will be used as the new long description. The newline at the end of the description will be added automaticly.
mob long "Wendie the newbie helper is helping [char]."
mob
Returns the mobs name. (Same as mob name)
mob money -gold -silver -total -amountismax -deduct|-add amount amount
Without options, or with -total it will return the total value of money a mob has, in silver-pieces. With -gold or -silver, it returns amount of gold or silver coins the mob has.
if none of -gold -silver -total are given , the amount of money the mob has is set or increased|decreased depending on -add|-deduct. A single amount is interpreted as 'total', two amounts as respectively gold and silver.
An attempt to deduct more money than the mob has will result in an error unless -amountismax is specified.
mob name
Returns the first name of the mob.
mob namespace -db
Returns the complete namespace where the mobprog for this mob instance resides. if -db is given, the namespace for the mobs database object is given instead.
mob oload vnum level wear|take|wearnoshow
This command will load object with vnum vnum into the mobs inventory. If "wear" is specified, the mob will wear the object. The "take" option is default. "wearnoshow" will equip the object but not show to other people.
mob peace-self
Causes the mob and all those fighting the mob to instantly stop fighting. If -self is given only the mob stops.
mob pet char id
Makes the mob a pet of char id. If char id is not supplied it returns true if the mob is (or has been) somebody's pet. A char can't have more than one pet. A mob can only become a pet once.
mob position -text
Returns the position of the mob. Using -text it returns a text:
- 0
- dead
- 1
- mort
- 2
- incap
- 3
- stun
- 4
- sleep
- 5
- rest
- 6
- sit
- 7
- fight
- 8
- stand
mob position was added on 2000-03-20
mob property key type value
If value is defined, it will set the property to the character, otherwise it will return the value of the property matching the specified key/type.
Type can be:
- int
- Integer
- char
- Character
- long
- Long int
- bool
- Boolean
- string
- String
mob delproperty key type
Removes the property from the mob.
mob remember charid
This command returns the remembered target. When giving an charid it remembers this character.
This command enables the mobile to remember a player for future reference in a mobprog. The player can subsequently be referred as char -target in programs activated by the mobile. mob forget clears the target. Most commonly this command is used in delayed programs, where the mobile has to remember the player who triggered the original event, for example to continue conversation.
mob forget
Forgets the remembered char.
mob hastarget
Does this mob have a target?
mob targethere
Returns true if the target of the mob is in the room of the mob.
See also: mob targethere
mob remove -all objid
Normally the remove command removes the object with the given object id from the character. When the -all switch is given the object with that objectid will be removed and the same command will be repeated again until no objects are found. If no arguments are given the command does nothing. If only the -all switch is given, all objects are removed.
This command removes objects from the inventory as will from the equipment.
mob restore
Just like the "restore" command in the mud: restore a mob to its max of hit/mana/movementpoints.
mob sex new gender
Reads or sets the gender of a mob. When reading it returns 'male' of 'female'. If new gender is given the gender is set to the new value. new gender may be one of the following:
- 0 or 'none'
- 1 or 'male'
- 2 or 'female'
- 3 or 'either'
mob short new short description
Returns the short description of the mob. Or sets it if new short description is supplied.
Most of the time it is better to use the mob act
command to display the mob short
message. With mob act
the visibility of the mob is taken into account.
mob dex
Returns the current dex of the mob.
mob str
Returns the current strength of the mob.
mob int
Returns the current intelligence of the mob.
mob wis
Returns the current wisdom of the mob.
mob con
Returns the current constitution of the mob.
mob timer value
Without arguments it returns the timer setting. With arguments it sets the timer. If argument is cancel the timer will be stopped.
mob timer value starts the timer at the given value. Every PULSE_MOBILE the timer will be increased. The timer can be stopped with the mob timer cancel command. The timer triggers the TIMER triggers. The trigger value will contain the value of the timer.
mob hastimer
Returns true if this mob has a timer running.
mob addtrigger name type call trigger
See addtrigger command
mob deltrigger -all -prefix name
It needs one ore more arguments. With the -all switch it deletes all triggers from this mob. You can also give the name of the trigger to delete. With the -prefix switch you can delete all triggers that are starting with a certain prefix.
mob triggers
Returns a list of triggernames for use with the trigger command.
This can also be used to give other mobs triggers: for example this proc is on mob 30212, and gives 30213 a trigger.
proc givetrig {} { ! grin mob -find v: 30213 addtrigger 1 exall {! say “None will pass!” ; return false} {trig exit north} } (PS you can’t transfer a variable in it)
mob unequip -silent location
removes an object from the equipment location and puts it in the inventory.