Many common actions, such as getting things or walking from room
to room, involve first walking to a destination and then doing something
when you get there. The process of walking to a destination reliably can
be very complex, so a daemon has been created to simplify the process. You
should be familiar with how to build an action before attempting this.

To use a walking action, you need to initialize it in the walk daemon.
That's done like this:

WALK_DAEMON->init_walk_action(
   mapping target_area,
   int target_coord,
   mixed arrive_action );

Note that you should include const.h to do this. The walk daemon
is currently in /daemon/walk, but that's not guaranteed to remain
unchanged; if you use the WALK_DAEMON constant, you should be fine.

The target_area and the target_coord describe where you will
walk to. The arrive_action is an action (in the array format) which will
be performed when you get there.

The target_area is a mapping describing a shape. There are several
standard shapes available in the walk daemon itself (all the functions
whose names being with "shape").

The target_coord is a coordinate (you can build coordinates using the
MAKE_C macro in const.h). The shape given by target_area is offset so that
target_coord is at its center, or origin. Note that most objects
have a query_coord() function. query_coord() is much simpler
than MAKE_C(ob->query_x(), ob->query_y(), ob->query_z()), although they
both do the same thing.

Once you've called init_walk_action, the action is on the queue;
you're done, just wait for your action to be called. init_walk_action()
will find the closest available point in the target_area, then walk to
that point using the path finding methods. If the point cannot be reached,
the action is aborted and the player is giving a message
(usually 'path blocked' or something similar).

If your action is called, you can assume the player is standing at
some point within the shape that you specified.

Here's an example walk action:

WALK_DAEMON->init_walk_action(
   WALK_DAEMON->shape_adjacent(),
   monster->query_coord(),
   ({ 1000, "/battle/actions/slay", monster, ST_STAND, 0 }) );

The player will walk to a square adjacent to the monster, and then the
function "/battle/actions/slay"->on_action(monster, 0); will
be called, giving you a chance to do something.

If you have questions, direct them to Acius.
