Commands
Within a block { }, can go other blocks, but mainly this is where commands
go. For mobs, any mud command is legal here, and there are several special
mob commands. Rooms and Objects can only use the commands defined here.
For example, in a mob script you could have the following block:
{
say Boy am I tired!
yawn
sleep
mpecho $i.persname falls dead asleep.
}
The first command is a normal mud command to 'say' something. The second
command is a social, which works fine. The third command is another normal
mud command, causing the mob to sleep. The fourth command is a specail
mob command that prints out a string to the room the mob is in. The $i
variable refers to the mob itself, so if this mob was Barliman, the resulting
string would be "Barliman falls dead asleep", and everyone in
the room would see that message.
MOB Commands
Here are the basic MOB commands that we found
to be enticing. ROOM and OBJECT comands are listed after MOB commands.
MPSTAT <mobile>
Shows the MOBprograms which are set on the mob of the given name or vnum
and some basic stats for the mobile. This is really an imm command, not
a command for use in mob programs.
MPASOUND text_string
Prints the text string to the rooms around the mobile in the same
manner as a death cry. In other words, the string will show up in the
rooms connected to the room the mob is in, but NOT in the room the mob
is in. This is really useful for powerful aggressives and is also nice
for wandering minstrels or mobiles like that in concept.
MPJUNK <object>
Destroys the object refered to in the mob's inventory. It prints no message
to the world and you can do things like junk all.bread or junk all. This
is nice for having janitor mobiles clean out their inventory if they are
carrying too much (have an @action trigger on the 'full inventory'.)
MPJOURNAL
Syntax:
mpjournal <player> subject <string>
mpjournal <player> + <string>
mpjournal <player> post
mpjournal <player> clear
MPJOURNAL allows scripts to write entries into player journals. No messages
are created with this, so provide your own.
MPECHO text_string
Prints the message to the room of the mob.
MPECHOAT <victim> text_string
Delivers a message to the victim. No one else will see the message. Note:
You can use this command to sneakily deliver a string to trigger a mobprog
on another mob.
MPECHOAROUND <victim> text_string
Delivers the message to mobs or players in the same room as the victim,
but NOT to the victim.
GIVEQUEST <quest id> <player>
Gives a quest to a player. No messages are given. It's a good idea to
initialize any quest variables at the same time.
MPMLOAD <vnum> (for a mob)
MPOLOAD <vnum> (for an object)
Loads the obj/mobile into the inven/room of the mobile. Even if the item
is non-takable, the mobile will receive it in the inventory. This lets
a mobile distribute a quest item or load a key or something.
MPKILL <victim>
Lets a mobile attack a player or mob.Lots of MOBprograms end up with mpkill
$n commands floating around. It works on both mobiles and players.
MPPURGE [argument]
Destroys the argument from the room of the mobile. Without an argument,
the result is the cleansing of all NPC's and items from the room with
the exception of the mobile itself. However, mppurge $i will indeed
purge the mobile, but it MUST be the last command the mobile tries to
do, otherwise the mud cant reference the person trying to do the commands
and bad things happen.
MPGOTO <dest>
Moves the mob to the room or mobile or object requested. It produces
no strings, so if needed they must be supplied by other means (emote,
mpecho, etc.)
MPAT <dest> <command>
Perfoms the command at the designated location. Very useful for doing
magic sleight of hand tricks that leave players dumbfounded, such as metamorphing
mobiles, or guard summoning, or corpse vanishing.
MPTRANSFER <victim> [dest]
MPTRANSFER ALLPCS [dest]
MPTRANSFER ALL [dest]
MPOTRANSFER <object> [dest]
MPOTRANSFER ALL [dest]
Mptransfer moves one mob or PC to the destination vnum.
Mptransfer allpcs moves all PCs in the room to the destination vnum.
Mptransfer all will move all PCs and mobs to the destination vnum.
Mpotransfer moves one object to the destination vnum.
Mpotransfer all moves all objects in the room to the destination vnum.
Note that mpotransfer will move transfer an object from anywhere in the
world, but will first search the room the mob is in. None of these mptransfers
will produce strings, so they can be used for tricky stuff :)
MPFORCE <victim> <command>
Forces the victim to do the designated command. The victim is not
told that they are forced; they just do the command so usually some mpecho
message is nice. You can force players to remove belongings and give them
to a mob, etc. The player sees the normal command messages (such
as removing the item and giving it away in the above example). Again,
if the victim is "all" then everyone in the mobiles room does the command.
MPMORPH <victim> <mobvnum>
Morphes the victim into a mobile of the given vnum. Only works on PCs.
MPCAST <spell>
Behaves just like 'cast', but built for mobprogs.
MPSET <room/object/mob>
Works just like the SET command. See the SET commands described below
in the ROOM/OBJECTS section.
MPSTRING <room/object/mob>
Works just like the STRING command. See the STRING commands described
below in the ROOM/OBJECTS section.
MPDAMAGE
See DAMAGE below for details.
ROOM and OBJECT Commands
More to come!
SAY (string)
Makes the ROOM or OBJECT produce a local string. The string consists only
of what follows the SAY command. For example, if you make a sword say
'Hey there!' all the player will see will be Hey There! (No quotes.) However,
if you want the Sword of Might to say something itself, you can
do this: SAY $I says 'Hey there!' and you will see 'The Sword of
Might says 'Hey there!' SAY is similar to the MPECHOs commands described
above, except that a sleeping player will not see the SAY string.
ECHOAT <target> (string)
Sends a message just to the targeted player or mob.
ECHOAROUND ('string') <target> <optional second target>
Sends a message to everyone in the room EXCEPT the target(s). Note
that in echoaround, you can use $N, $E, $S, $M for the single target or
$n, $e, $s, $m for the first target and $N, $E, $S, $M for the second.
Why do it this way? So that in combination with ECHOAT, you can send appropriate
messages to the player doing an action, a player receiving the action,
and players observing the action.
FORCE <player> <action>
Makes the ROOM or OBJECT force a player to do something. Works similarly
to MPFORCE, described above. 'FORCE $n sleep' will make $n (the
player who trigged the program) sleep.
GIVEQUEST <quest id> <player>
Gives a quest to a player. No messages are given. It's a good idea to
initialize any quest variables at the same time.
MORPH
Syntax:
morph <player> <mob vnum>
morph <player> mobhere <name of mob in room>
Morphs
a player into the target mob. Target must be a PC, cannot morph mobs.
SET CHAR (MOB ONLY, DON'T make your program SET players!!!!!!)
Syntax:
set char <name> <field> <value>
Field being one of:
str int wis dex con sex class level race gold
hp mana move practice align train thirst drunk
full act immune resis vulnernable comm aggie timer
size
Valid affect flags are:
blind invisible detect_evil detect_invis detect_magic detect_hidden sloth
sanctuary faeriefire infrared curse poison protect_good protect_evil
sneak hide charm flying passdoor haste calm plague weaken darkvision
berserk rejuvenation visegrip pyrokinetic_shield none
Valid act flags are:
sentinel scavenger stayarea wimpy pet train practice
undead cleric mage thief noalign nopurge gain holylight wizi fixer illusion
polymoprh none
Valid offense flags:
areaattack bash berserk disarm dodge fast kick kickdirt parry tail trip
assist_all assist_align assist_race assist_players assist_guard
assist_vnum none
Valid immune, resist, vulnerable flags:
summon charm magic weapon bash pierce slash fire cold lightning acid
poison negative holy energy mental disease drowning light none
Valid comm flags:
quiet deaf nowiz noauction nogossip noquestion nomusic noannounce
nodream nogratz nogame nowiznet nochant nobeep compact brief prompt combine
brieffights noemote noshout notell nochannels noretell none
Valid aggie flags:
normal npc wounded male female neutered good neutral
evil orc treant hobbit dwarf elf human shade giant
warrior thief mage cleric legend none
SET OBJ
Syntax:
set obj <object> <field> <value>
Field being one of:
value0 value1 value2 value3 value4 (v1-v4)
extra exclusion wear level weight cost timer condition
Extra flags are:
hum dark lock evil invis magic nodrop bless noremove
inventory nopurge rotdeath visdeath venom protected newbie
broken unbreakable noextended none
Exclusion flags are:
antigood antievil antineutral
antielf antidwarf antihuman antigiant antishade antihobbit antitreant
antiorc
antiwar antimage antithief anticleric
silver wot dragon khaos lords tower vamps independant
Wear flags are:
finger neck torso head legs feet hands arms shield body waist
wrist hold twohands none
Spell affects are:
blind, invisible, detectevil, detectinvis, detectmagic, detecthidden,
sloth,
sanctuary, faeriefire, infrared, curse, poison, protectgood, protectevil,
sneak, hide, sleep, flying, passdoor, haste, calm, plague, weaken, berserk,
rejuvenation, visegrip, pyrokineticshield.
SET ROOM
Syntax:
set room <location> <field> <value>
Field being one of:
flags sector
Flags are:
nomob indoors private safe solitary petshop norecall imponly godsonly
heroesonly newbiesonly law walledoff noteleport none
nocleric nomage nothief, nowarrior, levelstrict, nomagic
SET EXIT
Syntax:
set exit <name> <field> <value>
Field being one of:
info access exclude destination key reset
Valid info flags are:
door closed locked nopick nopass secret random nodetect hidden noscan
none
Valid exclude flags are:
nosmall nomedium nolarge none
Valid access flags are:
fly none
Valid reset values are:
closed locked none
Destination must be a valid room vnum.
Key must be a valid object vnum
STRING CHAR (Usually just a mob--be careful about stringing players!!)
Syntax:
string char <name> <field> <string>
fields: name short long desc title spec moveout movein
STRING OBJ
string obj <name> <field> <string>
fields: name short long extended
STRING ROOM
string room <vnum> <field> <(+) string>
fields: title description
STRING EXIT
string exit <name> <field> <string>
fields: keywords doorstring entrance_msg exit_msg description
LOAD OBJ <vnum>
LOAD MOB <vnum>
These commands will load objects or mobs into the room. Whoa! Works like
MPMLOAD and MPOLOAD.
DAMAGE <target> <num dice> <dice size> <dam class>
<dam msg> <inflictor>
<target> is the targeted player or mob. <num dice> is the number
of die to be rolled for calculating damage. <size dice> is the number
of sides the dice will have. (If dice calculations are a mystery to you,
see the Weapons section of the OBJECTS file for a detailed explanation.)
<dam class> is the type of damage -- see the table below. <dam
msg> indicates what action is causing the damage. It needs to be in quotes
( e.g. 'blast of ice' or 'bubbling lava'). <inflictor> is the
entity causing the damage. Again, must be quoted ( 'a blizzard',
'the avalance', etc.). If you don't supply an inflictor, it will use the
short description of the mob or object or the title of the room causing
the damage. Note: if you don't supply <dam msg> and <inflictor>,
no string at all will be produced, but the mob or player will take the
damage. This could be useful for sneaky stuff. The damage command if used
by a mob will start a fight.
DAM CLASS
| DAM_NONE |
0 |
DAM_NEGATIVE |
9 |
| DAM_BASH |
1 |
DAM_HOLY |
10 |
| DAM_PIERCE |
2 |
DAM_ENERGY |
11 |
| DAM_SLASH |
3 |
DAM_MENTAL |
12 |
| DAM_FIRE |
4 |
DAM_DISEASE |
13 |
| DAM_COLD |
5 |
DAM_DROWNING |
14 |
| DAM_LIGHTNING |
6 |
DAM_LIGHT |
15 |
| DAM_ACID |
7 |
DAM_OTHER |
16 |
| DAM_POISON |
8 |
DAM_HARM |
17 |
Example: damage $n 10 10 5 'blast of ice' 'a blizzard' will produce
this string: 'A blizzard's blast of ice -=ANNIHILATES=- a vulture.' Note
that the standard string indicating how much damage was caused is inserted
by the code.
TRANSFER <target> <optional vnum destination>
Transfers the mob or player to either the optional vnum destination or
to the room with the prog or the room the object with the prog is in.
No strings are produced, so if you want them, you gotta write them.
ADDAFFECT <target> <affect flag> <affect
level> <affect duration>
<target> is the targeted player or mob. <affect flag> is the
flag of the affect you want to add to the target. <affect level>
is the level of affect to be applied (1->140). <affect duration>
is the number of ticks that the affect will last (-1 for infinite, 1->9999
otherwise)
| AFF_BLIND |
A |
| AFF_INVISIBLE |
B |
| AFF_DETECT_EVIL |
C |
| AFF_DETECT_INVIS |
D |
| AFF_DETECT_MAGIC |
E |
| AFF_DETECT_HIDDEN |
F |
| AFF_SLOTH |
G |
| AFF_SANCTUARY |
H |
| AFF_FAERIE_FIRE |
I |
| AFF_INFRARED |
J |
| AFF_CURSE |
K |
| AFF_PYRO_SHIELD |
L |
| AFF_POISON |
M |
| AFF_PROTECT_EVIL |
N |
| AFF_PROTECT_GOOD |
O |
| AFF_SNEAK |
P |
| AFF_HIDE |
Q |
| AFF_SLEEP |
R |
| AFF_FLYING |
T |
| AFF_PASS_DOOR |
U |
| AFF_HASTE |
V |
| AFF_CALM |
W |
| AFF_PLAGUE |
X |
| AFF_WEAKEN |
Y |
| AFF_BERSERK |
a |
| AFF_REJUVENATION |
c |
| AFF_VISEGRIP |
e |
SPECIAL OBJECT COMMANDS
In addition, OBJECTS can use these special commands:
JUMP <optional target>
Makes the object jump to the target. The command without a target will
make the object 'jump' from a player's inventory to the ground. JUMP with
a target will make the object 'jump' into a player's inventory. Note:
this second instance could make the object 'jump' from the ground
to a player's inventory or FROM one player's inventory to another player's
inventory! No strings are produced, so if they are desired you need to
add them.
PURGE <optional target>
PURGE SELF
Purges a mob or object--that is, removes it from the game. Purge with
no argument will purge all mobs and objects from the room (except objects
with a nopurge flag). Purge with an optional target will remove the mob
or object targeted. If the object doing the purging is in a room, it
will only look for matches in the room, and not on any players. If the
purging object is in the inventory of a player, it will first look for
objects on the ground, the in the inventory of the player charying itself,
then at what that player is wearing. Purge <self> will
remove the object containing the purge command. No strings are produced,
so
you
if you
want them,
you
must write your own.
SPECIAL ROOM COMMANDS
ROOMs can use these special commands:
MAKEEXIT <destination> <name>
Makes an exit! For example, 'MAKEXIT 1212 down' will make an exit that
leads to 1212, the Realm of Despair! If used in conjunction with
STRING, you can make an exit, and then insert all the strings you want.
Too cool!
NUKEEXIT <name>
Removes an exit! The possibilities are endless. With this command and
the MAKEEXIT command, you can make a traveling ship or a moving
area!
GIVE <objectname> <player/mob>
This command allows a room to "give" an object to a player or mob. No
strings are produced, so you'll have to add them with SAY if you
want them. Also, if the object being given is NOT in the room already,
you'll have to have the objected loaded first. See LOAD OBJ or MPOLOAD.
Note: the room overrides carry limits on players.
AT <roomvnum/player-mob name> <command>
Works just like MPAT. Performs the command at the designated room vnum
or the designated player. Very powerful.
EAT <objectname>
Basically removes forever an object lying on the ground. No strings are
produced, so write any you want with SAY. Wheeeee!
|