« Triggers: Setting the prog loose on the world | Main | Control logic waltz - IF then ELSE then ENDIF »
July 20, 2005
Mob commands
Mob commands allow the programs to run commands that regular characters do not have access to. Many of these are similar to immortal commands, like transfer, zecho, oload (load obj) and purge, and some are unique to the mobs. The commands are entered into the code in the same way that normal commands like 'say Hello!', however, they are always prefixed with 'mob '.
The following table was stolen from the ToD Mob guide. A note about the syntax - $_ means any of the 'dollar sign codes' listed in Creating a simple mprog.
| Command | Definition |
|---|---|
| Mob Asound <string> | This creates an echo to the rooms directly around the room the prog is triggered in |
| Mob Gecho <string> | Displays the string to all players logged in (as the immortal command gecho) |
| Mob Zecho <string> | Displays the string to all players in the same area the prog was triggered in (as the immortal command zecho) |
| Mob Echo <string> | Displays the string to all players in the room the prog was triggered in (as the immortal command echo) |
| Mob echoat $_ <string> | Displays the string to the target player only (as the immortal command pecho) |
| Mob Echoaround $_ <string> | Displays the string to all others in the room the prog was triggered in except $_ |
| Mob Kill $_ | The mob will attack $_ (not effective for objects or rooms) |
| Mob Assist $_ | The mob will attack any who attack $_ (not effective for objects or rooms) |
| Mob Junk <name/all> | The item(s) in the mobs inventory are destroyed (not effective for objects or rooms) |
| Mob Mload <vnum> | The prog loads the mob with the vnum stated (as the immortal command load mob <vnum>) |
| Mob Oload <Vnum> <Level (obsolete, just use 1)> <R/W> | The prog loads the object with the vnum stated, (as the immortal command load mob <vnum>). Using r will load the object to the room, w loads it to the mobs wear location. Objects and Rooms should always load object with 'R', or the object will be destroyed. |
| Mob Purge <name> | The prog purges the object or mob with the ‘Name’ if left blank the mob will purge the entire room. |
| Mob Goto <Name/Vnum/$_> | The mob will go to the location by name, room vnum or target $_. |
| Mob At <Name/Vnum/$_> <command> | The command will be carried out at the desired location. |
| Mob Transfer $_ <name/vnum> | The prog will transfer $_ to the name or vnum |
| Mob Gtransfer $_ <name/vnum> | The prog will transfer $_ and its group to the name or Vnum |
| Mob Otransfer <name/vnum> <Name/Vnum/$_> | The prog transfers the object (by name or vnum) to the location name, vnum or $_ |
| Mob Force $_ <command> | Forces $_ to do the listed command |
| Mob Gforce $_ <command> | Force all in $_’s group to do the listed command |
| Mob Vforce <vnum><command> | Forces all mobs with the ‘Vnum’ to do the listed command |
| Mob Cast <spell> $_ | The prog casts the spell listed on $_ |
| Mob Damage $_ [min] [max] <lethal> | The prog damages $_ in the rangegiven (mob damage $n 20 200: This would damage $n between 20 and 200 damage). Using the "lethal" option means the damage can kill $_, otherwise it will not damage them below 1 hit point |
| Mob Remember $_ | This will store $_’s name as for later use, the stored name can be called using the variables $q or $Q |
| Mob Forget <$q/$Q> | The mob forgets the stored name |
| Mob Delay <Number> | The mob begins to count down (15 pulses = 1 tick). When the counter hits 0, any mprog attached with a delay trigger will be fired. (not effective for objects or rooms) |
| Mob Cancel | The ‘Delayed’ prog (As above) is canceled (not effective for objects or rooms) |
| Mob Call <vnum> | The prog calls another prog, the vnum, inside the first prog. A maximum of 5 may be called from inside each other. |
| Mob Flee | The mob will flee |
| Mob Remove $_ <vnum> | The mob removes the item vnum from $_ and junks it (destroys) |
Examples
Lets return to our crash test goblin. We want to make him a little mercenary, so that he will aid in combat anyone who gives him 400 (or more) platinum. He'll then make a little remark, send a message to the room (but not the briber) and force the bribing character to thank him. The mprog will be tied on to the goblin with a bribe trigger.
mpedit create 125
code
mob assist $n
mob remember $n
say You seem a worthy mark.
mob echoaround $n $i decides that $n is worthwhile. For now.
mob force $n thank $i
@
done
medit 120
addmprog 125 bribe 400
done
asave changed
Of course, goblins are notorious for their lack of ethics, morals and the vast willingness to kick someone when they're down...
mpedit create 126
code
say You know, you never did pay me enough.
mob echoat $q $i plunges $l little knife into your ribs.
mob damage $q 50 100 lethal
mob echoaround $q $i plunges $l little knife into $q's ribs.
@
done
medit 120
addmprog 126 attacked 10
done
asave changed
This code doesn't work as well as it should, however, as prog 126 will be triggered 1 in 10 (roughly) rounds of combat the goblin is involved in, regardless of whether the person who bribed him is there or not (or even still logged on).
There needs to be some form of test built in that can determine if the person who bribed him is there to be stabbed. Which leads to the next section... Control Statements.
Scrawled illegibly by Meathe at July 20, 2005 03:29 PM
Comments