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

View File

@@ -22,9 +22,9 @@
#include "act.h" #include "act.h"
#include "modify.h" #include "modify.h"
static bool legal_communication(char * arg); static bool legal_communication(char *arg);
static bool legal_communication(char * arg) static bool legal_communication(char *arg)
{ {
while (*arg) { while (*arg) {
if (*arg == '@') { if (*arg == '@') {
@@ -86,7 +86,8 @@ ACMD(do_gsay)
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument)) if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
parse_at(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)) if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
send_to_char(ch, "%s", CONFIG_OK); 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); act("$E's linkless at the moment.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
else if (PLR_FLAGGED(vict, PLR_WRITING)) 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); 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); act("$E can't hear you.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
else else
return (TRUE); return (TRUE);
@@ -168,7 +170,7 @@ ACMD(do_tell)
} }
/* Only a-z and +/- allowed. */ /* Only a-z and +/- allowed. */
for (p = buf2, q = word; *p ; p++) for (p = buf2, q = word; *p; p++)
if ((LOWER(*p) <= 'z' && LOWER(*p) >= 'a') || (*p == '+') || (*p == '-')) if ((LOWER(*p) <= 'z' && LOWER(*p) >= 'a') || (*p == '+') || (*p == '-'))
*q++ = *p; *q++ = *p;
@@ -178,7 +180,7 @@ ACMD(do_tell)
send_to_char(ch, "Sorry, only letters and +/- are allowed characters.\r\n"); send_to_char(ch, "Sorry, only letters and +/- are allowed characters.\r\n");
return; return;
} }
snprintf(buf, sizeof(buf), "../bin/webster %s %d &", word, (int) getpid()); snprintf(buf, sizeof(buf), "../bin/webster %s %d &", word, (int)getpid());
last_webster_teller = GET_IDNUM(ch); last_webster_teller = GET_IDNUM(ch);
send_to_char(ch, "You look up '%s' in Merriam-Webster.\r\n", word); send_to_char(ch, "You look up '%s' in Merriam-Webster.\r\n", word);
#endif /* platform specific part */ #endif /* platform specific part */
@@ -424,35 +426,42 @@ ACMD(do_gen_comm)
* [2] message if you're not on the channel * [2] message if you're not on the channel
* [3] a color string. */ * [3] a color string. */
const char *com_msgs[][4] = { const char *com_msgs[][4] = {
{"You cannot holler!!\r\n", {
"You cannot holler!!\r\n",
"holler", "holler",
"", "",
KYEL}, KYEL
},
{"You cannot shout!!\r\n", {
"You cannot shout!!\r\n",
"shout", "shout",
"Turn off your noshout flag first!\r\n", "Turn off your noshout flag first!\r\n",
KYEL}, KYEL
},
{"You cannot gossip!!\r\n", {
"You cannot gossip!!\r\n",
"gossip", "gossip",
"You aren't even on the channel!\r\n", "You aren't even on the channel!\r\n",
KYEL}, KYEL
},
{"You cannot auction!!\r\n", {
"You cannot auction!!\r\n",
"auction", "auction",
"You aren't even on the channel!\r\n", "You aren't even on the channel!\r\n",
KMAG}, KMAG
},
{"You cannot congratulate!\r\n", {
"You cannot congratulate!\r\n",
"congrat", "congrat",
"You aren't even on the channel!\r\n", "You aren't even on the channel!\r\n",
KGRN}, KGRN
},
{"You cannot gossip your emotions!\r\n", {
"You cannot gossip your emotions!\r\n",
"gossip", "gossip",
"You aren't even on the channel!\r\n", "You aren't even on the channel!\r\n",
KYEL} KYEL
}
}; };
if (PLR_FLAGGED(ch, PLR_NOSHOUT)) { if (PLR_FLAGGED(ch, PLR_NOSHOUT)) {
@@ -475,7 +484,8 @@ ACMD(do_gen_comm)
/* Level_can_shout defined in config.c. */ /* Level_can_shout defined in config.c. */
if (GET_LEVEL(ch) < CONFIG_LEVEL_CAN_SHOUT) { 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; return;
} }
/* Make sure the char is on the channel. */ /* Make sure the char is on the channel. */
@@ -520,7 +530,7 @@ ACMD(do_gen_comm)
/* Now send all the strings out. */ /* Now send all the strings out. */
for (i = descriptor_list; i; i = i->next) { for (i = descriptor_list; i; i = i->next) {
if (STATE(i) != CON_PLAYING || i == ch->desc || !i->character ) if (STATE(i) != CON_PLAYING || i == ch->desc || !i->character)
continue; continue;
if (!IS_NPC(ch) && (PRF_FLAGGED(i->character, channels[subcmd]) || PLR_FLAGGED(i->character, PLR_WRITING))) if (!IS_NPC(ch) && (PRF_FLAGGED(i->character, channels[subcmd]) || PLR_FLAGGED(i->character, PLR_WRITING)))
continue; continue;

View File

@@ -268,7 +268,6 @@ ACMD(do_action);
ACMD(do_gmote); ACMD(do_gmote);
/***************************************************************************** /*****************************************************************************
* Begin Functions and defines for act.wizard.c * Begin Functions and defines for act.wizard.c
****************************************************************************/ ****************************************************************************/
@@ -327,7 +326,7 @@ ACMD(do_plist);
ACMD(do_purge); ACMD(do_purge);
ACMD(do_recent); ACMD(do_recent);
ACMD(do_restore); ACMD(do_restore);
void return_to_char(struct char_data * ch); void return_to_char(struct char_data *ch);
ACMD(do_return); ACMD(do_return);
ACMD(do_saveall); ACMD(do_saveall);
ACMD(do_send); ACMD(do_send);

View File

@@ -77,8 +77,8 @@ static void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mod
found++; found++;
} }
if (found) { if (found) {
send_to_char(ch, "You are %s upon %s.", GET_POS(ch) == POS_SITTING ? "sitting" : send_to_char(ch, "You are %s upon %s.", GET_POS(ch) == POS_SITTING ? "sitting" : "resting",
"resting", obj->short_description); obj->short_description);
goto end; goto end;
} }
} }
@@ -147,7 +147,7 @@ static void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mod
* call with the incorrect mode and change it to an acceptable mode. */ * call with the incorrect mode and change it to an acceptable mode. */
return; return;
} }
end: end:
show_obj_modifiers(obj, ch); show_obj_modifiers(obj, ch);
send_to_char(ch, "\r\n"); send_to_char(ch, "\r\n");
@@ -221,18 +221,19 @@ 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) static void diag_char_to_char(struct char_data *i, struct char_data *ch)
{ {
struct { struct
{
byte percent; byte percent;
const char *text; const char *text;
} diagnosis[] = { } diagnosis[] = {
{ 100, "is in excellent condition." }, {100, "is in excellent condition."},
{ 90, "has a few scratches." }, {90, "has a few scratches."},
{ 75, "has some small wounds and bruises." }, {75, "has some small wounds and bruises."},
{ 50, "has quite a few wounds." }, {50, "has quite a few wounds."},
{ 30, "has some big nasty wounds and scratches." }, {30, "has some big nasty wounds and scratches."},
{ 15, "looks pretty hurt." }, {15, "looks pretty hurt."},
{ 0, "is in awful condition." }, {0, "is in awful condition."},
{ -1, "is bleeding awfully from big wounds." }, {-1, "is bleeding awfully from big wounds."},
}; };
int percent, ar_index; int percent, ar_index;
const char *pers = PERS(i, ch); const char *pers = PERS(i, ch);
@@ -360,11 +361,11 @@ static void list_one_char(struct char_data *i, struct char_data *ch)
if (GET_POS(i) != POS_FIGHTING) { if (GET_POS(i) != POS_FIGHTING) {
if (!SITTING(i)) if (!SITTING(i))
send_to_char(ch, "%s", positions[(int) GET_POS(i)]); send_to_char(ch, "%s", positions[(int)GET_POS(i)]);
else { else {
furniture = SITTING(i); furniture = SITTING(i);
send_to_char(ch, " is %s upon %s.", (GET_POS(i) == POS_SLEEPING ? send_to_char(ch, " is %s upon %s.",
"sleeping" : (GET_POS(i) == POS_RESTING ? "resting" : "sitting")), (GET_POS(i) == POS_SLEEPING ? "sleeping" : (GET_POS(i) == POS_RESTING ? "resting" : "sitting")),
OBJS(furniture, ch)); OBJS(furniture, ch));
} }
} else { } 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)) if (EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) && !PRF_FLAGGED(ch, PRF_HOLYLIGHT))
continue; continue;
if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) 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)) 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)); send_to_char(ch, "%s%s%s ", CCWHT(ch, C_NRM), autoexits[door], CCCYN(ch, C_NRM));
else else
@@ -443,16 +445,14 @@ ACMD(do_exits)
{ {
int door, len = 0; 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"); send_to_char(ch, "You can't see a damned thing, you're blind!\r\n");
return; return;
} }
send_to_char(ch, "Obvious exits:\r\n"); 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) if (!EXIT(ch, door) || EXIT(ch, door)->to_room == NOWHERE)
continue; continue;
if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) && !CONFIG_DISP_CLOSED_DOORS) if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) && !CONFIG_DISP_CLOSED_DOORS)
@@ -462,22 +462,19 @@ ACMD(do_exits)
len++; 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), 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); 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 */ /*But we tell them the door is closed */
send_to_char(ch, "%-5s - The %s is closed%s\r\n", dirs[door], 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(ch, door)->keyword) ? fname(EXIT(ch, door)->keyword) : "opening",
EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) ? " and hidden." : "."); 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) && 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) if (!len)
@@ -486,7 +483,7 @@ ACMD(do_exits)
void look_at_room(struct char_data *ch, int ignore_brief) void look_at_room(struct char_data *ch, int ignore_brief)
{ {
trig_data * t; trig_data *t;
struct room_data *rm = &world[IN_ROOM(ch)]; struct room_data *rm = &world[IN_ROOM(ch)];
room_vnum target_room; room_vnum target_room;
@@ -495,11 +492,10 @@ void look_at_room(struct char_data *ch, int ignore_brief)
if (!ch->desc) if (!ch->desc)
return; return;
if (IS_DARK(IN_ROOM(ch)) && !CAN_SEE_IN_DARK(ch)){ if (IS_DARK(IN_ROOM(ch)) && !CAN_SEE_IN_DARK(ch)) {
send_to_char(ch, "It is pitch black...\r\n"); send_to_char(ch, "It is pitch black...\r\n");
return; 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"); send_to_char(ch, "You see nothing but infinite darkness...\r\n");
return; 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, " %d", GET_TRIG_VNUM(t));
send_to_char(ch, "]"); send_to_char(ch, "]");
} }
} } else
else
send_to_char(ch, "%s", world[IN_ROOM(ch)].name); send_to_char(ch, "%s", world[IN_ROOM(ch)].name);
send_to_char(ch, "%s\r\n", CCNRM(ch, C_NRM)); 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)) if ((GET_OBJ_VAL(obj, 1) == 0) && (GET_OBJ_VAL(obj, 0) != -1))
send_to_char(ch, "It is empty.\r\n"); send_to_char(ch, "It is empty.\r\n");
else { else {
if (GET_OBJ_VAL(obj, 0) < 0) if (GET_OBJ_VAL(obj, 0) < 0) {
{
char buf2[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH];
sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2)); 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); 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 */ send_to_char(ch, "Its contents seem somewhat murky.\r\n"); /* BUG */
else else {
{
char buf2[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH];
amt = (GET_OBJ_VAL(obj, 1) * 3) / GET_OBJ_VAL(obj, 0); amt = (GET_OBJ_VAL(obj, 1) * 3) / GET_OBJ_VAL(obj, 0);
sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2)); sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2));
@@ -837,8 +829,7 @@ ACMD(do_score)
GET_NUM_QUESTS(ch) == 1 ? "" : "s"); GET_NUM_QUESTS(ch) == 1 ? "" : "s");
if (GET_QUEST(ch) == NOTHING) if (GET_QUEST(ch) == NOTHING)
send_to_char(ch, "and you are not on a quest at the moment.\r\n"); 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)))); 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)) if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS))
@@ -1020,19 +1011,18 @@ ACMD(do_weather)
"lit by flashes of lightning" "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], 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" : weather_info.change >= 0
"your foot tells you bad weather is due"); ? "you feel a warm wind from south"
: "your foot tells you bad weather is due");
if (GET_LEVEL(ch) >= LVL_GOD) if (GET_LEVEL(ch) >= LVL_GOD)
send_to_char(ch, "Pressure: %d (change: %d), Sky: %d (%s)\r\n", send_to_char(ch, "Pressure: %d (change: %d), Sky: %d (%s)\r\n",
weather_info.pressure, weather_info.pressure,
weather_info.change, weather_info.change,
weather_info.sky, weather_info.sky,
sky_look[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"); 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; break;
return (mid); return (mid);
} } else if (chk > 0)
else if (chk > 0)
bot = mid + 1; bot = mid + 1;
else else
top = mid - 1; top = mid - 1;
@@ -1136,15 +1125,19 @@ ACMD(do_who)
int showclass = 0, short_list = 0, outlaws = 0; int showclass = 0, short_list = 0, outlaws = 0;
int who_room = 0, showgroup = 0, showleader = 0; int who_room = 0, showgroup = 0, showleader = 0;
struct { struct
{
char *disp; char *disp;
int min_level; int min_level;
int max_level; int max_level;
int count; /* must always start as 0 */ int count; /* must always start as 0 */
} rank[] = { } rank[] = {
{ "Immortals\r\n---------\r\n", LVL_IMMORT, LVL_IMPL, 0}, {
{ "Mortals\r\n-------\r\n", 1, LVL_IMMORT - 1, 0 }, "Immortals\r\n---------\r\n", LVL_IMMORT, LVL_IMPL, 0},
{ "\n", 0, 0, 0 } {
"Mortals\r\n-------\r\n", 1, LVL_IMMORT - 1, 0},
{
"\n", 0, 0, 0}
}; };
skip_spaces(&argument); skip_spaces(&argument);
@@ -1361,7 +1354,7 @@ ACMD(do_who)
else else
send_to_char(ch, "%d characters displayed.\r\n", num_can_see); send_to_char(ch, "%d characters displayed.\r\n", num_can_see);
if (IS_HAPPYHOUR > 0){ if (IS_HAPPYHOUR > 0) {
send_to_char(ch, "It's a Happy Hour! Type \tRhappyhour\tW to see the current bonuses.\r\n"); send_to_char(ch, "It's a Happy Hour! Type \tRhappyhour\tW to see the current bonuses.\r\n");
} }
} }
@@ -1486,9 +1479,11 @@ ACMD(do_users)
strcpy(idletime, " "); strcpy(idletime, " ");
sprintf(line, "%3d %-7s %-12s %-14s %-3s %-8s ", d->desc_num, classname, sprintf(line, "%3d %-7s %-12s %-14s %-3s %-8s ", d->desc_num, classname,
d->original && d->original->player.name ? d->original->player.name : d->original && d->original->player.name
d->character && d->character->player.name ? d->character->player.name : ? d->original->player.name
"UNDEFINED", : d->character && d->character->player.name
? d->character->player.name
: "UNDEFINED",
state, idletime, timestr); state, idletime, timestr);
if (*d->host) if (*d->host)
@@ -1653,7 +1648,7 @@ static void perform_immort_where(struct char_data *ch, char *arg)
else else
send_to_char(ch, "%-8s%s %s[%s%5d%s]%s %-*s%s %s%s\r\n", GET_NAME(i), QNRM, send_to_char(ch, "%-8s%s %s[%s%5d%s]%s %-*s%s %s%s\r\n", GET_NAME(i), QNRM,
QCYN, QYEL, GET_ROOM_VNUM(IN_ROOM(i)), QCYN, QNRM, QCYN, QYEL, GET_ROOM_VNUM(IN_ROOM(i)), QCYN, QNRM,
30+count_color_chars(world[IN_ROOM(i)].name), world[IN_ROOM(i)].name, QNRM, 30 + count_color_chars(world[IN_ROOM(i)].name), world[IN_ROOM(i)].name, QNRM,
zone_table[(world[IN_ROOM(i)].zone)].name, QNRM); zone_table[(world[IN_ROOM(i)].zone)].name, QNRM);
} }
} }
@@ -1697,7 +1692,7 @@ ACMD(do_levels)
{ {
char buf[MAX_STRING_LENGTH], arg[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH], arg[MAX_STRING_LENGTH];
size_t len = 0, nlen; size_t len = 0, nlen;
int i, ret, min_lev=1, max_lev=LVL_IMMORT, val; int i, ret, min_lev = 1, max_lev = LVL_IMMORT, val;
if (IS_NPC(ch)) { if (IS_NPC(ch)) {
send_to_char(ch, "You ain't nothin' but a hound-dog.\r\n"); send_to_char(ch, "You ain't nothin' but a hound-dog.\r\n");
@@ -1712,24 +1707,20 @@ ACMD(do_levels)
/* No valid args found */ /* No valid args found */
min_lev = 1; min_lev = 1;
max_lev = LVL_IMMORT; max_lev = LVL_IMMORT;
} } else if (ret == 1) {
else if (ret == 1) {
/* One arg = range is (num) either side of current level */ /* One arg = range is (num) either side of current level */
val = min_lev; val = min_lev;
max_lev = MIN(GET_LEVEL(ch) + val, LVL_IMMORT); max_lev = MIN(GET_LEVEL(ch) + val, LVL_IMMORT);
min_lev = MAX(GET_LEVEL(ch) - val, 1); 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 */ /* Two args = min-max range limit - just do sanity checks */
min_lev = MAX(min_lev, 1); min_lev = MAX(min_lev, 1);
max_lev = MIN(max_lev + 1, LVL_IMMORT); 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, "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, "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)); send_to_char(ch, "%slevels %s- shows all levels (1-%d)\r\n", QCYN, QNRM, (LVL_IMMORT - 1));
send_to_char(ch, "%slevels 5 %s- shows 5 levels either side of your current level\r\n", QCYN, QNRM); send_to_char(ch, "%slevels 5 %s- shows 5 levels either side of your current level\r\n", QCYN, QNRM);
send_to_char(ch, "%slevels 10-40 %s- shows level 10 to level 40\r\n",QCYN, QNRM); send_to_char(ch, "%slevels 10-40 %s- shows level 10 to level 40\r\n",QCYN, QNRM);
return; return;
@@ -1836,108 +1827,179 @@ ACMD(do_toggle)
{ {
char buf2[4], arg[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH]; char buf2[4], arg[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
int toggle, tp, wimp_lev, result = 0, len = 0, i; int toggle, tp, wimp_lev, result = 0, len = 0, i;
const char *types[] = { "off", "brief", "normal", "on", "\n" }; const char *types[] = {"off", "brief", "normal", "on", "\n"};
const struct { const struct
{
char *command; char *command;
bitvector_t toggle; /* this needs changing once hashmaps are implemented */ bitvector_t toggle; /* this needs changing once hashmaps are implemented */
char min_level; char min_level;
char *disable_msg; char *disable_msg;
char *enable_msg; char *enable_msg;
} tog_messages[] = { } tog_messages[] = {
{"summonable", PRF_SUMMONABLE, 0, {
"summonable", PRF_SUMMONABLE, 0,
"You are now safe from summoning by other players.\r\n", "You are now safe from summoning by other players.\r\n",
"You may now be summoned by other players.\r\n"}, "You may now be summoned by other players.\r\n"
{"nohassle", PRF_NOHASSLE, LVL_IMMORT, },
{
"nohassle", PRF_NOHASSLE, LVL_IMMORT,
"Nohassle disabled.\r\n", "Nohassle disabled.\r\n",
"Nohassle enabled.\r\n"}, "Nohassle enabled.\r\n"
{"brief", PRF_BRIEF, 0, },
{
"brief", PRF_BRIEF, 0,
"Brief mode off.\r\n", "Brief mode off.\r\n",
"Brief mode on.\r\n"}, "Brief mode on.\r\n"
{"compact", PRF_COMPACT, 0, },
{
"compact", PRF_COMPACT, 0,
"Compact mode off.\r\n", "Compact mode off.\r\n",
"Compact mode on.\r\n"}, "Compact mode on.\r\n"
{"notell", PRF_NOTELL, 0, },
{
"notell", PRF_NOTELL, 0,
"You can now hear tells.\r\n", "You can now hear tells.\r\n",
"You are now deaf to tells.\r\n"}, "You are now deaf to tells.\r\n"
{"noauction", PRF_NOAUCT, 0, },
{
"noauction", PRF_NOAUCT, 0,
"You can now hear auctions.\r\n", "You can now hear auctions.\r\n",
"You are now deaf to auctions.\r\n"}, "You are now deaf to auctions.\r\n"
{"noshout", PRF_NOSHOUT, 0, },
{
"noshout", PRF_NOSHOUT, 0,
"You can now hear shouts.\r\n", "You can now hear shouts.\r\n",
"You are now deaf to shouts.\r\n"}, "You are now deaf to shouts.\r\n"
{"nogossip", PRF_NOGOSS, 0, },
{
"nogossip", PRF_NOGOSS, 0,
"You can now hear gossip.\r\n", "You can now hear gossip.\r\n",
"You are now deaf to gossip.\r\n"}, "You are now deaf to gossip.\r\n"
{"nograts", PRF_NOGRATZ, 0, },
{
"nograts", PRF_NOGRATZ, 0,
"You can now hear gratz.\r\n", "You can now hear gratz.\r\n",
"You are now deaf to gratz.\r\n"}, "You are now deaf to gratz.\r\n"
{"nowiz", PRF_NOWIZ, LVL_IMMORT, },
{
"nowiz", PRF_NOWIZ, LVL_IMMORT,
"You can now hear the Wiz-channel.\r\n", "You can now hear the Wiz-channel.\r\n",
"You are now deaf to the Wiz-channel.\r\n"}, "You are now deaf to the Wiz-channel.\r\n"
{"quest", PRF_QUEST, 0, },
{
"quest", PRF_QUEST, 0,
"You are no longer part of the Quest.\r\n", "You are no longer part of the Quest.\r\n",
"Okay, you are part of the Quest.\r\n"}, "Okay, you are part of the Quest.\r\n"
{"showvnums", PRF_SHOWVNUMS, LVL_IMMORT, },
{
"showvnums", PRF_SHOWVNUMS, LVL_IMMORT,
"You will no longer see the vnums.\r\n", "You will no longer see the vnums.\r\n",
"You will now see the vnums.\r\n"}, "You will now see the vnums.\r\n"
{"norepeat", PRF_NOREPEAT, 0, },
{
"norepeat", PRF_NOREPEAT, 0,
"You will now have your communication repeated.\r\n", "You will now have your communication repeated.\r\n",
"You will no longer have your communication repeated.\r\n"}, "You will no longer have your communication repeated.\r\n"
{"holylight", PRF_HOLYLIGHT, LVL_IMMORT, },
{
"holylight", PRF_HOLYLIGHT, LVL_IMMORT,
"HolyLight mode off.\r\n", "HolyLight mode off.\r\n",
"HolyLight mode on.\r\n"}, "HolyLight mode on.\r\n"
{"slownameserver", 0, LVL_IMPL, },
{
"slownameserver", 0, LVL_IMPL,
"Nameserver_is_slow changed to OFF; IP addresses will now be resolved.\r\n", "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"}, "Nameserver_is_slow changed to ON; sitenames will no longer be resolved.\r\n"
{"autoexits", PRF_AUTOEXIT, 0, },
{
"autoexits", PRF_AUTOEXIT, 0,
"Autoexits disabled.\r\n", "Autoexits disabled.\r\n",
"Autoexits enabled.\r\n"}, "Autoexits enabled.\r\n"
{"trackthru", 0, LVL_IMPL, },
{
"trackthru", 0, LVL_IMPL,
"Players can no longer track through doors.\r\n", "Players can no longer track through doors.\r\n",
"Players can now track through doors.\r\n"}, "Players can now track through doors.\r\n"
{"clsolc", PRF_CLS, LVL_BUILDER, },
{
"clsolc", PRF_CLS, LVL_BUILDER,
"You will no longer clear screen in OLC.\r\n", "You will no longer clear screen in OLC.\r\n",
"You will now clear screen in OLC.\r\n"}, "You will now clear screen in OLC.\r\n"
{"buildwalk", PRF_BUILDWALK, LVL_BUILDER, },
{
"buildwalk", PRF_BUILDWALK, LVL_BUILDER,
"Buildwalk is now Off.\r\n", "Buildwalk is now Off.\r\n",
"Buildwalk is now On.\r\n"}, "Buildwalk is now On.\r\n"
{"afk", PRF_AFK, 0, },
{
"afk", PRF_AFK, 0,
"AFK is now Off.\r\n", "AFK is now Off.\r\n",
"AFK is now On.\r\n"}, "AFK is now On.\r\n"
{"autoloot", PRF_AUTOLOOT, 0, },
{
"autoloot", PRF_AUTOLOOT, 0,
"Autoloot disabled.\r\n", "Autoloot disabled.\r\n",
"Autoloot enabled.\r\n"}, "Autoloot enabled.\r\n"
{"autogold", PRF_AUTOGOLD, 0, },
{
"autogold", PRF_AUTOGOLD, 0,
"Autogold disabled.\r\n", "Autogold disabled.\r\n",
"Autogold enabled.\r\n"}, "Autogold enabled.\r\n"
{"autosplit", PRF_AUTOSPLIT, 0, },
{
"autosplit", PRF_AUTOSPLIT, 0,
"Autosplit disabled.\r\n", "Autosplit disabled.\r\n",
"Autosplit enabled.\r\n"}, "Autosplit enabled.\r\n"
{"autosac", PRF_AUTOSAC, 0, },
{
"autosac", PRF_AUTOSAC, 0,
"Autosac disabled.\r\n", "Autosac disabled.\r\n",
"Autosac enabled.\r\n"}, "Autosac enabled.\r\n"
{"autoassist", PRF_AUTOASSIST, 0, },
{
"autoassist", PRF_AUTOASSIST, 0,
"Autoassist disabled.\r\n", "Autoassist disabled.\r\n",
"Autoassist enabled.\r\n"}, "Autoassist enabled.\r\n"
{"automap", PRF_AUTOMAP, 1, },
{
"automap", PRF_AUTOMAP, 1,
"You will no longer see the mini-map.\r\n", "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"}, "You will now see a mini-map at the side of room descriptions.\r\n"
{"autokey", PRF_AUTOKEY, 0, },
{
"autokey", PRF_AUTOKEY, 0,
"You will now have to unlock doors manually before opening.\r\n", "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"}, "You will now automatically unlock doors when opening them (if you have the key).\r\n"
{"autodoor", PRF_AUTODOOR, 0, },
{
"autodoor", PRF_AUTODOOR, 0,
"You will now need to specify a door direction when opening, closing and unlocking.\r\n", "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"}, "You will now find the next available door when opening, closing or unlocking.\r\n"
{"zoneresets", PRF_ZONERESETS, LVL_IMPL, },
{
"zoneresets", PRF_ZONERESETS, LVL_IMPL,
"You will no longer see zone resets.\r\n", "You will no longer see zone resets.\r\n",
"You will now 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"}, "syslog", 0, LVL_IMMORT, "\n", "\n"
{"screenwidth", 0, 0, "\n", "\n"}, },
{"color", 0, 0, "\n", "\n"}, {
{"\n", 0, -1, "\n", "\n"} /* must be last */ "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)) 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_1);
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2);
if (tp & 1) SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1); if (tp & 1)
if (tp & 2) SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2); 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]); send_to_char(ch, "Your %scolor%s is now %s.\r\n", CCRED(ch, C_SPR), CCNRM(ch, C_OFF), types[tp]);
return; return;
@@ -2102,8 +2166,10 @@ ACMD(do_toggle)
} }
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG1); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG2); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
if (tp & 1) SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG1); if (tp & 1)
if (tp & 2) SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG2); 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]); send_to_char(ch, "Your syslog is now %s.\r\n", types[tp]);
return; return;
@@ -2120,11 +2186,11 @@ ACMD(do_toggle)
} }
result = PRF_TOG_CHK(ch, PRF_BUILDWALK); result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
if (PRF_FLAGGED(ch, PRF_BUILDWALK)) { if (PRF_FLAGGED(ch, PRF_BUILDWALK)) {
for (i=0; *arg2 && *(sector_types[i]) != '\n'; i++) for (i = 0; *arg2 && *(sector_types[i]) != '\n'; i++)
if (is_abbrev(arg2, sector_types[i])) if (is_abbrev(arg2, sector_types[i]))
break; break;
if (*(sector_types[i]) == '\n') if (*(sector_types[i]) == '\n')
i=0; i = 0;
GET_BUILDWALK_SECTOR(ch) = i; GET_BUILDWALK_SECTOR(ch) = i;
send_to_char(ch, "Default sector type is %s\r\n", sector_types[i]); send_to_char(ch, "Default sector type is %s\r\n", sector_types[i]);
mudlog(CMP, GET_LEVEL(ch), TRUE, mudlog(CMP, GET_LEVEL(ch), TRUE,
@@ -2308,7 +2374,7 @@ ACMD(do_history)
struct txt_block *tmp; struct txt_block *tmp;
for (tmp = GET_HISTORY(ch, type); tmp; tmp = tmp->next) for (tmp = GET_HISTORY(ch, type); tmp; tmp = tmp->next)
send_to_char(ch, "%s", tmp->text); send_to_char(ch, "%s", tmp->text);
/* Make this a 1 if you want history to clear after viewing */ /* Make this a 1 if you want history to clear after viewing */
#if 0 #if 0
free_history(ch, type); free_history(ch, type);
#endif #endif
@@ -2317,6 +2383,7 @@ ACMD(do_history)
} }
#define HIST_LENGTH 100 #define HIST_LENGTH 100
void add_history(struct char_data *ch, char *str, int type) void add_history(struct char_data *ch, char *str, int type)
{ {
int i = 0; int i = 0;
@@ -2336,8 +2403,7 @@ void add_history(struct char_data *ch, char *str, int type)
if (!tmp) { if (!tmp) {
CREATE(GET_HISTORY(ch, type), struct txt_block, 1); CREATE(GET_HISTORY(ch, type), struct txt_block, 1);
GET_HISTORY(ch, type)->text = strdup(buf); GET_HISTORY(ch, type)->text = strdup(buf);
} } else {
else {
while (tmp->next) while (tmp->next)
tmp = tmp->next; tmp = tmp->next;
CREATE(tmp->next, struct txt_block, 1); CREATE(tmp->next, struct txt_block, 1);
@@ -2372,8 +2438,7 @@ ACMD(do_whois)
return; 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); CREATE(victim, struct char_data, 1);
clear_char(victim); clear_char(victim);
@@ -2384,8 +2449,8 @@ ACMD(do_whois)
if (load_char(buf, victim) > -1) if (load_char(buf, victim) > -1)
got_from_file = 1; got_from_file = 1;
else { else {
send_to_char (ch, "There is no such player.\r\n"); send_to_char(ch, "There is no such player.\r\n");
free_char (victim); free_char(victim);
return; return;
} }
} }
@@ -2395,7 +2460,7 @@ ACMD(do_whois)
send_to_char(ch, "Name: %s %s\r\nSex: %s\r\n", GET_NAME(victim), send_to_char(ch, "Name: %s %s\r\nSex: %s\r\n", GET_NAME(victim),
(victim->player.title ? victim->player.title : ""), buf); (victim->player.title ? victim->player.title : ""), buf);
sprinttype (victim->player.chclass, pc_class_types, buf, sizeof(buf)); sprinttype(victim->player.chclass, pc_class_types, buf, sizeof(buf));
send_to_char(ch, "Class: %s\r\n", buf); send_to_char(ch, "Class: %s\r\n", buf);
send_to_char(ch, "Level: %d\r\n", GET_LEVEL(victim)); send_to_char(ch, "Level: %d\r\n", GET_LEVEL(victim));
@@ -2415,13 +2480,13 @@ ACMD(do_whois)
send_to_char(ch, "\r\n"); send_to_char(ch, "\r\n");
if (PRF_FLAGGED(victim, PRF_AFK)) 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)); 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) } else if (hours > 0)
send_to_char(ch, "Last Logon: %s (%d days & %d hours ago.)\r\n", buf, hours/24, hours%24); send_to_char(ch, "Last Logon: %s (%d days & %d hours ago.)\r\n", buf, hours / 24, hours % 24);
else else
send_to_char(ch, "Last Logon: %s (0 hours & %d minutes ago.)\r\n", send_to_char(ch, "Last Logon: %s (0 hours & %d minutes ago.)\r\n",
buf, (int)(time(0) - victim->player.time.logon)/60); buf, (int)(time(0) - victim->player.time.logon) / 60);
} }
if (has_mail(GET_IDNUM(victim))) if (has_mail(GET_IDNUM(victim)))
@@ -2430,12 +2495,17 @@ ACMD(do_whois)
act("$E$u has no mail waiting.", FALSE, ch, 0, victim, TO_CHAR); act("$E$u has no mail waiting.", FALSE, ch, 0, victim, TO_CHAR);
if (PLR_FLAGGED(victim, PLR_DELETED)) if (PLR_FLAGGED(victim, PLR_DELETED))
send_to_char (ch, "***DELETED***\r\n"); send_to_char(ch, "***DELETED***\r\n");
if (!got_from_file && victim->desc != NULL && GET_LEVEL(ch) >= LVL_GOD) { if (!got_from_file && victim->desc != NULL && GET_LEVEL(ch) >= LVL_GOD) {
protocol_t * prot = victim->desc->pProtocol; 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, "Client: %s [%s]\r\n", prot->pVariables[eMSDP_CLIENT_ID]->pValueString,
send_to_char(ch, "Color: %s\r\n", prot->pVariables[eMSDP_XTERM_256_COLORS]->ValueInt ? "Xterm" : (prot->pVariables[eMSDP_ANSI_COLORS]->ValueInt ? "Ansi" : "None")); 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, "MXP: %s\r\n", prot->bMXP ? "Yes" : "No");
send_to_char(ch, "Charset: %s\r\n", prot->bCHARSET ? "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"); send_to_char(ch, "MSP: %s\r\n", prot->bMSP ? "Yes" : "No");
@@ -2444,7 +2514,7 @@ ACMD(do_whois)
} }
if (got_from_file) if (got_from_file)
free_char (victim); free_char(victim);
} }
static bool get_zone_levels(zone_rnum znum, char *buf) static bool get_zone_levels(zone_rnum znum, char *buf)
@@ -2471,7 +2541,7 @@ static bool get_zone_levels(zone_rnum znum, char *buf)
ACMD(do_areas) ACMD(do_areas)
{ {
int i, hilev=-1, lolev=-1, zcount=0, lev_set, len=0, tmp_len=0; int i, hilev = -1, lolev = -1, zcount = 0, lev_set, len = 0, tmp_len = 0;
char arg[MAX_INPUT_LENGTH], *second, lev_str[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH]; char arg[MAX_INPUT_LENGTH], *second, lev_str[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH];
bool show_zone = FALSE, overlap = FALSE, overlap_shown = FALSE; bool show_zone = FALSE, overlap = FALSE, overlap_shown = FALSE;
@@ -2488,10 +2558,10 @@ ACMD(do_areas)
lolev = atoi(arg); lolev = atoi(arg);
/* Check for 2nd value */ /* Check for 2nd value */
if (*(second+1) == '\0' || !isdigit(*(second+1)) ) if (*(second + 1) == '\0' || !isdigit(*(second+1)))
hilev = 100; hilev = 100;
else else
hilev = atoi(second+1); hilev = atoi(second + 1);
} else { } else {
/* No range - single number */ /* No range - single number */
@@ -2526,7 +2596,8 @@ ACMD(do_areas)
} else if ((hilev != -1) && (lolev >= ZONE_MINLVL(i)) && (hilev <= ZONE_MAXLVL(i))) { } else if ((hilev != -1) && (lolev >= ZONE_MINLVL(i)) && (hilev <= ZONE_MAXLVL(i))) {
/* Range supplied, it's completely within this zone's range (no overlap) */ /* Range supplied, it's completely within this zone's range (no overlap) */
show_zone = TRUE; 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 */ /* Range supplied, it overlaps this zone's range */
show_zone = TRUE; show_zone = TRUE;
overlap = TRUE; overlap = TRUE;
@@ -2541,19 +2612,23 @@ ACMD(do_areas)
} }
if (show_zone) { if (show_zone) {
if (overlap) overlap_shown = TRUE; if (overlap)
overlap_shown = TRUE;
lev_set = get_zone_levels(i, lev_str); 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,
count_color_chars(zone_table[i].name)+30, zone_table[i].name, 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"); lev_set ? "\tc" : "\tn", lev_set ? lev_str : "All Levels");
len += tmp_len; 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; len += tmp_len;
if (overlap_shown) { 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) if (zcount == 0)
@@ -2562,8 +2637,8 @@ ACMD(do_areas)
page_string(ch->desc, buf, TRUE); page_string(ch->desc, buf, TRUE);
} }
static void list_scanned_chars(struct char_data * list, struct char_data * ch, int static void list_scanned_chars(struct char_data *list, struct char_data *ch, int
distance, int door) distance, int door)
{ {
char buf[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH - 1]; char buf[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH - 1];
@@ -2577,12 +2652,12 @@ distance, int door)
int count = 0; int count = 0;
*buf = '\0'; *buf = '\0';
/* this loop is a quick, easy way to help make a grammatical sentence /* this loop is a quick, easy way to help make a grammatical sentence
(i.e., "You see x, x, y, and z." with commas, "and", etc.) */ (i.e., "You see x, x, y, and z." with commas, "and", etc.) */
for (i = list; i; i = i->next_in_room) for (i = list; i; i = i->next_in_room)
/* put any other conditions for scanning someone in this if statement - /* put any other conditions for scanning someone in this if statement -
i.e., if (CAN_SEE(ch, i) && condition2 && condition3) or whatever */ i.e., if (CAN_SEE(ch, i) && condition2 && condition3) or whatever */
if (CAN_SEE(ch, i)) if (CAN_SEE(ch, i))
@@ -2593,7 +2668,7 @@ distance, int door)
for (i = list; i; i = i->next_in_room) { for (i = list; i; i = i->next_in_room) {
/* make sure to add changes to the if statement above to this one also, using /* make sure to add changes to the if statement above to this one also, using
or's to join them.. i.e., or's to join them.. i.e.,
if (!CAN_SEE(ch, i) || !condition2 || !condition3) */ if (!CAN_SEE(ch, i) || !condition2 || !condition3) */
@@ -2619,7 +2694,7 @@ distance, int door)
ACMD(do_scan) ACMD(do_scan)
{ {
int door; int door;
bool found=FALSE; bool found = FALSE;
int range; int range;
int maxrange = 3; int maxrange = 3;
@@ -2632,7 +2707,7 @@ ACMD(do_scan)
} }
for (door = 0; door < DIR_COUNT; door++) { for (door = 0; door < DIR_COUNT; door++) {
for (range = 1; range<= maxrange; range++) { for (range = 1; range <= maxrange; range++) {
if (world[scanned_room].dir_option[door] && world[scanned_room].dir_option[door]->to_room != NOWHERE && if (world[scanned_room].dir_option[door] && world[scanned_room].dir_option[door]->to_room != NOWHERE &&
!IS_SET(world[scanned_room].dir_option[door]->exit_info, EX_CLOSED) && !IS_SET(world[scanned_room].dir_option[door]->exit_info, EX_CLOSED) &&
!IS_SET(world[scanned_room].dir_option[door]->exit_info, EX_HIDDEN)) { !IS_SET(world[scanned_room].dir_option[door]->exit_info, EX_HIDDEN)) {
@@ -2642,11 +2717,11 @@ ACMD(do_scan)
send_to_char(ch, "%s: It's too dark to see, but you can hear shuffling.\r\n", dirs[door]); send_to_char(ch, "%s: It's too dark to see, but you can hear shuffling.\r\n", dirs[door]);
else else
send_to_char(ch, "%s: It is too dark to see anything.\r\n", dirs[door]); send_to_char(ch, "%s: It is too dark to see anything.\r\n", dirs[door]);
found=TRUE; found = TRUE;
} else { } else {
if (world[scanned_room].people) { if (world[scanned_room].people) {
list_scanned_chars(world[scanned_room].people, ch, range - 1, door); list_scanned_chars(world[scanned_room].people, ch, range - 1, door);
found=TRUE; found = TRUE;
} }
} }
} // end of if } // end of if

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 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) static void perform_put(struct char_data *ch, struct obj_data *obj, struct obj_data *cont)
{ {
long object_id = obj_script_id(obj); 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"); send_to_char(ch, "You'd better open it first!\r\n");
else { else {
if (obj_dotmode == FIND_INDIV) { /* put <obj> <container> */ 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); send_to_char(ch, "You aren't carrying %s %s.\r\n", AN(theobj), theobj);
else if (obj == cont && howmany == 1) else if (obj == cont && howmany == 1)
send_to_char(ch, "You attempt to fold it into itself, but fail.\r\n"); send_to_char(ch, "You attempt to fold it into itself, but fail.\r\n");
@@ -162,12 +160,12 @@ ACMD(do_put)
static int can_take_obj(struct char_data *ch, struct obj_data *obj) static int can_take_obj(struct char_data *ch, struct obj_data *obj)
{ {
if (!(CAN_WEAR(obj, ITEM_WEAR_TAKE))) { if (!(CAN_WEAR(obj, ITEM_WEAR_TAKE))) {
act("$p: you can't take that!", FALSE, ch, obj, 0, TO_CHAR); act("$p: you can't take that!", FALSE, ch, obj, 0, TO_CHAR);
return (0); return (0);
} }
if (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)) { if (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)) {
if (IS_CARRYING_N(ch) >= CAN_CARRY_N(ch)) { if (IS_CARRYING_N(ch) >= CAN_CARRY_N(ch)) {
act("$p: you can't carry that many items.", FALSE, ch, obj, 0, TO_CHAR); act("$p: you can't carry that many items.", FALSE, ch, obj, 0, TO_CHAR);
return (0); return (0);
@@ -175,9 +173,9 @@ if (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)) {
act("$p: you can't carry that much weight.", FALSE, ch, obj, 0, TO_CHAR); act("$p: you can't carry that much weight.", FALSE, ch, obj, 0, TO_CHAR);
return (0); return (0);
} }
} }
if (OBJ_SAT_IN_BY(obj)){ if (OBJ_SAT_IN_BY(obj)) {
act("It appears someone is sitting on $p..", FALSE, ch, obj, 0, TO_CHAR); act("It appears someone is sitting on $p..", FALSE, ch, obj, 0, TO_CHAR);
return (0); return (0);
} }
@@ -298,7 +296,7 @@ static void get_from_room(struct char_data *ch, char *arg, int howmany)
send_to_char(ch, "You don't see %s %s here.\r\n", AN(arg), arg); send_to_char(ch, "You don't see %s %s here.\r\n", AN(arg), arg);
} else { } else {
struct obj_data *obj_next; struct obj_data *obj_next;
while(obj && howmany--) { while (obj && howmany--) {
obj_next = obj->next_content; obj_next = obj->next_content;
perform_get_from_room(ch, obj); perform_get_from_room(ch, obj);
obj = get_obj_in_list_vis(ch, arg, NULL, obj_next); obj = get_obj_in_list_vis(ch, arg, NULL, obj_next);
@@ -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) ? \ #define VANISH(mode) ((mode == SCMD_DONATE || mode == SCMD_JUNK) ? \
" It vanishes in a puff of smoke!" : "") " It vanishes in a puff of smoke!" : "")
static int perform_drop(struct char_data *ch, struct obj_data *obj, static int perform_drop(struct char_data *ch, struct obj_data *obj,
byte mode, const char *sname, room_rnum RDR) byte mode, const char *sname, room_rnum RDR)
{ {
@@ -524,7 +523,7 @@ ACMD(do_drop)
/* fail + double chance for room 1 */ /* fail + double chance for room 1 */
num_don_rooms = (CONFIG_DON_ROOM_1 != NOWHERE) * 2 + num_don_rooms = (CONFIG_DON_ROOM_1 != NOWHERE) * 2 +
(CONFIG_DON_ROOM_2 != NOWHERE) + (CONFIG_DON_ROOM_2 != NOWHERE) +
(CONFIG_DON_ROOM_3 != NOWHERE) + 1 ; (CONFIG_DON_ROOM_3 != NOWHERE) + 1;
switch (rand_number(0, num_don_rooms)) { switch (rand_number(0, num_don_rooms)) {
case 0: case 0:
mode = SCMD_JUNK; mode = SCMD_JUNK;
@@ -533,8 +532,12 @@ ACMD(do_drop)
case 2: case 2:
RDR = real_room(CONFIG_DON_ROOM_1); RDR = real_room(CONFIG_DON_ROOM_1);
break; break;
case 3: RDR = real_room(CONFIG_DON_ROOM_2); break; case 3:
case 4: RDR = real_room(CONFIG_DON_ROOM_3); break; RDR = real_room(CONFIG_DON_ROOM_2);
break;
case 4:
RDR = real_room(CONFIG_DON_ROOM_3);
break;
} }
if (RDR == NOWHERE) { if (RDR == NOWHERE) {
@@ -568,7 +571,8 @@ ACMD(do_drop)
next_obj = get_obj_in_list_vis(ch, arg, NULL, obj->next_content); next_obj = get_obj_in_list_vis(ch, arg, NULL, obj->next_content);
amount += perform_drop(ch, obj, mode, sname, RDR); amount += perform_drop(ch, obj, mode, sname, RDR);
obj = next_obj; obj = next_obj;
} while (obj && --multi); }
while (obj && --multi);
} }
} else { } else {
dotmode = find_all_dots(arg); 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); act("$N seems to have $S hands full.", FALSE, ch, 0, vict, TO_CHAR);
return; 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); act("$E can't carry that much weight.", FALSE, ch, 0, vict, TO_CHAR);
return; return;
} }
@@ -643,7 +648,7 @@ static void perform_give(struct char_data *ch, struct char_data *vict,
act("$n gives you $p.", FALSE, ch, obj, vict, TO_VICT); act("$n gives you $p.", FALSE, ch, obj, vict, TO_VICT);
act("$n gives $p to $N.", TRUE, ch, obj, vict, TO_NOTVICT); act("$n gives $p to $N.", TRUE, ch, obj, vict, TO_NOTVICT);
autoquest_trigger_check( ch, vict, obj, AQ_OBJ_RETURN); autoquest_trigger_check(ch, vict, obj, AQ_OBJ_RETURN);
} }
/* utility function for give */ /* utility function for give */
@@ -1081,8 +1086,7 @@ ACMD(do_pour)
GET_OBJ_VAL(from_obj, 1) = 0; GET_OBJ_VAL(from_obj, 1) = 0;
GET_OBJ_VAL(from_obj, 2) = 0; GET_OBJ_VAL(from_obj, 2) = 0;
GET_OBJ_VAL(from_obj, 3) = 0; GET_OBJ_VAL(from_obj, 3) = 0;
} } else
else
send_to_char(ch, "You can't possibly pour that container out!\r\n"); send_to_char(ch, "You can't possibly pour that container out!\r\n");
return; return;
@@ -1139,14 +1143,12 @@ ACMD(do_pour)
GET_OBJ_VAL(from_obj, 2) = 0; GET_OBJ_VAL(from_obj, 2) = 0;
GET_OBJ_VAL(from_obj, 3) = 0; GET_OBJ_VAL(from_obj, 3) = 0;
} }
} } else {
else {
GET_OBJ_VAL(to_obj, 1) = GET_OBJ_VAL(to_obj, 0); GET_OBJ_VAL(to_obj, 1) = GET_OBJ_VAL(to_obj, 0);
amount = GET_OBJ_VAL(to_obj, 0); amount = GET_OBJ_VAL(to_obj, 0);
} }
/* Poisoned? */ /* 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. */ /* Weight change, except for unlimited. */
if (GET_OBJ_VAL(from_obj, 0) > 0) { if (GET_OBJ_VAL(from_obj, 0) > 0) {
weight_change_object(from_obj, -amount); 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 (!arg || !*arg) {
if (CAN_WEAR(obj, ITEM_WEAR_FINGER)) where = WEAR_FINGER_R; if (CAN_WEAR(obj, ITEM_WEAR_FINGER))
if (CAN_WEAR(obj, ITEM_WEAR_NECK)) where = WEAR_NECK_1; where = WEAR_FINGER_R;
if (CAN_WEAR(obj, ITEM_WEAR_BODY)) where = WEAR_BODY; if (CAN_WEAR(obj, ITEM_WEAR_NECK))
if (CAN_WEAR(obj, ITEM_WEAR_HEAD)) where = WEAR_HEAD; where = WEAR_NECK_1;
if (CAN_WEAR(obj, ITEM_WEAR_LEGS)) where = WEAR_LEGS; if (CAN_WEAR(obj, ITEM_WEAR_BODY))
if (CAN_WEAR(obj, ITEM_WEAR_FEET)) where = WEAR_FEET; where = WEAR_BODY;
if (CAN_WEAR(obj, ITEM_WEAR_HANDS)) where = WEAR_HANDS; if (CAN_WEAR(obj, ITEM_WEAR_HEAD))
if (CAN_WEAR(obj, ITEM_WEAR_ARMS)) where = WEAR_ARMS; where = WEAR_HEAD;
if (CAN_WEAR(obj, ITEM_WEAR_SHIELD)) where = WEAR_SHIELD; if (CAN_WEAR(obj, ITEM_WEAR_LEGS))
if (CAN_WEAR(obj, ITEM_WEAR_ABOUT)) where = WEAR_ABOUT; where = WEAR_LEGS;
if (CAN_WEAR(obj, ITEM_WEAR_WAIST)) where = WEAR_WAIST; if (CAN_WEAR(obj, ITEM_WEAR_FEET))
if (CAN_WEAR(obj, ITEM_WEAR_WRIST)) where = WEAR_WRIST_R; 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) } else if ((where = search_block(arg, keywords, FALSE)) < 0)
send_to_char(ch, "'%s'? What part of your body is THAT?\r\n", arg); send_to_char(ch, "'%s'? What part of your body is THAT?\r\n", arg);
@@ -1447,7 +1461,7 @@ static void perform_remove(struct char_data *ch, int pos)
* (location) to remove an object from. */ * (location) to remove an object from. */
else if (OBJ_FLAGGED(obj, ITEM_NODROP) && !PRF_FLAGGED(ch, PRF_NOHASSLE)) else if (OBJ_FLAGGED(obj, ITEM_NODROP) && !PRF_FLAGGED(ch, PRF_NOHASSLE))
act("You can't remove $p, it must be CURSED!", FALSE, ch, obj, 0, TO_CHAR); act("You can't remove $p, it must be CURSED!", FALSE, ch, obj, 0, TO_CHAR);
else if (IS_CARRYING_N(ch) >= CAN_CARRY_N(ch)&& !PRF_FLAGGED(ch, PRF_NOHASSLE)) else if (IS_CARRYING_N(ch) >= CAN_CARRY_N(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE))
act("$p: you can't carry that many items!", FALSE, ch, obj, 0, TO_CHAR); act("$p: you can't carry that many items!", FALSE, ch, obj, 0, TO_CHAR);
else { else {
if (!remove_otrigger(obj, ch)) if (!remove_otrigger(obj, ch))
@@ -1515,7 +1529,8 @@ ACMD(do_sac)
return; 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"); send_to_char(ch, "It doesn't seem to be here.\n\r");
return; return;
} }
@@ -1529,30 +1544,34 @@ ACMD(do_sac)
switch (rand_number(0, 5)) { switch (rand_number(0, 5)) {
case 0: 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); increase_gold(ch, 1);
break; break;
case 1: case 1:
send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe Gods ignore your sacrifice.\r\n", GET_OBJ_SHORT(j)); send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe Gods ignore your sacrifice.\r\n", GET_OBJ_SHORT(j));
break; break;
case 2: 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),
GET_EXP(ch) += (1+2*GET_OBJ_LEVEL(j)); 1 + 2 * GET_OBJ_LEVEL(j));
GET_EXP(ch) += (1 + 2 * GET_OBJ_LEVEL(j));
break; break;
case 3: 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),
GET_EXP(ch) += (1+GET_OBJ_LEVEL(j)); 1 + GET_OBJ_LEVEL(j));
GET_EXP(ch) += (1 + GET_OBJ_LEVEL(j));
break; break;
case 4: case 4:
send_to_char(ch, "Your sacrifice to the Gods is rewarded with %d gold coins.\r\n", 1+GET_OBJ_LEVEL(j)); send_to_char(ch, "Your sacrifice to the Gods is rewarded with %d gold coins.\r\n", 1 + GET_OBJ_LEVEL(j));
increase_gold(ch, (1+GET_OBJ_LEVEL(j))); increase_gold(ch, (1 + GET_OBJ_LEVEL(j)));
break; break;
case 5: case 5:
send_to_char(ch, "Your sacrifice to the Gods is rewarded with %d gold coins\r\n", (1+2*GET_OBJ_LEVEL(j))); send_to_char(ch, "Your sacrifice to the Gods is rewarded with %d gold coins\r\n", (1 + 2 * GET_OBJ_LEVEL(j)));
increase_gold(ch, (1+2*GET_OBJ_LEVEL(j))); increase_gold(ch, (1 + 2 * GET_OBJ_LEVEL(j)));
break; break;
default: 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); increase_gold(ch, 1);
break; break;
} }

