act-files formatted

This commit is contained in:
welcor
2024-10-01 00:09:30 +02:00
parent 5c44f0575e
commit fdb6ff3771
12 changed files with 3855 additions and 3757 deletions

View File

@@ -40,7 +40,7 @@ IncludeCategories:
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseBlocks: true
IndentWidth: 4
IndentWidth: 2
InsertNewlineAtEOF: true
MacroBlockBegin: ''
MacroBlockEnd: ''
@@ -51,5 +51,5 @@ SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
TabWidth: 4
TabWidth: 2
...

View File

@@ -86,7 +86,8 @@ ACMD(do_gsay)
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
parse_at(argument);
send_to_group(ch, ch->group, "%s%s%s says, '%s'%s\r\n", CCGRN(ch, C_NRM), CCGRN(ch, C_NRM), GET_NAME(ch), argument, CCNRM(ch, C_NRM));
send_to_group(ch, ch->group, "%s%s%s says, '%s'%s\r\n", CCGRN(ch, C_NRM), CCGRN(ch, C_NRM), GET_NAME(ch),
argument, CCNRM(ch, C_NRM));
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
send_to_char(ch, "%s", CONFIG_OK);
@@ -131,7 +132,8 @@ static int is_tell_ok(struct char_data *ch, struct char_data *vict)
act("$E's linkless at the moment.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
else if (PLR_FLAGGED(vict, PLR_WRITING))
act("$E's writing a message right now; try again later.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
else if ((!IS_NPC(vict) && PRF_FLAGGED(vict, PRF_NOTELL)) || (ROOM_FLAGGED(IN_ROOM(vict), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD)))
else if ((!IS_NPC(vict) && PRF_FLAGGED(vict, PRF_NOTELL)) || (
ROOM_FLAGGED(IN_ROOM(vict), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD)))
act("$E can't hear you.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
else
return (TRUE);
@@ -424,35 +426,42 @@ ACMD(do_gen_comm)
* [2] message if you're not on the channel
* [3] a color string. */
const char *com_msgs[][4] = {
{"You cannot holler!!\r\n",
{
"You cannot holler!!\r\n",
"holler",
"",
KYEL},
{"You cannot shout!!\r\n",
KYEL
},
{
"You cannot shout!!\r\n",
"shout",
"Turn off your noshout flag first!\r\n",
KYEL},
{"You cannot gossip!!\r\n",
KYEL
},
{
"You cannot gossip!!\r\n",
"gossip",
"You aren't even on the channel!\r\n",
KYEL},
{"You cannot auction!!\r\n",
KYEL
},
{
"You cannot auction!!\r\n",
"auction",
"You aren't even on the channel!\r\n",
KMAG},
{"You cannot congratulate!\r\n",
KMAG
},
{
"You cannot congratulate!\r\n",
"congrat",
"You aren't even on the channel!\r\n",
KGRN},
{"You cannot gossip your emotions!\r\n",
KGRN
},
{
"You cannot gossip your emotions!\r\n",
"gossip",
"You aren't even on the channel!\r\n",
KYEL}
KYEL
}
};
if (PLR_FLAGGED(ch, PLR_NOSHOUT)) {
@@ -475,7 +484,8 @@ ACMD(do_gen_comm)
/* Level_can_shout defined in config.c. */
if (GET_LEVEL(ch) < CONFIG_LEVEL_CAN_SHOUT) {
send_to_char(ch, "You must be at least level %d before you can %s.\r\n", CONFIG_LEVEL_CAN_SHOUT, com_msgs[subcmd][1]);
send_to_char(ch, "You must be at least level %d before you can %s.\r\n", CONFIG_LEVEL_CAN_SHOUT,
com_msgs[subcmd][1]);
return;
}
/* Make sure the char is on the channel. */

View File

@@ -268,7 +268,6 @@ ACMD(do_action);
ACMD(do_gmote);
/*****************************************************************************
* Begin Functions and defines for act.wizard.c
****************************************************************************/

View File

@@ -77,8 +77,8 @@ static void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mod
found++;
}
if (found) {
send_to_char(ch, "You are %s upon %s.", GET_POS(ch) == POS_SITTING ? "sitting" :
"resting", obj->short_description);
send_to_char(ch, "You are %s upon %s.", GET_POS(ch) == POS_SITTING ? "sitting" : "resting",
obj->short_description);
goto end;
}
}
@@ -221,7 +221,8 @@ static void list_obj_to_char(struct obj_data *list, struct char_data *ch, int mo
static void diag_char_to_char(struct char_data *i, struct char_data *ch)
{
struct {
struct
{
byte percent;
const char *text;
} diagnosis[] = {
@@ -363,8 +364,8 @@ static void list_one_char(struct char_data *i, struct char_data *ch)
send_to_char(ch, "%s", positions[(int)GET_POS(i)]);
else {
furniture = SITTING(i);
send_to_char(ch, " is %s upon %s.", (GET_POS(i) == POS_SLEEPING ?
"sleeping" : (GET_POS(i) == POS_RESTING ? "resting" : "sitting")),
send_to_char(ch, " is %s upon %s.",
(GET_POS(i) == POS_SLEEPING ? "sleeping" : (GET_POS(i) == POS_RESTING ? "resting" : "sitting")),
OBJS(furniture, ch));
}
} else {
@@ -428,7 +429,8 @@ static void do_auto_exits(struct char_data *ch)
if (EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) && !PRF_FLAGGED(ch, PRF_HOLYLIGHT))
continue;
if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED))
send_to_char(ch, "%s(%s)%s ", EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) ? CCWHT(ch, C_NRM) : CCRED(ch, C_NRM), autoexits[door], CCCYN(ch, C_NRM));
send_to_char(ch, "%s(%s)%s ", EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) ? CCWHT(ch, C_NRM) : CCRED(ch, C_NRM),
autoexits[door], CCCYN(ch, C_NRM));
else if (EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN))
send_to_char(ch, "%s%s%s ", CCWHT(ch, C_NRM), autoexits[door], CCCYN(ch, C_NRM));
else
@@ -443,16 +445,14 @@ ACMD(do_exits)
{
int door, len = 0;
if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT)
{
if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT) {
send_to_char(ch, "You can't see a damned thing, you're blind!\r\n");
return;
}
send_to_char(ch, "Obvious exits:\r\n");
for (door = 0; door < DIR_COUNT; door++)
{
for (door = 0; door < DIR_COUNT; door++) {
if (!EXIT(ch, door) || EXIT(ch, door)->to_room == NOWHERE)
continue;
if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) && !CONFIG_DISP_CLOSED_DOORS)
@@ -462,22 +462,19 @@ ACMD(do_exits)
len++;
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS) && !EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED))
{
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS) && !EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) {
send_to_char(ch, "%-5s -[%5d]%s %s\r\n", dirs[door], GET_ROOM_VNUM(EXIT(ch, door)->to_room),
EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) ? "[HIDDEN]" : "", world[EXIT(ch, door)->to_room].name);
}
else if (CONFIG_DISP_CLOSED_DOORS && EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED))
{
} else if (CONFIG_DISP_CLOSED_DOORS && EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) {
/*But we tell them the door is closed */
send_to_char(ch, "%-5s - The %s is closed%s\r\n", dirs[door],
(EXIT(ch, door)->keyword) ? fname(EXIT(ch, door)->keyword) : "opening",
EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) ? " and hidden." : ".");
}
else
{
} else {
send_to_char(ch, "%-5s - %s\r\n", dirs[door], IS_DARK(EXIT(ch, door)->to_room) &&
!CAN_SEE_IN_DARK(ch) ? "Too dark to tell." : world[EXIT(ch, door)->to_room].name);
!CAN_SEE_IN_DARK(ch)
? "Too dark to tell."
: world[EXIT(ch, door)->to_room].name);
}
}
if (!len)
@@ -498,8 +495,7 @@ void look_at_room(struct char_data *ch, int ignore_brief)
if (IS_DARK(IN_ROOM(ch)) && !CAN_SEE_IN_DARK(ch)) {
send_to_char(ch, "It is pitch black...\r\n");
return;
}
else if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT) {
} else if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT) {
send_to_char(ch, "You see nothing but infinite darkness...\r\n");
return;
}
@@ -518,8 +514,7 @@ void look_at_room(struct char_data *ch, int ignore_brief)
send_to_char(ch, " %d", GET_TRIG_VNUM(t));
send_to_char(ch, "]");
}
}
else
} else
send_to_char(ch, "%s", world[IN_ROOM(ch)].name);
send_to_char(ch, "%s\r\n", CCNRM(ch, C_NRM));
@@ -597,16 +592,13 @@ static void look_in_obj(struct char_data *ch, char *arg)
if ((GET_OBJ_VAL(obj, 1) == 0) && (GET_OBJ_VAL(obj, 0) != -1))
send_to_char(ch, "It is empty.\r\n");
else {
if (GET_OBJ_VAL(obj, 0) < 0)
{
if (GET_OBJ_VAL(obj, 0) < 0) {
char buf2[MAX_STRING_LENGTH];
sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2));
send_to_char(ch, "It's full of a %s liquid.\r\n", buf2);
}
else if (GET_OBJ_VAL(obj,1)>GET_OBJ_VAL(obj,0))
} else if (GET_OBJ_VAL(obj, 1) > GET_OBJ_VAL(obj, 0))
send_to_char(ch, "Its contents seem somewhat murky.\r\n"); /* BUG */
else
{
else {
char buf2[MAX_STRING_LENGTH];
amt = (GET_OBJ_VAL(obj, 1) * 3) / GET_OBJ_VAL(obj, 0);
sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2));
@@ -837,8 +829,7 @@ ACMD(do_score)
GET_NUM_QUESTS(ch) == 1 ? "" : "s");
if (GET_QUEST(ch) == NOTHING)
send_to_char(ch, "and you are not on a quest at the moment.\r\n");
else
{
else {
send_to_char(ch, "and your current quest is: %s", QST_NAME(real_quest(GET_QUEST(ch))));
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS))
@@ -1020,19 +1011,18 @@ ACMD(do_weather)
"lit by flashes of lightning"
};
if (OUTSIDE(ch))
{
if (OUTSIDE(ch)) {
send_to_char(ch, "The sky is %s and %s.\r\n", sky_look[weather_info.sky],
weather_info.change >= 0 ? "you feel a warm wind from south" :
"your foot tells you bad weather is due");
weather_info.change >= 0
? "you feel a warm wind from south"
: "your foot tells you bad weather is due");
if (GET_LEVEL(ch) >= LVL_GOD)
send_to_char(ch, "Pressure: %d (change: %d), Sky: %d (%s)\r\n",
weather_info.pressure,
weather_info.change,
weather_info.sky,
sky_look[weather_info.sky]);
}
else
} else
send_to_char(ch, "You have no feeling about the weather at all.\r\n");
}
@@ -1064,8 +1054,7 @@ int search_help(const char *argument, int level)
break;
return (mid);
}
else if (chk > 0)
} else if (chk > 0)
bot = mid + 1;
else
top = mid - 1;
@@ -1136,15 +1125,19 @@ ACMD(do_who)
int showclass = 0, short_list = 0, outlaws = 0;
int who_room = 0, showgroup = 0, showleader = 0;
struct {
struct
{
char *disp;
int min_level;
int max_level;
int count; /* must always start as 0 */
} rank[] = {
{ "Immortals\r\n---------\r\n", LVL_IMMORT, LVL_IMPL, 0},
{ "Mortals\r\n-------\r\n", 1, LVL_IMMORT - 1, 0 },
{ "\n", 0, 0, 0 }
{
"Immortals\r\n---------\r\n", LVL_IMMORT, LVL_IMPL, 0},
{
"Mortals\r\n-------\r\n", 1, LVL_IMMORT - 1, 0},
{
"\n", 0, 0, 0}
};
skip_spaces(&argument);
@@ -1486,9 +1479,11 @@ ACMD(do_users)
strcpy(idletime, " ");
sprintf(line, "%3d %-7s %-12s %-14s %-3s %-8s ", d->desc_num, classname,
d->original && d->original->player.name ? d->original->player.name :
d->character && d->character->player.name ? d->character->player.name :
"UNDEFINED",
d->original && d->original->player.name
? d->original->player.name
: d->character && d->character->player.name
? d->character->player.name
: "UNDEFINED",
state, idletime, timestr);
if (*d->host)
@@ -1712,21 +1707,17 @@ ACMD(do_levels)
/* No valid args found */
min_lev = 1;
max_lev = LVL_IMMORT;
}
else if (ret == 1) {
} else if (ret == 1) {
/* One arg = range is (num) either side of current level */
val = min_lev;
max_lev = MIN(GET_LEVEL(ch) + val, LVL_IMMORT);
min_lev = MAX(GET_LEVEL(ch) - val, 1);
}
else if (ret == 2) {
} else if (ret == 2) {
/* Two args = min-max range limit - just do sanity checks */
min_lev = MAX(min_lev, 1);
max_lev = MIN(max_lev + 1, LVL_IMMORT);
}
}
else
{
} else {
send_to_char(ch, "Usage: %slevels [<min>-<max> | <range>]%s\r\n\r\n", QYEL, QNRM);
send_to_char(ch, "Displays exp required for levels.\r\n");
send_to_char(ch, "%slevels %s- shows all levels (1-%d)\r\n", QCYN, QNRM, (LVL_IMMORT - 1));
@@ -1838,106 +1829,177 @@ ACMD(do_toggle)
int toggle, tp, wimp_lev, result = 0, len = 0, i;
const char *types[] = {"off", "brief", "normal", "on", "\n"};
const struct {
const struct
{
char *command;
bitvector_t toggle; /* this needs changing once hashmaps are implemented */
char min_level;
char *disable_msg;
char *enable_msg;
} tog_messages[] = {
{"summonable", PRF_SUMMONABLE, 0,
{
"summonable", PRF_SUMMONABLE, 0,
"You are now safe from summoning by other players.\r\n",
"You may now be summoned by other players.\r\n"},
{"nohassle", PRF_NOHASSLE, LVL_IMMORT,
"You may now be summoned by other players.\r\n"
},
{
"nohassle", PRF_NOHASSLE, LVL_IMMORT,
"Nohassle disabled.\r\n",
"Nohassle enabled.\r\n"},
{"brief", PRF_BRIEF, 0,
"Nohassle enabled.\r\n"
},
{
"brief", PRF_BRIEF, 0,
"Brief mode off.\r\n",
"Brief mode on.\r\n"},
{"compact", PRF_COMPACT, 0,
"Brief mode on.\r\n"
},
{
"compact", PRF_COMPACT, 0,
"Compact mode off.\r\n",
"Compact mode on.\r\n"},
{"notell", PRF_NOTELL, 0,
"Compact mode on.\r\n"
},
{
"notell", PRF_NOTELL, 0,
"You can now hear tells.\r\n",
"You are now deaf to tells.\r\n"},
{"noauction", PRF_NOAUCT, 0,
"You are now deaf to tells.\r\n"
},
{
"noauction", PRF_NOAUCT, 0,
"You can now hear auctions.\r\n",
"You are now deaf to auctions.\r\n"},
{"noshout", PRF_NOSHOUT, 0,
"You are now deaf to auctions.\r\n"
},
{
"noshout", PRF_NOSHOUT, 0,
"You can now hear shouts.\r\n",
"You are now deaf to shouts.\r\n"},
{"nogossip", PRF_NOGOSS, 0,
"You are now deaf to shouts.\r\n"
},
{
"nogossip", PRF_NOGOSS, 0,
"You can now hear gossip.\r\n",
"You are now deaf to gossip.\r\n"},
{"nograts", PRF_NOGRATZ, 0,
"You are now deaf to gossip.\r\n"
},
{
"nograts", PRF_NOGRATZ, 0,
"You can now hear gratz.\r\n",
"You are now deaf to gratz.\r\n"},
{"nowiz", PRF_NOWIZ, LVL_IMMORT,
"You are now deaf to gratz.\r\n"
},
{
"nowiz", PRF_NOWIZ, LVL_IMMORT,
"You can now hear the Wiz-channel.\r\n",
"You are now deaf to the Wiz-channel.\r\n"},
{"quest", PRF_QUEST, 0,
"You are now deaf to the Wiz-channel.\r\n"
},
{
"quest", PRF_QUEST, 0,
"You are no longer part of the Quest.\r\n",
"Okay, you are part of the Quest.\r\n"},
{"showvnums", PRF_SHOWVNUMS, LVL_IMMORT,
"Okay, you are part of the Quest.\r\n"
},
{
"showvnums", PRF_SHOWVNUMS, LVL_IMMORT,
"You will no longer see the vnums.\r\n",
"You will now see the vnums.\r\n"},
{"norepeat", PRF_NOREPEAT, 0,
"You will now see the vnums.\r\n"
},
{
"norepeat", PRF_NOREPEAT, 0,
"You will now have your communication repeated.\r\n",
"You will no longer have your communication repeated.\r\n"},
{"holylight", PRF_HOLYLIGHT, LVL_IMMORT,
"You will no longer have your communication repeated.\r\n"
},
{
"holylight", PRF_HOLYLIGHT, LVL_IMMORT,
"HolyLight mode off.\r\n",
"HolyLight mode on.\r\n"},
{"slownameserver", 0, LVL_IMPL,
"HolyLight mode on.\r\n"
},
{
"slownameserver", 0, LVL_IMPL,
"Nameserver_is_slow changed to OFF; IP addresses will now be resolved.\r\n",
"Nameserver_is_slow changed to ON; sitenames will no longer be resolved.\r\n"},
{"autoexits", PRF_AUTOEXIT, 0,
"Nameserver_is_slow changed to ON; sitenames will no longer be resolved.\r\n"
},
{
"autoexits", PRF_AUTOEXIT, 0,
"Autoexits disabled.\r\n",
"Autoexits enabled.\r\n"},
{"trackthru", 0, LVL_IMPL,
"Autoexits enabled.\r\n"
},
{
"trackthru", 0, LVL_IMPL,
"Players can no longer track through doors.\r\n",
"Players can now track through doors.\r\n"},
{"clsolc", PRF_CLS, LVL_BUILDER,
"Players can now track through doors.\r\n"
},
{
"clsolc", PRF_CLS, LVL_BUILDER,
"You will no longer clear screen in OLC.\r\n",
"You will now clear screen in OLC.\r\n"},
{"buildwalk", PRF_BUILDWALK, LVL_BUILDER,
"You will now clear screen in OLC.\r\n"
},
{
"buildwalk", PRF_BUILDWALK, LVL_BUILDER,
"Buildwalk is now Off.\r\n",
"Buildwalk is now On.\r\n"},
{"afk", PRF_AFK, 0,
"Buildwalk is now On.\r\n"
},
{
"afk", PRF_AFK, 0,
"AFK is now Off.\r\n",
"AFK is now On.\r\n"},
{"autoloot", PRF_AUTOLOOT, 0,
"AFK is now On.\r\n"
},
{
"autoloot", PRF_AUTOLOOT, 0,
"Autoloot disabled.\r\n",
"Autoloot enabled.\r\n"},
{"autogold", PRF_AUTOGOLD, 0,
"Autoloot enabled.\r\n"
},
{
"autogold", PRF_AUTOGOLD, 0,
"Autogold disabled.\r\n",
"Autogold enabled.\r\n"},
{"autosplit", PRF_AUTOSPLIT, 0,
"Autogold enabled.\r\n"
},
{
"autosplit", PRF_AUTOSPLIT, 0,
"Autosplit disabled.\r\n",
"Autosplit enabled.\r\n"},
{"autosac", PRF_AUTOSAC, 0,
"Autosplit enabled.\r\n"
},
{
"autosac", PRF_AUTOSAC, 0,
"Autosac disabled.\r\n",
"Autosac enabled.\r\n"},
{"autoassist", PRF_AUTOASSIST, 0,
"Autosac enabled.\r\n"
},
{
"autoassist", PRF_AUTOASSIST, 0,
"Autoassist disabled.\r\n",
"Autoassist enabled.\r\n"},
{"automap", PRF_AUTOMAP, 1,
"Autoassist enabled.\r\n"
},
{
"automap", PRF_AUTOMAP, 1,
"You will no longer see the mini-map.\r\n",
"You will now see a mini-map at the side of room descriptions.\r\n"},
{"autokey", PRF_AUTOKEY, 0,
"You will now see a mini-map at the side of room descriptions.\r\n"
},
{
"autokey", PRF_AUTOKEY, 0,
"You will now have to unlock doors manually before opening.\r\n",
"You will now automatically unlock doors when opening them (if you have the key).\r\n"},
{"autodoor", PRF_AUTODOOR, 0,
"You will now automatically unlock doors when opening them (if you have the key).\r\n"
},
{
"autodoor", PRF_AUTODOOR, 0,
"You will now need to specify a door direction when opening, closing and unlocking.\r\n",
"You will now find the next available door when opening, closing or unlocking.\r\n"},
{"zoneresets", PRF_ZONERESETS, LVL_IMPL,
"You will now find the next available door when opening, closing or unlocking.\r\n"
},
{
"zoneresets", PRF_ZONERESETS, LVL_IMPL,
"You will no longer see zone resets.\r\n",
"You will now see zone resets.\r\n"},
{"syslog", 0, LVL_IMMORT, "\n", "\n"},
{"wimpy", 0, 0, "\n", "\n"},
{"pagelength", 0, 0, "\n", "\n"},
{"screenwidth", 0, 0, "\n", "\n"},
{"color", 0, 0, "\n", "\n"},
{"\n", 0, -1, "\n", "\n"} /* must be last */
"You will now see zone resets.\r\n"
},
{
"syslog", 0, LVL_IMMORT, "\n", "\n"
},
{
"wimpy", 0, 0, "\n", "\n"
},
{
"pagelength", 0, 0, "\n", "\n"
},
{
"screenwidth", 0, 0, "\n", "\n"
},
{
"color", 0, 0, "\n", "\n"
},
{
"\n", 0, -1, "\n", "\n"
} /* must be last */
};
if (IS_NPC(ch))
@@ -2085,8 +2147,10 @@ ACMD(do_toggle)
}
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1);
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2);
if (tp & 1) SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1);
if (tp & 2) SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2);
if (tp & 1)
SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1);
if (tp & 2)
SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2);
send_to_char(ch, "Your %scolor%s is now %s.\r\n", CCRED(ch, C_SPR), CCNRM(ch, C_OFF), types[tp]);
return;
@@ -2102,8 +2166,10 @@ ACMD(do_toggle)
}
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
if (tp & 1) SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
if (tp & 2) SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
if (tp & 1)
SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
if (tp & 2)
SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
send_to_char(ch, "Your syslog is now %s.\r\n", types[tp]);
return;
@@ -2317,6 +2383,7 @@ ACMD(do_history)
}
#define HIST_LENGTH 100
void add_history(struct char_data *ch, char *str, int type)
{
int i = 0;
@@ -2336,8 +2403,7 @@ void add_history(struct char_data *ch, char *str, int type)
if (!tmp) {
CREATE(GET_HISTORY(ch, type), struct txt_block, 1);
GET_HISTORY(ch, type)->text = strdup(buf);
}
else {
} else {
while (tmp->next)
tmp = tmp->next;
CREATE(tmp->next, struct txt_block, 1);
@@ -2372,8 +2438,7 @@ ACMD(do_whois)
return;
}
if (!(victim=get_player_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
{
if (!(victim = get_player_vis(ch, buf, NULL, FIND_CHAR_WORLD))) {
CREATE(victim, struct char_data, 1);
clear_char(victim);
@@ -2415,9 +2480,9 @@ ACMD(do_whois)
send_to_char(ch, "\r\n");
if (PRF_FLAGGED(victim, PRF_AFK))
send_to_char(ch, "%s%s is afk right now, so %s may not respond to communication.%s\r\n", CBGRN(ch, C_NRM), GET_NAME(victim), HSSH(victim), CCNRM(ch, C_NRM));
}
else if (hours > 0)
send_to_char(ch, "%s%s is afk right now, so %s may not respond to communication.%s\r\n", CBGRN(ch, C_NRM),
GET_NAME(victim), HSSH(victim), CCNRM(ch, C_NRM));
} else if (hours > 0)
send_to_char(ch, "Last Logon: %s (%d days & %d hours ago.)\r\n", buf, hours / 24, hours % 24);
else
send_to_char(ch, "Last Logon: %s (0 hours & %d minutes ago.)\r\n",
@@ -2434,8 +2499,13 @@ ACMD(do_whois)
if (!got_from_file && victim->desc != NULL && GET_LEVEL(ch) >= LVL_GOD) {
protocol_t *prot = victim->desc->pProtocol;
send_to_char(ch, "Client: %s [%s]\r\n", prot->pVariables[eMSDP_CLIENT_ID]->pValueString, prot->pVariables[eMSDP_CLIENT_VERSION]->pValueString ? prot->pVariables[eMSDP_CLIENT_VERSION]->pValueString : "Unknown");
send_to_char(ch, "Color: %s\r\n", prot->pVariables[eMSDP_XTERM_256_COLORS]->ValueInt ? "Xterm" : (prot->pVariables[eMSDP_ANSI_COLORS]->ValueInt ? "Ansi" : "None"));
send_to_char(ch, "Client: %s [%s]\r\n", prot->pVariables[eMSDP_CLIENT_ID]->pValueString,
prot->pVariables[eMSDP_CLIENT_VERSION]->pValueString
? prot->pVariables[eMSDP_CLIENT_VERSION]->pValueString
: "Unknown");
send_to_char(ch, "Color: %s\r\n", prot->pVariables[eMSDP_XTERM_256_COLORS]->ValueInt
? "Xterm"
: (prot->pVariables[eMSDP_ANSI_COLORS]->ValueInt ? "Ansi" : "None"));
send_to_char(ch, "MXP: %s\r\n", prot->bMXP ? "Yes" : "No");
send_to_char(ch, "Charset: %s\r\n", prot->bCHARSET ? "Yes" : "No");
send_to_char(ch, "MSP: %s\r\n", prot->bMSP ? "Yes" : "No");
@@ -2526,7 +2596,8 @@ ACMD(do_areas)
} else if ((hilev != -1) && (lolev >= ZONE_MINLVL(i)) && (hilev <= ZONE_MAXLVL(i))) {
/* Range supplied, it's completely within this zone's range (no overlap) */
show_zone = TRUE;
} else if ((hilev != -1) && ((lolev >= ZONE_MINLVL(i) && lolev <= ZONE_MAXLVL(i)) || (hilev <= ZONE_MAXLVL(i) && hilev >= ZONE_MINLVL(i)))) {
} else if ((hilev != -1) && ((lolev >= ZONE_MINLVL(i) && lolev <= ZONE_MAXLVL(i)) || (
hilev <= ZONE_MAXLVL(i) && hilev >= ZONE_MINLVL(i)))) {
/* Range supplied, it overlaps this zone's range */
show_zone = TRUE;
overlap = TRUE;
@@ -2541,19 +2612,23 @@ ACMD(do_areas)
}
if (show_zone) {
if (overlap) overlap_shown = TRUE;
if (overlap)
overlap_shown = TRUE;
lev_set = get_zone_levels(i, lev_str);
tmp_len = snprintf(buf+len, sizeof(buf)-len, "\tn(%3d) %s%-*s\tn %s%s\tn\r\n", ++zcount, overlap ? QRED : QCYN,
tmp_len = snprintf(buf + len, sizeof(buf) - len, "\tn(%3d) %s%-*s\tn %s%s\tn\r\n", ++zcount,
overlap ? QRED : QCYN,
count_color_chars(zone_table[i].name) + 30, zone_table[i].name,
lev_set ? "\tc" : "\tn", lev_set ? lev_str : "All Levels");
len += tmp_len;
}
}
tmp_len = snprintf(buf+len, sizeof(buf)-len, "%s%d%s area%s found.\r\n", QYEL, zcount, QNRM, zcount == 1 ? "" : "s");
tmp_len = snprintf(buf + len, sizeof(buf) - len, "%s%d%s area%s found.\r\n", QYEL, zcount, QNRM,
zcount == 1 ? "" : "s");
len += tmp_len;
if (overlap_shown) {
snprintf(buf+len, sizeof(buf)-len, "Areas shown in \trred\tn may have some creatures outside the specified range.\r\n");
snprintf(buf + len, sizeof(buf) - len,
"Areas shown in \trred\tn may have some creatures outside the specified range.\r\n");
}
if (zcount == 0)

View File

@@ -48,8 +48,6 @@ static void perform_wear(struct char_data *ch, struct obj_data *obj, int where);
static void wear_message(struct char_data *ch, struct obj_data *obj, int where);
static void perform_put(struct char_data *ch, struct obj_data *obj, struct obj_data *cont)
{
long object_id = obj_script_id(obj);
@@ -126,7 +124,7 @@ ACMD(do_put)
send_to_char(ch, "You'd better open it first!\r\n");
else {
if (obj_dotmode == FIND_INDIV) { /* put <obj> <container> */
if (!(obj = get_obj_in_list_vis(ch, theobj, NULL, ch->carrying)))
if (!((obj = get_obj_in_list_vis(ch, theobj, NULL, ch->carrying))))
send_to_char(ch, "You aren't carrying %s %s.\r\n", AN(theobj), theobj);
else if (obj == cont && howmany == 1)
send_to_char(ch, "You attempt to fold it into itself, but fail.\r\n");
@@ -446,6 +444,7 @@ static void perform_drop_gold(struct char_data *ch, int amount, byte mode, room_
#define VANISH(mode) ((mode == SCMD_DONATE || mode == SCMD_JUNK) ? \
" It vanishes in a puff of smoke!" : "")
static int perform_drop(struct char_data *ch, struct obj_data *obj,
byte mode, const char *sname, room_rnum RDR)
{
@@ -533,8 +532,12 @@ ACMD(do_drop)
case 2:
RDR = real_room(CONFIG_DON_ROOM_1);
break;
case 3: RDR = real_room(CONFIG_DON_ROOM_2); break;
case 4: RDR = real_room(CONFIG_DON_ROOM_3); break;
case 3:
RDR = real_room(CONFIG_DON_ROOM_2);
break;
case 4:
RDR = real_room(CONFIG_DON_ROOM_3);
break;
}
if (RDR == NOWHERE) {
@@ -568,7 +571,8 @@ ACMD(do_drop)
next_obj = get_obj_in_list_vis(ch, arg, NULL, obj->next_content);
amount += perform_drop(ch, obj, mode, sname, RDR);
obj = next_obj;
} while (obj && --multi);
}
while (obj && --multi);
}
} else {
dotmode = find_all_dots(arg);
@@ -633,7 +637,8 @@ static void perform_give(struct char_data *ch, struct char_data *vict,
act("$N seems to have $S hands full.", FALSE, ch, 0, vict, TO_CHAR);
return;
}
if (GET_OBJ_WEIGHT(obj) + IS_CARRYING_W(vict) > CAN_CARRY_W(vict) && GET_LEVEL(ch) < LVL_IMMORT && GET_LEVEL(vict) < LVL_IMMORT) {
if (GET_OBJ_WEIGHT(obj) + IS_CARRYING_W(vict) > CAN_CARRY_W(vict) && GET_LEVEL(ch) < LVL_IMMORT && GET_LEVEL(vict) <
LVL_IMMORT) {
act("$E can't carry that much weight.", FALSE, ch, 0, vict, TO_CHAR);
return;
}
@@ -1081,8 +1086,7 @@ ACMD(do_pour)
GET_OBJ_VAL(from_obj, 1) = 0;
GET_OBJ_VAL(from_obj, 2) = 0;
GET_OBJ_VAL(from_obj, 3) = 0;
}
else
} else
send_to_char(ch, "You can't possibly pour that container out!\r\n");
return;
@@ -1139,14 +1143,12 @@ ACMD(do_pour)
GET_OBJ_VAL(from_obj, 2) = 0;
GET_OBJ_VAL(from_obj, 3) = 0;
}
}
else {
} else {
GET_OBJ_VAL(to_obj, 1) = GET_OBJ_VAL(to_obj, 0);
amount = GET_OBJ_VAL(to_obj, 0);
}
/* Poisoned? */
GET_OBJ_VAL(to_obj, 3) = (GET_OBJ_VAL(to_obj, 3) || GET_OBJ_VAL(from_obj, 3))
;
GET_OBJ_VAL(to_obj, 3) = (GET_OBJ_VAL(to_obj, 3) || GET_OBJ_VAL(from_obj, 3));
/* Weight change, except for unlimited. */
if (GET_OBJ_VAL(from_obj, 0) > 0) {
weight_change_object(from_obj, -amount);
@@ -1304,18 +1306,30 @@ int find_eq_pos(struct char_data *ch, struct obj_data *obj, char *arg)
};
if (!arg || !*arg) {
if (CAN_WEAR(obj, ITEM_WEAR_FINGER)) where = WEAR_FINGER_R;
if (CAN_WEAR(obj, ITEM_WEAR_NECK)) where = WEAR_NECK_1;
if (CAN_WEAR(obj, ITEM_WEAR_BODY)) where = WEAR_BODY;
if (CAN_WEAR(obj, ITEM_WEAR_HEAD)) where = WEAR_HEAD;
if (CAN_WEAR(obj, ITEM_WEAR_LEGS)) where = WEAR_LEGS;
if (CAN_WEAR(obj, ITEM_WEAR_FEET)) where = WEAR_FEET;
if (CAN_WEAR(obj, ITEM_WEAR_HANDS)) where = WEAR_HANDS;
if (CAN_WEAR(obj, ITEM_WEAR_ARMS)) where = WEAR_ARMS;
if (CAN_WEAR(obj, ITEM_WEAR_SHIELD)) where = WEAR_SHIELD;
if (CAN_WEAR(obj, ITEM_WEAR_ABOUT)) where = WEAR_ABOUT;
if (CAN_WEAR(obj, ITEM_WEAR_WAIST)) where = WEAR_WAIST;
if (CAN_WEAR(obj, ITEM_WEAR_WRIST)) where = WEAR_WRIST_R;
if (CAN_WEAR(obj, ITEM_WEAR_FINGER))
where = WEAR_FINGER_R;
if (CAN_WEAR(obj, ITEM_WEAR_NECK))
where = WEAR_NECK_1;
if (CAN_WEAR(obj, ITEM_WEAR_BODY))
where = WEAR_BODY;
if (CAN_WEAR(obj, ITEM_WEAR_HEAD))
where = WEAR_HEAD;
if (CAN_WEAR(obj, ITEM_WEAR_LEGS))
where = WEAR_LEGS;
if (CAN_WEAR(obj, ITEM_WEAR_FEET))
where = WEAR_FEET;
if (CAN_WEAR(obj, ITEM_WEAR_HANDS))
where = WEAR_HANDS;
if (CAN_WEAR(obj, ITEM_WEAR_ARMS))
where = WEAR_ARMS;
if (CAN_WEAR(obj, ITEM_WEAR_SHIELD))
where = WEAR_SHIELD;
if (CAN_WEAR(obj, ITEM_WEAR_ABOUT))
where = WEAR_ABOUT;
if (CAN_WEAR(obj, ITEM_WEAR_WAIST))
where = WEAR_WAIST;
if (CAN_WEAR(obj, ITEM_WEAR_WRIST))
where = WEAR_WRIST_R;
} else if ((where = search_block(arg, keywords, FALSE)) < 0)
send_to_char(ch, "'%s'? What part of your body is THAT?\r\n", arg);
@@ -1515,7 +1529,8 @@ ACMD(do_sac)
return;
}
if (!(j = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents)) && (!(j = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)))) {
if (!(j = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents)) && (!(
j = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)))) {
send_to_char(ch, "It doesn't seem to be here.\n\r");
return;
}
@@ -1529,18 +1544,21 @@ ACMD(do_sac)
switch (rand_number(0, 5)) {
case 0:
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n", GET_OBJ_SHORT(j));
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n",
GET_OBJ_SHORT(j));
increase_gold(ch, 1);
break;
case 1:
send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe Gods ignore your sacrifice.\r\n", GET_OBJ_SHORT(j));
break;
case 2:
send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe gods give you %d experience points.\r\n", GET_OBJ_SHORT(j), 1+2*GET_OBJ_LEVEL(j));
send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe gods give you %d experience points.\r\n", GET_OBJ_SHORT(j),
1 + 2 * GET_OBJ_LEVEL(j));
GET_EXP(ch) += (1 + 2 * GET_OBJ_LEVEL(j));
break;
case 3:
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive %d experience points.\r\n", GET_OBJ_SHORT(j), 1+GET_OBJ_LEVEL(j));
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive %d experience points.\r\n", GET_OBJ_SHORT(j),
1 + GET_OBJ_LEVEL(j));
GET_EXP(ch) += (1 + GET_OBJ_LEVEL(j));
break;
case 4:
@@ -1552,7 +1570,8 @@ ACMD(do_sac)
increase_gold(ch, (1 + 2 * GET_OBJ_LEVEL(j)));
break;
default:
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n",GET_OBJ_SHORT(j));
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n",
GET_OBJ_SHORT(j));
increase_gold(ch, 1);
break;
}

