>I was thinking about saving mounts so that you could rent them. So
>before quitting, you would have to rent the mount at a stable. Any idea
>how to do this? I'm
>guessing i would create functions like obj_from_store and
>obj_to_store...
>Would I create a new struct for mounts? and perhaps create a pointer in
>the
>player structure such as struct mount_data *mount.. or this is an
>entirely wrong
>way of doing it?
Hi, I don't have my older mud up and running anymore, but I still have
snippits of the code laying around. I found this spec_proc for a stable
master, but the structs and locations of the structs aren't defined in it.
Hope looking at the way I did it helps.
SPECIAL(stable_master)
{
struct char_data *new_mob;
int found, i;
extern int stable_nums[MAX_STABLE_NUM];
if(!CMD_IS("board") && !CMD_IS("fetch"))
return FALSE;
for(i=0;i <= MAX_STABLE_NUM;i++) {
if(world[ch->in_room].number == stable_num[i]) {
found = TRUE;
break;
}
}
if(!found)
return FALSE;
if(CMD_IS("board")) {
for(i=0;i <= MAX_STABLE_NUM;i++) {
if(world[ch->in_room].number == stable_nums[i]) {
if(ch->stable->mob_num[i] == 0) {
found = TRUE;
ch->stable->stable_num[i] = stable_nums[i];
ch->stable->mob_num[i] = GET_MOB_VNUM(RIDING(ch));
char_from_room(RIDING(ch));
RIDING(ch) = NULL;
}
else {
send_to_char("You already have something boarded here friend.\r\n",
ch);
return FALSE;
}
}
else
return FALSE;
}
}
else if(CMD_IS("fetch")) {
for(i=0;i <= MAX_STABLE_NUM + 1;i++) {
if(ch->stable->stable_num[i] == world[ch->in_room].number) {
if(ch->stable->mob_num[i] > 0) {
new_mob = read_mobile(ch->stable->mob_num[i], REAL);
found = TRUE;
break;
}
else {
send_to_char("The stable master tells you, 'You don't seem to have a
mount stored here.\r\n", ch);
return FALSE;
}
}
else
return FALSE;
}
if(found == TRUE) {
send_to_char("The stable master returns with your mount.", ch);
char_to_room(new_mob, ch->in_room);
}
}
-------
"Remember, you are unique and special . . . . just like everyone else!"
-Bumpersticker
"Friends help you move. Real friends help you move bodies."
-Bumpersticker
"You believe in God, she believes in Allah, they believe in Jesus . . . .
can I just believe in He-Man?"
-Chuck Reed
-------
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST