Mprog Compendium

For every entry in this database, I will attempt to explain to the fullest degree possible the various ways every mobprog command, trigger, and ifchk works in the Cleft of Dimensions. If you're just a tourist, check out some examples
===IFCHECKS===
 rand		if rand 30		- if random number between 1 and 100 is < 30
 ishere if ishere $q - is $q in this room?
 mobhere		if mobhere fido		- is there a 'fido' here
 objhere		if objhere bottle	- is there a 'bottle' here
 			if mobhere 1233		- is there mob vnum 1233 here
 			if objhere 1233		- is there obj vnum 1233 here
 mobexists		if mobexists fido	- is there a fido somewhere
 objexists		if objexists sword	- is there a sword somewhere
 
 people		if people > 4		- does room contain > 4 people
 players		if players > 1		- does room contain > 1 pcs
 mobs	 	if mobs > 2		- does room contain > 2 mobiles
 clones		if clones > 3 	- are there > 3 mobs of $i's vnum here
 order		if order == 0		- is mob the first in room
 hour	 	if hour > 11		- is the time > 11 o'clock
 Sunrise occurs at 6am (hour 6)
 Sunset occurs at 6pm (hour 18)
 day if day > 0 - is today not the first day of the week
 0 - Mana Holy Day
 1 - Luna Day 
 2 - Salamando Day
 3 - Undine Day
 4 - Dryad Day
 5 - Jinn Day
 6 - Gnome Day
 sky 	 	if sky > 2 	- is the sky rating > cloudy
 	0 - dry
 	1 - cloudless
 	2 - cloudy
 	3 - raining
 	4 - lightning
 wind	 	if wind > 2		- is the wind rating > breeze
 	0 - stale
 	1 - none
 	2 - breeze
 	3 - windy
 	4 - gale
 ispc	 	if ispc $n 		- is $n a pc
 isnpc		if isnpc $n 		- is $n a mobile
 isgood		if isgood $n 		- is $n good
 isevil		if isevil $n 		- is $n evil
 isneutral		if isneutral $n 	- is $n neutral
 isimmort		if isimmort $n		- is $n immortal
 ischarm		if ischarm $n		- is $n charmed */
 isfollow		if isfollow $n		- is $n following someone
 isactive		if isactive $n		- is $n's position > SLEEPING
 isdelay		if isdelay $i		- does $i have mobprog pending
 isvisible		if isvisible $n		- can mob see $n
 hastarget		if hastarget $i		- does $i have a valid target
 istarget		if istarget $n		- is $n mob's target
 exists		if exists $n		- does $n exist somewhere
 
 affected		if affected $n blind	- is $n affected by blind
 shielded 		if shielded $n charge	- is $n shielded by charge
 act			if act $i sentinel	- is $i flagged sentinel
 off 	if off $i berserk	- is $i flagged berserk
 imm 	if imm $i fire		- is $i immune to fire 
 carries		if carries $n sword	- does $n have a 'sword'
 			if carries $n 1233	- does $n have obj vnum 1233
 wears		if wears $n lantern	- is $n wearing a 'lantern'
 			if wears $n 1233	- is $n wearing obj vnum 1233
 has 		if has $n weapon	- does $n have obj of type weapon
 uses	 	if uses $n armor	- is $n wearing obj of type armor
 name	 	if name $n puff		- is $n's name 'puff'
 pos			if pos $n standing	- is $n standing
 clan	 	if clan $n 'tuna' 	- does $n belong to clan 'tuna'
 race 		if race $n dragon	- is $n of 'dragon' race
 class		if class $n mage	- is $n's class 'mage'
 objtype		if objtype $p scroll	- is $p a scroll
 quest		if quest $n nerb1	- is nerb1 toggled for $n
 skill if skill $n 'big boo' - does $n have the big boo skill
 
 vnum	 	if vnum $i == 1233 	- virtual number check
 hpcnt		if hpcnt $i > 30	- hit point percent check
 room	 	if room $i == 1233	- room virtual number
 sex			if sex $i == 0		- sex check
 	0 - none
 	1 - male
 	2 - female
 level		if level $n < 5		- level check
 align		if align $n < -1000	- alignment check
 innate		if innate $n == 1	- innate check
 0 - None
 1 - Water
 2 - Moon
 3 - Wood
 4 - None (Don't use)
 5 - Wind
 6 - Earth
 7 - Fire
 size 		if size $n < 2		- size check
 	0 - tiny
 	1 - small
 	2 - medium
 	3 - large
 	4 - huge
 	5 - giant
 money		if money $n > 500	- money check (in silver)
 duplicates		if duplicates $n > 3	- are there > 3 mobs of same vnum here
 objval0		if objval0 > 1000 	- object value[] checks 0..4
 objval1
 objval2
 objval3
 objval4
 grpsize		if grpsize $n > 6	- group size check
 mpchk 	if mpchk $i > 8 	- mana point check
 str			if str $n > 13		- strength check
 int			if int $i < 18		- intelligence check
 wis			if wis $q == 25		- wisdom check
 dex			if dex $f >= 8		- dexterity check
 con			if con $g <= 20		- constitution check
 hpchk		if hpchk $n < 15 	- hit point check
 mpcnt		if mpcnt $i > 50 	- mana percentage check
 counter		if counter $i >= 6 	- mob counter check
 sector if sector $i == 5 - sector check
 0 - inside 1 - city 2 - field 3 - forest 
 4 - hills 5 - mountain 6 - swim 7 - noswim
 8 - unused 9 - air 10 - desert 11 - rock
 12 - road 13 - enter 14 - snow 15 - swamp
 16 - jungle 17 - ruins 18 - mount2 19 - coastal
 20 - developed 21 - void
 drunk if drunk $n >= 5 - drunkenness check
 subclass if subclass $n > 0 - subclass check
 skillchk if skillchk $n 'big boo' > 90 - character's skill percentage check
===VARIABLES===
There are two types of variables that are used in mobprogs. There is a limited set of variables than can be used with ifchecks, and there is a far more diverse set of variables than can be used with everything else. Additionally, there are variables outside of mobprogs that deal with items such as gender, but those are covered by the general variables listed below and are outside the scope of this document anyway. The variables listed below are in alphabetical order.
====Ifcheck Variables:====
 $f	the pet of the mob remember target
 $g	the master of the mob remember target
 $i	the acting mob himself
 $n	the target of the mob
 $o	the target object of the mob
 $p	the secondary target object of the mob (act trigger only)*
 $q	the mob remember target
 $r	random character in room
 $t	the secondary target of the mob (act trigger only)*
 $z	the counter of the acting mob
====General Variables:====
 	$a	the numerical damage amount of the last successful Mob Damage (only works with Mob Echo)
 	$e	the subject pronoun of the mob's target
 	$E	the subject pronoun of the mob's secondary target*
 	$f	the name of the pet of the mob's remember target
 	$F	the short desc of the pet of the mob's remember target
 	$g	the name of the master of the mob's remember target
 	$G	the short desc of the master of the mob's remember target
 	$i	the name of the acting mob
 	$I	the short desc of the acting mob
 	$j	the subject pronoun of the acting mob (he/she/it)
 	$J	the subject pronoun of a random character
 	$k	the object pronoun of the acting mob (him/her/it)
 	$K	the object pronoun of a random character
 	$l	the possessive adjective of the acting mob (his/her/its)
 	$L	the possessive adjective of a random character
 	$m	the object pronoun of the mob's target
 	$M	the object pronoun of the mob's secondary target*
 	$n	the name of the mob's target
 	$N	the short desc of the mob's target
 	$o	the name of the mob's object target
 	$O	the short desc of the mob's object target
 	$p	the name of the mob's secondary object target*
 	$P	the short desc of the mob's secondary object target*
 	$q	the name of the mob's remember target
 	$Q	the short desc of the mob's remember target
 	$r	the name of a random character
 	$R	the short desc of a random character
 	$s	the possessive adjective of the mob's target
 	$S	the possessive adjective of the mob's secondary target*
 	$t	the name of the mob's secondary target*
 	$T	the short desc of the mob's secondary target*
 	$X	the subject pronoun of the mob remember target
 	$Y	the object pronoun of the mob remember target
 	$z	the counter of the acting mob
 	$Z	the possessive adjective of the mob remember target
OR:
 	Name 	Short Desc 	Subject Pronoun	Object Pronoun	Possessive Adjective
 	For Targetting	For Echoing	He/She/It 	Him/Her/It 	His/Her/Its
Acting Mob 	$i 	$I 	$j 	$k 	$l
Mob's Target 	$n 	$N 	$e 	$m 	$s
Secondary Target* 	$t 	$T 	$E 	$M 	$S
Object Target 	$o 	$O 	 	 	
Secondary Object* 	$p 	$P 	 	 	
Random Character 	$r 	$R 	$J 	$K 	$L
Mob Remember Target 	$q 	$Q 	$X 	$Y 	$Z
Remember Target's Pet 	$f 	$F 	 	 	
Remember Target's Master	$g 	$G 	 	 	
*The secondary target variables are a bit odd. Basically, they only work when a target or mob is related indirectly to the mob. For example, if Griswald opened a box and the mob had an act prog execute on that, the box would be $p. Or if Griswald parried Ami's attack and the mob had an act prog execute on that, Ami would be $t. $p and $t cannot exist at the same time.
===MOB COMMANDS===
The commands are grouped logically, not alphabetically. Commands that serve a similar purpose are grouped together, since I thought it would be more helpful that way. Every command has the appropriate syntax listed under it. Stuff in <brackets> denotes necessary parameters, stuff in [brackets] denotes unnecessary parameters. A synopsis of every command is listed as well. At the bottom of every entry I list examples of every command's usage. 
A list of examples is given for each command. Every command has up to five basic examples and a further list of advanced usages for the command. In general, I try to draw no more than one example from each area, unless a given area has two or more distinctly different advanced usages of a command. The examples can be accessed via mpdump.
;ECHO:mob echo <string>
This command sends a text message to every player in the room. It is the basic command to output whatever you want via mobprogs. There are many more specialized versions of this command, all of which are listed below. Oftentimes echo is a better choice than having a mob say or emote something.
Examples: 1362, 2206, 2553, 1161, 4715
;ECHOAT:mob echoat <target> <string>
This command will echo a message to the specific player targetted in the room and no one else. In combination with the echoaround command, this can allow for messages that simulate real commands. Usually the echo command is preferable, but echoaround combined with echoat can allow for the distinction between "you" and "$n" in messages. Echoat is useful in events such as someone being telepathed to, or if you just want to hide a certain message from other players in the room.
Examples: 1072, 33, 152, 1502, 3007
;ECHOAROUND:mob echoaround <target> <string>
This command will echo a message to every player in the room with the exception of the target. In combination with the echoat command, this can allow for messages that simulate real commands. Usually the echo command is preferable, but echoaround combined with echoat can allow for the distinction between "you" and "$n" in messages. Echoaround is generally useful when you want to hide certain messages from the target player.
Examples: 1462, 4001, 4807, 3129, 4072
;ASOUND:mob asound <string>
This command is similiar to echo. Unlike echo, however, asound will echo a message to every room that the mob's current room has an exit to - i.e., the surrounding rooms. What's interesting about asound is that it doesn't echo to the room the mob is in, only adjacent ones. It will echo through doors, but will not echo through portals or one-way exits leading INTO the mob's room.
Examples: 4017, 5683, 2217, 5494, 2714
;ZECHO:mob zecho <string>
This command is a more powerful version of echo, echoing a message to every player in the mob's current area. Staff will get a "mob echo>" in front of every zecho message, but players won't. The applications of this command are pretty straightforward, and they can easily add some flavor to your area.
Examples: 1035, 1003, 182
;GECHO:mob gecho <string>
This command is a more powerful version of zecho, echoing a message to every player in the MUD. There probably aren't that many times anybody would want to use this, but it's a powerful command and it's there. Staff will get a "mob echo>" in front of every gecho message, but players won't.
Examples: 419
;GOTO:mob goto <location>
This command transfers the mobile from the current room to another. The location parameter takes many different arguments. When given a number, goto will transfer the mob to the given room number. When given any single word, goto will transfer the mob to the first relevant mob or object in the world. An interesting fact about goto is that it stops the mob's combat during the transfer, so it acts like a localized mob peace. Also, use of the goto command can disguise a mob's death cry - shown in the examples below. Mob goto can transfer through safe or no_mob room flags and can move sentinel mobs.
Examples: 4004, 2712, 3116, 1021, 5555
Adv. Examples: 2115, 4069, 1212, 1549, 2262, 71, 4851, 1053, 187, 733
;TRANSFER:mob transfer <target> [location]
This command transfers the target to the given location. The location can be a room vnum or a single keyword for a given mob or object. If location is omitted, the command will transfer the target to the room the mob is in. The target can be any mob or player in the world. Mob transfer can also transfer "all," which will move all characters in the mob's room. Mob transfer can transfer through safe or no_mob room flags and move sentinel mobs.
Examples: 1452, 4014, 2708, 4854, 1714
;GTRANSFER:mob transfer <target> [location]
This command works just like transfer, except it transfers everyone in the target's group as well as the target. However, you cannot gtransfer all. Besides that, it is entirely identical to transfer.
Examples: None.
;MLOAD:mob mload <vnum>
This command loads a mob with the chosen vnum into the same room as the acting mob. It can load mobs from any area and into any room with no restrictions. It only takes vnums as a parameter - you cannot mload specific words. While the command appears straightforward, it can be used creatively.
Examples: 1206, 1453, 39, 3119, 154
Adv. Examples: 2729, 2262, 4076, 1404, 4849, 1563, 1003
;OLOAD:mob oload <vnum> [level] [R] [W]
This command loads an object with the chosen vnum into the inventory of the mobile. If the item cannot be taken into inventory, it is generated on the floor. The optional level parameter allows you to modify the level of the loaded item, varying who can wear it and its cost. Level is limited to the mob's level, though. "R" will send the object to the room, and "W" will make the mob wear the object, if possible, instead of placing it in inventory. What's great about loading objects is that they can be used as "counters" in mobprogs, illustrated in some examples below.
Examples: 1475, 1360, 3126, 2381, 2127
Adv. Examples: 2232, 178, 5670, 4818
;OTRANSFER:mob otransfer <target> <location>
This command transfers an object to a given location. The target object can be in the room, in the mob's inventory, or part of the mob's equipment. The location parameter can be a room vnum or an argument for a mobile or object anywhere in the world. Unlike the regular transfer command, the location is mandatory. Unfortunately, no matter what the location is, the target object will always transfer to the room the location is in, never the actual character specified. NOTE: items inside containers cannot be otransfered, but ifchks can see them.
Examples: 4868
;PURGE:mob purge [target]
This command can delete items or mobiles from the room the mob is in. It has powerful and versatile purposes. Mob purge without a parameter will purge all mobs and items in the room that lack the nopurge flag. Mob purge with a target can purge any mobile in the room or any object in the room or in the mob's inventory or equipment. Mob purge will never purge player characters. A mob can "mob purge self," but do so sparingly - it appears to be able to crash the MUD at times. When you do use "mob purge self," try to place it as close to the end of mobprogs as possible.
Examples: 53, 3149, 4829, 1581, 710
Adv. Examples: 1005, 3123
;JUNK:mob junk <item>
This command can destroy any item the mob has in inventory or is wearing as equipment. The <item> parameter is very versatile. You can junk all, or junk all.something, or just junk a specific item. It works just like the get command in this regard. I believe it also takes variables such as $o, but of this I am not absolutely certain. Mob junk cannot junk items on the ground or items in a player's inventory. NOTE: items inside containers cannot be junked, but ifchks can see them.
Examples: 1476, 2109, 1360, 2710, 4886
Adv. Examples: 3146, 2216, 4015, 2387, 727, 1009, 1212, 5491, 3113
;REMOVE:mob remove <target> <vnum>
This command removes the given object from the target's inventory or equipment. The target must be in the same room as the mob. The vnum parameter specifies the vnum of the object to be removed from the target. Mob remove will remove all objects of the given vnum from the target, which may or may not be helpful, depending on your circumstances. Alternately, all can be used instead of a vnum - this will remove every object the target has. Removed objects are completely destroyed, not dropped to the floor or given to the mob. This means be careful when using it. NOTE: items inside containers cannot be removed, but ifchks can see them. NOTE: the previous note is no longer true.
Examples: 1027, 4829, 1314, 1162, 5556
;FLEE:mob flee
This command causes the mob to instantly run to an adjoining room. It only works if the mob is not currently fighting. The mob will not flee through closed doors or into no_mob rooms, and it will not flee into the same room as it started in (via looped exits). The way it works is that the mob tries, six times, to run in a random direction. If at the end of those six attempts it hasn't found a valid exit, the mob does nothing. Because of this, mob flee is more likely to work in rooms with more exits than rooms with fewer exits.
Examples: 1006
;KILL:mob kill <target>
This command will force the mob to attack the target. The target parameter can be either a variable like $n or an actual name like goomba. It ignores almost all of the restrictions the regular kill command has - for example, a mob can attack a person who is already fighting someone else, or it can attack through a safe room. Here are the only restrictions: the target must be in the same room as the mob, the mob can't attack itself, and charmed mobs can't attack their masters. When your mobile absolutely must attack someone, you want to use this instead of the regular kill command.
Examples: 4700, 1456, 2712, 3123
Adv. Examples: 1514, 2352, 3014, 1060, 161, 172
;ASSIST:mob assist <target>
This command works similarly to kill. It functions somewhat differently than the regular assist command. Mob assist will force the mob to attack whoever the target is fighting with. The target parameter can be either a variable like $n or an actual name like goomba. It does not relieve the target of fighting, it merely draws the mob into the fray. Mob assist will attack under any circumstances unless: the target isn't in the same room as the mob, the mob is trying to assist itself, the target is not fighting, or the mob is already fighting.
Examples: None. This command is not mentioned in the standard mprog documentation.
;PEACE:mob peace
This command stops all fighting in the same room as the mob. It works exactly like the staff command of the same name. Besides furthering the cause of pacifism, it's ideal for creating a gap in the fighting to execute commands that can't be done while fighting, then resuming the brawl. Additionally, it's a helpful command to use with inert or passive mobs.
Examples: 5669, 4001, 3014, 172, 3139
;SKILL:mob skill <command>
This command allows the mob to execute almost any skill. The given command is parsed like a regular command, except that, when this command is executed, the mob is treated as having 75% adequacy in all skills in the game. Therefore, skills that are normally forbidden to mobs can be used with the mob skill command. By using the adept and inept act2 flags, the proficiency of the mob at skills can be increased or decreased by 25%.
Examples: 2511
;DAMAGE:mob damage <target> <min> <max> [damtype] [lethal] [safe] [percent]
This command directly damages the target. The target can be any character in the same room as the mob, or it can be all, which targets all characters in the room. Mob damage does a random number of hitpoints damage between min and max. Min and max are not dice, they are a flat range. Mob damage can do negative damage, which will heal the target - however, mob damage will not send the target's hp above maximum. 
Damtype specifies what type of damage to use in respect to resistances and vulnerabilities. It can be any damage type you see with "? imm" in medit. A given mob damage can only have one given damtype.
If you type "lethal" at the end of the command, the mob damage can kill the target. Otherwise, the target's hp will not drop below 0. [damtype] and [lethal]'s positions in the command are interchangeable. If you type "safe" at the end of the command, the mob damage will not hurt characters in the same group as the mob; however, this is only relevant to "all" mob damages.
The "percent" keyword changes the min and max from a damage quantity into a percentage of the target's maximum HP. It will not do more damage than the target's current HP, however.
Examples: 4061, 4831, 1704, 1532, 701
;CAST:mob cast <spell> [target]
This command allows a mob to cast any of the spells normally available to players. The spell parameter takes an argument, and you'd type in given spell there just like you would with the regular cast command. The target can be any mob or object in the room or mob's inventory, or, depending on the spell, no target at all. Mob cast costs no mana. Unfortunately, the targetting system for mob cast doesn't work very well. Some spells, such as curse, won't work at all. However, most attack spells will work, as well as buffs. You'll usually want to pair this command with a mob echo for more flavor.
Examples: 4001, 2203, 4838, 301, 4716
;MANA:mob mana <target> <min> <max>
This command drains mana from the target. It works in a similar fashion to mob damage, but it is less complex. The target can be any character in the same room as the mob, or it can be "all," which targets all characters in the room. Mob mana does a random number of mana damage between min and max. Min and max are not dice, thye are a range. Mob mana can drain negative mana to cause restoration, but it will not give more mana than a character has max. Likewise, it will never send mana below 0. Mob mana $i commands are an excellent way to make realistic spellcasting for mobs, especially when combined with mob cast and mob damage commands, in addition to the mpchk ifchk.
Examples: 3139, 2748, 169, 701. This command is unique to CoD.
;AWARD:mob award <target> <type> <value>
This command can award various points to the target. It works almost exactly like the staff command of the same name. The target argument can be any character in the world, but cannot be a mob or a staffer. Below is a chart of type arguments and their relevant range of values:
 gold	-10000	10000		exp	-10000	10000		prac	10	-10
 silver	-10000	10000		qp	-10000	10000		train	5	-5
Use this command sparingly and only as a reward for doing important stuff. It is best used in conjunction with the mob quest command, especially when dealing with experiernce, practices, or trains. Qp stands for quest points, and it is a marginally important value that basically translates to IOUs for restrings.
Examples: 2260, 4022, 1027, 1116, 32. This command is unique to CoD.
;QUEST:mob quest <target> <+/-/=> <questflag>
This command modifies the value of a quest flag on the target character. Quset flags are unique, hardcoded flags that save whether a mob has completed a certain event or not. Target is an argument and can refer to any player in the world. Mob quest does not work with mob targets. <+/-/=> indicates whether to set or unset the relevant quest flag; + and = are exactly the same. Finally, the questflag parameter is one of the hardcoded questflags in the MUD. Do you need a questflag added for your mobprogs? If so, talk to Carsanquay about adding one.
The QUEST2 command works exactly the same as the QUEST command but only works for quest2 flags. The normal QUEST command works for both normal quest flags and the extended quest2 flags so the QUEST2 command 
Examples: 54, 3113, 2390, 4874, 1596. This command is unique to CoD.
;PETIFY:mob petify <target> <victim>
This command makes the victim the pet of the target. It works almost exactly like the staff command of the same name. Target and victim are arguments, and they can be any character in the world. However, mob petify will not work if victim is a player or if target already has a pet. It's probably not a great idea to petify a victim that's not in the same room as the target, even though you can within the extent of the command.
Examples: 2106, 3196, 700, 707, 715. This command is unique to CoD.
;FORCE:mob force <target> <command>
This command forces the given target to perform the given command. The target can be anyone in the same room as the mobile, excluding the mobile itself. The target can also be "all," which will affect every character in the room that the mob can see and who is not staff. The command can be any regular command - or if the target is a mob, a mob command - but it cannot be an ifcheck. This can be a very powerful command.
Examples: 5660, 3130, 2710, 3014, 2387
;GFORCE:mob gforce <target> <command>
This command works just like force, except it forces everyone in the target's group as well as the target. The target must be in the same room as and not be the mob. Besides that, it is entirely identical to force.
Examples: 5276
;VFORCE:mob vforce <vnum> <command>
This command works just like force, except it forces every character in the world of the specified vnum to do the given command. Vnum must be a number. Vforce will not force the mob that executed the command, or players, or characters that are currently fighting. Besides that, it is entirely identical to force.
Examples: None.
;AT:mob at <location> <command>
This command allows a mob to perform any single action at any location on the MUD. It's like using a mob goto, a command, and another mob goto to return all in one command. The location can be a vnum or any one word mob or object. The command parameter works just like a regular line of code in a mobprog. The <command> can be any regular or mob command, but it cannot be an ifcheck. If you want to perform multiple commands and ifchecks in a remote room, use multiple mob goto statements instead.
Examples: 4073, 1003, 5664, 735, 2387
;DELAY:mob delay <pulses>
This command sets the delay timer for the mob. The delay timer is measured in pulses - to see how quickly pulses count down, cast a buff spell and see how its timer works. When the delay timer hits zero, the mob's delay trigger prog will execute, if it has one. Unless a mob has update_always, its delay counter won't tick down unless there are players in the area - staff do not count. So when debugging progs, you may note in mpstat that the delay counter can stagnate. Mob delay is an intensely useful function and requires some thought to figure out. Due to the nature of mob delay, many potential example mobprogs are split up over several progs and are difficult to show here.
Examples: 182, 1005, 1502, 1061, 1806
;CANCEL:mob cancel
This command cancels the mob's delay timer. It sets it to zero and stops the mob's delay triggers from activating. While waiting enough pulses will also let the delay timer reach zero, that will make the mob's delay triggers activate. This will not.
Examples: 4011, 1009
;REMEMBER:mob remember <target>
This command stores the name of a target in the mob's memory. Target is one argument and can be either a name or a variable. The target can be anywhere in the world. Once remembered, the target's name is stored as $q for the mob and will remain until a mob forget command, a new mob remember, or the mob's death. A mob's memory can be seen with mpstat. If a mob has no target, it will remember the first person who walks into the room with it - note this, as it can cause problems for some mobprogs. Due to the nature of mob remember, many potential example mobprogs are split up over several progs and are difficult to show here.
Examples: 4065, 1211, 1053, 1015, 160
;FORGET:mob forget
This command empties the mob's memory. It is the opposite of mob remember and almost always appears accompanying it. Besides mob forget, the only way to clear mob memory is to kill the relevant mob (although you can always store a new target to mob memory with a new mob remember).
Examples: 738, 1501, 3142, 5508, 2727
;CALL:mob call <vnum> [victim] [obj1] [obj2]
This command executes a mobprog subroutine. Essentially, when you put in a mob call command, the MUD goes into the mobprog of the given vnum and executes it. Once the sub-prog finishes, the main prog continues as normal. Victim, obj1, and obj2 are optional parameters that specify what $n, $o, and $p are in the subroutine, respectively. If they are left out, the subroutine will execute with $n, $o, and $p set to null. If you want these variables to be null, just type null in the appropriate fields. Victim, obj1, and obj2 will look for mobs or objects in the same room as the mob. A mobprog can call itself recursively, but the MUD will stop such infinite loops after 5 recursive calls.
Examples: 1368, 47, 1400, 2395, 5661
;COUNTER: mob counter <value OR 'zero'>
This command allows basic addition and subtraction operations to be performed on a variable stored on a mob. An ifcheck exists to take advantage of the command (if counter). The value parameter can be either positive or negative to perform either addition or subtraction. The word 'zero' sets the counter to zero.
Examples: 21, 22
;FACE:mob face <long desc>
This command changes the mob's long desc to whatever is specified. 
Examples: 9038
;FLAG:mob flag <victim> <flag type> <flag> +/-
The Flag command can modify the act, act2, affect, shield, imm, resist, vuln, and off flags of a mob. A mob can use this command to change its own abilities on the fly.
;SDAMAGE:mob sdamage ??? ???
Appears to be an uncoded solution to the problem that the $a flag fixed.
;SPAWN:mob spawn <victim> <room vnum>
The Spawn command will change the target's recall point to the specified room vnum.
;RESCUE:mob rescue <victim>
The Rescue command works as the Rescue skill does, but without the restrictions on grouping or any skill checks.
Examples: 9098
===MOB TRIGGERS===
The triggers are listed alphabetically, since there aren't all that many of them and the ones that have a similar purpose have a similar name. Triggers are mostly self-explanatory, so the main use of this section will be to give examples of how the triggers are used in the MUD. Examples of usage will not be given in this section, but I will attempt to describe situations in which the triggers are usable. To see the triggers on any given mob, mpstat them.
;ACT:addmprog <vnum> act <phrase>
The act trigger is the most versatile and basic trigger there is. The act trigger reads output directly from the MUD. It will activate when the <phrase> text appears to the mob. This means that act triggers will activate when a mob or player says something, when a mob or player does a social, or when a mob or player does an action (like give or eat or sleep). However, the act trigger will not activate on emotes. Act triggers are case insensitive. Act triggers can use one or more words in <phrase> - to set the phrase as multiple words, surrounded the phrase with "quotation marks." When triggered by someone's speech, the act prog will activate before the <phrase> is actually spoken - making it look out of order. Many mobiles have an act prog with the phrase "talks to you," which triggers on the talk social. This is especially common in towns and with humanoid mobs.
;BRIBE:addmprog <vnum> bribe <amount, in silver>
;DEATH:addmprog <vnum> death <percent>
;DELAY:addmprog <vnum> delay <percent>
The delay trigger is activated when the delay timer for the mob decrements to 0. To set a mob's delay timer, use the mob delay command. The trigger has a <percent> chance of activating when the delay timer hits 0, although in almost every usage of this command, 100 is used for the <percent> parameter. Delay triggers are known to occasionally and randomly not work. Delay timers will only count down if players are currently in the mob's area or have recently been in the area. It is important to note that delay triggers are checked at the same time as schedule and random triggers. A simultaneous schedule trigger activation will override a delay trigger, and a delay trigger will likewise override a random trigger activation.
;EXALL:addmprog <vnum> exall <exit number>
The exall trigger works exactly like the exit trigger with the difference that the mob does not have to see the target character in order to activate the trigger. For further information, please see the EXIT trigger.
;ENTRY:addmprog <vnum> entry <percent>
The entry trigger is activated whenever the mob walks into a new room. The trigger has a <percent> chance of activating on each mob movement. The entry trigger does not carry a $n target into the mobprog, so, in general, this trigger is not as useful as greet or grall. 
;EXIT:addmprog <vnum> exit <exit number>
The exit trigger is checked whenever a PC tries to exit the mob's room. The trigger will activate whenever a player tries to use <exit number>'s exit. It is important to note that if an exit trigger activates, the player's movement will be cancelled - so if you want a player to be able to move after an exit trigger has been activated on him, you'll need to use the mob transfer command. The exit trigger will only activate if the mob can see the target character. The trigger will also only work if the mob is in its default position - important because fighting mobs will not check exit triggers.
The following <exit numbers> collaborate with the indicated exits:
 0 - north 1 - east 2 - south 3 - west 4 - up
 5 - down 6 - ne 7 - nw 8 - se 9 - sw
;FIGHT:addmprog <vnum> fight <percent>
The fight trigger is checked at the end of each combat round for the mob. The trigger has a <percent> chance of activating each round. Both a hpcnt trigger and a fight trigger can activate in the same combat round. Most mob combat routines are activated with the fight trigger.
;GIVE:addmprog <vnum> give <object>
The give trigger is checked when an object is given to the mob. When an item of keyword <object> is given to the mob, the trigger activates. The phrase 'all' can be used for <object> to cause the give trigger to activate when any item is given to the mob. In the mobprog triggered by the give trigger, the variable $o represents the object given. It is common practice to design all give triggers with the 'all' phrase and then have specific object keywords checked within the mobprog. This is so that objects can be given back to the character who gave them with the 'give $o $n' statement.
;GRALL:addmprog <vnum> grall <percent>
The grall trigger works exactly like the greet trigger with the difference that the mob does not have to see the target character in order to activate the trigger. For further information, please see the GREET trigger.
;GREET:addmprog <vnum> greet <percent>
The greet trigger is checked whenever a character enters the room that the mob occupies. It has a <percent> chance of activating each time a character enters the room. Note that if several characters enter the room simultaneously, such as when characters travel in a group, the greet trigger will activate for each of the characters. The greet trigger will only activate if the mob can see the target character. 
;HPCNT:addmprog <vnum> hpcnt <hp percent>
The hpcnt trigger is checked at the end of each combat round for the mob. The trigger will activate if the mob's hp percentage drops below the <hp percent> level. Both a hpcnt trigger and a fight trigger can activate in the same combat round. Hpcnt is frequently used as an easy way to activate mob desperation attacks.
;KILL:addmprog <vnum> kill <percent>
The kill trigger is checked when someone attempts to kill the mob. The trigger has a <percent> chance of activating whenever someone initiates combat with the mob. This trigger only activates when someone attempts to kill the mob when it was not previously fighting. That is to say that the trigger activates only when combat is initiated, not when additional characters (such as groupmates) start attacking the mob.
;RANDOM:addmprog <vnum> random <percent>
The random trigger is checked once every mob pulse for the game. A mob pulse is equal in frequency to a combat pulse. For reference, there are 15 mob pulses in a tick and a mob pulse triggers about once every 4 seconds. Random triggers have a <percent> chance of activating every mob pulse, but only if players are currently in the mob's area or have recently been in the area. A mob with the update_always act flag will have its random triggers checked every mob pulse, regardless of the status of players. Random triggers are only checked if the mob is in its default position - i.e., standing. Random triggers are commonly used for all sorts of mob activity. It is important to note that random triggers are checked at the same time as schedule and delay triggers, and the simultaneous activation of either of these triggers will prevent a random trigger from happening.
;SCHEDULE:addmprog <vnum> schedule <hour>
The schedule trigger is checked once every hour, on the hour. The <hour> parameter equals a number from 0 to 23, where 0 is midnight and 12 is noon. If the <hour> equals the current hour, then the trigger activates. Schedule triggers are commonly used for time-based mob activity, especially mobs that move based on the time of day. It is important to note that schedule triggers are checked at the same time as random and delay triggers, and the activation of a schedule trigger will override any simultaneous delay or random trigger.
;SPAWN:addmprog <vnum> spawn <percent>
The spawn trigger is checked whenever a mob is reset into an area. When the mob resets into its area, there is a <percent> chance that the spawn trigger will activate. For the most part, the spawn trigger is used to load equipment onto a mob when one does not want said equipment reset 100% of the time like with a normal reset.
;SPEECH:addmprog <vnum> speech <phrase>
The speech trigger is mostly identical to the act trigger, with the biggest difference being that the speech trigger only activates when a mob or player uses the 'say', 'osay', or 'tell' commands. The speech trigger is best used when one wants to limit mob response to speech instead of actions. Of further interest, the speech trigger will occur AFTER the target has actually spoken, unlike the act trigger. For further information, please see the ACT trigger.
;SURRENDER:addmprog <vnum> surrender <percent>
The surrender trigger, while present on the triggers list, is defunct and is not actually used.
*I like using this trigger to show what mprogs my mob calls within its other mprogs. -Ageatii
Category:Technical Information