bool spec_mayor (CHAR_DATA * ch)
{
static const char open_path[] =
"W3a3003b33000c111d0d111Oe333333Oe22c222112212111a1S.";
static const char close_path[] =
"W3a3003b33000c111d0d111CE333333CE22c222112212111a1S.";
switch (path[pos])
{
case '0':
case '1':
case '2':
case '3':
move_char (ch, path[pos] - '0', FALSE);
break;
case 'W':
ch->position = POS_STANDING;
act ("$n awakens and groans loudly.", ch, NULL, NULL, TO_ROOM);
break;
case 'S':
ch->position = POS_SLEEPING;
act ("$n lies down and falls asleep.", ch, NULL, NULL, TO_ROOM);
break;
case 'a':
act ("$n says 'Hello Honey!'", ch, NULL, NULL, TO_ROOM);
break;
case 'b':
act
("$n says 'What a view! I must do something about that dump!'",
ch, NULL, NULL, TO_ROOM);
break;
case 'c':
act
("$n says 'Vandals! Youngsters have no respect for anything!'",
ch, NULL, NULL, TO_ROOM);
break;
case 'd':
act ("$n says 'Good day, citizens!'", ch, NULL, NULL, TO_ROOM);
break;
case 'e':
act ("$n says 'I hereby declare the city of Midgaard open!'",
ch, NULL, NULL, TO_ROOM);
break;
case 'E':
act ("$n says 'I hereby declare the city of Midgaard closed!'",
ch, NULL, NULL, TO_ROOM);
break;
case 'O':
/* do_function(ch, &do_unlock, "gate" ); */
do_function (ch, &do_open, "gate");
break;
case 'C':
do_function (ch, &do_close, "gate");
/* do_function(ch, &do_lock, "gate" ); */
break;
case '.':
move = FALSE;
break;
}
I'm curious what the logic is behind the path information? is this some sort of hex-code for exits?
why not something less complex / readable like: "w,n,n,s,e" = west, north , north, south, east?
anyway, i'm planning on creating a bunch of specials for my mud, so naturally i may want to hardcode a path,
do i need to learn anything else?