View File

@@ -166,8 +166,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
return 0; return 0;
/* Charm effect: Does it override the movement? */ /* 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"); 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); act("$n bursts into tears.", FALSE, ch, 0, 0, TO_ROOM);
return (0); 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? */ /* Water, No Swimming Rooms: Does the deep water prevent movement? */
if ((SECT(was_in) == SECT_WATER_NOSWIM) || if ((SECT(was_in) == SECT_WATER_NOSWIM) ||
(SECT(going_to) == SECT_WATER_NOSWIM)) (SECT(going_to) == SECT_WATER_NOSWIM)) {
{ if (!has_boat(ch)) {
if (!has_boat(ch))
{
send_to_char(ch, "You need a boat to go there.\r\n"); send_to_char(ch, "You need a boat to go there.\r\n");
return (0); return (0);
} }
} }
/* Flying Required: Does lack of flying prevent movement? */ /* Flying Required: Does lack of flying prevent movement? */
if ((SECT(was_in) == SECT_FLYING) || (SECT(going_to) == SECT_FLYING)) if ((SECT(was_in) == SECT_FLYING) || (SECT(going_to) == SECT_FLYING)) {
{ if (!has_flight(ch)) {
if (!has_flight(ch))
{
send_to_char(ch, "You need to be flying to go there!\r\n"); send_to_char(ch, "You need to be flying to go there!\r\n");
return (0); return (0);
} }
} }
/* Underwater Room: Does lack of underwater breathing prevent movement? */ /* 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)) { 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"); send_to_char(ch, "You need to be able to breathe water to go there!\r\n");
return (0); 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? */ /* Houses: Can the player walk into the house? */
if (ROOM_FLAGGED(was_in, ROOM_ATRIUM)) if (ROOM_FLAGGED(was_in, ROOM_ATRIUM)) {
{ if (!House_can_enter(ch, GET_ROOM_VNUM(going_to))) {
if (!House_can_enter(ch, GET_ROOM_VNUM(going_to)))
{
send_to_char(ch, "That's private property -- no trespassing!\r\n"); send_to_char(ch, "That's private property -- no trespassing!\r\n");
return (0); 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"); send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n");
return (0); 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"); send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n");
return (0); return (0);
} }
/* Room Size Capacity: Is the room full of people already? */ /* Room Size Capacity: Is the room full of people already? */
if (ROOM_FLAGGED(going_to, ROOM_TUNNEL) && 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) if (CONFIG_TUNNEL_SIZE > 1)
send_to_char(ch, "There isn't enough room for you to go there!\r\n"); send_to_char(ch, "There isn't enough room for you to go there!\r\n");
else 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? */ /* 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"); send_to_char(ch, "You aren't godly enough to use that room!\r\n");
return (0); 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; movement_loss[SECT(going_to)]) / 2;
/* Move Point Requirement Check */ /* 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) if (need_specials_check && ch->master)
send_to_char(ch, "You are too exhausted to follow.\r\n"); send_to_char(ch, "You are too exhausted to follow.\r\n");
else else
@@ -274,8 +264,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
GET_MOVE(ch) -= need_movement; GET_MOVE(ch) -= need_movement;
/* Generate the leave message and display to others in the was_in room. */ /* 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]); snprintf(leave_message, sizeof(leave_message), "$n leaves %s.", dirs[dir]);
act(leave_message, TRUE, ch, 0, 0, TO_ROOM); 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); look_at_room(ch, 0);
/* ... and Kill the player if the room is a death trap. */ /* ... and Kill the player if the room is a death trap. */
if (ROOM_FLAGGED(going_to, ROOM_DEATH) && GET_LEVEL(ch) < LVL_IMMORT) 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),
mudlog(BRF, LVL_IMMORT, TRUE, "%s hit death trap #%d (%s)", GET_NAME(ch), GET_ROOM_VNUM(going_to), world[going_to].name); world[going_to].name);
death_cry(ch); death_cry(ch);
extract_char(ch); extract_char(ch);
return (0); 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 /* 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. */ * prevents movement, and if so, move the player back to the previous room. */
entry_memory_mtrigger(ch); entry_memory_mtrigger(ch);
if (!greet_mtrigger(ch, dir)) if (!greet_mtrigger(ch, dir)) {
{
char_from_room(ch); char_from_room(ch);
char_to_room(ch, was_in); char_to_room(ch, was_in);
look_at_room(ch, 0); look_at_room(ch, 0);
/* Failed move, return a failure */ /* Failed move, return a failure */
return (0); return (0);
} } else
else
greet_memory_mtrigger(ch); greet_memory_mtrigger(ch);
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
/* End: Post-move operations. */ /* 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"); 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) 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"); 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) if (EXIT(ch, dir)->keyword)
send_to_char(ch, "The %s seems to be closed.\r\n", fname(EXIT(ch, dir)->keyword)); send_to_char(ch, "The %s seems to be closed.\r\n", fname(EXIT(ch, dir)->keyword));
else else
@@ -410,30 +398,24 @@ 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); send_to_char(ch, "What is it you want to %s?\r\n", cmdname);
return (-1); return (-1);
} }
for (door = 0; door < DIR_COUNT; door++) for (door = 0; door < DIR_COUNT; door++) {
{ if (EXIT(ch, door)) {
if (EXIT(ch, door)) if (EXIT(ch, door)->keyword) {
{ if (isname(type, EXIT(ch, door)->keyword)) {
if (EXIT(ch, door)->keyword)
{
if (isname(type, EXIT(ch, door)->keyword))
{
if ((!IS_NPC(ch)) && (!PRF_FLAGGED(ch, PRF_AUTODOOR))) if ((!IS_NPC(ch)) && (!PRF_FLAGGED(ch, PRF_AUTODOOR)))
return door; return door;
else if (is_abbrev(cmdname, "open")) else if (is_abbrev(cmdname, "open")) {
{
if (IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED)) if (IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))
return door; return door;
else if (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED)) else if (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))
return door; 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; return door;
else if ((is_abbrev(cmdname, "lock")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))) ) else if ((is_abbrev(cmdname, "lock")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))))
return door; return door;
else if ((is_abbrev(cmdname, "unlock")) && (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED)) ) else if ((is_abbrev(cmdname, "unlock")) && (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED)))
return door; return door;
else if ((is_abbrev(cmdname, "pick")) && (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED)) ) else if ((is_abbrev(cmdname, "pick")) && (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED)))
return door; return door;
} }
} }
@@ -655,17 +637,15 @@ ACMD(do_gen_door)
send_to_char(ch, "But it's currently open!\r\n"); 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)) 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"); 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"); 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, SCMD_UNLOCK);
do_doorcmd(ch, obj, door, subcmd); do_doorcmd(ch, obj, door, subcmd);
} } 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) && ((!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (!has_key(ch, keynum)) ) !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"); 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)))) (GET_LEVEL(ch) < LVL_IMMORT || (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE))))
send_to_char(ch, "It seems to be locked.\r\n"); 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))) else if (!has_key(ch, keynum) && (GET_LEVEL(ch) < LVL_GOD) && ((subcmd == SCMD_LOCK) || (subcmd == SCMD_UNLOCK)))
@@ -799,7 +779,7 @@ ACMD(do_sit)
} else { } else {
if (OBJ_SAT_IN_BY(furniture) == NULL) if (OBJ_SAT_IN_BY(furniture) == NULL)
OBJ_SAT_IN_BY(furniture) = ch; OBJ_SAT_IN_BY(furniture) = ch;
for (tempch = OBJ_SAT_IN_BY(furniture); tempch != ch ; tempch = NEXT_SITTING(tempch)) { for (tempch = OBJ_SAT_IN_BY(furniture); tempch != ch; tempch = NEXT_SITTING(tempch)) {
if (NEXT_SITTING(tempch)) if (NEXT_SITTING(tempch))
continue; continue;
NEXT_SITTING(tempch) = ch; NEXT_SITTING(tempch) = ch;
@@ -942,7 +922,7 @@ ACMD(do_follow)
return; return;
} }
} else { } else {
if (ch->master != (char_data*) NULL) { if (ch->master != (char_data *)NULL) {
send_to_char(ch, "You are following %s.\r\n", send_to_char(ch, "You are following %s.\r\n",
GET_NAME(ch->master)); GET_NAME(ch->master));
} else { } else {

View File

@@ -88,7 +88,8 @@ ACMD(do_hit)
if ((GET_POS(ch) == POS_STANDING) && (vict != FIGHTING(ch))) { 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 */ 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 */ 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); WAIT_STATE(ch, PULSE_VIOLENCE + 2);
} else } else
send_to_char(ch, "You're fighting the best you can!\r\n"); send_to_char(ch, "You're fighting the best you can!\r\n");
@@ -404,8 +405,8 @@ EVENTFUNC(event_whirlwind)
/* For the sake of simplicity, we will place the event data in easily /* For the sake of simplicity, we will place the event data in easily
* referenced pointers */ * referenced pointers */
pMudEvent = (struct mud_event_data *) event_obj; pMudEvent = (struct mud_event_data *)event_obj;
ch = (struct char_data *) pMudEvent->pStruct; ch = (struct char_data *)pMudEvent->pStruct;
/* When using a list, we have to make sure to allocate the list as it /* When using a list, we have to make sure to allocate the list as it
* uses dynamic memory */ * uses dynamic memory */
@@ -528,11 +529,10 @@ ACMD(do_kick)
ACMD(do_bandage) ACMD(do_bandage)
{ {
char arg[MAX_INPUT_LENGTH]; char arg[MAX_INPUT_LENGTH];
struct char_data * vict; struct char_data *vict;
int percent, prob; 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"); send_to_char(ch, "You are unskilled in the art of bandaging.\r\n");
return; return;
} }

