From: Alvoria MUD (mudguy@conan.ids.net)
Date: 11/16/96

On Sat, 16 Nov 1996, BlackWind wrote:
> Ok, well, I figured out how to make it so the mob moves around, and
> says stuff after he's moved a certain number of times, etc.
> What I can't figure out is how to make it so that if someone says
> something to the mob, they do something, or if someone walks in the
> room, etc.  How can I do this?

Er... it's been a few hours and nobody's answered him... oh well. I guess
I will... the least I can do for leeching off of this list... haha.

1. If you want a mob to react to something being said to it, add a check
in it's spec_proc for the cmd being say, tell, whisper, etc... and proceed
from there by checking the arg passed to it (which will be the text the
player typed.) Also, you may want to pass the cmd on to the do_XXX function
it belongs to so it will still tell the player... -> You tell $n '...' etc..
And also return a TRUE value after all the stuff is done.

2. For a player action, same thing. Most of the time the cmds for player
actions will likely be socials, which all use do_action(cmd,0,0,0);, if
you look in the master command table.

3. Now here is the problem... spec_procs are called BEFORE a cmd is
executed by the interpreter, so a reaction upon entering the room cannot
be done without changing how the spec_proc system works. What you can do
is make it so that spec_procs also get called AFTER a cmd is executed,
and maybe add another arg to the SPECIAL() prototype so that you can
specify whether it is after or before the mentioned action... (gee.. I
think I may do this.. :P). Or, you can add something to the do_move()
function, but extending the spec_proc system is probably the better way to

  - mendar

Alvoria MUD -- Where things aren't quite the same...
  Address   -- telnet://conan.ids.net:4000/
  Homepage  -- http://users.ids.net/~mudguy/
  (under construction, perhaps not even updated for months to come)

| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |

This archive was generated by hypermail 2b30 : 12/18/00 PST