Posted Wednesday, August 12th @ 11:28:32 PM, by George Greer in the Commands dept.
Added Dec 4, 1996. Click the link below to read it or download it.
From: Wout Mertens <Wout.Mertens@rug.ac.be>
Subject: Home Command
This is a do_home command that is similar to recall, but returns people
to their houses if they have one. (I made this some time ago, and I
changed some save and load and newbie code, so I don't know if it is
totally working on stock circle, but you can try, right? Besides, the
house stuff should work ok)
#include "structs.h"
#include "utils.h" /* And I'm not sure if these are enough */
sh_int get_home(struct char_data *ch)
{
extern sh_int r_mortal_start_room;
extern sh_int r_immort_start_room;
extern sh_int r_frozen_start_room;
sh_int load_room, i;
if (PLR_FLAGGED(ch, PLR_FROZEN))
return r_frozen_start_room;
if ((load_room = real_room(GET_LOADROOM(ch))) < 0) {
/* small glitch: if char has non-grouped followers only, he will
not go to his house */
if (!(AFF_FLAGGED(ch, AFF_GROUP) && (ch->master || ch->followers))
&& num_of_houses) { /* Not in or in one-member group */
for (i = 0; i < num_of_houses; i++) {
if (GET_IDNUM(ch) == house_control[i].owner) {
return real_room(house_control[i].vnum);
}
}
}
if (GET_LEVEL(ch) >= LVL_IMMORT)
return r_immort_start_room;
else
return r_mortal_start_room;
} else
return load_room;
}
Gekke Eekhoorn of BUG.
<< Hidden Doors / Search [by Joe Frohne] | Reply | View as text | Threaded | Hometowns [by Daniel Burke] >> |
|
Related Links |
|
|
|
CircleMUD Snippets |
|
|
Note: Not all of these snippets will work perfectly with
your version of code, so be prepared to fix one
or two bugs that may arise, and please let me know
what you needed to do to fix it. Sending a corrected
version is always welcome.
|
Finally, if you wish to use any of the snippets from this
page, you are more than welcome, just mention the
authors in your credits. If you wish to release any
of these snippets to the public on another site,
contact me FIRST.
|
|
|
|
|
|
|