Tips and Tricks
Posted: Wed Jun 30, 2010 10:19 am
Post whatever general tips and tricks you may have for people building on NarutoMUD.
Syntax: switch <character>
Syntax: return
SWITCH switches you into the body of another character (who must not
already have a descriptor, e.g. you can't switch into a PC).
RETURN returns you to your original body.
say Hello $n, welcome to my lab!
say I am a mad scientist who loves to build.
say I like to watch grass grow and eat Playdoh.
say Don't worry about me, I'll be fine.
say Hello $n, welcome to my lab!+
I am a mad scientist who loves to build.+
I like to watch grass grow and eat Playdoh.+
Don't worry about me, I'll be fine.
say I like meat balls a lot!+
Do you?
smile
say I like meat balls a lot!+
smile
Billy says, "I like meat balls a lot! smile"
emote looks up at you.
mpsleep 9
say Oh, I almost didn't see you there.
mpsleep 4
cough
mpsleep 4
say Sorry, I'm coming down with a cold.
mpsleep # (Where # is number of beats to wait)
9 beats = ~1 second.
Syntax: Silent
This is a command used for Building areas, its specific function is to
suppress output sent to players. With this keyword, any command won't show
output, except bug messages.
Examples:
silent mpforce $n remove all
silent say Only NPCs will see this!
speech prog p I am ready.
if level($n) > 10
silent say Level greater 10.
else
silent say level less than 10.
endifspeech prog p level greater 10.
say Ah, you're ready to go!speech prog p level less than 10.
say You need to train more!
Code: Select all
setqbit 10 Sandwich quest
setqbit 11 Sandwich quest complete
setabit 10 Tomato
setabit 11 Lettuce
Code: Select all
speech prog I want to get you a sandwich!
say Thanks for wanting to make me a sandwich, fetch me a tomato and lettuce!
mpqset $n 3100
Code: Select all
give prog gives you a tomato.
if hasqbit($n) == 10
if hasabit($n) != 10
say This looks delicious! Thanks, I can't wait to eat my sandwich!
mpaset $n 10
else
say You already gave me a tomato, I don't need another.
endif
else
say Why are you giving me a tomato? I never asked you to make me a sandwich.
endif
Code: Select all
speech prog You have all the ingredients.
if hasqbit($n) == 10
if hasabit($n) == 10
if hasabit($n) == 11
say Yum! You're the best!
smile $n
mpqset $n 11
else
say I need lettuce!
endif
else
say I still need my tomato!
endif
endif
Code: Select all
entry prog
if hasqbit($n) == 11
say Oh hey! My brother told me you made him a sandwich, I want one too!
else
say Hi, I haven't seen you around before.
endif
Syntax: MPJUNK <name>
Destroys an object in inventory/being worn - can be used with all.object .
Syntax: MPPURGE <object/mobile>
Purges the room, or a specified object/mobile.
-----------------------------------------------------------
SYNTAX: mppurge
mppurge <item name>
mppurge <mob name>
DESCRIPTION: The MPPURGE mpcommand works much like the
immortal command PURGE, but for one exception:
there must be something to purge. If there is
nothing to be purged, the command will log a bug.
-----------------------------------------------------------
Code: Select all
speech prog I got you now!
say You'll never take me alive!
mppurge robber
Code: Select all
speech prog I got you now!
say You'll never take me alive!
Code: Select all
speech prog You'll never take me alive!
if isnpc($n)
if mobcount(10) > 1
mppurge robber
endif
endif
Gatz wrote:NPC's scriptCode: Select all
speech prog I got you now!
say You'll never take me alive!
Room's scriptCode: Select all
speech prog You'll never take me alive!
if isnpc($n)
if mobcount(10) > 1
mppurge robber
endif
endif
Don't be scared by the room's script, all it is doing is seeing if the person who said that line is an NPC, and also if our NPC we want to purge exists in the room, in this example his vnum is 10. Here we still want to be careful about using the correct name for the purge, however.
Using mpjunk and mppurge correctly might be a little scary at first, but it becomes vital to use and pretty simply to understand once you get the a basic grasp of it.
Yuuta wrote:Would it not be better to have the command mppurge $n? If it is merely mppurge "robber", would it not purge the first robber in the room, regardless of whether it was the one who spoke the line? This would cause problems if there were more than one robber in the room and, let's say, this was a command to be used right before death (at < 10% hp). If the robber would say its line every round of combat, then the room would quickly begin purging robbers that have nothing to do with the mob who originally spoke. Is using $n to define the target of a script impossible?
Syntax: MPFORCE <name/all>
Forces a player/mob to do a command (non-functional on immortals, all will
only force all in room).
Code: Select all
mpforce $n sing $n
Code: Select all
mpforce Gatz sing Gatz
You sing a little tune to yourself.
Code: Select all
mpforce $n west
Code: Select all
say Flavor text of some kind, this is why I'm tossing you over here!
mptrans $n 1034
mpat $n mpforce $n look
mpat $n mea $n Bill the NPC hurls you to the west!
mpat $n mer $n Bill the NPC hurls $n into the room, ouch!
mpat $n say And stay out!
Businessman
Female Shopper
Male Photographer
Code: Select all
add random 50
if rand(50)
emote looks at his watch.
gasp
say I'm late for a meeting!
else
emote phone starts to ring.
mpsleep 2
wear phone
say Yeah?
mpsleep 2
say Oh God...
mpsleep 2
say No...tell him I'll call him back later.
mpsleep 2
emote hangs up the phone.
mpsleep 2
remove phone
mpsleep 4
say Idiots.
endif
Code: Select all
add rand 5
say Hrm....
if inroom($i) == 1234
say Wow! Look at all those deals!
endif
Code: Select all
add rand 70
if sex($n) == 2
say Wow, pretty lady! Let me take your photograph!
mea $n Photographer Man takes photos of you obnoxiously!
mea $n Photography Man is taking photos of $n!
else
say Can you move out of the way of my shot?
endif