Progs

Posted by Akula on Wed 23 Jan 2002 02:11 AM — 7 posts, 24,404 views.

#0
I am pretty sure that I've seen this done and was curious in what I do to create this. What is the commands to setup a prog that prevents players from leaving an exit unless they give a certain amount of gold to the mob guarding the exit or the mob is killed. (e.g.)
You try leaving south but the Ogre blocks your way!
The Ogre says 'You must pay 50 gold coins to cross this bridge, traveller.'

Oh, and I was also wondering if the act_prog is what causes what LP MUD calls 'room chats'. Room chats are where you are standing in a room and messages will appear every minute or so (e.g.)
The wind blows strongly.

Is this so?
Thanks
Akula
Australia Forum Administrator #1
On the room you could put a "leave_prog" to force the mobile to make that statement - you might need to check if the mobile exists, so that you let the player leave if he doesn't (ie. has been killed), or, put a "death_prog" on the mobile to transfer you out, so that the player doing the killing gets through the door.

On the mobile you could put a "bribe_prog" to accept the bribe and transfer the player out.

As for periodic messages, try "rand_prog". If you give it a lower percentage then the messages will appear less frequently.
#2
If you have any spare time could you please show me a brief example of a bribe_prog where you cannot leave a certain exit without giving an item/money to the mob?

Akula
Australia Forum Administrator #3
I would make an exit that can't normally be traversed at all, eg. one which needs a key you don't have. Then add a bribe_prog that transfers you into the room the exit leads to. eg.


mpechoat $r Your bribe is accepted.
mpechoat $r You pass through the door to room X.
mpechoaround $r $r bribes the guard and leaves west!
mptransfer $r 12345

#4
My problems were as follows with a similiar version to your suggestion.
I want the exit you cannot enter to still be displayed, and if I have it as a doorway it will not be. And if I do have it displayed you can enter it as you please without paying the bribe.
Also the mptransfer doesn't automatically show the 'look' description as entering a room does and 'mpforce $n look' did nothing.
Any suggestions? :)
Australia Forum Administrator #5
Yes, I see what you mean. I can't suggest a simple fix, excepting maybe changing the source code to add another flag.
#6
Couldn't you use a room leave_prog that

mpecho Ogre growls in anger when you try to enter backroom!
mptrans 0.$n 100


Assuming room with Ogre is vnum 100, and then use the bribe to get past the exit.