Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ Running the server ➜ NPC prog help

NPC prog help

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by BHawk   (6 posts)  Bio
Date Fri 30 Jul 2004 04:46 AM (UTC)
Message
Sorry, Im not sure if this belongs here, but please move it or point me in the right direction if it doesnt.

Im trying to create a bouncer NPC that will prevent certain characters from going through an exit. I know a bit about npc progs and can make simple ones and even use if/endif statements in them, but how would I prevent the character from going through an exit? One thought I had, was to teleport the player back to the same room when he tried to leave, but that would be messy since i dont really want the player to see whats on the other side.

thanx in advance for any help.
Top

Posted by Gatewaysysop2   USA  (146 posts)  Bio
Date Reply #1 on Fri 30 Jul 2004 07:48 AM (UTC)
Message
Hmm. Well, one thing off the top of my head would be to lock the exit with a key and give the key to the bouncer mob. Then use the mobprogs to determine whether or not to let the person in, based on whatever criterion you wanted to use. You could then have the mob unlock the door, open it, force the person through (or whatever) then close and lock it again afterward if they're supposed to be allowed through. That shouldn't be too complicated to put together (bear in mind I haven't actually done this) but I would think it could work.

Just a thought I had, hope that helps.

"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #2 on Fri 30 Jul 2004 01:22 PM (UTC)
Message
You should be able to do something like this:

mpedit bouncer add speech password 100
if clan($n) == "The Thieving Guild"
say Oh, yes sir. Right this way sir.
unlock east
open east
mpforce $n east
close east
lock east
else
say Sorry, you are not permitted back there.
glare $n
endif

Modify that to how you want, but that should do the job. If you can code, there is also a snippet available that makes mob_progs trigger on phrases entered by the player that could stop them from going east if the door were open.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


13,711 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.