View File

@@ -33,7 +33,7 @@
/* Local defined utility functions */ /* Local defined utility functions */
/* do_group utility functions */ /* do_group utility functions */
static void print_group(struct char_data *ch); static void print_group(struct char_data *ch);
static void display_group_list(struct char_data * ch); static void display_group_list(struct char_data *ch);
ACMD(do_quit) ACMD(do_quit)
{ {
@@ -205,7 +205,7 @@ ACMD(do_steal)
return; return;
} else { } else {
if (!give_otrigger(obj, vict, ch) || if (!give_otrigger(obj, vict, ch) ||
!receive_mtrigger(ch, vict, obj) ) { !receive_mtrigger(ch, vict, obj)) {
send_to_char(ch, "Impossible!\r\n"); send_to_char(ch, "Impossible!\r\n");
return; return;
} }
@@ -226,7 +226,7 @@ ACMD(do_steal)
} else { /* Steal the item */ } else { /* Steal the item */
if (IS_CARRYING_N(ch) + 1 < CAN_CARRY_N(ch)) { if (IS_CARRYING_N(ch) + 1 < CAN_CARRY_N(ch)) {
if (!give_otrigger(obj, vict, ch) || if (!give_otrigger(obj, vict, ch) ||
!receive_mtrigger(ch, vict, obj) ) { !receive_mtrigger(ch, vict, obj)) {
send_to_char(ch, "Impossible!\r\n"); send_to_char(ch, "Impossible!\r\n");
return; return;
} }
@@ -317,13 +317,13 @@ ACMD(do_title)
static void print_group(struct char_data *ch) static void print_group(struct char_data *ch)
{ {
struct char_data * k; struct char_data *k;
send_to_char(ch, "Your group consists of:\r\n"); send_to_char(ch, "Your group consists of:\r\n");
while ((k = (struct char_data *) simple_list(ch->group->members)) != NULL) while ((k = (struct char_data *)simple_list(ch->group->members)) != NULL)
send_to_char(ch, "%-*s: %s[%4d/%-4d]H [%4d/%-4d]M [%4d/%-4d]V%s\r\n", send_to_char(ch, "%-*s: %s[%4d/%-4d]H [%4d/%-4d]M [%4d/%-4d]V%s\r\n",
count_color_chars(GET_NAME(k))+22, GET_NAME(k), count_color_chars(GET_NAME(k)) + 22, GET_NAME(k),
GROUP_LEADER(GROUP(ch)) == k ? CBGRN(ch, C_NRM) : CCGRN(ch, C_NRM), GROUP_LEADER(GROUP(ch)) == k ? CBGRN(ch, C_NRM) : CCGRN(ch, C_NRM),
GET_HIT(k), GET_MAX_HIT(k), GET_HIT(k), GET_MAX_HIT(k),
GET_MANA(k), GET_MAX_MANA(k), GET_MANA(k), GET_MAX_MANA(k),
@@ -331,23 +331,24 @@ static void print_group(struct char_data *ch)
CCNRM(ch, C_NRM)); CCNRM(ch, C_NRM));
} }
static void display_group_list(struct char_data * ch) static void display_group_list(struct char_data *ch)
{ {
struct group_data * group; struct group_data *group;
int count = 0; int count = 0;
if (group_list->iSize) { if (group_list->iSize) {
send_to_char(ch, "# Group Leader # of Members In Zone\r\n" send_to_char(ch, "# Group Leader # of Members In Zone\r\n"
"---------------------------------------------------\r\n"); "---------------------------------------------------\r\n");
while ((group = (struct group_data *) simple_list(group_list)) != NULL) { while ((group = (struct group_data *)simple_list(group_list)) != NULL) {
if (IS_SET(GROUP_FLAGS(group), GROUP_NPC)) if (IS_SET(GROUP_FLAGS(group), GROUP_NPC))
continue; continue;
if (GROUP_LEADER(group) && !IS_SET(GROUP_FLAGS(group), GROUP_ANON)) if (GROUP_LEADER(group) && !IS_SET(GROUP_FLAGS(group), GROUP_ANON))
send_to_char(ch, "%-2d) %s%-12s %-2d %s%s\r\n", send_to_char(ch, "%-2d) %s%-12s %-2d %s%s\r\n",
++count, ++count,
IS_SET(GROUP_FLAGS(group), GROUP_OPEN) ? CCGRN(ch, C_NRM) : CCRED(ch, C_NRM), 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)); CCNRM(ch, C_NRM));
else else
send_to_char(ch, "%-2d) Hidden\r\n", ++count); send_to_char(ch, "%-2d) Hidden\r\n", ++count);
@@ -415,10 +416,10 @@ ACMD(do_group)
} else if (vict == ch) { } else if (vict == ch) {
send_to_char(ch, "There are easier ways to leave the group.\r\n"); send_to_char(ch, "There are easier ways to leave the group.\r\n");
return; return;
} else if (!GROUP(ch) ) { } else if (!GROUP(ch)) {
send_to_char(ch, "But you are not part of a group.\r\n"); send_to_char(ch, "But you are not part of a group.\r\n");
return; return;
} else if (GROUP_LEADER(GROUP(ch)) != ch ) { } else if (GROUP_LEADER(GROUP(ch)) != ch) {
send_to_char(ch, "Only the group's leader can kick members out.\r\n"); send_to_char(ch, "Only the group's leader can kick members out.\r\n");
return; return;
} else if (GROUP(vict) != GROUP(ch)) { } else if (GROUP(vict) != GROUP(ch)) {
@@ -459,10 +460,12 @@ ACMD(do_group)
} }
if (is_abbrev(argument, "open")) { if (is_abbrev(argument, "open")) {
TOGGLE_BIT(GROUP_FLAGS(GROUP(ch)), GROUP_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")) { } else if (is_abbrev(argument, "anonymous")) {
TOGGLE_BIT(GROUP_FLAGS(GROUP(ch)), GROUP_ANON); 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 } else
send_to_char(ch, "The flag options are: Open, Anonymous\r\n"); send_to_char(ch, "The flag options are: Open, Anonymous\r\n");
} else { } else {
@@ -511,7 +514,7 @@ ACMD(do_split)
} }
if (GROUP(ch)) if (GROUP(ch))
while ((k = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL) while ((k = (struct char_data *)simple_list(GROUP(ch)->members)) != NULL)
if (IN_ROOM(ch) == IN_ROOM(k) && !IS_NPC(k)) if (IN_ROOM(ch) == IN_ROOM(k) && !IS_NPC(k))
num++; num++;
@@ -534,7 +537,7 @@ ACMD(do_split)
(rest == 1) ? "" : "s", (rest == 1) ? "was" : "were", GET_NAME(ch)); (rest == 1) ? "" : "s", (rest == 1) ? "was" : "were", GET_NAME(ch));
} }
while ((k = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL) while ((k = (struct char_data *)simple_list(GROUP(ch)->members)) != NULL)
if (k != ch && IN_ROOM(ch) == IN_ROOM(k) && !IS_NPC(k)) { if (k != ch && IN_ROOM(ch) == IN_ROOM(k) && !IS_NPC(k)) {
increase_gold(k, share); increase_gold(k, share);
send_to_char(k, "%s", buf); send_to_char(k, "%s", buf);
@@ -793,11 +796,11 @@ ACMD(do_gen_tog)
result = PRF_TOG_CHK(ch, PRF_BUILDWALK); result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
if (PRF_FLAGGED(ch, PRF_BUILDWALK)) { if (PRF_FLAGGED(ch, PRF_BUILDWALK)) {
one_argument(argument, arg); one_argument(argument, arg);
for (i=0; *arg && *(sector_types[i]) != '\n'; i++) for (i = 0; *arg && *(sector_types[i]) != '\n'; i++)
if (is_abbrev(arg, sector_types[i])) if (is_abbrev(arg, sector_types[i]))
break; break;
if (*(sector_types[i]) == '\n') if (*(sector_types[i]) == '\n')
i=0; i = 0;
GET_BUILDWALK_SECTOR(ch) = i; GET_BUILDWALK_SECTOR(ch) = i;
send_to_char(ch, "Default sector type is %s\r\n", sector_types[i]); send_to_char(ch, "Default sector type is %s\r\n", sector_types[i]);
@@ -862,8 +865,7 @@ static void show_happyhour(struct char_data *ch)
char happyexp[80], happygold[80], happyqp[80]; char happyexp[80], happygold[80], happyqp[80];
int secs_left; int secs_left;
if ((IS_HAPPYHOUR) || (GET_LEVEL(ch) >= LVL_GRGOD)) if ((IS_HAPPYHOUR) || (GET_LEVEL(ch) >= LVL_GRGOD)) {
{
if (HAPPY_TIME) if (HAPPY_TIME)
secs_left = ((HAPPY_TIME - 1) * SECS_PER_MUD_HOUR) + next_tick; secs_left = ((HAPPY_TIME - 1) * SECS_PER_MUD_HOUR) + next_tick;
else else
@@ -881,10 +883,8 @@ static void show_happyhour(struct char_data *ch)
(IS_HAPPYQP || (GET_LEVEL(ch) >= LVL_GOD)) ? happyqp : "", (IS_HAPPYQP || (GET_LEVEL(ch) >= LVL_GOD)) ? happyqp : "",
CCYEL(ch, C_NRM), (secs_left / 3600), CCNRM(ch, C_NRM), 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 % 3600) / 60, CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), (secs_left % 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"); 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]; char arg[MAX_INPUT_LENGTH], val[MAX_INPUT_LENGTH];
int num; int num;
if (GET_LEVEL(ch) < LVL_GOD) if (GET_LEVEL(ch) < LVL_GOD) {
{
show_happyhour(ch); show_happyhour(ch);
return; return;
} }
@@ -903,20 +902,15 @@ ACMD(do_happyhour)
/* Only Imms get here, so check args */ /* Only Imms get here, so check args */
two_arguments(argument, arg, val); two_arguments(argument, arg, val);
if (is_abbrev(arg, "experience")) if (is_abbrev(arg, "experience")) {
{
num = MIN(MAX((atoi(val)), 0), 1000); num = MIN(MAX((atoi(val)), 0), 1000);
HAPPY_EXP = num; HAPPY_EXP = num;
send_to_char(ch, "Happy Hour Exp rate set to +%d%%\r\n", HAPPY_EXP); 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); num = MIN(MAX((atoi(val)), 0), 1000);
HAPPY_GOLD = num; HAPPY_GOLD = num;
send_to_char(ch, "Happy Hour Gold rate set to +%d%%\r\n", HAPPY_GOLD); 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); num = MIN(MAX((atoi(val)), 0), 1000);
if (HAPPY_TIME && !num) if (HAPPY_TIME && !num)
game_info("Happyhour has been stopped!"); game_info("Happyhour has been stopped!");
@@ -926,30 +920,22 @@ ACMD(do_happyhour)
HAPPY_TIME = num; HAPPY_TIME = num;
send_to_char(ch, "Happy Hour Time set to %d ticks (%d hours %d mins and %d secs)\r\n", send_to_char(ch, "Happy Hour Time set to %d ticks (%d hours %d mins and %d secs)\r\n",
HAPPY_TIME, HAPPY_TIME,
(HAPPY_TIME*SECS_PER_MUD_HOUR)/3600, (HAPPY_TIME * SECS_PER_MUD_HOUR) / 3600,
((HAPPY_TIME*SECS_PER_MUD_HOUR)%3600) / 60, ((HAPPY_TIME * SECS_PER_MUD_HOUR) % 3600) / 60,
(HAPPY_TIME*SECS_PER_MUD_HOUR)%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); num = MIN(MAX((atoi(val)), 0), 1000);
HAPPY_QP = num; HAPPY_QP = num;
send_to_char(ch, "Happy Hour Questpoints rate set to +%d%%\r\n", HAPPY_QP); 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); show_happyhour(ch);
} } else if (is_abbrev(arg, "default")) {
else if (is_abbrev(arg, "default"))
{
HAPPY_EXP = 100; HAPPY_EXP = 100;
HAPPY_GOLD = 50; HAPPY_GOLD = 50;
HAPPY_QP = 50; HAPPY_QP = 50;
HAPPY_TIME = 48; HAPPY_TIME = 48;
game_info("A Happyhour has started!"); game_info("A Happyhour has started!");
} } else {
else
{
send_to_char(ch, "Usage: %shappyhour %s- show usage (this info)\r\n" 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 show %s- display current settings (what mortals see)\r\n"
" %shappyhour time <ticks> %s- set happyhour time and start timer\r\n" " %shappyhour time <ticks> %s- set happyhour time and start timer\r\n"
@@ -966,6 +952,6 @@ ACMD(do_happyhour)
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM), CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM), CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), CCNRM(ch, C_NRM), CCYEL(ch, C_NRM), CCNRM(ch, C_NRM),
(3600 / SECS_PER_MUD_HOUR) ); (3600 / SECS_PER_MUD_HOUR));
} }
} }

View File

@@ -65,7 +65,8 @@ ACMD(do_action)
if (!vict) { if (!vict) {
if (action->char_obj_found) { if (action->char_obj_found) {
targ = get_obj_in_list_vis(ch, arg, NULL, ch->carrying); 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) { if (targ) {
act(action->char_obj_found, action->hide, ch, targ, 0, TO_CHAR); act(action->char_obj_found, action->hide, ch, targ, 0, TO_CHAR);
act(action->others_obj_found, action->hide, ch, targ, 0, TO_ROOM); 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 */ /* count the commands in the command list */
i = 0; i = 0;
while(*cmd_info[i].command != '\n') i++; while (*cmd_info[i].command != '\n')
i++;
i++; i++;
CREATE(complete_cmd_info, struct command_info, top_of_socialt + i + 2); CREATE(complete_cmd_info, struct command_info, top_of_socialt + i + 2);
@@ -166,29 +168,45 @@ void free_social_messages(void)
struct social_messg *mess; struct social_messg *mess;
int i; int i;
for (i = 0;i <= top_of_socialt;i++) { for (i = 0; i <= top_of_socialt; i++) {
mess = &soc_mess_list[i]; mess = &soc_mess_list[i];
free_action(mess); free_action(mess);
} }
free(soc_mess_list); free(soc_mess_list);
} }
void free_action(struct social_messg *mess) { void free_action(struct social_messg *mess)
if (mess->command) free(mess->command); {
if (mess->sort_as) free(mess->sort_as); if (mess->command)
if (mess->char_no_arg) free(mess->char_no_arg); free(mess->command);
if (mess->others_no_arg) free(mess->others_no_arg); if (mess->sort_as)
if (mess->char_found) free(mess->char_found); free(mess->sort_as);
if (mess->others_found) free(mess->others_found); if (mess->char_no_arg)
if (mess->vict_found) free(mess->vict_found); free(mess->char_no_arg);
if (mess->char_body_found) free(mess->char_body_found); if (mess->others_no_arg)
if (mess->others_body_found) free(mess->others_body_found); free(mess->others_no_arg);
if (mess->vict_body_found) free(mess->vict_body_found); if (mess->char_found)
if (mess->not_found) free(mess->not_found); free(mess->char_found);
if (mess->char_auto) free(mess->char_auto); if (mess->others_found)
if (mess->others_auto) free(mess->others_auto); free(mess->others_found);
if (mess->char_obj_found) free(mess->char_obj_found); if (mess->vict_found)
if (mess->others_obj_found) free(mess->others_obj_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)); memset(mess, 0, sizeof(struct social_messg));
} }
@@ -226,7 +244,7 @@ ACMD(do_gmote)
half_chop(argument, buf, arg); half_chop(argument, buf, arg);
if(subcmd) if (subcmd)
for (length = strlen(buf), cmd = 0; *complete_cmd_info[cmd].command != '\n'; cmd++) for (length = strlen(buf), cmd = 0; *complete_cmd_info[cmd].command != '\n'; cmd++)
if (!strncmp(complete_cmd_info[cmd].command, buf, length)) if (!strncmp(complete_cmd_info[cmd].command, buf, length))
break; break;
@@ -242,13 +260,13 @@ ACMD(do_gmote)
return; return;
} }
action = &soc_mess_list[act_nr]; action = &soc_mess_list[act_nr];
if (!action->char_found) if (!action->char_found)
*arg = '\0'; *arg = '\0';
if (!*arg) { if (!*arg) {
if(!action->others_no_arg || !*action->others_no_arg) { if (!action->others_no_arg || !*action->others_no_arg) {
send_to_char(ch, "Who are you going to do that to?\r\n"); send_to_char(ch, "Who are you going to do that to?\r\n");
return; return;
} }
@@ -257,7 +275,7 @@ action = &soc_mess_list[act_nr];
send_to_char(ch, "%s\r\n", action->not_found); send_to_char(ch, "%s\r\n", action->not_found);
return; return;
} else if (vict == ch) { } else if (vict == ch) {
if(!action->others_auto || !*action->others_auto) { if (!action->others_auto || !*action->others_auto) {
send_to_char(ch, "%s\r\n", action->char_auto); send_to_char(ch, "%s\r\n", action->char_auto);
return; return;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -22,7 +22,7 @@
/* local utility functions */ /* local utility functions */
static int aedit_find_command(const char *txt); static int aedit_find_command(const char *txt);
static void aedit_disp_menu(struct descriptor_data * d); static void aedit_disp_menu(struct descriptor_data *d);
static void aedit_save_to_disk(struct descriptor_data *d); static void aedit_save_to_disk(struct descriptor_data *d);
/* used in aedit parse */ /* used in aedit parse */
static void aedit_setup_new(struct descriptor_data *d); static void aedit_setup_new(struct descriptor_data *d);
@@ -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); static void aedit_save_internally(struct descriptor_data *d);
/* Utils and exported functions. */ /* Utils and exported functions. */
ACMD(do_oasis_aedit) ACMD(do_oasis_aedit)
{ {
@@ -225,28 +224,28 @@ static void aedit_save_to_disk(struct descriptor_data *d)
soc_mess_list[i].min_level_char); soc_mess_list[i].min_level_char);
sprintf(buf, "%s\n%s\n%s\n%s\n", sprintf(buf, "%s\n%s\n%s\n%s\n",
((soc_mess_list[i].char_no_arg)?soc_mess_list[i].char_no_arg:"#"), ((soc_mess_list[i].char_no_arg) ? soc_mess_list[i].char_no_arg : "#"),
((soc_mess_list[i].others_no_arg)?soc_mess_list[i].others_no_arg:"#"), ((soc_mess_list[i].others_no_arg) ? soc_mess_list[i].others_no_arg : "#"),
((soc_mess_list[i].char_found)?soc_mess_list[i].char_found:"#"), ((soc_mess_list[i].char_found) ? soc_mess_list[i].char_found : "#"),
((soc_mess_list[i].others_found)?soc_mess_list[i].others_found:"#")); ((soc_mess_list[i].others_found) ? soc_mess_list[i].others_found : "#"));
fprintf(fp, "%s", convert_from_tabs(buf)); fprintf(fp, "%s", convert_from_tabs(buf));
sprintf(buf, "%s\n%s\n%s\n%s\n", sprintf(buf, "%s\n%s\n%s\n%s\n",
((soc_mess_list[i].vict_found)?soc_mess_list[i].vict_found:"#"), ((soc_mess_list[i].vict_found) ? soc_mess_list[i].vict_found : "#"),
((soc_mess_list[i].not_found)?soc_mess_list[i].not_found:"#"), ((soc_mess_list[i].not_found) ? soc_mess_list[i].not_found : "#"),
((soc_mess_list[i].char_auto)?soc_mess_list[i].char_auto:"#"), ((soc_mess_list[i].char_auto) ? soc_mess_list[i].char_auto : "#"),
((soc_mess_list[i].others_auto)?soc_mess_list[i].others_auto:"#")); ((soc_mess_list[i].others_auto) ? soc_mess_list[i].others_auto : "#"));
fprintf(fp, "%s", convert_from_tabs(buf)); fprintf(fp, "%s", convert_from_tabs(buf));
sprintf(buf, "%s\n%s\n%s\n", sprintf(buf, "%s\n%s\n%s\n",
((soc_mess_list[i].char_body_found)?soc_mess_list[i].char_body_found:"#"), ((soc_mess_list[i].char_body_found) ? soc_mess_list[i].char_body_found : "#"),
((soc_mess_list[i].others_body_found)?soc_mess_list[i].others_body_found:"#"), ((soc_mess_list[i].others_body_found) ? soc_mess_list[i].others_body_found : "#"),
((soc_mess_list[i].vict_body_found)?soc_mess_list[i].vict_body_found:"#")); ((soc_mess_list[i].vict_body_found) ? soc_mess_list[i].vict_body_found : "#"));
fprintf(fp, "%s", convert_from_tabs(buf)); fprintf(fp, "%s", convert_from_tabs(buf));
sprintf(buf, "%s\n%s\n\n", sprintf(buf, "%s\n%s\n\n",
((soc_mess_list[i].char_obj_found)?soc_mess_list[i].char_obj_found:"#"), ((soc_mess_list[i].char_obj_found) ? soc_mess_list[i].char_obj_found : "#"),
((soc_mess_list[i].others_obj_found)?soc_mess_list[i].others_obj_found:"#")); ((soc_mess_list[i].others_obj_found) ? soc_mess_list[i].others_obj_found : "#"));
fprintf(fp, "%s", convert_from_tabs(buf)); fprintf(fp, "%s", convert_from_tabs(buf));
} }
@@ -256,7 +255,7 @@ static void aedit_save_to_disk(struct descriptor_data *d)
} }
/* The Main Menu. */ /* The Main Menu. */
static void aedit_disp_menu(struct descriptor_data * d) static void aedit_disp_menu(struct descriptor_data *d)
{ {
struct social_messg *action = OLC_ACTION(d); struct social_messg *action = OLC_ACTION(d);
struct char_data *ch = d->character; struct char_data *ch = d->character;
@@ -294,7 +293,7 @@ static void aedit_disp_menu(struct descriptor_data * d)
grn, nrm, grn, nrm,
cyn, action->min_level_char, cyn, action->min_level_char,
grn, nrm, grn, nrm,
cyn, (action->hide?"HIDDEN":"NOT HIDDEN"), cyn, (action->hide ? "HIDDEN" : "NOT HIDDEN"),
grn, nrm, cyn, grn, nrm, cyn,
action->char_no_arg ? action->char_no_arg : "<Null>", action->char_no_arg ? action->char_no_arg : "<Null>",
grn, nrm, cyn, grn, nrm, cyn,
@@ -327,7 +326,7 @@ static void aedit_disp_menu(struct descriptor_data * d)
} }
/* The main loop. */ /* The main loop. */
void aedit_parse(struct descriptor_data * d, char *arg) void aedit_parse(struct descriptor_data *d, char *arg)
{ {
int i; int i;
@@ -337,7 +336,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
case 'y': case 'y':
case 'Y': case 'Y':
aedit_save_internally(d); aedit_save_internally(d);
mudlog (CMP, MAX(LVL_GOD, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits action %s", mudlog(CMP, MAX(LVL_GOD, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits action %s",
GET_NAME(d->character), OLC_ACTION(d)->command); GET_NAME(d->character), OLC_ACTION(d)->command);
/* do not free the strings.. just the structure */ /* do not free the strings.. just the structure */
@@ -422,7 +421,8 @@ void aedit_parse(struct descriptor_data * d, char *arg)
if (OLC_VAL(d)) { /* Something was modified */ if (OLC_VAL(d)) { /* Something was modified */
write_to_output(d, "Do you wish to save your changes? : "); write_to_output(d, "Do you wish to save your changes? : ");
OLC_MODE(d) = AEDIT_CONFIRM_SAVESTRING; OLC_MODE(d) = AEDIT_CONFIRM_SAVESTRING;
} else cleanup_olc(d, CLEANUP_ALL); } else
cleanup_olc(d, CLEANUP_ALL);
break; break;
case 'n': case 'n':
write_to_output(d, "Enter action name: "); write_to_output(d, "Enter action name: ");
@@ -434,7 +434,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
return; return;
case '2': case '2':
write_to_output(d, "Enter the minimum position the Character has to be in to activate social:\r\n"); write_to_output(d, "Enter the minimum position the Character has to be in to activate social:\r\n");
for (i=POS_DEAD; i<=POS_STANDING; i++) for (i = POS_DEAD; i <= POS_STANDING; i++)
write_to_output(d, " %d) %s\r\n", i, position_types[i]); write_to_output(d, " %d) %s\r\n", i, position_types[i]);
write_to_output(d, "Enter choice: "); write_to_output(d, "Enter choice: ");
@@ -442,7 +442,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
return; return;
case '3': case '3':
write_to_output(d, "Enter the minimum position the Victim has to be in to activate social:\r\n"); write_to_output(d, "Enter the minimum position the Victim has to be in to activate social:\r\n");
for (i=POS_DEAD; i<=POS_STANDING; i++) for (i = POS_DEAD; i <= POS_STANDING; i++)
write_to_output(d, " %d) %s\r\n", i, position_types[i]); write_to_output(d, " %d) %s\r\n", i, position_types[i]);
write_to_output(d, "Enter choice: "); write_to_output(d, "Enter choice: ");
@@ -462,7 +462,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter social shown to the Character when there is no argument supplied.\r\n" write_to_output(d, "Enter social shown to the Character when there is no argument supplied.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->char_no_arg)?OLC_ACTION(d)->char_no_arg:"NULL")); ((OLC_ACTION(d)->char_no_arg) ? OLC_ACTION(d)->char_no_arg : "NULL"));
OLC_MODE(d) = AEDIT_NOVICT_CHAR; OLC_MODE(d) = AEDIT_NOVICT_CHAR;
return; return;
case 'b': case 'b':
@@ -470,7 +470,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter social shown to Others when there is no argument supplied.\r\n" write_to_output(d, "Enter social shown to Others when there is no argument supplied.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->others_no_arg)?OLC_ACTION(d)->others_no_arg:"NULL")); ((OLC_ACTION(d)->others_no_arg) ? OLC_ACTION(d)->others_no_arg : "NULL"));
OLC_MODE(d) = AEDIT_NOVICT_OTHERS; OLC_MODE(d) = AEDIT_NOVICT_OTHERS;
return; return;
case 'c': case 'c':
@@ -478,7 +478,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter text shown to the Character when his victim isnt found.\r\n" write_to_output(d, "Enter text shown to the Character when his victim isnt found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->not_found)?OLC_ACTION(d)->not_found:"NULL")); ((OLC_ACTION(d)->not_found) ? OLC_ACTION(d)->not_found : "NULL"));
OLC_MODE(d) = AEDIT_VICT_NOT_FOUND; OLC_MODE(d) = AEDIT_VICT_NOT_FOUND;
return; return;
@@ -487,7 +487,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter social shown to the Character when it is its own victim.\r\n" write_to_output(d, "Enter social shown to the Character when it is its own victim.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->char_auto)?OLC_ACTION(d)->char_auto:"NULL")); ((OLC_ACTION(d)->char_auto) ? OLC_ACTION(d)->char_auto : "NULL"));
OLC_MODE(d) = AEDIT_SELF_CHAR; OLC_MODE(d) = AEDIT_SELF_CHAR;
return; return;
@@ -496,7 +496,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter social shown to Others when the Char is its own victim.\r\n" write_to_output(d, "Enter social shown to Others when the Char is its own victim.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->others_auto)?OLC_ACTION(d)->others_auto:"NULL")); ((OLC_ACTION(d)->others_auto) ? OLC_ACTION(d)->others_auto : "NULL"));
OLC_MODE(d) = AEDIT_SELF_OTHERS; OLC_MODE(d) = AEDIT_SELF_OTHERS;
return; return;
@@ -505,7 +505,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter normal social shown to the Character when the victim is found.\r\n" write_to_output(d, "Enter normal social shown to the Character when the victim is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->char_found)?OLC_ACTION(d)->char_found:"NULL")); ((OLC_ACTION(d)->char_found) ? OLC_ACTION(d)->char_found : "NULL"));
OLC_MODE(d) = AEDIT_VICT_CHAR_FOUND; OLC_MODE(d) = AEDIT_VICT_CHAR_FOUND;
return; return;
@@ -514,7 +514,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter normal social shown to Others when the victim is found.\r\n" write_to_output(d, "Enter normal social shown to Others when the victim is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->others_found)?OLC_ACTION(d)->others_found:"NULL")); ((OLC_ACTION(d)->others_found) ? OLC_ACTION(d)->others_found : "NULL"));
OLC_MODE(d) = AEDIT_VICT_OTHERS_FOUND; OLC_MODE(d) = AEDIT_VICT_OTHERS_FOUND;
return; return;
@@ -523,7 +523,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter normal social shown to the Victim when the victim is found.\r\n" write_to_output(d, "Enter normal social shown to the Victim when the victim is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->vict_found)?OLC_ACTION(d)->vict_found:"NULL")); ((OLC_ACTION(d)->vict_found) ? OLC_ACTION(d)->vict_found : "NULL"));
OLC_MODE(d) = AEDIT_VICT_VICT_FOUND; OLC_MODE(d) = AEDIT_VICT_VICT_FOUND;
return; return;
@@ -532,7 +532,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter 'body part' social shown to the Character when the victim is found.\r\n" write_to_output(d, "Enter 'body part' social shown to the Character when the victim is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->char_body_found)?OLC_ACTION(d)->char_body_found:"NULL")); ((OLC_ACTION(d)->char_body_found) ? OLC_ACTION(d)->char_body_found : "NULL"));
OLC_MODE(d) = AEDIT_VICT_CHAR_BODY_FOUND; OLC_MODE(d) = AEDIT_VICT_CHAR_BODY_FOUND;
return; return;
@@ -541,7 +541,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter 'body part' social shown to Others when the victim is found.\r\n" write_to_output(d, "Enter 'body part' social shown to Others when the victim is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->others_body_found)?OLC_ACTION(d)->others_body_found:"NULL")); ((OLC_ACTION(d)->others_body_found) ? OLC_ACTION(d)->others_body_found : "NULL"));
OLC_MODE(d) = AEDIT_VICT_OTHERS_BODY_FOUND; OLC_MODE(d) = AEDIT_VICT_OTHERS_BODY_FOUND;
return; return;
@@ -550,7 +550,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter 'body part' social shown to the Victim when the victim is found.\r\n" write_to_output(d, "Enter 'body part' social shown to the Victim when the victim is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->vict_body_found)?OLC_ACTION(d)->vict_body_found:"NULL")); ((OLC_ACTION(d)->vict_body_found) ? OLC_ACTION(d)->vict_body_found : "NULL"));
OLC_MODE(d) = AEDIT_VICT_VICT_BODY_FOUND; OLC_MODE(d) = AEDIT_VICT_VICT_BODY_FOUND;
return; return;
@@ -559,7 +559,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter 'object' social shown to the Character when the object is found.\r\n" write_to_output(d, "Enter 'object' social shown to the Character when the object is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->char_obj_found)?OLC_ACTION(d)->char_obj_found:"NULL")); ((OLC_ACTION(d)->char_obj_found) ? OLC_ACTION(d)->char_obj_found : "NULL"));
OLC_MODE(d) = AEDIT_OBJ_CHAR_FOUND; OLC_MODE(d) = AEDIT_OBJ_CHAR_FOUND;
return; return;
@@ -568,7 +568,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
write_to_output(d, "Enter 'object' social shown to the Room when the object is found.\r\n" write_to_output(d, "Enter 'object' social shown to the Room when the object is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->others_obj_found)?OLC_ACTION(d)->others_obj_found:"NULL")); ((OLC_ACTION(d)->others_obj_found) ? OLC_ACTION(d)->others_obj_found : "NULL"));
OLC_MODE(d) = AEDIT_OBJ_OTHERS_FOUND; OLC_MODE(d) = AEDIT_OBJ_OTHERS_FOUND;
return; return;
@@ -579,7 +579,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
return; return;
case AEDIT_ACTION_NAME: case AEDIT_ACTION_NAME:
if (!*arg || strchr(arg,' ')) { if (!*arg || strchr(arg, ' ')) {
aedit_disp_menu(d); aedit_disp_menu(d);
return; return;
} }
@@ -590,7 +590,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
break; break;
case AEDIT_SORT_AS: case AEDIT_SORT_AS:
if (!*arg || strchr(arg,' ')) { if (!*arg || strchr(arg, ' ')) {
aedit_disp_menu(d); aedit_disp_menu(d);
return; return;
} }
@@ -778,7 +778,7 @@ ACMD(do_astat)
one_argument(argument, arg); one_argument(argument, arg);
if(!*arg) { if (!*arg) {
send_to_char(ch, "Astat which social?\r\n"); send_to_char(ch, "Astat which social?\r\n");
return; return;
} }
@@ -846,4 +846,3 @@ static int aedit_find_command(const char *txt)
return (cmd); return (cmd);
return (-1); return (-1);
} }

