Here's how I would go about it (you're very close - the bug is that the number is an rnum when it should have been a vnum):
Code:
diff --git a/src/act.h b/src/act.h
index 93cce58..124e170 100644
--- a/src/act.h
+++ b/src/act.h
@@ -152,6 +152,14 @@ ACMD(do_gen_door);
#define SCMD_UNLOCK 2
#define SCMD_LOCK 3
#define SCMD_PICK 4
+
+/* do_goto_color */
+ACMD(do_goto_color);
+#define SCMD_BLUE 1
+#define SCMD_RED 2
+#define SCMD_INDIGO 3
+#define SCMD_VIOLET 4
+#define SCMD_YELLOW 5
/* Functions without subcommands */
ACMD(do_enter);
ACMD(do_follow);
diff --git a/src/act.movement.c b/src/act.movement.c
index ffef0d8..edac770 100644
--- a/src/act.movement.c
+++ b/src/act.movement.c
@@ -926,6 +926,58 @@ ACMD(do_wake)
}
}
+struct color_goto_data {
+ room_vnum from_room;
+ room_vnum to_room;
+ int subcommand;
+};
+const struct color_goto_data goto_data[] = {
+ { 3100, 3102, SCMD_RED},
+ { 3100, 3103, SCMD_VIOLET},
+ { 3101, 3104, SCMD_BLUE},
+ { 3102, 3101, SCMD_VIOLET},
+ { 3, 4, SCMD_VIOLET},
+ { 4, 1, SCMD_VIOLET},
+ { NOWHERE, -1, 0}
+};
+
+ACMD(do_goto_color)
+{
+ char buf[MAX_STRING_LENGTH];
+ room_rnum location = NOWHERE;
+ room_vnum pc_room;
+ int i;
+
+ if (IN_ROOM(ch) == NOWHERE) {
+ send_to_char(ch, "%s", CONFIG_HUH);
+ return;
+ }
+ pc_room = world[IN_ROOM(ch)].number;
+
+ for (i = 0; goto_data[i].from_room != NOWHERE; i++) {
+ if (goto_data[i].from_room == pc_room && goto_data[i].subcommand == subcmd) {
+ location = real_room(goto_data[i].to_room);
+ }
+ }
+ if (location == NOWHERE) {
+ send_to_char(ch, "%s", CONFIG_HUH);
+ return;
+ }
+
+ snprintf(buf, sizeof(buf), "$n 파랑으로 갔다.");
+ act(buf, TRUE, ch, 0, 0, TO_ROOM);
+
+ char_from_room(ch);
+ char_to_room(ch, location);
+
+ snprintf(buf, sizeof(buf), "$n$Hn0 왔다.");
+ act(buf, TRUE, ch, 0, 0, TO_ROOM);
+
+ look_at_room(ch, 0);
+ enter_wtrigger(&world[IN_ROOM(ch)], ch, -1);
+}
+
diff --git a/src/interpreter.c b/src/interpreter.c
index 0dadad0..6fe64be 100644
--- a/src/interpreter.c
+++ b/src/interpreter.c
@@ -106,6 +106,7 @@ cpp_extern const struct command_info cmd_info[] = {
{ "bandage" , "band" , POS_RESTING , do_bandage , 1, 0 },
{ "balance" , "bal" , POS_STANDING, do_not_here , 1, 0 },
{ "bash" , "bas" , POS_FIGHTING, do_bash , 1, 0 },
+ { "blue" , "blu" , POS_STANDING, do_goto_color, 0, SCMD_BLUE },
{ "brief" , "br" , POS_DEAD , do_gen_tog , 0, SCMD_BRIEF },
{ "buildwalk", "buildwalk", POS_STANDING, do_gen_tog , LVL_BUILDER, SCMD_BUI
LDWALK },
{ "buy" , "bu" , POS_STANDING, do_not_here , 0, 0 },
@@ -262,6 +263,7 @@ cpp_extern const struct command_info cmd_info[] = {
{ "recite" , "reci" , POS_RESTING , do_use , 0, SCMD_RECITE },
{ "receive" , "rece" , POS_STANDING, do_not_here , 1, 0 },
{ "recent" , "recent" , POS_DEAD , do_recent , LVL_IMMORT, 0 },
+ { "red" , "red" , POS_STANDING, do_goto_color, 0, SCMD_RED },
{ "remove" , "rem" , POS_RESTING , do_remove , 0, 0 },
{ "rent" , "rent" , POS_STANDING, do_not_here , 1, 0 },
{ "report" , "repo" , POS_RESTING , do_report , 0, 0 },
@@ -332,6 +334,7 @@ cpp_extern const struct command_info cmd_info[] = {
{ "value" , "val" , POS_STANDING, do_not_here , 0, 0 },
{ "version" , "ver" , POS_DEAD , do_gen_ps , 0, SCMD_VERSION },
{ "visible" , "vis" , POS_RESTING , do_visible , 1, 0 },
+ { "violet" , "viole" , POS_STANDING, do_goto_color, 0, SCMD_VIOLET },
{ "vnum" , "vnum" , POS_DEAD , do_vnum , LVL_IMMORT, 0 },
{ "vstat" , "vstat" , POS_DEAD , do_vstat , LVL_IMMORT, 0 },
{ "vdelete" , "vdelete" , POS_DEAD , do_vdelete , LVL_BUILDER, 0 },
However, it's proably just as easy to make a trigger in the given rooms.
Code:
diff --git a/src/interpreter.c b/src/interpreter.c
index 0dadad0..6fe64be 100644
--- a/src/interpreter.c
+++ b/src/interpreter.c
@@ -106,6 +106,7 @@ cpp_extern const struct command_info cmd_info[] = {
{ "bandage" , "band" , POS_RESTING , do_bandage , 1, 0 },
{ "balance" , "bal" , POS_STANDING, do_not_here , 1, 0 },
{ "bash" , "bas" , POS_FIGHTING, do_bash , 1, 0 },
+ { "blue" , "blu" , POS_STANDING, do_not_here, 0, 0 },
{ "brief" , "br" , POS_DEAD , do_gen_tog , 0, SCMD_BRIEF },
{ "buildwalk", "buildwalk", POS_STANDING, do_gen_tog , LVL_BUILDER, SCMD_BUI
LDWALK },
{ "buy" , "bu" , POS_STANDING, do_not_here , 0, 0 },
@@ -262,6 +263,7 @@ cpp_extern const struct command_info cmd_info[] = {
{ "recite" , "reci" , POS_RESTING , do_use , 0, SCMD_RECITE },
{ "receive" , "rece" , POS_STANDING, do_not_here , 1, 0 },
{ "recent" , "recent" , POS_DEAD , do_recent , LVL_IMMORT, 0 },
+ { "red" , "red" , POS_STANDING, do_not_here, 0, 0 },
{ "remove" , "rem" , POS_RESTING , do_remove , 0, 0 },
{ "rent" , "rent" , POS_STANDING, do_not_here , 1, 0 },
{ "report" , "repo" , POS_RESTING , do_report , 0, 0 },
@@ -332,6 +334,7 @@ cpp_extern const struct command_info cmd_info[] = {
{ "value" , "val" , POS_STANDING, do_not_here , 0, 0 },
{ "version" , "ver" , POS_DEAD , do_gen_ps , 0, SCMD_VERSION },
{ "visible" , "vis" , POS_RESTING , do_visible , 1, 0 },
+ { "violet" , "viole" , POS_STANDING, do_not_here, 0, 0 },
{ "vnum" , "vnum" , POS_DEAD , do_vnum , LVL_IMMORT, 0 },
{ "vstat" , "vstat" , POS_DEAD , do_vstat , LVL_IMMORT, 0 },
{ "vdelete" , "vdelete" , POS_DEAD , do_vdelete , LVL_BUILDER, 0 },