View File

@@ -166,8 +166,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
return 0;
/* Charm effect: Does it override the movement? */
if (AFF_FLAGGED(ch, AFF_CHARM) && ch->master && was_in == IN_ROOM(ch->master))
{
if (AFF_FLAGGED(ch, AFF_CHARM) && ch->master && was_in == IN_ROOM(ch->master)) {
send_to_char(ch, "The thought of leaving your master makes you weep.\r\n");
act("$n bursts into tears.", FALSE, ch, 0, 0, TO_ROOM);
return (0);
@@ -175,28 +174,23 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
/* Water, No Swimming Rooms: Does the deep water prevent movement? */
if ((SECT(was_in) == SECT_WATER_NOSWIM) ||
(SECT(going_to) == SECT_WATER_NOSWIM))
{
if (!has_boat(ch))
{
(SECT(going_to) == SECT_WATER_NOSWIM)) {
if (!has_boat(ch)) {
send_to_char(ch, "You need a boat to go there.\r\n");
return (0);
}
}
/* Flying Required: Does lack of flying prevent movement? */
if ((SECT(was_in) == SECT_FLYING) || (SECT(going_to) == SECT_FLYING))
{
if (!has_flight(ch))
{
if ((SECT(was_in) == SECT_FLYING) || (SECT(going_to) == SECT_FLYING)) {
if (!has_flight(ch)) {
send_to_char(ch, "You need to be flying to go there!\r\n");
return (0);
}
}
/* Underwater Room: Does lack of underwater breathing prevent movement? */
if ((SECT(was_in) == SECT_UNDERWATER) || (SECT(going_to) == SECT_UNDERWATER))
{
if ((SECT(was_in) == SECT_UNDERWATER) || (SECT(going_to) == SECT_UNDERWATER)) {
if (!has_scuba(ch) && !IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)) {
send_to_char(ch, "You need to be able to breathe water to go there!\r\n");
return (0);
@@ -204,10 +198,8 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
}
/* Houses: Can the player walk into the house? */
if (ROOM_FLAGGED(was_in, ROOM_ATRIUM))
{
if (!House_can_enter(ch, GET_ROOM_VNUM(going_to)))
{
if (ROOM_FLAGGED(was_in, ROOM_ATRIUM)) {
if (!House_can_enter(ch, GET_ROOM_VNUM(going_to))) {
send_to_char(ch, "That's private property -- no trespassing!\r\n");
return (0);
}
@@ -223,15 +215,15 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n");
return (0);
}
if (ZONE_FLAGGED(GET_ROOM_ZONE(going_to), ZONE_NOIMMORT) && (GET_LEVEL(ch) >= LVL_IMMORT) && (GET_LEVEL(ch) < LVL_GRGOD)) {
if (ZONE_FLAGGED(GET_ROOM_ZONE(going_to), ZONE_NOIMMORT) && (GET_LEVEL(ch) >= LVL_IMMORT) && (
GET_LEVEL(ch) < LVL_GRGOD)) {
send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n");
return (0);
}
/* Room Size Capacity: Is the room full of people already? */
if (ROOM_FLAGGED(going_to, ROOM_TUNNEL) &&
num_pc_in_room(&(world[going_to])) >= CONFIG_TUNNEL_SIZE)
{
num_pc_in_room(&(world[going_to])) >= CONFIG_TUNNEL_SIZE) {
if (CONFIG_TUNNEL_SIZE > 1)
send_to_char(ch, "There isn't enough room for you to go there!\r\n");
else
@@ -240,8 +232,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
}
/* Room Level Requirements: Is ch privileged enough to enter the room? */
if (ROOM_FLAGGED(going_to, ROOM_GODROOM) && GET_LEVEL(ch) < LVL_GOD)
{
if (ROOM_FLAGGED(going_to, ROOM_GODROOM) && GET_LEVEL(ch) < LVL_GOD) {
send_to_char(ch, "You aren't godly enough to use that room!\r\n");
return (0);
}
@@ -253,8 +244,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
movement_loss[SECT(going_to)]) / 2;
/* Move Point Requirement Check */
if (GET_MOVE(ch) < need_movement && !IS_NPC(ch))
{
if (GET_MOVE(ch) < need_movement && !IS_NPC(ch)) {
if (need_specials_check && ch->master)
send_to_char(ch, "You are too exhausted to follow.\r\n");
else
@@ -274,8 +264,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
GET_MOVE(ch) -= need_movement;
/* Generate the leave message and display to others in the was_in room. */
if (!AFF_FLAGGED(ch, AFF_SNEAK))
{
if (!AFF_FLAGGED(ch, AFF_SNEAK)) {
snprintf(leave_message, sizeof(leave_message), "$n leaves %s.", dirs[dir]);
act(leave_message, TRUE, ch, 0, 0, TO_ROOM);
}
@@ -307,9 +296,9 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
look_at_room(ch, 0);
/* ... and Kill the player if the room is a death trap. */
if (ROOM_FLAGGED(going_to, ROOM_DEATH) && GET_LEVEL(ch) < LVL_IMMORT)
{
mudlog(BRF, LVL_IMMORT, TRUE, "%s hit death trap #%d (%s)", GET_NAME(ch), GET_ROOM_VNUM(going_to), world[going_to].name);
if (ROOM_FLAGGED(going_to, ROOM_DEATH) && GET_LEVEL(ch) < LVL_IMMORT) {
mudlog(BRF, LVL_IMMORT, TRUE, "%s hit death trap #%d (%s)", GET_NAME(ch), GET_ROOM_VNUM(going_to),
world[going_to].name);
death_cry(ch);
extract_char(ch);
return (0);
@@ -319,15 +308,13 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
/* Fire memory and greet triggers, check and see if the greet trigger
* prevents movement, and if so, move the player back to the previous room. */
entry_memory_mtrigger(ch);
if (!greet_mtrigger(ch, dir))
{
if (!greet_mtrigger(ch, dir)) {
char_from_room(ch);
char_to_room(ch, was_in);
look_at_room(ch, 0);
/* Failed move, return a failure */
return (0);
}
else
} else
greet_memory_mtrigger(ch);
/*---------------------------------------------------------------------*/
/* End: Post-move operations. */
@@ -348,7 +335,8 @@ int perform_move(struct char_data *ch, int dir, int need_specials_check)
send_to_char(ch, "Alas, you cannot go that way...\r\n");
else if ((!EXIT(ch, dir) && !buildwalk(ch, dir)) || EXIT(ch, dir)->to_room == NOWHERE)
send_to_char(ch, "Alas, you cannot go that way...\r\n");
else if (EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED) && (GET_LEVEL(ch) < LVL_IMMORT || (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)))) {
else if (EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED) && (GET_LEVEL(ch) < LVL_IMMORT || (
!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)))) {
if (EXIT(ch, dir)->keyword)
send_to_char(ch, "The %s seems to be closed.\r\n", fname(EXIT(ch, dir)->keyword));
else
@@ -410,24 +398,18 @@ static int find_door(struct char_data *ch, const char *type, char *dir, const ch
send_to_char(ch, "What is it you want to %s?\r\n", cmdname);
return (-1);
}
for (door = 0; door < DIR_COUNT; door++)
{
if (EXIT(ch, door))
{
if (EXIT(ch, door)->keyword)
{
if (isname(type, EXIT(ch, door)->keyword))
{
for (door = 0; door < DIR_COUNT; door++) {
if (EXIT(ch, door)) {
if (EXIT(ch, door)->keyword) {
if (isname(type, EXIT(ch, door)->keyword)) {
if ((!IS_NPC(ch)) && (!PRF_FLAGGED(ch, PRF_AUTODOOR)))
return door;
else if (is_abbrev(cmdname, "open"))
{
else if (is_abbrev(cmdname, "open")) {
if (IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))
return door;
else if (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))
return door;
}
else if ((is_abbrev(cmdname, "close")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))) )
} else if ((is_abbrev(cmdname, "close")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))))
return door;
else if ((is_abbrev(cmdname, "lock")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))))
return door;
@@ -655,17 +637,15 @@ ACMD(do_gen_door)
send_to_char(ch, "But it's currently open!\r\n");
else if (!(DOOR_IS_LOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_LOCKED))
send_to_char(ch, "Oh.. it wasn't locked, after all..\r\n");
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (has_key(ch, keynum)) )
{
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((
!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (has_key(ch, keynum))) {
send_to_char(ch, "It is locked, but you have the key.\r\n");
do_doorcmd(ch, obj, door, SCMD_UNLOCK);
do_doorcmd(ch, obj, door, subcmd);
}
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (!has_key(ch, keynum)) )
{
} else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((
!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (!has_key(ch, keynum))) {
send_to_char(ch, "It is locked, and you do not have the key!\r\n");
}
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) &&
} else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) &&
(GET_LEVEL(ch) < LVL_IMMORT || (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE))))
send_to_char(ch, "It seems to be locked.\r\n");
else if (!has_key(ch, keynum) && (GET_LEVEL(ch) < LVL_GOD) && ((subcmd == SCMD_LOCK) || (subcmd == SCMD_UNLOCK)))

View File

@@ -88,7 +88,8 @@ ACMD(do_hit)
if ((GET_POS(ch) == POS_STANDING) && (vict != FIGHTING(ch))) {
if (GET_DEX(ch) > GET_DEX(vict) || (GET_DEX(ch) == GET_DEX(vict) && rand_number(1, 2) == 1)) /* if faster */
hit(ch, vict, TYPE_UNDEFINED); /* first */
else hit(vict, ch, TYPE_UNDEFINED); /* or the victim is first */
else
hit(vict, ch, TYPE_UNDEFINED); /* or the victim is first */
WAIT_STATE(ch, PULSE_VIOLENCE + 2);
} else
send_to_char(ch, "You're fighting the best you can!\r\n");
@@ -531,8 +532,7 @@ ACMD(do_bandage)
struct char_data *vict;
int percent, prob;
if (!GET_SKILL(ch, SKILL_BANDAGE))
{
if (!GET_SKILL(ch, SKILL_BANDAGE)) {
send_to_char(ch, "You are unskilled in the art of bandaging.\r\n");
return;
}

View File

@@ -347,7 +347,8 @@ static void display_group_list(struct char_data * ch)
send_to_char(ch, "%-2d) %s%-12s %-2d %s%s\r\n",
++count,
IS_SET(GROUP_FLAGS(group), GROUP_OPEN) ? CCGRN(ch, C_NRM) : CCRED(ch, C_NRM),
GET_NAME(GROUP_LEADER(group)), group->members->iSize, zone_table[world[IN_ROOM(GROUP_LEADER(group))].zone].name,
GET_NAME(GROUP_LEADER(group)), group->members->iSize,
zone_table[world[IN_ROOM(GROUP_LEADER(group))].zone].name,
CCNRM(ch, C_NRM));
else
send_to_char(ch, "%-2d) Hidden\r\n", ++count);
@@ -459,10 +460,12 @@ ACMD(do_group)
}
if (is_abbrev(argument, "open")) {
TOGGLE_BIT(GROUP_FLAGS(GROUP(ch)), GROUP_OPEN);
send_to_char(ch, "The group is now %s to new members.\r\n", IS_SET(GROUP_FLAGS(GROUP(ch)), GROUP_OPEN) ? "open" : "closed");
send_to_char(ch, "The group is now %s to new members.\r\n",
IS_SET(GROUP_FLAGS(GROUP(ch)), GROUP_OPEN) ? "open" : "closed");
} else if (is_abbrev(argument, "anonymous")) {
TOGGLE_BIT(GROUP_FLAGS(GROUP(ch)), GROUP_ANON);
send_to_char(ch, "The group location is now %s to other players.\r\n", IS_SET(GROUP_FLAGS(GROUP(ch)), GROUP_ANON) ? "invisible" : "visible");
send_to_char(ch, "The group location is now %s to other players.\r\n",
IS_SET(GROUP_FLAGS(GROUP(ch)), GROUP_ANON) ? "invisible" : "visible");
} else
send_to_char(ch, "The flag options are: Open, Anonymous\r\n");
} else {
@@ -862,8 +865,7 @@ static void show_happyhour(struct char_data *ch)
char happyexp[80], happygold[80], happyqp[80];
int secs_left;
if ((IS_HAPPYHOUR) || (GET_LEVEL(ch) >= LVL_GRGOD))
{
if ((IS_HAPPYHOUR) || (GET_LEVEL(ch) >= LVL_GRGOD)) {
if (HAPPY_TIME)
secs_left = ((HAPPY_TIME - 1) * SECS_PER_MUD_HOUR) + next_tick;
else
@@ -882,9 +884,7 @@ static void show_happyhour(struct char_data *ch)
CCYEL(ch, C_NRM), (secs_left / 3600), CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), (secs_left % 3600) / 60, CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), (secs_left % 60), CCNRM(ch, C_NRM));
}
else
{
} else {
send_to_char(ch, "Sorry, there is currently no happy hour!\r\n");
}
}
@@ -894,8 +894,7 @@ ACMD(do_happyhour)
char arg[MAX_INPUT_LENGTH], val[MAX_INPUT_LENGTH];
int num;
if (GET_LEVEL(ch) < LVL_GOD)
{
if (GET_LEVEL(ch) < LVL_GOD) {
show_happyhour(ch);
return;
}
@@ -903,20 +902,15 @@ ACMD(do_happyhour)
/* Only Imms get here, so check args */
two_arguments(argument, arg, val);
if (is_abbrev(arg, "experience"))
{
if (is_abbrev(arg, "experience")) {
num = MIN(MAX((atoi(val)), 0), 1000);
HAPPY_EXP = num;
send_to_char(ch, "Happy Hour Exp rate set to +%d%%\r\n", HAPPY_EXP);
}
else if ((is_abbrev(arg, "gold")) || (is_abbrev(arg, "coins")))
{
} else if ((is_abbrev(arg, "gold")) || (is_abbrev(arg, "coins"))) {
num = MIN(MAX((atoi(val)), 0), 1000);
HAPPY_GOLD = num;
send_to_char(ch, "Happy Hour Gold rate set to +%d%%\r\n", HAPPY_GOLD);
}
else if ((is_abbrev(arg, "time")) || (is_abbrev(arg, "ticks")))
{
} else if ((is_abbrev(arg, "time")) || (is_abbrev(arg, "ticks"))) {
num = MIN(MAX((atoi(val)), 0), 1000);
if (HAPPY_TIME && !num)
game_info("Happyhour has been stopped!");
@@ -929,27 +923,19 @@ ACMD(do_happyhour)
(HAPPY_TIME * SECS_PER_MUD_HOUR) / 3600,
((HAPPY_TIME * SECS_PER_MUD_HOUR) % 3600) / 60,
(HAPPY_TIME * SECS_PER_MUD_HOUR) % 60);
}
else if ((is_abbrev(arg, "qp")) || (is_abbrev(arg, "questpoints")))
{
} else if ((is_abbrev(arg, "qp")) || (is_abbrev(arg, "questpoints"))) {
num = MIN(MAX((atoi(val)), 0), 1000);
HAPPY_QP = num;
send_to_char(ch, "Happy Hour Questpoints rate set to +%d%%\r\n", HAPPY_QP);
}
else if (is_abbrev(arg, "show"))
{
} else if (is_abbrev(arg, "show")) {
show_happyhour(ch);
}
else if (is_abbrev(arg, "default"))
{
} else if (is_abbrev(arg, "default")) {
HAPPY_EXP = 100;
HAPPY_GOLD = 50;
HAPPY_QP = 50;
HAPPY_TIME = 48;
game_info("A Happyhour has started!");
}
else
{
} else {
send_to_char(ch, "Usage: %shappyhour %s- show usage (this info)\r\n"
" %shappyhour show %s- display current settings (what mortals see)\r\n"
" %shappyhour time <ticks> %s- set happyhour time and start timer\r\n"

View File

@@ -65,7 +65,8 @@ ACMD(do_action)
if (!vict) {
if (action->char_obj_found) {
targ = get_obj_in_list_vis(ch, arg, NULL, ch->carrying);
if (!targ) targ = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents);
if (!targ)
targ = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents);
if (targ) {
act(action->char_obj_found, action->hide, ch, targ, 0, TO_CHAR);
act(action->others_obj_found, action->hide, ch, targ, 0, TO_ROOM);
@@ -128,7 +129,8 @@ void create_command_list(void)
/* count the commands in the command list */
i = 0;
while(*cmd_info[i].command != '\n') i++;
while (*cmd_info[i].command != '\n')
i++;
i++;
CREATE(complete_cmd_info, struct command_info, top_of_socialt + i + 2);
@@ -173,22 +175,38 @@ void free_social_messages(void)
free(soc_mess_list);
}
void free_action(struct social_messg *mess) {
if (mess->command) free(mess->command);
if (mess->sort_as) free(mess->sort_as);
if (mess->char_no_arg) free(mess->char_no_arg);
if (mess->others_no_arg) free(mess->others_no_arg);
if (mess->char_found) free(mess->char_found);
if (mess->others_found) free(mess->others_found);
if (mess->vict_found) free(mess->vict_found);
if (mess->char_body_found) free(mess->char_body_found);
if (mess->others_body_found) free(mess->others_body_found);
if (mess->vict_body_found) free(mess->vict_body_found);
if (mess->not_found) free(mess->not_found);
if (mess->char_auto) free(mess->char_auto);
if (mess->others_auto) free(mess->others_auto);
if (mess->char_obj_found) free(mess->char_obj_found);
if (mess->others_obj_found) free(mess->others_obj_found);
void free_action(struct social_messg *mess)
{
if (mess->command)
free(mess->command);
if (mess->sort_as)
free(mess->sort_as);
if (mess->char_no_arg)
free(mess->char_no_arg);
if (mess->others_no_arg)
free(mess->others_no_arg);
if (mess->char_found)
free(mess->char_found);
if (mess->others_found)
free(mess->others_found);
if (mess->vict_found)
free(mess->vict_found);
if (mess->char_body_found)
free(mess->char_body_found);
if (mess->others_body_found)
free(mess->others_body_found);
if (mess->vict_body_found)
free(mess->vict_body_found);
if (mess->not_found)
free(mess->not_found);
if (mess->char_auto)
free(mess->char_auto);
if (mess->others_auto)
free(mess->others_auto);
if (mess->char_obj_found)
free(mess->char_obj_found);
if (mess->others_obj_found)
free(mess->others_obj_found);
memset(mess, 0, sizeof(struct social_messg));
}

View File

@@ -63,7 +63,8 @@ static int purge_room(room_rnum room)
int j;
struct char_data *vict;
if (room == NOWHERE || room > top_of_world) return 0;
if (room == NOWHERE || room > top_of_world)
return 0;
for (vict = world[room].people; vict; vict = vict->next_in_room) {
if (!IS_NPC(vict))
@@ -271,7 +272,8 @@ ACMD(do_goto)
if ((location = find_target_room(ch, argument)) == NOWHERE)
return;
if (ZONE_FLAGGED(GET_ROOM_ZONE(location), ZONE_NOIMMORT) && (GET_LEVEL(ch) >= LVL_IMMORT) && (GET_LEVEL(ch) < LVL_GRGOD)) {
if (ZONE_FLAGGED(GET_ROOM_ZONE(location), ZONE_NOIMMORT) && (GET_LEVEL(ch) >= LVL_IMMORT) && (
GET_LEVEL(ch) < LVL_GRGOD)) {
send_to_char(ch, "Sorry, that zone is off-limits for immortals!");
return;
}
@@ -497,17 +499,17 @@ static void list_zone_commands_room(struct char_data *ch, room_vnum rvnum)
ZOCMD.if_flag ? " then " : "",
cyn, trig_index[ZOCMD.arg2]->proto->name, yel,
cyn, trig_index[ZOCMD.arg2]->vnum, yel,
((ZOCMD.arg1 == MOB_TRIGGER) ? "mobile" :
((ZOCMD.arg1 == OBJ_TRIGGER) ? "object" :
((ZOCMD.arg1 == WLD_TRIGGER)? "room" : "????"))));
((ZOCMD.arg1 == MOB_TRIGGER)
? "mobile"
: ((ZOCMD.arg1 == OBJ_TRIGGER) ? "object" : ((ZOCMD.arg1 == WLD_TRIGGER) ? "room" : "????"))));
break;
case 'V':
send_to_char(ch, "%sAssign global %s:%d to %s = %s\r\n",
ZOCMD.if_flag ? " then " : "",
ZOCMD.sarg1, ZOCMD.arg2,
((ZOCMD.arg1 == MOB_TRIGGER) ? "mobile" :
((ZOCMD.arg1 == OBJ_TRIGGER) ? "object" :
((ZOCMD.arg1 == WLD_TRIGGER)? "room" : "????"))),
((ZOCMD.arg1 == MOB_TRIGGER)
? "mobile"
: ((ZOCMD.arg1 == OBJ_TRIGGER) ? "object" : ((ZOCMD.arg1 == WLD_TRIGGER) ? "room" : "????"))),
ZOCMD.sarg2);
break;
default:
@@ -593,7 +595,8 @@ static void do_stat_room(struct char_data *ch, struct room_data *rm)
if (rm->dir_option[i]->to_room == NOWHERE)
snprintf(buf1, sizeof(buf1), " %sNONE%s", CCCYN(ch, C_NRM), CCNRM(ch, C_NRM));
else
snprintf(buf1, sizeof(buf1), "%s%5d%s", CCCYN(ch, C_NRM), GET_ROOM_VNUM(rm->dir_option[i]->to_room), CCNRM(ch, C_NRM));
snprintf(buf1, sizeof(buf1), "%s%5d%s", CCCYN(ch, C_NRM), GET_ROOM_VNUM(rm->dir_option[i]->to_room),
CCNRM(ch, C_NRM));
sprintbit(rm->dir_option[i]->exit_info, exit_bits, buf2, sizeof(buf2));
@@ -601,7 +604,9 @@ static void do_stat_room(struct char_data *ch, struct room_data *rm)
CCCYN(ch, C_NRM), dirs[i], CCNRM(ch, C_NRM), buf1,
rm->dir_option[i]->key == NOTHING ? -1 : rm->dir_option[i]->key,
rm->dir_option[i]->keyword ? rm->dir_option[i]->keyword : "None", buf2,
rm->dir_option[i]->general_description ? rm->dir_option[i]->general_description : " No exit description.\r\n");
rm->dir_option[i]->general_description
? rm->dir_option[i]->general_description
: " No exit description.\r\n");
}
/* check the room for a script */
@@ -686,7 +691,8 @@ static void do_stat_object(struct char_data *ch, struct obj_data *j)
break;
case ITEM_WEAPON:
send_to_char(ch, "Todam: %dd%d, Avg Damage: %.1f. Message type: %s\r\n",
GET_OBJ_VAL(j, 1), GET_OBJ_VAL(j, 2), ((GET_OBJ_VAL(j, 2) + 1) / 2.0) * GET_OBJ_VAL(j, 1), attack_hit_text[GET_OBJ_VAL(j, 3)].singular);
GET_OBJ_VAL(j, 1), GET_OBJ_VAL(j, 2), ((GET_OBJ_VAL(j, 2) + 1) / 2.0) * GET_OBJ_VAL(j, 1),
attack_hit_text[GET_OBJ_VAL(j, 3)].singular);
break;
case ITEM_ARMOR:
send_to_char(ch, "AC-apply: [%d]\r\n", GET_OBJ_VAL(j, 0));
@@ -772,7 +778,8 @@ static void do_stat_character(struct char_data *ch, struct char_data *k)
sprinttype(GET_SEX(k), genders, buf, sizeof(buf));
send_to_char(ch, "%s %s '%s' IDNum: [%5ld], In room [%5d], Loadroom : [%5d]\r\n",
buf, (!IS_NPC(k) ? "PC" : (!IS_MOB(k) ? "NPC" : "MOB")),
GET_NAME(k), IS_NPC(k) ? char_script_id(k) : GET_IDNUM(k), GET_ROOM_VNUM(IN_ROOM(k)), IS_NPC(k) ? NOWHERE : GET_LOADROOM(k));
GET_NAME(k), IS_NPC(k) ? char_script_id(k) : GET_IDNUM(k), GET_ROOM_VNUM(IN_ROOM(k)),
IS_NPC(k) ? NOWHERE : GET_LOADROOM(k));
if (IS_MOB(k)) {
send_to_char(ch, "Keyword: %s, VNum: [%5d], RNum: [%5d]\r\n", k->player.name, GET_MOB_VNUM(k), GET_MOB_RNUM(k));
@@ -889,7 +896,8 @@ static void do_stat_character(struct char_data *ch, struct char_data *k)
send_to_char(ch, "eq: %d\r\n", i2);
if (!IS_NPC(k))
send_to_char(ch, "Hunger: %d, Thirst: %d, Drunk: %d\r\n", GET_COND(k, HUNGER), GET_COND(k, THIRST), GET_COND(k, DRUNK));
send_to_char(ch, "Hunger: %d, Thirst: %d, Drunk: %d\r\n", GET_COND(k, HUNGER), GET_COND(k, THIRST),
GET_COND(k, DRUNK));
column = send_to_char(ch, "Master is: %s, Followers are:", k->master ? GET_NAME(k->master) : "<none>");
if (!k->followers)
@@ -914,7 +922,8 @@ static void do_stat_character(struct char_data *ch, struct char_data *k)
/* Routine to show what spells a char is affected by */
if (k->affected) {
for (aff = k->affected; aff; aff = aff->next) {
send_to_char(ch, "SPL: (%3dhr) %s%-21s%s ", aff->duration + 1, CCCYN(ch, C_NRM), skill_name(aff->spell), CCNRM(ch, C_NRM));
send_to_char(ch, "SPL: (%3dhr) %s%-21s%s ", aff->duration + 1, CCCYN(ch, C_NRM), skill_name(aff->spell),
CCNRM(ch, C_NRM));
if (aff->modifier)
send_to_char(ch, "%+d to %s", aff->modifier, apply_types[(int)aff->location]);
@@ -1578,12 +1587,10 @@ ACMD(do_restore)
one_argument(argument, buf);
if (!*buf)
send_to_char(ch, "Whom do you wish to restore?\r\n");
else if (is_abbrev(buf, "all"))
{
else if (is_abbrev(buf, "all")) {
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s restored all",GET_NAME(ch));
for (j = descriptor_list; j; j = j->next)
{
for (j = descriptor_list; j; j = j->next) {
if (!IS_PLAYING(j) || !(vict = j->character) || GET_LEVEL(vict) >= LVL_IMMORT)
continue;
@@ -1595,8 +1602,7 @@ ACMD(do_restore)
send_to_char(ch, "%s has been fully healed.\r\n", GET_NAME(vict));
act("You have been fully healed by $N!", FALSE, vict, 0, ch, TO_CHAR);
}
}
else if (!(vict = get_char_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
} else if (!(vict = get_char_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
send_to_char(ch, "%s", CONFIG_NOPERSON);
else if (!IS_NPC(vict) && ch != vict && GET_LEVEL(vict) >= GET_LEVEL(ch))
act("$E doesn't need your help.", FALSE, ch, 0, vict, TO_CHAR);
@@ -1835,7 +1841,8 @@ static const char *last_array[11] = {
"Playing"
};
struct last_entry *find_llog_entry(int punique, long idnum) {
struct last_entry *find_llog_entry(int punique, long idnum)
{
FILE *fp;
struct last_entry mlast;
struct last_entry *llast;
@@ -1874,7 +1881,8 @@ struct last_entry *find_llog_entry(int punique, long idnum) {
}
/* mod_llog_entry assumes that llast is accurate */
static void mod_llog_entry(struct last_entry *llast,int type) {
static void mod_llog_entry(struct last_entry *llast, int type)
{
FILE *fp;
struct last_entry mlast;
int size, recs, tmp;
@@ -1923,7 +1931,8 @@ static void mod_llog_entry(struct last_entry *llast,int type) {
return;
}
void add_llog_entry(struct char_data *ch, int type) {
void add_llog_entry(struct char_data *ch, int type)
{
FILE *fp;
struct last_entry *llast;
@@ -1963,7 +1972,8 @@ void add_llog_entry(struct char_data *ch, int type) {
free(llast);
}
void clean_llog_entries(void) {
void clean_llog_entries(void)
{
FILE *ofp, *nfp;
struct last_entry mlast;
int recs;
@@ -2030,7 +2040,8 @@ static void list_llog_entries(struct char_data *ch)
}
}
static struct char_data *is_in_game(long idnum) {
static struct char_data *is_in_game(long idnum)
{
struct descriptor_data *i;
for (i = descriptor_list; i; i = i->next) {
@@ -2159,7 +2170,8 @@ ACMD(do_force)
else {
send_to_char(ch, "%s", CONFIG_OK);
act(buf1, TRUE, ch, NULL, vict, TO_VICT);
mudlog(CMP, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s forced %s to %s", GET_NAME(ch), GET_NAME(vict), to_force);
mudlog(CMP, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s forced %s to %s", GET_NAME(ch), GET_NAME(vict),
to_force);
command_interpreter(vict, to_force);
}
} else if (!str_cmp("room", arg)) {
@@ -2295,7 +2307,8 @@ ACMD(do_zreset)
reset_zone(i);
send_to_char(ch, "Reset world.\r\n");
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s reset entire world.", GET_NAME(ch));
return; }
return;
}
} else if (*arg == '.' || !*arg)
i = world[IN_ROOM(ch)].zone;
else {
@@ -2307,7 +2320,8 @@ ACMD(do_zreset)
if (i <= top_of_zone_table && (can_edit_zone(ch, i) || GET_LEVEL(ch) > LVL_IMMORT)) {
reset_zone(i);
send_to_char(ch, "Reset zone #%d: %s.\r\n", zone_table[i].number, zone_table[i].name);
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s reset zone %d (%s)", GET_NAME(ch), zone_table[i].number, zone_table[i].name);
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s reset zone %d (%s)", GET_NAME(ch), zone_table[i].number,
zone_table[i].name);
} else
send_to_char(ch, "You do not have permission to reset this zone. Try %d.\r\n", GET_OLC_ZONE(ch));
}
@@ -2374,7 +2388,8 @@ ACMD(do_wizutil)
}
SET_BIT_AR(PLR_FLAGS(vict), PLR_FROZEN);
GET_FREEZE_LEV(vict) = GET_LEVEL(ch);
send_to_char(vict, "A bitter wind suddenly rises and drains every erg of heat from your body!\r\nYou feel frozen!\r\n");
send_to_char(
vict, "A bitter wind suddenly rises and drains every erg of heat from your body!\r\nYou feel frozen!\r\n");
send_to_char(ch, "Frozen.\r\n");
act("A sudden cold wind conjured from nowhere freezes $n!", FALSE, vict, 0, 0, TO_ROOM);
mudlog(BRF, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s frozen by %s.", GET_NAME(vict), GET_NAME(ch));
@@ -2434,7 +2449,9 @@ static size_t print_zone_to_buf(char *bufptr, size_t left, zone_rnum zone, int l
"%3d %-30.30s%s By: %-10.10s%s Age: %3d; Reset: %3d (%s); Range: %5d-%5d\r\n",
zone_table[zone].number, zone_table[zone].name, KNRM, zone_table[zone].builders, KNRM,
zone_table[zone].age, zone_table[zone].lifespan,
zone_table[zone].reset_mode ? ((zone_table[zone].reset_mode == 1) ? "Reset when no players are in zone" : "Normal reset") : "Never reset",
zone_table[zone].reset_mode
? ((zone_table[zone].reset_mode == 1) ? "Reset when no players are in zone" : "Normal reset")
: "Never reset",
zone_table[zone].bot, zone_table[zone].top);
j = k = l = m = n = o = 0;
@@ -2499,7 +2516,8 @@ ACMD(do_show)
int r, g, b;
char colour[16];
struct show_struct {
struct show_struct
{
const char *cmd;
const char level;
} fields[] = {
@@ -2591,7 +2609,8 @@ ACMD(do_show)
break;
/* show player */
case 2: {
case 2:
{
char buf1[64], buf2[64];
if (!*value) {
@@ -2682,13 +2701,15 @@ ACMD(do_show)
if (!W_EXIT(i, j))
continue;
if (W_EXIT(i, j)->to_room == 0) {
nlen = snprintf(buf + len, sizeof(buf) - len, "%2d: (void ) [%5d] %-*s%s (%s)\r\n", ++k, GET_ROOM_VNUM(i), count_color_chars(world[i].name)+40, world[i].name, QNRM, dirs[j]);
nlen = snprintf(buf + len, sizeof(buf) - len, "%2d: (void ) [%5d] %-*s%s (%s)\r\n", ++k, GET_ROOM_VNUM(i),
count_color_chars(world[i].name) + 40, world[i].name, QNRM, dirs[j]);
if (len + nlen >= sizeof(buf))
break;
len += nlen;
}
if (W_EXIT(i, j)->to_room == NOWHERE && !W_EXIT(i, j)->general_description) {
nlen = snprintf(buf + len, sizeof(buf) - len, "%2d: (Nowhere) [%5d] %-*s%s (%s)\r\n", ++k, GET_ROOM_VNUM(i), count_color_chars(world[i].name)+ 40, world[i].name, QNRM, dirs[j]);
nlen = snprintf(buf + len, sizeof(buf) - len, "%2d: (Nowhere) [%5d] %-*s%s (%s)\r\n", ++k, GET_ROOM_VNUM(i),
count_color_chars(world[i].name) + 40, world[i].name, QNRM, dirs[j]);
if (len + nlen >= sizeof(buf))
break;
len += nlen;
@@ -2702,7 +2723,8 @@ ACMD(do_show)
len = strlcpy(buf, "Death Traps\r\n-----------\r\n", sizeof(buf));
for (i = 0, j = 0; i <= top_of_world; i++)
if (ROOM_FLAGGED(i, ROOM_DEATH)) {
nlen = snprintf(buf + len, sizeof(buf) - len, "%2d: [%5d] %s%s\r\n", ++j, GET_ROOM_VNUM(i), world[i].name, QNRM);
nlen = snprintf(buf + len, sizeof(buf) - len, "%2d: [%5d] %s%s\r\n", ++j, GET_ROOM_VNUM(i), world[i].name,
QNRM);
if (len + nlen >= sizeof(buf))
break;
len += nlen;
@@ -2715,7 +2737,8 @@ ACMD(do_show)
len = strlcpy(buf, "Godrooms\r\n--------------------------\r\n", sizeof(buf));
for (i = 0, j = 0; i <= top_of_world; i++)
if (ROOM_FLAGGED(i, ROOM_GODROOM)) {
nlen = snprintf(buf + len, sizeof(buf) - len, "%2d: [%5d] %s%s\r\n", ++j, GET_ROOM_VNUM(i), world[i].name, QNRM);
nlen = snprintf(buf + len, sizeof(buf) - len, "%2d: [%5d] %s%s\r\n", ++j, GET_ROOM_VNUM(i), world[i].name,
QNRM);
if (len + nlen >= sizeof(buf))
break;
len += nlen;
@@ -2745,7 +2768,8 @@ ACMD(do_show)
if (!CAN_SEE(ch, d->character) || IN_ROOM(d->character) == NOWHERE)
continue;
i++;
send_to_char(ch, "%-10s%s - snooped by %s%s.\r\n", GET_NAME(d->snooping->character), QNRM, GET_NAME(d->character), QNRM);
send_to_char(ch, "%-10s%s - snooped by %s%s.\r\n", GET_NAME(d->snooping->character), QNRM, GET_NAME(d->character),
QNRM);
}
if (i == 0)
send_to_char(ch, "No one is currently snooping.\r\n");
@@ -2794,7 +2818,8 @@ ACMD(do_show)
for (g = 0; g < 6; g++)
for (b = 0; b < 6; b++) {
sprintf(colour, "F%d%d%d", r, g, b);
nlen = snprintf(buf + len, sizeof(buf) - len, "%s%s%s", ColourRGB(ch->desc, colour), colour, ++k % 6 == 0 ? "\tn\r\n" : " ");
nlen = snprintf(buf + len, sizeof(buf) - len, "%s%s%s", ColourRGB(ch->desc, colour), colour,
++k % 6 == 0 ? "\tn\r\n" : " ");
if (len + nlen >= sizeof(buf))
break;
len += nlen;
@@ -2826,7 +2851,8 @@ ACMD(do_show)
#define RANGE(low, high) (value = MAX((low), MIN((high), (value))))
/* The set options available */
static struct set_struct {
static struct set_struct
{
const char *cmd;
const char level;
const char pcnpc;
@@ -3506,7 +3532,9 @@ ACMD(do_links)
/* Armor class limits*/
#define TOTAL_WEAR_CHECKS (NUM_ITEM_WEARS-2) /*minus Wield and Take*/
static struct zcheck_armor {
static struct zcheck_armor
{
bitvector_t bitvector; /* from Structs.h */
int ac_allowed; /* Max. AC allowed for this body part */
char *message; /* phrase for error message */
@@ -3528,7 +3556,8 @@ static struct zcheck_armor {
/* Applies limits !! Very Important: Keep these in the same order as in Structs.h.
* To ignore an apply, set max_aff to -99. These will be ignored if MAX_APPLIES_LIMIT = 0 */
static struct zcheck_affs {
static struct zcheck_affs
{
int aff_type; /*from Structs.h*/
int min_aff; /*min. allowed value*/
int max_aff; /*max. allowed value*/
@@ -3654,7 +3683,8 @@ ACMD (do_zcheck)
len += snprintf(buf + len, sizeof(buf) - len,
"- Needs to be fixed - %sAutogenerate!%s\r\n", CCYEL(ch, C_NRM), CCNRM(ch, C_NRM));
if (MOB_FLAGGED(mob, MOB_AGGRESSIVE) && (MOB_FLAGGED(mob, MOB_AGGR_GOOD) || MOB_FLAGGED(mob, MOB_AGGR_EVIL) || MOB_FLAGGED(mob, MOB_AGGR_NEUTRAL)) && (found=1))
if (MOB_FLAGGED(mob, MOB_AGGRESSIVE) && (MOB_FLAGGED(mob, MOB_AGGR_GOOD) || MOB_FLAGGED(mob, MOB_AGGR_EVIL) ||
MOB_FLAGGED(mob, MOB_AGGR_NEUTRAL)) && (found = 1))
len += snprintf(buf + len, sizeof(buf) - len,
"- Both aggresive and agressive to align.\r\n");
@@ -3776,7 +3806,8 @@ ACMD (do_zcheck)
/*first check for over-all affections*/
for (affs = 0, j = 0; j < MAX_OBJ_AFFECT; j++)
if (obj->affected[j].modifier) affs++;
if (obj->affected[j].modifier)
affs++;
if (affs > MAX_AFFECTS_ALLOWED && (found = 1))
len += snprintf(buf + len, sizeof(buf) - len,
@@ -3788,7 +3819,8 @@ ACMD (do_zcheck)
if (zaffs[(int)obj->affected[j].location].max_aff != -99 && /* only care if a range is set */
(obj->affected[j].modifier > zaffs[(int)obj->affected[j].location].max_aff ||
obj->affected[j].modifier < zaffs[(int)obj->affected[j].location].min_aff ||
zaffs[(int)obj->affected[j].location].min_aff == zaffs[(int)obj->affected[j].location].max_aff) && (found=1))
zaffs[(int)obj->affected[j].location].min_aff == zaffs[(int)obj->affected[j].location].max_aff) && (
found = 1))
len += snprintf(buf + len, sizeof(buf) - len,
"- apply to %s is %d (limit %d - %d).\r\n",
zaffs[(int)obj->affected[j].location].message,
@@ -3855,7 +3887,8 @@ ACMD (do_zcheck)
} /* for (k.. */
} /* cycle directions */
if (ROOM_FLAGGED(i, ROOM_ATRIUM) || ROOM_FLAGGED(i, ROOM_HOUSE) || ROOM_FLAGGED(i, ROOM_HOUSE_CRASH) || ROOM_FLAGGED(i, ROOM_OLC) || ROOM_FLAGGED(i, ROOM_BFS_MARK))
if (ROOM_FLAGGED(i, ROOM_ATRIUM) || ROOM_FLAGGED(i, ROOM_HOUSE) || ROOM_FLAGGED(i, ROOM_HOUSE_CRASH) ||
ROOM_FLAGGED(i, ROOM_OLC) || ROOM_FLAGGED(i, ROOM_BFS_MARK))
len += snprintf(buf + len, sizeof(buf) - len,
"- Has illegal affection bits set (%s %s %s %s %s)\r\n",
ROOM_FLAGGED(i, ROOM_ATRIUM) ? "ATRIUM" : "",
@@ -4033,8 +4066,9 @@ static void trg_checkload(struct char_data *ch, trig_vnum tvnum)
}
send_to_char(ch, "Checking load info for the %s trigger '%s':\r\n",
trig_index[trnum]->proto->attach_type == MOB_TRIGGER ? "mobile" :
(trig_index[trnum]->proto->attach_type == OBJ_TRIGGER ? "object" : "room"),
trig_index[trnum]->proto->attach_type == MOB_TRIGGER
? "mobile"
: (trig_index[trnum]->proto->attach_type == OBJ_TRIGGER ? "object" : "room"),
trig_index[trnum]->proto->name);
for (zone = 0; zone <= top_of_zone_table; zone++) {
@@ -4159,6 +4193,7 @@ ACMD(do_checkloadstatus)
return;
}
}
/* Zone Checker code above. */
/* (c) 1996-97 Erwin S. Andreasen. */
@@ -4252,18 +4287,15 @@ ACMD(do_zpurge)
one_argument(argument, arg);
if (*arg == '.' || !*arg) {
zone = world[IN_ROOM(ch)].zone;
}
else if (is_number(arg)) {
} else if (is_number(arg)) {
zone = real_zone(atoi(arg));
if (zone == NOWHERE || zone > top_of_zone_table) {
send_to_char(ch, "That zone doesn't exist!\r\n");
return;
}
}
else if (*arg == '*') {
} else if (*arg == '*') {
purge_all = TRUE;
}
else {
} else {
send_to_char(ch, "That isn't a valid zone number!\r\n");
return;
}
@@ -4276,9 +4308,9 @@ ACMD(do_zpurge)
purge_room(real_room(vroom));
}
send_to_char(ch, "Purged zone #%d: %s.\r\n", zone_table[zone].number, zone_table[zone].name);
mudlog(NRM, MAX(LVL_GRGOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s purged zone %d (%s)", GET_NAME(ch), zone_table[zone].number, zone_table[zone].name);
}
else {
mudlog(NRM, MAX(LVL_GRGOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s purged zone %d (%s)", GET_NAME(ch),
zone_table[zone].number, zone_table[zone].name);
} else {
for (room = 0; room <= top_of_world; room++) {
purge_room(room);
}
@@ -4313,7 +4345,8 @@ ACMD(do_file)
char buf[MAX_STRING_LENGTH]; /* Display buffer for req_file. */
/* Defines which files are available to read. */
struct file_struct {
struct file_struct
{
char *cmd; /* The 'name' of the file to view */
char level; /* Minimum level needed to view. */
char *file; /* The file location, relative to the working dir. */
@@ -4361,8 +4394,7 @@ ACMD(do_file)
/* There are some arguments, deal with them. */
two_arguments(argument, field, value);
for (l = 0; *(fields[l].cmd) != '\n'; l++)
{
for (l = 0; *(fields[l].cmd) != '\n'; l++) {
if (!strncmp(field, fields[l].cmd, strlen(field)))
break;
}
@@ -4381,15 +4413,12 @@ ACMD(do_file)
/* Number of lines to view. Default is 15. */
if (!*value)
req_lines = def_lines_to_read;
else if (!isdigit(*value))
{
else if (!isdigit(*value)) {
/* This check forces the requisite positive digit and prevents negative
* numbers of lines from being read. */
send_to_char(ch, "'%s' is not a valid number of lines to view.\r\n", value);
return;
}
else
{
} else {
req_lines = atoi(value);
/* Limit the maximum number of lines */
req_lines = MIN(req_lines, max_lines_to_read);
@@ -4415,14 +4444,11 @@ ACMD(do_file)
req_file_lines);
/* Should the file be 'headed' or 'tailed'? */
if ( (fields[l].read_backwards == TRUE) && (req_lines < req_file_lines) )
{
if ((fields[l].read_backwards == TRUE) && (req_lines < req_file_lines)) {
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
"\tgReading from the tail of the file.\tn\r\n\r\n");
lines_read = file_tail(req_file, buf, sizeof(buf), req_lines);
}
else
{
} else {
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
"\tgReading from the head of the file.\tn\r\n\r\n");
lines_read = file_head(req_file, buf, sizeof(buf), req_lines);
@@ -4430,21 +4456,16 @@ ACMD(do_file)
/* Since file_head and file_tail will add the overflow message, we
* don't check for status here. */
if ( lines_read == req_file_lines )
{
if (lines_read == req_file_lines) {
/* We're reading the entire file */
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
"\r\n\tgEntire file returned (\tn%d \tglines).\tn\r\n",
lines_read);
}
else if ( lines_read == max_lines_to_read )
{
} else if (lines_read == max_lines_to_read) {
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
"\r\n\tgMaximum number of \tn%d \tglines returned.\tn\r\n",
lines_read);
}
else
{
} else {
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
"\r\n%d \tglines returned.\tn\r\n",
lines_read);
@@ -4621,14 +4642,12 @@ bool change_player_name(struct char_data *ch, struct char_data *vict, char *new_
int plr_i = 0, i, k;
char old_name[MAX_NAME_LENGTH], old_pfile[50], new_pfile[50], buf[MAX_STRING_LENGTH];
if (!ch)
{
if (!ch) {
log("SYSERR: No char passed to change_player_name.");
return FALSE;
}
if (!vict)
{
if (!vict) {
log("SYSERR: No victim passed to change_player_name.");
send_to_char(ch, "Invalid victim.\r\n");
return FALSE;
@@ -4663,8 +4682,7 @@ bool change_player_name(struct char_data *ch, struct char_data *vict, char *new_
if (player_table[i].id == GET_IDNUM(vict))
break;
if (player_table[i].id != GET_IDNUM(vict))
{
if (player_table[i].id != GET_IDNUM(vict)) {
send_to_char(ch, "Your target was not found in the player index.\r\n");
log("SYSERR: Player %s, with ID %ld, could not be found in the player index.", GET_NAME(vict), GET_IDNUM(vict));
return FALSE;
@@ -4672,13 +4690,11 @@ bool change_player_name(struct char_data *ch, struct char_data *vict, char *new_
/* Set up a few variables that will be needed */
sprintf(old_name, "%s", GET_NAME(vict));
if (!get_filename(old_pfile, sizeof(old_pfile), PLR_FILE, old_name))
{
if (!get_filename(old_pfile, sizeof(old_pfile), PLR_FILE, old_name)) {
send_to_char(ch, "Unable to ascertain player's old pfile name.\r\n");
return FALSE;
}
if (!get_filename(new_pfile, sizeof(new_pfile), PLR_FILE, new_name))
{
if (!get_filename(new_pfile, sizeof(new_pfile), PLR_FILE, new_name)) {
send_to_char(ch, "Unable to ascertain player's new pfile name.\r\n");
return FALSE;
}
@@ -4700,7 +4716,8 @@ bool change_player_name(struct char_data *ch, struct char_data *vict, char *new_
mudlog(BRF, LVL_IMMORT, TRUE, "(GC) %s changed the name of %s to %s", GET_NAME(ch), old_name, new_name);
if (vict->desc) /* Descriptor is set if the victim is logged in */
send_to_char(vict, "Your login name has changed from %s%s%s to %s%s%s.\r\n", CCYEL(vict, C_NRM), old_name, CCNRM(vict, C_NRM),
send_to_char(vict, "Your login name has changed from %s%s%s to %s%s%s.\r\n", CCYEL(vict, C_NRM), old_name,
CCNRM(vict, C_NRM),
CCYEL(vict, C_NRM), new_name, CCNRM(vict, C_NRM));
return TRUE;
@@ -4771,10 +4788,12 @@ ACMD(do_zlock)
/* Show all locked zones */
for (zn = 0; zn <= top_of_zone_table; zn++) {
if (ZONE_FLAGGED(zn, ZONE_NOBUILD)) {
if (!counter) send_to_char(ch, "Locked Zones\r\n");
if (!counter)
send_to_char(ch, "Locked Zones\r\n");
send_to_char(ch, "[%s%3d%s] %s%-*s %s%-1s%s\r\n",
QGRN, zone_table[zn].number, QNRM, QCYN, count_color_chars(zone_table[zn].name)+30, zone_table[zn].name,
QGRN, zone_table[zn].number, QNRM, QCYN, count_color_chars(zone_table[zn].name) + 30,
zone_table[zn].name,
QYEL, zone_table[zn].builders ? zone_table[zn].builders : "None.", QNRM);
counter++;
}
@@ -4783,8 +4802,7 @@ ACMD(do_zlock)
send_to_char(ch, "There are currently no locked zones!\r\n");
}
return;
}
else if ((znvnum = atoi(arg)) == 0) {
} else if ((znvnum = atoi(arg)) == 0) {
send_to_char(ch, "Usage: %szlock <zone number>%s\r\n", QYEL, QNRM);
return;
}
@@ -4808,9 +4826,7 @@ ACMD(do_zlock)
SET_BIT_AR(ZONE_FLAGS(zn), ZONE_NOBUILD);
if (save_zone(zn)) {
mudlog(NRM, MAX(LVL_GRGOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s has locked zone %d", GET_NAME(ch), znvnum);
}
else
{
} else {
send_to_char(ch, "Unable to save zone changes. Check syslog!\r\n");
}
}
@@ -4865,10 +4881,12 @@ ACMD(do_zunlock)
/* Show all unlocked zones */
for (zn = 0; zn <= top_of_zone_table; zn++) {
if (!ZONE_FLAGGED(zn, ZONE_NOBUILD)) {
if (!counter) send_to_char(ch, "Unlocked Zones\r\n");
if (!counter)
send_to_char(ch, "Unlocked Zones\r\n");
send_to_char(ch, "[%s%3d%s] %s%-*s %s%-1s%s\r\n",
QGRN, zone_table[zn].number, QNRM, QCYN, count_color_chars(zone_table[zn].name)+30, zone_table[zn].name,
QGRN, zone_table[zn].number, QNRM, QCYN, count_color_chars(zone_table[zn].name) + 30,
zone_table[zn].name,
QYEL, zone_table[zn].builders ? zone_table[zn].builders : "None.", QNRM);
counter++;
}
@@ -4877,8 +4895,7 @@ ACMD(do_zunlock)
send_to_char(ch, "There are currently no unlocked zones!\r\n");
}
return;
}
else if ((znvnum = atoi(arg)) == 0) {
} else if ((znvnum = atoi(arg)) == 0) {
send_to_char(ch, "Usage: %szunlock <zone number>%s\r\n", QYEL, QNRM);
return;
}
@@ -4902,9 +4919,7 @@ ACMD(do_zunlock)
REMOVE_BIT_AR(ZONE_FLAGS(zn), ZONE_NOBUILD);
if (save_zone(zn)) {
mudlog(NRM, MAX(LVL_GRGOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s has unlocked zone %d", GET_NAME(ch), znvnum);
}
else
{
} else {
send_to_char(ch, "Unable to save zone changes. Check syslog!\r\n");
}
}
@@ -4917,9 +4932,9 @@ static int get_max_recent(void)
this = recent_list;
while (this)
{
if (this->vnum > iRet) iRet = this->vnum;
while (this) {
if (this->vnum > iRet)
iRet = this->vnum;
this = this->next;
}
@@ -4965,7 +4980,8 @@ bool AddRecentPlayer(char *chname, char *chhost, bool newplr, bool cpyplr)
this = create_recent();
if (!this) return FALSE;
if (!this)
return FALSE;
this->time = ct;
this->new_player = newplr;
@@ -4985,8 +5001,7 @@ void free_recent_players(void)
this = recent_list;
while((temp = this) != NULL)
{
while ((temp = this) != NULL) {
this = this->next;
free(temp);
}
@@ -5014,31 +5029,31 @@ ACMD(do_recent)
}
this = recent_list;
while(this)
{
while (this) {
loc = FALSE;
hits++;
ct = this->time;
strftime(timestr, sizeof(timestr), "%a %b %d %H:%M:%S %Y", localtime(&ct));
if (*(this->host)) {
if (!strcmp(this->host, "localhost")) loc = TRUE;
if (!strcmp(this->host, "localhost"))
loc = TRUE;
}
if ((limit == 0) || (count < limit))
{
if ((limit == 0) || (count < limit)) {
if (GET_LEVEL(ch) >= LVL_GRGOD) /* If High-Level Imm, then show Host IP */
{
if (this->new_player == TRUE) {
send_to_char(ch, "%3d | %-24.24s | %s%-32s%s | %s %s(New Player)%s\r\n", this->vnum, timestr, loc ? QRED : "", this->host, QNRM, this->name, QYEL, QNRM);
send_to_char(ch, "%3d | %-24.24s | %s%-32s%s | %s %s(New Player)%s\r\n", this->vnum, timestr, loc ? QRED : "",
this->host, QNRM, this->name, QYEL, QNRM);
} else if (this->copyover_player == TRUE) {
send_to_char(ch, "%3d | %-24.24s | %s%-32s%s | %s %s(Copyover)%s\r\n", this->vnum, timestr, loc ? QRED : "", this->host, QNRM, this->name, QCYN, QNRM);
send_to_char(ch, "%3d | %-24.24s | %s%-32s%s | %s %s(Copyover)%s\r\n", this->vnum, timestr, loc ? QRED : "",
this->host, QNRM, this->name, QCYN, QNRM);
} else {
send_to_char(ch, "%3d | %-24.24s | %s%-32s%s | %s\r\n", this->vnum, timestr, loc ? QRED : "", this->host, QNRM, this->name);
send_to_char(ch, "%3d | %-24.24s | %s%-32s%s | %s\r\n", this->vnum, timestr, loc ? QRED : "", this->host,
QNRM, this->name);
}
}
else
{
} else {
if (this->new_player == TRUE) {
send_to_char(ch, "%3d | %-24.24s | %s %s(New Player)%s\r\n", this->vnum, timestr, this->name, QYEL, QNRM);
} else if (this->copyover_player == TRUE) {
@@ -5050,9 +5065,7 @@ ACMD(do_recent)
count++;
this = this->next;
}
else
{
} else {
this = NULL;
}
}

View File

@@ -30,7 +30,6 @@ static void aedit_setup_existing(struct descriptor_data *d, int real_num);
static void aedit_save_internally(struct descriptor_data *d);
/* Utils and exported functions. */
ACMD(do_oasis_aedit)
{
@@ -422,7 +421,8 @@ void aedit_parse(struct descriptor_data * d, char *arg)
if (OLC_VAL(d)) { /* Something was modified */
write_to_output(d, "Do you wish to save your changes? : ");
OLC_MODE(d) = AEDIT_CONFIRM_SAVESTRING;
} else cleanup_olc(d, CLEANUP_ALL);
} else
cleanup_olc(d, CLEANUP_ALL);
break;
case 'n':
write_to_output(d, "Enter action name: ");
@@ -846,4 +846,3 @@ static int aedit_find_command(const char *txt)
return (cmd);
return (-1);
}

View File

@@ -255,8 +255,7 @@ void char_from_furniture(struct char_data *ch);
temp = temp->next; \
if (temp) \
temp->next = (item)->next; \
} \
}
/* Connect 'link' to the end of a double-linked list
* The new item becomes the last in the linked list, and the last
* pointer is updated.