View File

@@ -59,17 +59,17 @@ struct time_info_data *mud_time_passed(time_t t2, time_t t1);
void prune_crlf(char *txt); void prune_crlf(char *txt);
void column_list(struct char_data *ch, int num_cols, const char **list, int list_length, bool show_nums); void column_list(struct char_data *ch, int num_cols, const char **list, int list_length, bool show_nums);
int get_flag_by_name(const char *flag_list[], char *flag_name); int get_flag_by_name(const char *flag_list[], char *flag_name);
int file_head( FILE *file, char *buf, size_t bufsize, int lines_to_read ); int file_head(FILE *file, char *buf, size_t bufsize, int lines_to_read);
int file_tail( FILE *file, char *buf, size_t bufsize, int lines_to_read ); int file_tail(FILE *file, char *buf, size_t bufsize, int lines_to_read);
size_t file_sizeof( FILE *file ); size_t file_sizeof(FILE *file);
int file_numlines( FILE *file ); int file_numlines(FILE *file);
IDXTYPE atoidx( const char *str_to_conv ); IDXTYPE atoidx(const char *str_to_conv);
char *strfrmt(char *str, int w, int h, int justify, int hpad, int vpad); char *strfrmt(char *str, int w, int h, int justify, int hpad, int vpad);
char *strpaste(char *str1, char *str2, char *joiner); char *strpaste(char *str1, char *str2, char *joiner);
void new_affect(struct affected_type *af); void new_affect(struct affected_type *af);
int get_class_by_name(char *classname); int get_class_by_name(char *classname);
char * convert_from_tabs(char * string); char *convert_from_tabs(char *string);
int count_non_protocol_chars(char * str); int count_non_protocol_chars(char *str);
char *right_trim_whitespace(const char *string); char *right_trim_whitespace(const char *string);
void remove_from_string(char *string, const char *to_remove); void remove_from_string(char *string, const char *to_remove);
@@ -255,8 +255,7 @@ void char_from_furniture(struct char_data *ch);
temp = temp->next; \ temp = temp->next; \
if (temp) \ if (temp) \
temp->next = (item)->next; \ temp->next = (item)->next; \
} \ }
/* Connect 'link' to the end of a double-linked list /* Connect 'link' to the end of a double-linked list
* The new item becomes the last in the linked list, and the last * The new item becomes the last in the linked list, and the last
* pointer is updated. * pointer is updated.