forked from kyonshi/grenzland-mud
act-files formatted
This commit is contained in:
@@ -40,7 +40,7 @@ IncludeCategories:
|
||||
Priority: 3
|
||||
IncludeIsMainRegex: '([-_](test|unittest))?$'
|
||||
IndentCaseBlocks: true
|
||||
IndentWidth: 4
|
||||
IndentWidth: 2
|
||||
InsertNewlineAtEOF: true
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
@@ -51,5 +51,5 @@ SpacesInAngles: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
TabWidth: 4
|
||||
TabWidth: 2
|
||||
...
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
#include "act.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) {
|
||||
if (*arg == '@') {
|
||||
@@ -86,7 +86,8 @@ ACMD(do_gsay)
|
||||
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
||||
parse_at(argument);
|
||||
|
||||
send_to_group(ch, ch->group, "%s%s%s says, '%s'%s\r\n", CCGRN(ch, C_NRM), CCGRN(ch, C_NRM), GET_NAME(ch), argument, CCNRM(ch, C_NRM));
|
||||
send_to_group(ch, ch->group, "%s%s%s says, '%s'%s\r\n", CCGRN(ch, C_NRM), CCGRN(ch, C_NRM), GET_NAME(ch),
|
||||
argument, CCNRM(ch, C_NRM));
|
||||
|
||||
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
|
||||
send_to_char(ch, "%s", CONFIG_OK);
|
||||
@@ -131,7 +132,8 @@ static int is_tell_ok(struct char_data *ch, struct char_data *vict)
|
||||
act("$E's linkless at the moment.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
||||
else if (PLR_FLAGGED(vict, PLR_WRITING))
|
||||
act("$E's writing a message right now; try again later.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
||||
else if ((!IS_NPC(vict) && PRF_FLAGGED(vict, PRF_NOTELL)) || (ROOM_FLAGGED(IN_ROOM(vict), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD)))
|
||||
else if ((!IS_NPC(vict) && PRF_FLAGGED(vict, PRF_NOTELL)) || (
|
||||
ROOM_FLAGGED(IN_ROOM(vict), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD)))
|
||||
act("$E can't hear you.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
||||
else
|
||||
return (TRUE);
|
||||
@@ -168,7 +170,7 @@ ACMD(do_tell)
|
||||
}
|
||||
|
||||
/* 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 == '-'))
|
||||
*q++ = *p;
|
||||
|
||||
@@ -178,7 +180,7 @@ ACMD(do_tell)
|
||||
send_to_char(ch, "Sorry, only letters and +/- are allowed characters.\r\n");
|
||||
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);
|
||||
send_to_char(ch, "You look up '%s' in Merriam-Webster.\r\n", word);
|
||||
#endif /* platform specific part */
|
||||
@@ -424,35 +426,42 @@ ACMD(do_gen_comm)
|
||||
* [2] message if you're not on the channel
|
||||
* [3] a color string. */
|
||||
const char *com_msgs[][4] = {
|
||||
{"You cannot holler!!\r\n",
|
||||
{
|
||||
"You cannot holler!!\r\n",
|
||||
"holler",
|
||||
"",
|
||||
KYEL},
|
||||
|
||||
{"You cannot shout!!\r\n",
|
||||
KYEL
|
||||
},
|
||||
{
|
||||
"You cannot shout!!\r\n",
|
||||
"shout",
|
||||
"Turn off your noshout flag first!\r\n",
|
||||
KYEL},
|
||||
|
||||
{"You cannot gossip!!\r\n",
|
||||
KYEL
|
||||
},
|
||||
{
|
||||
"You cannot gossip!!\r\n",
|
||||
"gossip",
|
||||
"You aren't even on the channel!\r\n",
|
||||
KYEL},
|
||||
|
||||
{"You cannot auction!!\r\n",
|
||||
KYEL
|
||||
},
|
||||
{
|
||||
"You cannot auction!!\r\n",
|
||||
"auction",
|
||||
"You aren't even on the channel!\r\n",
|
||||
KMAG},
|
||||
|
||||
{"You cannot congratulate!\r\n",
|
||||
KMAG
|
||||
},
|
||||
{
|
||||
"You cannot congratulate!\r\n",
|
||||
"congrat",
|
||||
"You aren't even on the channel!\r\n",
|
||||
KGRN},
|
||||
|
||||
{"You cannot gossip your emotions!\r\n",
|
||||
KGRN
|
||||
},
|
||||
{
|
||||
"You cannot gossip your emotions!\r\n",
|
||||
"gossip",
|
||||
"You aren't even on the channel!\r\n",
|
||||
KYEL}
|
||||
KYEL
|
||||
}
|
||||
};
|
||||
|
||||
if (PLR_FLAGGED(ch, PLR_NOSHOUT)) {
|
||||
@@ -475,7 +484,8 @@ ACMD(do_gen_comm)
|
||||
|
||||
/* Level_can_shout defined in config.c. */
|
||||
if (GET_LEVEL(ch) < CONFIG_LEVEL_CAN_SHOUT) {
|
||||
send_to_char(ch, "You must be at least level %d before you can %s.\r\n", CONFIG_LEVEL_CAN_SHOUT, com_msgs[subcmd][1]);
|
||||
send_to_char(ch, "You must be at least level %d before you can %s.\r\n", CONFIG_LEVEL_CAN_SHOUT,
|
||||
com_msgs[subcmd][1]);
|
||||
return;
|
||||
}
|
||||
/* Make sure the char is on the channel. */
|
||||
@@ -520,7 +530,7 @@ ACMD(do_gen_comm)
|
||||
|
||||
/* Now send all the strings out. */
|
||||
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;
|
||||
if (!IS_NPC(ch) && (PRF_FLAGGED(i->character, channels[subcmd]) || PLR_FLAGGED(i->character, PLR_WRITING)))
|
||||
continue;
|
||||
|
||||
@@ -268,7 +268,6 @@ ACMD(do_action);
|
||||
ACMD(do_gmote);
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Begin Functions and defines for act.wizard.c
|
||||
****************************************************************************/
|
||||
@@ -327,7 +326,7 @@ ACMD(do_plist);
|
||||
ACMD(do_purge);
|
||||
ACMD(do_recent);
|
||||
ACMD(do_restore);
|
||||
void return_to_char(struct char_data * ch);
|
||||
void return_to_char(struct char_data *ch);
|
||||
ACMD(do_return);
|
||||
ACMD(do_saveall);
|
||||
ACMD(do_send);
|
||||
|
||||
@@ -77,8 +77,8 @@ static void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mod
|
||||
found++;
|
||||
}
|
||||
if (found) {
|
||||
send_to_char(ch, "You are %s upon %s.", GET_POS(ch) == POS_SITTING ? "sitting" :
|
||||
"resting", obj->short_description);
|
||||
send_to_char(ch, "You are %s upon %s.", GET_POS(ch) == POS_SITTING ? "sitting" : "resting",
|
||||
obj->short_description);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
@@ -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. */
|
||||
return;
|
||||
}
|
||||
end:
|
||||
end:
|
||||
|
||||
show_obj_modifiers(obj, ch);
|
||||
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)
|
||||
{
|
||||
struct {
|
||||
struct
|
||||
{
|
||||
byte percent;
|
||||
const char *text;
|
||||
} diagnosis[] = {
|
||||
{ 100, "is in excellent condition." },
|
||||
{ 90, "has a few scratches." },
|
||||
{ 75, "has some small wounds and bruises." },
|
||||
{ 50, "has quite a few wounds." },
|
||||
{ 30, "has some big nasty wounds and scratches." },
|
||||
{ 15, "looks pretty hurt." },
|
||||
{ 0, "is in awful condition." },
|
||||
{ -1, "is bleeding awfully from big wounds." },
|
||||
{100, "is in excellent condition."},
|
||||
{90, "has a few scratches."},
|
||||
{75, "has some small wounds and bruises."},
|
||||
{50, "has quite a few wounds."},
|
||||
{30, "has some big nasty wounds and scratches."},
|
||||
{15, "looks pretty hurt."},
|
||||
{0, "is in awful condition."},
|
||||
{-1, "is bleeding awfully from big wounds."},
|
||||
};
|
||||
int percent, ar_index;
|
||||
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 (!SITTING(i))
|
||||
send_to_char(ch, "%s", positions[(int) GET_POS(i)]);
|
||||
send_to_char(ch, "%s", positions[(int)GET_POS(i)]);
|
||||
else {
|
||||
furniture = SITTING(i);
|
||||
send_to_char(ch, " is %s upon %s.", (GET_POS(i) == POS_SLEEPING ?
|
||||
"sleeping" : (GET_POS(i) == POS_RESTING ? "resting" : "sitting")),
|
||||
send_to_char(ch, " is %s upon %s.",
|
||||
(GET_POS(i) == POS_SLEEPING ? "sleeping" : (GET_POS(i) == POS_RESTING ? "resting" : "sitting")),
|
||||
OBJS(furniture, ch));
|
||||
}
|
||||
} else {
|
||||
@@ -428,7 +429,8 @@ static void do_auto_exits(struct char_data *ch)
|
||||
if (EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) && !PRF_FLAGGED(ch, PRF_HOLYLIGHT))
|
||||
continue;
|
||||
if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED))
|
||||
send_to_char(ch, "%s(%s)%s ", EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) ? CCWHT(ch, C_NRM) : CCRED(ch, C_NRM), autoexits[door], CCCYN(ch, C_NRM));
|
||||
send_to_char(ch, "%s(%s)%s ", EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) ? CCWHT(ch, C_NRM) : CCRED(ch, C_NRM),
|
||||
autoexits[door], CCCYN(ch, C_NRM));
|
||||
else if (EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN))
|
||||
send_to_char(ch, "%s%s%s ", CCWHT(ch, C_NRM), autoexits[door], CCCYN(ch, C_NRM));
|
||||
else
|
||||
@@ -443,16 +445,14 @@ ACMD(do_exits)
|
||||
{
|
||||
int door, len = 0;
|
||||
|
||||
if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT)
|
||||
{
|
||||
if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT) {
|
||||
send_to_char(ch, "You can't see a damned thing, you're blind!\r\n");
|
||||
return;
|
||||
}
|
||||
|
||||
send_to_char(ch, "Obvious exits:\r\n");
|
||||
|
||||
for (door = 0; door < DIR_COUNT; door++)
|
||||
{
|
||||
for (door = 0; door < DIR_COUNT; door++) {
|
||||
if (!EXIT(ch, door) || EXIT(ch, door)->to_room == NOWHERE)
|
||||
continue;
|
||||
if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) && !CONFIG_DISP_CLOSED_DOORS)
|
||||
@@ -462,22 +462,19 @@ ACMD(do_exits)
|
||||
|
||||
len++;
|
||||
|
||||
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS) && !EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED))
|
||||
{
|
||||
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS) && !EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) {
|
||||
send_to_char(ch, "%-5s -[%5d]%s %s\r\n", dirs[door], GET_ROOM_VNUM(EXIT(ch, door)->to_room),
|
||||
EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) ? "[HIDDEN]" : "", world[EXIT(ch, door)->to_room].name);
|
||||
}
|
||||
else if (CONFIG_DISP_CLOSED_DOORS && EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED))
|
||||
{
|
||||
} else if (CONFIG_DISP_CLOSED_DOORS && EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) {
|
||||
/*But we tell them the door is closed */
|
||||
send_to_char(ch, "%-5s - The %s is closed%s\r\n", dirs[door],
|
||||
(EXIT(ch, door)->keyword) ? fname(EXIT(ch, door)->keyword) : "opening",
|
||||
EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) ? " and hidden." : ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
send_to_char(ch, "%-5s - %s\r\n", dirs[door], IS_DARK(EXIT(ch, door)->to_room) &&
|
||||
!CAN_SEE_IN_DARK(ch) ? "Too dark to tell." : world[EXIT(ch, door)->to_room].name);
|
||||
!CAN_SEE_IN_DARK(ch)
|
||||
? "Too dark to tell."
|
||||
: world[EXIT(ch, door)->to_room].name);
|
||||
}
|
||||
}
|
||||
if (!len)
|
||||
@@ -486,7 +483,7 @@ ACMD(do_exits)
|
||||
|
||||
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)];
|
||||
room_vnum target_room;
|
||||
|
||||
@@ -495,11 +492,10 @@ void look_at_room(struct char_data *ch, int ignore_brief)
|
||||
if (!ch->desc)
|
||||
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");
|
||||
return;
|
||||
}
|
||||
else if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT) {
|
||||
} else if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT) {
|
||||
send_to_char(ch, "You see nothing but infinite darkness...\r\n");
|
||||
return;
|
||||
}
|
||||
@@ -518,8 +514,7 @@ void look_at_room(struct char_data *ch, int ignore_brief)
|
||||
send_to_char(ch, " %d", GET_TRIG_VNUM(t));
|
||||
send_to_char(ch, "]");
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
send_to_char(ch, "%s", world[IN_ROOM(ch)].name);
|
||||
|
||||
send_to_char(ch, "%s\r\n", CCNRM(ch, C_NRM));
|
||||
@@ -597,16 +592,13 @@ static void look_in_obj(struct char_data *ch, char *arg)
|
||||
if ((GET_OBJ_VAL(obj, 1) == 0) && (GET_OBJ_VAL(obj, 0) != -1))
|
||||
send_to_char(ch, "It is empty.\r\n");
|
||||
else {
|
||||
if (GET_OBJ_VAL(obj, 0) < 0)
|
||||
{
|
||||
if (GET_OBJ_VAL(obj, 0) < 0) {
|
||||
char buf2[MAX_STRING_LENGTH];
|
||||
sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2));
|
||||
send_to_char(ch, "It's full of a %s liquid.\r\n", buf2);
|
||||
}
|
||||
else if (GET_OBJ_VAL(obj,1)>GET_OBJ_VAL(obj,0))
|
||||
} else if (GET_OBJ_VAL(obj, 1) > GET_OBJ_VAL(obj, 0))
|
||||
send_to_char(ch, "Its contents seem somewhat murky.\r\n"); /* BUG */
|
||||
else
|
||||
{
|
||||
else {
|
||||
char buf2[MAX_STRING_LENGTH];
|
||||
amt = (GET_OBJ_VAL(obj, 1) * 3) / GET_OBJ_VAL(obj, 0);
|
||||
sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2));
|
||||
@@ -837,8 +829,7 @@ ACMD(do_score)
|
||||
GET_NUM_QUESTS(ch) == 1 ? "" : "s");
|
||||
if (GET_QUEST(ch) == NOTHING)
|
||||
send_to_char(ch, "and you are not on a quest at the moment.\r\n");
|
||||
else
|
||||
{
|
||||
else {
|
||||
send_to_char(ch, "and your current quest is: %s", QST_NAME(real_quest(GET_QUEST(ch))));
|
||||
|
||||
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS))
|
||||
@@ -1020,19 +1011,18 @@ ACMD(do_weather)
|
||||
"lit by flashes of lightning"
|
||||
};
|
||||
|
||||
if (OUTSIDE(ch))
|
||||
{
|
||||
if (OUTSIDE(ch)) {
|
||||
send_to_char(ch, "The sky is %s and %s.\r\n", sky_look[weather_info.sky],
|
||||
weather_info.change >= 0 ? "you feel a warm wind from south" :
|
||||
"your foot tells you bad weather is due");
|
||||
weather_info.change >= 0
|
||||
? "you feel a warm wind from south"
|
||||
: "your foot tells you bad weather is due");
|
||||
if (GET_LEVEL(ch) >= LVL_GOD)
|
||||
send_to_char(ch, "Pressure: %d (change: %d), Sky: %d (%s)\r\n",
|
||||
weather_info.pressure,
|
||||
weather_info.change,
|
||||
weather_info.sky,
|
||||
sky_look[weather_info.sky]);
|
||||
}
|
||||
else
|
||||
} else
|
||||
send_to_char(ch, "You have no feeling about the weather at all.\r\n");
|
||||
}
|
||||
|
||||
@@ -1064,8 +1054,7 @@ int search_help(const char *argument, int level)
|
||||
break;
|
||||
|
||||
return (mid);
|
||||
}
|
||||
else if (chk > 0)
|
||||
} else if (chk > 0)
|
||||
bot = mid + 1;
|
||||
else
|
||||
top = mid - 1;
|
||||
@@ -1136,15 +1125,19 @@ ACMD(do_who)
|
||||
int showclass = 0, short_list = 0, outlaws = 0;
|
||||
int who_room = 0, showgroup = 0, showleader = 0;
|
||||
|
||||
struct {
|
||||
struct
|
||||
{
|
||||
char *disp;
|
||||
int min_level;
|
||||
int max_level;
|
||||
int count; /* must always start as 0 */
|
||||
} rank[] = {
|
||||
{ "Immortals\r\n---------\r\n", LVL_IMMORT, LVL_IMPL, 0},
|
||||
{ "Mortals\r\n-------\r\n", 1, LVL_IMMORT - 1, 0 },
|
||||
{ "\n", 0, 0, 0 }
|
||||
{
|
||||
"Immortals\r\n---------\r\n", LVL_IMMORT, LVL_IMPL, 0},
|
||||
{
|
||||
"Mortals\r\n-------\r\n", 1, LVL_IMMORT - 1, 0},
|
||||
{
|
||||
"\n", 0, 0, 0}
|
||||
};
|
||||
|
||||
skip_spaces(&argument);
|
||||
@@ -1361,7 +1354,7 @@ ACMD(do_who)
|
||||
else
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -1486,9 +1479,11 @@ ACMD(do_users)
|
||||
strcpy(idletime, " ");
|
||||
|
||||
sprintf(line, "%3d %-7s %-12s %-14s %-3s %-8s ", d->desc_num, classname,
|
||||
d->original && d->original->player.name ? d->original->player.name :
|
||||
d->character && d->character->player.name ? d->character->player.name :
|
||||
"UNDEFINED",
|
||||
d->original && d->original->player.name
|
||||
? d->original->player.name
|
||||
: d->character && d->character->player.name
|
||||
? d->character->player.name
|
||||
: "UNDEFINED",
|
||||
state, idletime, timestr);
|
||||
|
||||
if (*d->host)
|
||||
@@ -1653,7 +1648,7 @@ static void perform_immort_where(struct char_data *ch, char *arg)
|
||||
else
|
||||
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,
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1697,7 +1692,7 @@ ACMD(do_levels)
|
||||
{
|
||||
char buf[MAX_STRING_LENGTH], arg[MAX_STRING_LENGTH];
|
||||
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)) {
|
||||
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 */
|
||||
min_lev = 1;
|
||||
max_lev = LVL_IMMORT;
|
||||
}
|
||||
else if (ret == 1) {
|
||||
} else if (ret == 1) {
|
||||
/* One arg = range is (num) either side of current level */
|
||||
val = min_lev;
|
||||
max_lev = MIN(GET_LEVEL(ch) + val, LVL_IMMORT);
|
||||
min_lev = MAX(GET_LEVEL(ch) - val, 1);
|
||||
}
|
||||
else if (ret == 2) {
|
||||
} else if (ret == 2) {
|
||||
/* Two args = min-max range limit - just do sanity checks */
|
||||
min_lev = MAX(min_lev, 1);
|
||||
max_lev = MIN(max_lev + 1, LVL_IMMORT);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
send_to_char(ch, "Usage: %slevels [<min>-<max> | <range>]%s\r\n\r\n", QYEL, QNRM);
|
||||
send_to_char(ch, "Displays exp required for levels.\r\n");
|
||||
send_to_char(ch, "%slevels %s- shows all levels (1-%d)\r\n", QCYN, QNRM, (LVL_IMMORT-1));
|
||||
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 10-40 %s- shows level 10 to level 40\r\n",QCYN, QNRM);
|
||||
return;
|
||||
@@ -1836,108 +1827,179 @@ ACMD(do_toggle)
|
||||
{
|
||||
char buf2[4], arg[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
||||
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;
|
||||
bitvector_t toggle; /* this needs changing once hashmaps are implemented */
|
||||
char min_level;
|
||||
char *disable_msg;
|
||||
char *enable_msg;
|
||||
} tog_messages[] = {
|
||||
{"summonable", PRF_SUMMONABLE, 0,
|
||||
{
|
||||
"summonable", PRF_SUMMONABLE, 0,
|
||||
"You are now safe from summoning by other players.\r\n",
|
||||
"You may now be summoned by other players.\r\n"},
|
||||
{"nohassle", PRF_NOHASSLE, LVL_IMMORT,
|
||||
"You may now be summoned by other players.\r\n"
|
||||
},
|
||||
{
|
||||
"nohassle", PRF_NOHASSLE, LVL_IMMORT,
|
||||
"Nohassle disabled.\r\n",
|
||||
"Nohassle enabled.\r\n"},
|
||||
{"brief", PRF_BRIEF, 0,
|
||||
"Nohassle enabled.\r\n"
|
||||
},
|
||||
{
|
||||
"brief", PRF_BRIEF, 0,
|
||||
"Brief mode off.\r\n",
|
||||
"Brief mode on.\r\n"},
|
||||
{"compact", PRF_COMPACT, 0,
|
||||
"Brief mode on.\r\n"
|
||||
},
|
||||
{
|
||||
"compact", PRF_COMPACT, 0,
|
||||
"Compact mode off.\r\n",
|
||||
"Compact mode on.\r\n"},
|
||||
{"notell", PRF_NOTELL, 0,
|
||||
"Compact mode on.\r\n"
|
||||
},
|
||||
{
|
||||
"notell", PRF_NOTELL, 0,
|
||||
"You can now hear tells.\r\n",
|
||||
"You are now deaf to tells.\r\n"},
|
||||
{"noauction", PRF_NOAUCT, 0,
|
||||
"You are now deaf to tells.\r\n"
|
||||
},
|
||||
{
|
||||
"noauction", PRF_NOAUCT, 0,
|
||||
"You can now hear auctions.\r\n",
|
||||
"You are now deaf to auctions.\r\n"},
|
||||
{"noshout", PRF_NOSHOUT, 0,
|
||||
"You are now deaf to auctions.\r\n"
|
||||
},
|
||||
{
|
||||
"noshout", PRF_NOSHOUT, 0,
|
||||
"You can now hear shouts.\r\n",
|
||||
"You are now deaf to shouts.\r\n"},
|
||||
{"nogossip", PRF_NOGOSS, 0,
|
||||
"You are now deaf to shouts.\r\n"
|
||||
},
|
||||
{
|
||||
"nogossip", PRF_NOGOSS, 0,
|
||||
"You can now hear gossip.\r\n",
|
||||
"You are now deaf to gossip.\r\n"},
|
||||
{"nograts", PRF_NOGRATZ, 0,
|
||||
"You are now deaf to gossip.\r\n"
|
||||
},
|
||||
{
|
||||
"nograts", PRF_NOGRATZ, 0,
|
||||
"You can now hear gratz.\r\n",
|
||||
"You are now deaf to gratz.\r\n"},
|
||||
{"nowiz", PRF_NOWIZ, LVL_IMMORT,
|
||||
"You are now deaf to gratz.\r\n"
|
||||
},
|
||||
{
|
||||
"nowiz", PRF_NOWIZ, LVL_IMMORT,
|
||||
"You can now hear the Wiz-channel.\r\n",
|
||||
"You are now deaf to the Wiz-channel.\r\n"},
|
||||
{"quest", PRF_QUEST, 0,
|
||||
"You are now deaf to the Wiz-channel.\r\n"
|
||||
},
|
||||
{
|
||||
"quest", PRF_QUEST, 0,
|
||||
"You are no longer part of the Quest.\r\n",
|
||||
"Okay, you are part of the Quest.\r\n"},
|
||||
{"showvnums", PRF_SHOWVNUMS, LVL_IMMORT,
|
||||
"Okay, you are part of the Quest.\r\n"
|
||||
},
|
||||
{
|
||||
"showvnums", PRF_SHOWVNUMS, LVL_IMMORT,
|
||||
"You will no longer see the vnums.\r\n",
|
||||
"You will now see the vnums.\r\n"},
|
||||
{"norepeat", PRF_NOREPEAT, 0,
|
||||
"You will now see the vnums.\r\n"
|
||||
},
|
||||
{
|
||||
"norepeat", PRF_NOREPEAT, 0,
|
||||
"You will now have your communication repeated.\r\n",
|
||||
"You will no longer have your communication repeated.\r\n"},
|
||||
{"holylight", PRF_HOLYLIGHT, LVL_IMMORT,
|
||||
"You will no longer have your communication repeated.\r\n"
|
||||
},
|
||||
{
|
||||
"holylight", PRF_HOLYLIGHT, LVL_IMMORT,
|
||||
"HolyLight mode off.\r\n",
|
||||
"HolyLight mode on.\r\n"},
|
||||
{"slownameserver", 0, LVL_IMPL,
|
||||
"HolyLight mode on.\r\n"
|
||||
},
|
||||
{
|
||||
"slownameserver", 0, LVL_IMPL,
|
||||
"Nameserver_is_slow changed to OFF; IP addresses will now be resolved.\r\n",
|
||||
"Nameserver_is_slow changed to ON; sitenames will no longer be resolved.\r\n"},
|
||||
{"autoexits", PRF_AUTOEXIT, 0,
|
||||
"Nameserver_is_slow changed to ON; sitenames will no longer be resolved.\r\n"
|
||||
},
|
||||
{
|
||||
"autoexits", PRF_AUTOEXIT, 0,
|
||||
"Autoexits disabled.\r\n",
|
||||
"Autoexits enabled.\r\n"},
|
||||
{"trackthru", 0, LVL_IMPL,
|
||||
"Autoexits enabled.\r\n"
|
||||
},
|
||||
{
|
||||
"trackthru", 0, LVL_IMPL,
|
||||
"Players can no longer track through doors.\r\n",
|
||||
"Players can now track through doors.\r\n"},
|
||||
{"clsolc", PRF_CLS, LVL_BUILDER,
|
||||
"Players can now track through doors.\r\n"
|
||||
},
|
||||
{
|
||||
"clsolc", PRF_CLS, LVL_BUILDER,
|
||||
"You will no longer clear screen in OLC.\r\n",
|
||||
"You will now clear screen in OLC.\r\n"},
|
||||
{"buildwalk", PRF_BUILDWALK, LVL_BUILDER,
|
||||
"You will now clear screen in OLC.\r\n"
|
||||
},
|
||||
{
|
||||
"buildwalk", PRF_BUILDWALK, LVL_BUILDER,
|
||||
"Buildwalk is now Off.\r\n",
|
||||
"Buildwalk is now On.\r\n"},
|
||||
{"afk", PRF_AFK, 0,
|
||||
"Buildwalk is now On.\r\n"
|
||||
},
|
||||
{
|
||||
"afk", PRF_AFK, 0,
|
||||
"AFK is now Off.\r\n",
|
||||
"AFK is now On.\r\n"},
|
||||
{"autoloot", PRF_AUTOLOOT, 0,
|
||||
"AFK is now On.\r\n"
|
||||
},
|
||||
{
|
||||
"autoloot", PRF_AUTOLOOT, 0,
|
||||
"Autoloot disabled.\r\n",
|
||||
"Autoloot enabled.\r\n"},
|
||||
{"autogold", PRF_AUTOGOLD, 0,
|
||||
"Autoloot enabled.\r\n"
|
||||
},
|
||||
{
|
||||
"autogold", PRF_AUTOGOLD, 0,
|
||||
"Autogold disabled.\r\n",
|
||||
"Autogold enabled.\r\n"},
|
||||
{"autosplit", PRF_AUTOSPLIT, 0,
|
||||
"Autogold enabled.\r\n"
|
||||
},
|
||||
{
|
||||
"autosplit", PRF_AUTOSPLIT, 0,
|
||||
"Autosplit disabled.\r\n",
|
||||
"Autosplit enabled.\r\n"},
|
||||
{"autosac", PRF_AUTOSAC, 0,
|
||||
"Autosplit enabled.\r\n"
|
||||
},
|
||||
{
|
||||
"autosac", PRF_AUTOSAC, 0,
|
||||
"Autosac disabled.\r\n",
|
||||
"Autosac enabled.\r\n"},
|
||||
{"autoassist", PRF_AUTOASSIST, 0,
|
||||
"Autosac enabled.\r\n"
|
||||
},
|
||||
{
|
||||
"autoassist", PRF_AUTOASSIST, 0,
|
||||
"Autoassist disabled.\r\n",
|
||||
"Autoassist enabled.\r\n"},
|
||||
{"automap", PRF_AUTOMAP, 1,
|
||||
"Autoassist enabled.\r\n"
|
||||
},
|
||||
{
|
||||
"automap", PRF_AUTOMAP, 1,
|
||||
"You will no longer see the mini-map.\r\n",
|
||||
"You will now see a mini-map at the side of room descriptions.\r\n"},
|
||||
{"autokey", PRF_AUTOKEY, 0,
|
||||
"You will now see a mini-map at the side of room descriptions.\r\n"
|
||||
},
|
||||
{
|
||||
"autokey", PRF_AUTOKEY, 0,
|
||||
"You will now have to unlock doors manually before opening.\r\n",
|
||||
"You will now automatically unlock doors when opening them (if you have the key).\r\n"},
|
||||
{"autodoor", PRF_AUTODOOR, 0,
|
||||
"You will now automatically unlock doors when opening them (if you have the key).\r\n"
|
||||
},
|
||||
{
|
||||
"autodoor", PRF_AUTODOOR, 0,
|
||||
"You will now need to specify a door direction when opening, closing and unlocking.\r\n",
|
||||
"You will now find the next available door when opening, closing or unlocking.\r\n"},
|
||||
{"zoneresets", PRF_ZONERESETS, LVL_IMPL,
|
||||
"You will now find the next available door when opening, closing or unlocking.\r\n"
|
||||
},
|
||||
{
|
||||
"zoneresets", PRF_ZONERESETS, LVL_IMPL,
|
||||
"You will no longer see zone resets.\r\n",
|
||||
"You will now see zone resets.\r\n"},
|
||||
{"syslog", 0, LVL_IMMORT, "\n", "\n"},
|
||||
{"wimpy", 0, 0, "\n", "\n"},
|
||||
{"pagelength", 0, 0, "\n", "\n"},
|
||||
{"screenwidth", 0, 0, "\n", "\n"},
|
||||
{"color", 0, 0, "\n", "\n"},
|
||||
{"\n", 0, -1, "\n", "\n"} /* must be last */
|
||||
"You will now see zone resets.\r\n"
|
||||
},
|
||||
{
|
||||
"syslog", 0, LVL_IMMORT, "\n", "\n"
|
||||
},
|
||||
{
|
||||
"wimpy", 0, 0, "\n", "\n"
|
||||
},
|
||||
{
|
||||
"pagelength", 0, 0, "\n", "\n"
|
||||
},
|
||||
{
|
||||
"screenwidth", 0, 0, "\n", "\n"
|
||||
},
|
||||
{
|
||||
"color", 0, 0, "\n", "\n"
|
||||
},
|
||||
{
|
||||
"\n", 0, -1, "\n", "\n"
|
||||
} /* must be last */
|
||||
};
|
||||
|
||||
if (IS_NPC(ch))
|
||||
@@ -2085,8 +2147,10 @@ ACMD(do_toggle)
|
||||
}
|
||||
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1);
|
||||
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2);
|
||||
if (tp & 1) SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1);
|
||||
if (tp & 2) SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2);
|
||||
if (tp & 1)
|
||||
SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1);
|
||||
if (tp & 2)
|
||||
SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2);
|
||||
|
||||
send_to_char(ch, "Your %scolor%s is now %s.\r\n", CCRED(ch, C_SPR), CCNRM(ch, C_OFF), types[tp]);
|
||||
return;
|
||||
@@ -2102,8 +2166,10 @@ ACMD(do_toggle)
|
||||
}
|
||||
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
|
||||
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
|
||||
if (tp & 1) SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
|
||||
if (tp & 2) SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
|
||||
if (tp & 1)
|
||||
SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
|
||||
if (tp & 2)
|
||||
SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
|
||||
|
||||
send_to_char(ch, "Your syslog is now %s.\r\n", types[tp]);
|
||||
return;
|
||||
@@ -2120,11 +2186,11 @@ ACMD(do_toggle)
|
||||
}
|
||||
result = PRF_TOG_CHK(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]))
|
||||
break;
|
||||
if (*(sector_types[i]) == '\n')
|
||||
i=0;
|
||||
i = 0;
|
||||
GET_BUILDWALK_SECTOR(ch) = i;
|
||||
send_to_char(ch, "Default sector type is %s\r\n", sector_types[i]);
|
||||
mudlog(CMP, GET_LEVEL(ch), TRUE,
|
||||
@@ -2308,7 +2374,7 @@ ACMD(do_history)
|
||||
struct txt_block *tmp;
|
||||
for (tmp = GET_HISTORY(ch, type); tmp; tmp = tmp->next)
|
||||
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
|
||||
free_history(ch, type);
|
||||
#endif
|
||||
@@ -2317,6 +2383,7 @@ ACMD(do_history)
|
||||
}
|
||||
|
||||
#define HIST_LENGTH 100
|
||||
|
||||
void add_history(struct char_data *ch, char *str, int type)
|
||||
{
|
||||
int i = 0;
|
||||
@@ -2336,8 +2403,7 @@ void add_history(struct char_data *ch, char *str, int type)
|
||||
if (!tmp) {
|
||||
CREATE(GET_HISTORY(ch, type), struct txt_block, 1);
|
||||
GET_HISTORY(ch, type)->text = strdup(buf);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
while (tmp->next)
|
||||
tmp = tmp->next;
|
||||
CREATE(tmp->next, struct txt_block, 1);
|
||||
@@ -2372,8 +2438,7 @@ ACMD(do_whois)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(victim=get_player_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
|
||||
{
|
||||
if (!(victim = get_player_vis(ch, buf, NULL, FIND_CHAR_WORLD))) {
|
||||
CREATE(victim, struct char_data, 1);
|
||||
clear_char(victim);
|
||||
|
||||
@@ -2384,8 +2449,8 @@ ACMD(do_whois)
|
||||
if (load_char(buf, victim) > -1)
|
||||
got_from_file = 1;
|
||||
else {
|
||||
send_to_char (ch, "There is no such player.\r\n");
|
||||
free_char (victim);
|
||||
send_to_char(ch, "There is no such player.\r\n");
|
||||
free_char(victim);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -2395,7 +2460,7 @@ ACMD(do_whois)
|
||||
send_to_char(ch, "Name: %s %s\r\nSex: %s\r\n", GET_NAME(victim),
|
||||
(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, "Level: %d\r\n", GET_LEVEL(victim));
|
||||
@@ -2415,13 +2480,13 @@ ACMD(do_whois)
|
||||
send_to_char(ch, "\r\n");
|
||||
|
||||
if (PRF_FLAGGED(victim, PRF_AFK))
|
||||
send_to_char(ch, "%s%s is afk right now, so %s may not respond to communication.%s\r\n", CBGRN(ch, C_NRM), GET_NAME(victim), HSSH(victim), CCNRM(ch, C_NRM));
|
||||
}
|
||||
else if (hours > 0)
|
||||
send_to_char(ch, "Last Logon: %s (%d days & %d hours ago.)\r\n", buf, hours/24, hours%24);
|
||||
send_to_char(ch, "%s%s is afk right now, so %s may not respond to communication.%s\r\n", CBGRN(ch, C_NRM),
|
||||
GET_NAME(victim), HSSH(victim), CCNRM(ch, C_NRM));
|
||||
} else if (hours > 0)
|
||||
send_to_char(ch, "Last Logon: %s (%d days & %d hours ago.)\r\n", buf, hours / 24, hours % 24);
|
||||
else
|
||||
send_to_char(ch, "Last Logon: %s (0 hours & %d minutes ago.)\r\n",
|
||||
buf, (int)(time(0) - victim->player.time.logon)/60);
|
||||
buf, (int)(time(0) - victim->player.time.logon) / 60);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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) {
|
||||
protocol_t * prot = victim->desc->pProtocol;
|
||||
send_to_char(ch, "Client: %s [%s]\r\n", prot->pVariables[eMSDP_CLIENT_ID]->pValueString, prot->pVariables[eMSDP_CLIENT_VERSION]->pValueString ? prot->pVariables[eMSDP_CLIENT_VERSION]->pValueString : "Unknown");
|
||||
send_to_char(ch, "Color: %s\r\n", prot->pVariables[eMSDP_XTERM_256_COLORS]->ValueInt ? "Xterm" : (prot->pVariables[eMSDP_ANSI_COLORS]->ValueInt ? "Ansi" : "None"));
|
||||
protocol_t *prot = victim->desc->pProtocol;
|
||||
send_to_char(ch, "Client: %s [%s]\r\n", prot->pVariables[eMSDP_CLIENT_ID]->pValueString,
|
||||
prot->pVariables[eMSDP_CLIENT_VERSION]->pValueString
|
||||
? prot->pVariables[eMSDP_CLIENT_VERSION]->pValueString
|
||||
: "Unknown");
|
||||
send_to_char(ch, "Color: %s\r\n", prot->pVariables[eMSDP_XTERM_256_COLORS]->ValueInt
|
||||
? "Xterm"
|
||||
: (prot->pVariables[eMSDP_ANSI_COLORS]->ValueInt ? "Ansi" : "None"));
|
||||
send_to_char(ch, "MXP: %s\r\n", prot->bMXP ? "Yes" : "No");
|
||||
send_to_char(ch, "Charset: %s\r\n", prot->bCHARSET ? "Yes" : "No");
|
||||
send_to_char(ch, "MSP: %s\r\n", prot->bMSP ? "Yes" : "No");
|
||||
@@ -2444,7 +2514,7 @@ ACMD(do_whois)
|
||||
}
|
||||
|
||||
if (got_from_file)
|
||||
free_char (victim);
|
||||
free_char(victim);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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];
|
||||
bool show_zone = FALSE, overlap = FALSE, overlap_shown = FALSE;
|
||||
|
||||
@@ -2488,10 +2558,10 @@ ACMD(do_areas)
|
||||
lolev = atoi(arg);
|
||||
|
||||
/* Check for 2nd value */
|
||||
if (*(second+1) == '\0' || !isdigit(*(second+1)) )
|
||||
if (*(second + 1) == '\0' || !isdigit(*(second+1)))
|
||||
hilev = 100;
|
||||
else
|
||||
hilev = atoi(second+1);
|
||||
hilev = atoi(second + 1);
|
||||
|
||||
} else {
|
||||
/* No range - single number */
|
||||
@@ -2526,7 +2596,8 @@ ACMD(do_areas)
|
||||
} else if ((hilev != -1) && (lolev >= ZONE_MINLVL(i)) && (hilev <= ZONE_MAXLVL(i))) {
|
||||
/* Range supplied, it's completely within this zone's range (no overlap) */
|
||||
show_zone = TRUE;
|
||||
} else if ((hilev != -1) && ((lolev >= ZONE_MINLVL(i) && lolev <= ZONE_MAXLVL(i)) || (hilev <= ZONE_MAXLVL(i) && hilev >= ZONE_MINLVL(i)))) {
|
||||
} else if ((hilev != -1) && ((lolev >= ZONE_MINLVL(i) && lolev <= ZONE_MAXLVL(i)) || (
|
||||
hilev <= ZONE_MAXLVL(i) && hilev >= ZONE_MINLVL(i)))) {
|
||||
/* Range supplied, it overlaps this zone's range */
|
||||
show_zone = TRUE;
|
||||
overlap = TRUE;
|
||||
@@ -2541,19 +2612,23 @@ ACMD(do_areas)
|
||||
}
|
||||
|
||||
if (show_zone) {
|
||||
if (overlap) overlap_shown = TRUE;
|
||||
if (overlap)
|
||||
overlap_shown = TRUE;
|
||||
lev_set = get_zone_levels(i, lev_str);
|
||||
tmp_len = snprintf(buf+len, sizeof(buf)-len, "\tn(%3d) %s%-*s\tn %s%s\tn\r\n", ++zcount, overlap ? QRED : QCYN,
|
||||
count_color_chars(zone_table[i].name)+30, zone_table[i].name,
|
||||
tmp_len = snprintf(buf + len, sizeof(buf) - len, "\tn(%3d) %s%-*s\tn %s%s\tn\r\n", ++zcount,
|
||||
overlap ? QRED : QCYN,
|
||||
count_color_chars(zone_table[i].name) + 30, zone_table[i].name,
|
||||
lev_set ? "\tc" : "\tn", lev_set ? lev_str : "All Levels");
|
||||
len += tmp_len;
|
||||
}
|
||||
}
|
||||
tmp_len = snprintf(buf+len, sizeof(buf)-len, "%s%d%s area%s found.\r\n", QYEL, zcount, QNRM, zcount == 1 ? "" : "s");
|
||||
tmp_len = snprintf(buf + len, sizeof(buf) - len, "%s%d%s area%s found.\r\n", QYEL, zcount, QNRM,
|
||||
zcount == 1 ? "" : "s");
|
||||
len += tmp_len;
|
||||
|
||||
if (overlap_shown) {
|
||||
snprintf(buf+len, sizeof(buf)-len, "Areas shown in \trred\tn may have some creatures outside the specified range.\r\n");
|
||||
snprintf(buf + len, sizeof(buf) - len,
|
||||
"Areas shown in \trred\tn may have some creatures outside the specified range.\r\n");
|
||||
}
|
||||
|
||||
if (zcount == 0)
|
||||
@@ -2562,8 +2637,8 @@ ACMD(do_areas)
|
||||
page_string(ch->desc, buf, TRUE);
|
||||
}
|
||||
|
||||
static void list_scanned_chars(struct char_data * list, struct char_data * ch, int
|
||||
distance, int door)
|
||||
static void list_scanned_chars(struct char_data *list, struct char_data *ch, int
|
||||
distance, int door)
|
||||
{
|
||||
char buf[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH - 1];
|
||||
|
||||
@@ -2577,12 +2652,12 @@ distance, int door)
|
||||
int count = 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.) */
|
||||
|
||||
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 */
|
||||
|
||||
if (CAN_SEE(ch, i))
|
||||
@@ -2593,7 +2668,7 @@ distance, int door)
|
||||
|
||||
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.,
|
||||
if (!CAN_SEE(ch, i) || !condition2 || !condition3) */
|
||||
|
||||
@@ -2619,7 +2694,7 @@ distance, int door)
|
||||
ACMD(do_scan)
|
||||
{
|
||||
int door;
|
||||
bool found=FALSE;
|
||||
bool found = FALSE;
|
||||
|
||||
int range;
|
||||
int maxrange = 3;
|
||||
@@ -2632,7 +2707,7 @@ ACMD(do_scan)
|
||||
}
|
||||
|
||||
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 &&
|
||||
!IS_SET(world[scanned_room].dir_option[door]->exit_info, EX_CLOSED) &&
|
||||
!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]);
|
||||
else
|
||||
send_to_char(ch, "%s: It is too dark to see anything.\r\n", dirs[door]);
|
||||
found=TRUE;
|
||||
found = TRUE;
|
||||
} else {
|
||||
if (world[scanned_room].people) {
|
||||
list_scanned_chars(world[scanned_room].people, ch, range - 1, door);
|
||||
found=TRUE;
|
||||
found = TRUE;
|
||||
}
|
||||
}
|
||||
} // end of if
|
||||
|
||||
107
src/act.item.c
107
src/act.item.c
@@ -48,8 +48,6 @@ static void perform_wear(struct char_data *ch, struct obj_data *obj, int where);
|
||||
static void wear_message(struct char_data *ch, struct obj_data *obj, int where);
|
||||
|
||||
|
||||
|
||||
|
||||
static void perform_put(struct char_data *ch, struct obj_data *obj, struct obj_data *cont)
|
||||
{
|
||||
long object_id = obj_script_id(obj);
|
||||
@@ -126,7 +124,7 @@ ACMD(do_put)
|
||||
send_to_char(ch, "You'd better open it first!\r\n");
|
||||
else {
|
||||
if (obj_dotmode == FIND_INDIV) { /* put <obj> <container> */
|
||||
if (!(obj = get_obj_in_list_vis(ch, theobj, NULL, ch->carrying)))
|
||||
if (!((obj = get_obj_in_list_vis(ch, theobj, NULL, ch->carrying))))
|
||||
send_to_char(ch, "You aren't carrying %s %s.\r\n", AN(theobj), theobj);
|
||||
else if (obj == cont && howmany == 1)
|
||||
send_to_char(ch, "You attempt to fold it into itself, but fail.\r\n");
|
||||
@@ -162,12 +160,12 @@ ACMD(do_put)
|
||||
|
||||
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);
|
||||
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)) {
|
||||
act("$p: you can't carry that many items.", FALSE, ch, obj, 0, TO_CHAR);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
} else {
|
||||
struct obj_data *obj_next;
|
||||
while(obj && howmany--) {
|
||||
while (obj && howmany--) {
|
||||
obj_next = obj->next_content;
|
||||
perform_get_from_room(ch, obj);
|
||||
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) ? \
|
||||
" It vanishes in a puff of smoke!" : "")
|
||||
|
||||
static int perform_drop(struct char_data *ch, struct obj_data *obj,
|
||||
byte mode, const char *sname, room_rnum RDR)
|
||||
{
|
||||
@@ -524,7 +523,7 @@ ACMD(do_drop)
|
||||
/* fail + double chance for room 1 */
|
||||
num_don_rooms = (CONFIG_DON_ROOM_1 != NOWHERE) * 2 +
|
||||
(CONFIG_DON_ROOM_2 != NOWHERE) +
|
||||
(CONFIG_DON_ROOM_3 != NOWHERE) + 1 ;
|
||||
(CONFIG_DON_ROOM_3 != NOWHERE) + 1;
|
||||
switch (rand_number(0, num_don_rooms)) {
|
||||
case 0:
|
||||
mode = SCMD_JUNK;
|
||||
@@ -533,8 +532,12 @@ ACMD(do_drop)
|
||||
case 2:
|
||||
RDR = real_room(CONFIG_DON_ROOM_1);
|
||||
break;
|
||||
case 3: RDR = real_room(CONFIG_DON_ROOM_2); break;
|
||||
case 4: RDR = real_room(CONFIG_DON_ROOM_3); break;
|
||||
case 3:
|
||||
RDR = real_room(CONFIG_DON_ROOM_2);
|
||||
break;
|
||||
case 4:
|
||||
RDR = real_room(CONFIG_DON_ROOM_3);
|
||||
break;
|
||||
|
||||
}
|
||||
if (RDR == NOWHERE) {
|
||||
@@ -568,7 +571,8 @@ ACMD(do_drop)
|
||||
next_obj = get_obj_in_list_vis(ch, arg, NULL, obj->next_content);
|
||||
amount += perform_drop(ch, obj, mode, sname, RDR);
|
||||
obj = next_obj;
|
||||
} while (obj && --multi);
|
||||
}
|
||||
while (obj && --multi);
|
||||
}
|
||||
} else {
|
||||
dotmode = find_all_dots(arg);
|
||||
@@ -633,7 +637,8 @@ static void perform_give(struct char_data *ch, struct char_data *vict,
|
||||
act("$N seems to have $S hands full.", FALSE, ch, 0, vict, TO_CHAR);
|
||||
return;
|
||||
}
|
||||
if (GET_OBJ_WEIGHT(obj) + IS_CARRYING_W(vict) > CAN_CARRY_W(vict) && GET_LEVEL(ch) < LVL_IMMORT && GET_LEVEL(vict) < LVL_IMMORT) {
|
||||
if (GET_OBJ_WEIGHT(obj) + IS_CARRYING_W(vict) > CAN_CARRY_W(vict) && GET_LEVEL(ch) < LVL_IMMORT && GET_LEVEL(vict) <
|
||||
LVL_IMMORT) {
|
||||
act("$E can't carry that much weight.", FALSE, ch, 0, vict, TO_CHAR);
|
||||
return;
|
||||
}
|
||||
@@ -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 $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 */
|
||||
@@ -1081,8 +1086,7 @@ ACMD(do_pour)
|
||||
GET_OBJ_VAL(from_obj, 1) = 0;
|
||||
GET_OBJ_VAL(from_obj, 2) = 0;
|
||||
GET_OBJ_VAL(from_obj, 3) = 0;
|
||||
}
|
||||
else
|
||||
} else
|
||||
send_to_char(ch, "You can't possibly pour that container out!\r\n");
|
||||
|
||||
return;
|
||||
@@ -1139,14 +1143,12 @@ ACMD(do_pour)
|
||||
GET_OBJ_VAL(from_obj, 2) = 0;
|
||||
GET_OBJ_VAL(from_obj, 3) = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
GET_OBJ_VAL(to_obj, 1) = GET_OBJ_VAL(to_obj, 0);
|
||||
amount = GET_OBJ_VAL(to_obj, 0);
|
||||
}
|
||||
/* Poisoned? */
|
||||
GET_OBJ_VAL(to_obj, 3) = (GET_OBJ_VAL(to_obj, 3) || GET_OBJ_VAL(from_obj, 3))
|
||||
;
|
||||
GET_OBJ_VAL(to_obj, 3) = (GET_OBJ_VAL(to_obj, 3) || GET_OBJ_VAL(from_obj, 3));
|
||||
/* Weight change, except for unlimited. */
|
||||
if (GET_OBJ_VAL(from_obj, 0) > 0) {
|
||||
weight_change_object(from_obj, -amount);
|
||||
@@ -1304,18 +1306,30 @@ int find_eq_pos(struct char_data *ch, struct obj_data *obj, char *arg)
|
||||
};
|
||||
|
||||
if (!arg || !*arg) {
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_FINGER)) where = WEAR_FINGER_R;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_NECK)) where = WEAR_NECK_1;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_BODY)) where = WEAR_BODY;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_HEAD)) where = WEAR_HEAD;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_LEGS)) where = WEAR_LEGS;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_FEET)) where = WEAR_FEET;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_HANDS)) where = WEAR_HANDS;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_ARMS)) where = WEAR_ARMS;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_SHIELD)) where = WEAR_SHIELD;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_ABOUT)) where = WEAR_ABOUT;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_WAIST)) where = WEAR_WAIST;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_WRIST)) where = WEAR_WRIST_R;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_FINGER))
|
||||
where = WEAR_FINGER_R;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_NECK))
|
||||
where = WEAR_NECK_1;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_BODY))
|
||||
where = WEAR_BODY;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_HEAD))
|
||||
where = WEAR_HEAD;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_LEGS))
|
||||
where = WEAR_LEGS;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_FEET))
|
||||
where = WEAR_FEET;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_HANDS))
|
||||
where = WEAR_HANDS;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_ARMS))
|
||||
where = WEAR_ARMS;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_SHIELD))
|
||||
where = WEAR_SHIELD;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_ABOUT))
|
||||
where = WEAR_ABOUT;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_WAIST))
|
||||
where = WEAR_WAIST;
|
||||
if (CAN_WEAR(obj, ITEM_WEAR_WRIST))
|
||||
where = WEAR_WRIST_R;
|
||||
} else if ((where = search_block(arg, keywords, FALSE)) < 0)
|
||||
send_to_char(ch, "'%s'? What part of your body is THAT?\r\n", arg);
|
||||
|
||||
@@ -1447,7 +1461,7 @@ static void perform_remove(struct char_data *ch, int pos)
|
||||
* (location) to remove an object from. */
|
||||
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);
|
||||
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);
|
||||
else {
|
||||
if (!remove_otrigger(obj, ch))
|
||||
@@ -1515,7 +1529,8 @@ ACMD(do_sac)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(j = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents)) && (!(j = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)))) {
|
||||
if (!(j = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents)) && (!(
|
||||
j = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)))) {
|
||||
send_to_char(ch, "It doesn't seem to be here.\n\r");
|
||||
return;
|
||||
}
|
||||
@@ -1529,30 +1544,34 @@ ACMD(do_sac)
|
||||
|
||||
switch (rand_number(0, 5)) {
|
||||
case 0:
|
||||
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n", GET_OBJ_SHORT(j));
|
||||
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n",
|
||||
GET_OBJ_SHORT(j));
|
||||
increase_gold(ch, 1);
|
||||
break;
|
||||
case 1:
|
||||
send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe Gods ignore your sacrifice.\r\n", GET_OBJ_SHORT(j));
|
||||
break;
|
||||
case 2:
|
||||
send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe gods give you %d experience points.\r\n", GET_OBJ_SHORT(j), 1+2*GET_OBJ_LEVEL(j));
|
||||
GET_EXP(ch) += (1+2*GET_OBJ_LEVEL(j));
|
||||
send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe gods give you %d experience points.\r\n", GET_OBJ_SHORT(j),
|
||||
1 + 2 * GET_OBJ_LEVEL(j));
|
||||
GET_EXP(ch) += (1 + 2 * GET_OBJ_LEVEL(j));
|
||||
break;
|
||||
case 3:
|
||||
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive %d experience points.\r\n", GET_OBJ_SHORT(j), 1+GET_OBJ_LEVEL(j));
|
||||
GET_EXP(ch) += (1+GET_OBJ_LEVEL(j));
|
||||
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive %d experience points.\r\n", GET_OBJ_SHORT(j),
|
||||
1 + GET_OBJ_LEVEL(j));
|
||||
GET_EXP(ch) += (1 + GET_OBJ_LEVEL(j));
|
||||
break;
|
||||
case 4:
|
||||
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)));
|
||||
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)));
|
||||
break;
|
||||
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)));
|
||||
increase_gold(ch, (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)));
|
||||
break;
|
||||
default:
|
||||
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n",GET_OBJ_SHORT(j));
|
||||
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n",
|
||||
GET_OBJ_SHORT(j));
|
||||
increase_gold(ch, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -166,8 +166,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
||||
return 0;
|
||||
|
||||
/* Charm effect: Does it override the movement? */
|
||||
if (AFF_FLAGGED(ch, AFF_CHARM) && ch->master && was_in == IN_ROOM(ch->master))
|
||||
{
|
||||
if (AFF_FLAGGED(ch, AFF_CHARM) && ch->master && was_in == IN_ROOM(ch->master)) {
|
||||
send_to_char(ch, "The thought of leaving your master makes you weep.\r\n");
|
||||
act("$n bursts into tears.", FALSE, ch, 0, 0, TO_ROOM);
|
||||
return (0);
|
||||
@@ -175,28 +174,23 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
||||
|
||||
/* Water, No Swimming Rooms: Does the deep water prevent movement? */
|
||||
if ((SECT(was_in) == SECT_WATER_NOSWIM) ||
|
||||
(SECT(going_to) == SECT_WATER_NOSWIM))
|
||||
{
|
||||
if (!has_boat(ch))
|
||||
{
|
||||
(SECT(going_to) == SECT_WATER_NOSWIM)) {
|
||||
if (!has_boat(ch)) {
|
||||
send_to_char(ch, "You need a boat to go there.\r\n");
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Flying Required: Does lack of flying prevent movement? */
|
||||
if ((SECT(was_in) == SECT_FLYING) || (SECT(going_to) == SECT_FLYING))
|
||||
{
|
||||
if (!has_flight(ch))
|
||||
{
|
||||
if ((SECT(was_in) == SECT_FLYING) || (SECT(going_to) == SECT_FLYING)) {
|
||||
if (!has_flight(ch)) {
|
||||
send_to_char(ch, "You need to be flying to go there!\r\n");
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Underwater Room: Does lack of underwater breathing prevent movement? */
|
||||
if ((SECT(was_in) == SECT_UNDERWATER) || (SECT(going_to) == SECT_UNDERWATER))
|
||||
{
|
||||
if ((SECT(was_in) == SECT_UNDERWATER) || (SECT(going_to) == SECT_UNDERWATER)) {
|
||||
if (!has_scuba(ch) && !IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)) {
|
||||
send_to_char(ch, "You need to be able to breathe water to go there!\r\n");
|
||||
return (0);
|
||||
@@ -204,10 +198,8 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
||||
}
|
||||
|
||||
/* Houses: Can the player walk into the house? */
|
||||
if (ROOM_FLAGGED(was_in, ROOM_ATRIUM))
|
||||
{
|
||||
if (!House_can_enter(ch, GET_ROOM_VNUM(going_to)))
|
||||
{
|
||||
if (ROOM_FLAGGED(was_in, ROOM_ATRIUM)) {
|
||||
if (!House_can_enter(ch, GET_ROOM_VNUM(going_to))) {
|
||||
send_to_char(ch, "That's private property -- no trespassing!\r\n");
|
||||
return (0);
|
||||
}
|
||||
@@ -223,15 +215,15 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
||||
send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n");
|
||||
return (0);
|
||||
}
|
||||
if (ZONE_FLAGGED(GET_ROOM_ZONE(going_to), ZONE_NOIMMORT) && (GET_LEVEL(ch) >= LVL_IMMORT) && (GET_LEVEL(ch) < LVL_GRGOD)) {
|
||||
if (ZONE_FLAGGED(GET_ROOM_ZONE(going_to), ZONE_NOIMMORT) && (GET_LEVEL(ch) >= LVL_IMMORT) && (
|
||||
GET_LEVEL(ch) < LVL_GRGOD)) {
|
||||
send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* Room Size Capacity: Is the room full of people already? */
|
||||
if (ROOM_FLAGGED(going_to, ROOM_TUNNEL) &&
|
||||
num_pc_in_room(&(world[going_to])) >= CONFIG_TUNNEL_SIZE)
|
||||
{
|
||||
num_pc_in_room(&(world[going_to])) >= CONFIG_TUNNEL_SIZE) {
|
||||
if (CONFIG_TUNNEL_SIZE > 1)
|
||||
send_to_char(ch, "There isn't enough room for you to go there!\r\n");
|
||||
else
|
||||
@@ -240,8 +232,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
||||
}
|
||||
|
||||
/* Room Level Requirements: Is ch privileged enough to enter the room? */
|
||||
if (ROOM_FLAGGED(going_to, ROOM_GODROOM) && GET_LEVEL(ch) < LVL_GOD)
|
||||
{
|
||||
if (ROOM_FLAGGED(going_to, ROOM_GODROOM) && GET_LEVEL(ch) < LVL_GOD) {
|
||||
send_to_char(ch, "You aren't godly enough to use that room!\r\n");
|
||||
return (0);
|
||||
}
|
||||
@@ -253,8 +244,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
||||
movement_loss[SECT(going_to)]) / 2;
|
||||
|
||||
/* Move Point Requirement Check */
|
||||
if (GET_MOVE(ch) < need_movement && !IS_NPC(ch))
|
||||
{
|
||||
if (GET_MOVE(ch) < need_movement && !IS_NPC(ch)) {
|
||||
if (need_specials_check && ch->master)
|
||||
send_to_char(ch, "You are too exhausted to follow.\r\n");
|
||||
else
|
||||
@@ -274,8 +264,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
||||
GET_MOVE(ch) -= need_movement;
|
||||
|
||||
/* Generate the leave message and display to others in the was_in room. */
|
||||
if (!AFF_FLAGGED(ch, AFF_SNEAK))
|
||||
{
|
||||
if (!AFF_FLAGGED(ch, AFF_SNEAK)) {
|
||||
snprintf(leave_message, sizeof(leave_message), "$n leaves %s.", dirs[dir]);
|
||||
act(leave_message, TRUE, ch, 0, 0, TO_ROOM);
|
||||
}
|
||||
@@ -307,9 +296,9 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
||||
look_at_room(ch, 0);
|
||||
|
||||
/* ... and Kill the player if the room is a death trap. */
|
||||
if (ROOM_FLAGGED(going_to, ROOM_DEATH) && GET_LEVEL(ch) < LVL_IMMORT)
|
||||
{
|
||||
mudlog(BRF, LVL_IMMORT, TRUE, "%s hit death trap #%d (%s)", GET_NAME(ch), GET_ROOM_VNUM(going_to), world[going_to].name);
|
||||
if (ROOM_FLAGGED(going_to, ROOM_DEATH) && GET_LEVEL(ch) < LVL_IMMORT) {
|
||||
mudlog(BRF, LVL_IMMORT, TRUE, "%s hit death trap #%d (%s)", GET_NAME(ch), GET_ROOM_VNUM(going_to),
|
||||
world[going_to].name);
|
||||
death_cry(ch);
|
||||
extract_char(ch);
|
||||
return (0);
|
||||
@@ -319,15 +308,13 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
|
||||
/* Fire memory and greet triggers, check and see if the greet trigger
|
||||
* prevents movement, and if so, move the player back to the previous room. */
|
||||
entry_memory_mtrigger(ch);
|
||||
if (!greet_mtrigger(ch, dir))
|
||||
{
|
||||
if (!greet_mtrigger(ch, dir)) {
|
||||
char_from_room(ch);
|
||||
char_to_room(ch, was_in);
|
||||
look_at_room(ch, 0);
|
||||
/* Failed move, return a failure */
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
} else
|
||||
greet_memory_mtrigger(ch);
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* End: Post-move operations. */
|
||||
@@ -348,7 +335,8 @@ int perform_move(struct char_data *ch, int dir, int need_specials_check)
|
||||
send_to_char(ch, "Alas, you cannot go that way...\r\n");
|
||||
else if ((!EXIT(ch, dir) && !buildwalk(ch, dir)) || EXIT(ch, dir)->to_room == NOWHERE)
|
||||
send_to_char(ch, "Alas, you cannot go that way...\r\n");
|
||||
else if (EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED) && (GET_LEVEL(ch) < LVL_IMMORT || (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)))) {
|
||||
else if (EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED) && (GET_LEVEL(ch) < LVL_IMMORT || (
|
||||
!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)))) {
|
||||
if (EXIT(ch, dir)->keyword)
|
||||
send_to_char(ch, "The %s seems to be closed.\r\n", fname(EXIT(ch, dir)->keyword));
|
||||
else
|
||||
@@ -410,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);
|
||||
return (-1);
|
||||
}
|
||||
for (door = 0; door < DIR_COUNT; door++)
|
||||
{
|
||||
if (EXIT(ch, door))
|
||||
{
|
||||
if (EXIT(ch, door)->keyword)
|
||||
{
|
||||
if (isname(type, EXIT(ch, door)->keyword))
|
||||
{
|
||||
for (door = 0; door < DIR_COUNT; door++) {
|
||||
if (EXIT(ch, door)) {
|
||||
if (EXIT(ch, door)->keyword) {
|
||||
if (isname(type, EXIT(ch, door)->keyword)) {
|
||||
if ((!IS_NPC(ch)) && (!PRF_FLAGGED(ch, PRF_AUTODOOR)))
|
||||
return door;
|
||||
else if (is_abbrev(cmdname, "open"))
|
||||
{
|
||||
else if (is_abbrev(cmdname, "open")) {
|
||||
if (IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))
|
||||
return door;
|
||||
else if (IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))
|
||||
return door;
|
||||
}
|
||||
else if ((is_abbrev(cmdname, "close")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))) )
|
||||
} else if ((is_abbrev(cmdname, "close")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))))
|
||||
return door;
|
||||
else if ((is_abbrev(cmdname, "lock")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))) )
|
||||
else if ((is_abbrev(cmdname, "lock")) && (!(IS_SET(EXIT(ch, door)->exit_info, EX_LOCKED))))
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -655,17 +637,15 @@ ACMD(do_gen_door)
|
||||
send_to_char(ch, "But it's currently open!\r\n");
|
||||
else if (!(DOOR_IS_LOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_LOCKED))
|
||||
send_to_char(ch, "Oh.. it wasn't locked, after all..\r\n");
|
||||
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (has_key(ch, keynum)) )
|
||||
{
|
||||
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((
|
||||
!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (has_key(ch, keynum))) {
|
||||
send_to_char(ch, "It is locked, but you have the key.\r\n");
|
||||
do_doorcmd(ch, obj, door, SCMD_UNLOCK);
|
||||
do_doorcmd(ch, obj, door, subcmd);
|
||||
}
|
||||
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (!has_key(ch, keynum)) )
|
||||
{
|
||||
} else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) && ((
|
||||
!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOKEY))) && (!has_key(ch, keynum))) {
|
||||
send_to_char(ch, "It is locked, and you do not have the key!\r\n");
|
||||
}
|
||||
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) &&
|
||||
} else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && IS_SET(flags_door[subcmd], NEED_UNLOCKED) &&
|
||||
(GET_LEVEL(ch) < LVL_IMMORT || (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE))))
|
||||
send_to_char(ch, "It seems to be locked.\r\n");
|
||||
else if (!has_key(ch, keynum) && (GET_LEVEL(ch) < LVL_GOD) && ((subcmd == SCMD_LOCK) || (subcmd == SCMD_UNLOCK)))
|
||||
@@ -799,7 +779,7 @@ ACMD(do_sit)
|
||||
} else {
|
||||
if (OBJ_SAT_IN_BY(furniture) == NULL)
|
||||
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))
|
||||
continue;
|
||||
NEXT_SITTING(tempch) = ch;
|
||||
@@ -942,7 +922,7 @@ ACMD(do_follow)
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (ch->master != (char_data*) NULL) {
|
||||
if (ch->master != (char_data *)NULL) {
|
||||
send_to_char(ch, "You are following %s.\r\n",
|
||||
GET_NAME(ch->master));
|
||||
} else {
|
||||
|
||||
@@ -88,7 +88,8 @@ ACMD(do_hit)
|
||||
if ((GET_POS(ch) == POS_STANDING) && (vict != FIGHTING(ch))) {
|
||||
if (GET_DEX(ch) > GET_DEX(vict) || (GET_DEX(ch) == GET_DEX(vict) && rand_number(1, 2) == 1)) /* if faster */
|
||||
hit(ch, vict, TYPE_UNDEFINED); /* first */
|
||||
else hit(vict, ch, TYPE_UNDEFINED); /* or the victim is first */
|
||||
else
|
||||
hit(vict, ch, TYPE_UNDEFINED); /* or the victim is first */
|
||||
WAIT_STATE(ch, PULSE_VIOLENCE + 2);
|
||||
} else
|
||||
send_to_char(ch, "You're fighting the best you can!\r\n");
|
||||
@@ -404,8 +405,8 @@ EVENTFUNC(event_whirlwind)
|
||||
|
||||
/* For the sake of simplicity, we will place the event data in easily
|
||||
* referenced pointers */
|
||||
pMudEvent = (struct mud_event_data *) event_obj;
|
||||
ch = (struct char_data *) pMudEvent->pStruct;
|
||||
pMudEvent = (struct mud_event_data *)event_obj;
|
||||
ch = (struct char_data *)pMudEvent->pStruct;
|
||||
|
||||
/* When using a list, we have to make sure to allocate the list as it
|
||||
* uses dynamic memory */
|
||||
@@ -528,11 +529,10 @@ ACMD(do_kick)
|
||||
ACMD(do_bandage)
|
||||
{
|
||||
char arg[MAX_INPUT_LENGTH];
|
||||
struct char_data * vict;
|
||||
struct char_data *vict;
|
||||
int percent, prob;
|
||||
|
||||
if (!GET_SKILL(ch, SKILL_BANDAGE))
|
||||
{
|
||||
if (!GET_SKILL(ch, SKILL_BANDAGE)) {
|
||||
send_to_char(ch, "You are unskilled in the art of bandaging.\r\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
/* Local defined utility functions */
|
||||
/* do_group utility functions */
|
||||
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)
|
||||
{
|
||||
@@ -205,7 +205,7 @@ ACMD(do_steal)
|
||||
return;
|
||||
} else {
|
||||
if (!give_otrigger(obj, vict, ch) ||
|
||||
!receive_mtrigger(ch, vict, obj) ) {
|
||||
!receive_mtrigger(ch, vict, obj)) {
|
||||
send_to_char(ch, "Impossible!\r\n");
|
||||
return;
|
||||
}
|
||||
@@ -226,7 +226,7 @@ ACMD(do_steal)
|
||||
} else { /* Steal the item */
|
||||
if (IS_CARRYING_N(ch) + 1 < CAN_CARRY_N(ch)) {
|
||||
if (!give_otrigger(obj, vict, ch) ||
|
||||
!receive_mtrigger(ch, vict, obj) ) {
|
||||
!receive_mtrigger(ch, vict, obj)) {
|
||||
send_to_char(ch, "Impossible!\r\n");
|
||||
return;
|
||||
}
|
||||
@@ -317,13 +317,13 @@ ACMD(do_title)
|
||||
|
||||
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");
|
||||
|
||||
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",
|
||||
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),
|
||||
GET_HIT(k), GET_MAX_HIT(k),
|
||||
GET_MANA(k), GET_MAX_MANA(k),
|
||||
@@ -331,23 +331,24 @@ static void print_group(struct char_data *ch)
|
||||
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;
|
||||
|
||||
if (group_list->iSize) {
|
||||
send_to_char(ch, "# Group Leader # of Members In Zone\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))
|
||||
continue;
|
||||
if (GROUP_LEADER(group) && !IS_SET(GROUP_FLAGS(group), GROUP_ANON))
|
||||
send_to_char(ch, "%-2d) %s%-12s %-2d %s%s\r\n",
|
||||
++count,
|
||||
IS_SET(GROUP_FLAGS(group), GROUP_OPEN) ? CCGRN(ch, C_NRM) : CCRED(ch, C_NRM),
|
||||
GET_NAME(GROUP_LEADER(group)), group->members->iSize, zone_table[world[IN_ROOM(GROUP_LEADER(group))].zone].name,
|
||||
GET_NAME(GROUP_LEADER(group)), group->members->iSize,
|
||||
zone_table[world[IN_ROOM(GROUP_LEADER(group))].zone].name,
|
||||
CCNRM(ch, C_NRM));
|
||||
else
|
||||
send_to_char(ch, "%-2d) Hidden\r\n", ++count);
|
||||
@@ -415,10 +416,10 @@ ACMD(do_group)
|
||||
} else if (vict == ch) {
|
||||
send_to_char(ch, "There are easier ways to leave the group.\r\n");
|
||||
return;
|
||||
} else if (!GROUP(ch) ) {
|
||||
} else if (!GROUP(ch)) {
|
||||
send_to_char(ch, "But you are not part of a group.\r\n");
|
||||
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");
|
||||
return;
|
||||
} else if (GROUP(vict) != GROUP(ch)) {
|
||||
@@ -459,10 +460,12 @@ ACMD(do_group)
|
||||
}
|
||||
if (is_abbrev(argument, "open")) {
|
||||
TOGGLE_BIT(GROUP_FLAGS(GROUP(ch)), GROUP_OPEN);
|
||||
send_to_char(ch, "The group is now %s to new members.\r\n", IS_SET(GROUP_FLAGS(GROUP(ch)), GROUP_OPEN) ? "open" : "closed");
|
||||
send_to_char(ch, "The group is now %s to new members.\r\n",
|
||||
IS_SET(GROUP_FLAGS(GROUP(ch)), GROUP_OPEN) ? "open" : "closed");
|
||||
} else if (is_abbrev(argument, "anonymous")) {
|
||||
TOGGLE_BIT(GROUP_FLAGS(GROUP(ch)), GROUP_ANON);
|
||||
send_to_char(ch, "The group location is now %s to other players.\r\n", IS_SET(GROUP_FLAGS(GROUP(ch)), GROUP_ANON) ? "invisible" : "visible");
|
||||
send_to_char(ch, "The group location is now %s to other players.\r\n",
|
||||
IS_SET(GROUP_FLAGS(GROUP(ch)), GROUP_ANON) ? "invisible" : "visible");
|
||||
} else
|
||||
send_to_char(ch, "The flag options are: Open, Anonymous\r\n");
|
||||
} else {
|
||||
@@ -511,7 +514,7 @@ ACMD(do_split)
|
||||
}
|
||||
|
||||
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))
|
||||
num++;
|
||||
|
||||
@@ -534,7 +537,7 @@ ACMD(do_split)
|
||||
(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)) {
|
||||
increase_gold(k, share);
|
||||
send_to_char(k, "%s", buf);
|
||||
@@ -793,11 +796,11 @@ ACMD(do_gen_tog)
|
||||
result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
|
||||
if (PRF_FLAGGED(ch, PRF_BUILDWALK)) {
|
||||
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]))
|
||||
break;
|
||||
if (*(sector_types[i]) == '\n')
|
||||
i=0;
|
||||
i = 0;
|
||||
GET_BUILDWALK_SECTOR(ch) = 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];
|
||||
int secs_left;
|
||||
|
||||
if ((IS_HAPPYHOUR) || (GET_LEVEL(ch) >= LVL_GRGOD))
|
||||
{
|
||||
if ((IS_HAPPYHOUR) || (GET_LEVEL(ch) >= LVL_GRGOD)) {
|
||||
if (HAPPY_TIME)
|
||||
secs_left = ((HAPPY_TIME - 1) * SECS_PER_MUD_HOUR) + next_tick;
|
||||
else
|
||||
@@ -881,10 +883,8 @@ static void show_happyhour(struct char_data *ch)
|
||||
(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) / 60, CCNRM(ch, C_NRM),
|
||||
CCYEL(ch, C_NRM), (secs_left % 60), CCNRM(ch, C_NRM) );
|
||||
}
|
||||
else
|
||||
{
|
||||
CCYEL(ch, C_NRM), (secs_left % 60), CCNRM(ch, C_NRM));
|
||||
} else {
|
||||
send_to_char(ch, "Sorry, there is currently no happy hour!\r\n");
|
||||
}
|
||||
}
|
||||
@@ -894,8 +894,7 @@ ACMD(do_happyhour)
|
||||
char arg[MAX_INPUT_LENGTH], val[MAX_INPUT_LENGTH];
|
||||
int num;
|
||||
|
||||
if (GET_LEVEL(ch) < LVL_GOD)
|
||||
{
|
||||
if (GET_LEVEL(ch) < LVL_GOD) {
|
||||
show_happyhour(ch);
|
||||
return;
|
||||
}
|
||||
@@ -903,20 +902,15 @@ ACMD(do_happyhour)
|
||||
/* Only Imms get here, so check args */
|
||||
two_arguments(argument, arg, val);
|
||||
|
||||
if (is_abbrev(arg, "experience"))
|
||||
{
|
||||
if (is_abbrev(arg, "experience")) {
|
||||
num = MIN(MAX((atoi(val)), 0), 1000);
|
||||
HAPPY_EXP = num;
|
||||
send_to_char(ch, "Happy Hour Exp rate set to +%d%%\r\n", HAPPY_EXP);
|
||||
}
|
||||
else if ((is_abbrev(arg, "gold")) || (is_abbrev(arg, "coins")))
|
||||
{
|
||||
} else if ((is_abbrev(arg, "gold")) || (is_abbrev(arg, "coins"))) {
|
||||
num = MIN(MAX((atoi(val)), 0), 1000);
|
||||
HAPPY_GOLD = num;
|
||||
send_to_char(ch, "Happy Hour Gold rate set to +%d%%\r\n", HAPPY_GOLD);
|
||||
}
|
||||
else if ((is_abbrev(arg, "time")) || (is_abbrev(arg, "ticks")))
|
||||
{
|
||||
} else if ((is_abbrev(arg, "time")) || (is_abbrev(arg, "ticks"))) {
|
||||
num = MIN(MAX((atoi(val)), 0), 1000);
|
||||
if (HAPPY_TIME && !num)
|
||||
game_info("Happyhour has been stopped!");
|
||||
@@ -926,30 +920,22 @@ ACMD(do_happyhour)
|
||||
HAPPY_TIME = num;
|
||||
send_to_char(ch, "Happy Hour Time set to %d ticks (%d hours %d mins and %d secs)\r\n",
|
||||
HAPPY_TIME,
|
||||
(HAPPY_TIME*SECS_PER_MUD_HOUR)/3600,
|
||||
((HAPPY_TIME*SECS_PER_MUD_HOUR)%3600) / 60,
|
||||
(HAPPY_TIME*SECS_PER_MUD_HOUR)%60 );
|
||||
}
|
||||
else if ((is_abbrev(arg, "qp")) || (is_abbrev(arg, "questpoints")))
|
||||
{
|
||||
(HAPPY_TIME * SECS_PER_MUD_HOUR) / 3600,
|
||||
((HAPPY_TIME * SECS_PER_MUD_HOUR) % 3600) / 60,
|
||||
(HAPPY_TIME * SECS_PER_MUD_HOUR) % 60);
|
||||
} else if ((is_abbrev(arg, "qp")) || (is_abbrev(arg, "questpoints"))) {
|
||||
num = MIN(MAX((atoi(val)), 0), 1000);
|
||||
HAPPY_QP = num;
|
||||
send_to_char(ch, "Happy Hour Questpoints rate set to +%d%%\r\n", HAPPY_QP);
|
||||
}
|
||||
else if (is_abbrev(arg, "show"))
|
||||
{
|
||||
} else if (is_abbrev(arg, "show")) {
|
||||
show_happyhour(ch);
|
||||
}
|
||||
else if (is_abbrev(arg, "default"))
|
||||
{
|
||||
} else if (is_abbrev(arg, "default")) {
|
||||
HAPPY_EXP = 100;
|
||||
HAPPY_GOLD = 50;
|
||||
HAPPY_QP = 50;
|
||||
HAPPY_TIME = 48;
|
||||
game_info("A Happyhour has started!");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
send_to_char(ch, "Usage: %shappyhour %s- show usage (this info)\r\n"
|
||||
" %shappyhour show %s- display current settings (what mortals see)\r\n"
|
||||
" %shappyhour time <ticks> %s- set happyhour time and start timer\r\n"
|
||||
@@ -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),
|
||||
(3600 / SECS_PER_MUD_HOUR) );
|
||||
(3600 / SECS_PER_MUD_HOUR));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,8 @@ ACMD(do_action)
|
||||
if (!vict) {
|
||||
if (action->char_obj_found) {
|
||||
targ = get_obj_in_list_vis(ch, arg, NULL, ch->carrying);
|
||||
if (!targ) targ = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents);
|
||||
if (!targ)
|
||||
targ = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents);
|
||||
if (targ) {
|
||||
act(action->char_obj_found, action->hide, ch, targ, 0, TO_CHAR);
|
||||
act(action->others_obj_found, action->hide, ch, targ, 0, TO_ROOM);
|
||||
@@ -128,7 +129,8 @@ void create_command_list(void)
|
||||
|
||||
/* count the commands in the command list */
|
||||
i = 0;
|
||||
while(*cmd_info[i].command != '\n') i++;
|
||||
while (*cmd_info[i].command != '\n')
|
||||
i++;
|
||||
i++;
|
||||
|
||||
CREATE(complete_cmd_info, struct command_info, top_of_socialt + i + 2);
|
||||
@@ -166,29 +168,45 @@ void free_social_messages(void)
|
||||
struct social_messg *mess;
|
||||
int i;
|
||||
|
||||
for (i = 0;i <= top_of_socialt;i++) {
|
||||
for (i = 0; i <= top_of_socialt; i++) {
|
||||
mess = &soc_mess_list[i];
|
||||
free_action(mess);
|
||||
}
|
||||
free(soc_mess_list);
|
||||
}
|
||||
|
||||
void free_action(struct social_messg *mess) {
|
||||
if (mess->command) free(mess->command);
|
||||
if (mess->sort_as) free(mess->sort_as);
|
||||
if (mess->char_no_arg) free(mess->char_no_arg);
|
||||
if (mess->others_no_arg) free(mess->others_no_arg);
|
||||
if (mess->char_found) free(mess->char_found);
|
||||
if (mess->others_found) free(mess->others_found);
|
||||
if (mess->vict_found) free(mess->vict_found);
|
||||
if (mess->char_body_found) free(mess->char_body_found);
|
||||
if (mess->others_body_found) free(mess->others_body_found);
|
||||
if (mess->vict_body_found) free(mess->vict_body_found);
|
||||
if (mess->not_found) free(mess->not_found);
|
||||
if (mess->char_auto) free(mess->char_auto);
|
||||
if (mess->others_auto) free(mess->others_auto);
|
||||
if (mess->char_obj_found) free(mess->char_obj_found);
|
||||
if (mess->others_obj_found) free(mess->others_obj_found);
|
||||
void free_action(struct social_messg *mess)
|
||||
{
|
||||
if (mess->command)
|
||||
free(mess->command);
|
||||
if (mess->sort_as)
|
||||
free(mess->sort_as);
|
||||
if (mess->char_no_arg)
|
||||
free(mess->char_no_arg);
|
||||
if (mess->others_no_arg)
|
||||
free(mess->others_no_arg);
|
||||
if (mess->char_found)
|
||||
free(mess->char_found);
|
||||
if (mess->others_found)
|
||||
free(mess->others_found);
|
||||
if (mess->vict_found)
|
||||
free(mess->vict_found);
|
||||
if (mess->char_body_found)
|
||||
free(mess->char_body_found);
|
||||
if (mess->others_body_found)
|
||||
free(mess->others_body_found);
|
||||
if (mess->vict_body_found)
|
||||
free(mess->vict_body_found);
|
||||
if (mess->not_found)
|
||||
free(mess->not_found);
|
||||
if (mess->char_auto)
|
||||
free(mess->char_auto);
|
||||
if (mess->others_auto)
|
||||
free(mess->others_auto);
|
||||
if (mess->char_obj_found)
|
||||
free(mess->char_obj_found);
|
||||
if (mess->others_obj_found)
|
||||
free(mess->others_obj_found);
|
||||
memset(mess, 0, sizeof(struct social_messg));
|
||||
}
|
||||
|
||||
@@ -226,7 +244,7 @@ ACMD(do_gmote)
|
||||
|
||||
half_chop(argument, buf, arg);
|
||||
|
||||
if(subcmd)
|
||||
if (subcmd)
|
||||
for (length = strlen(buf), cmd = 0; *complete_cmd_info[cmd].command != '\n'; cmd++)
|
||||
if (!strncmp(complete_cmd_info[cmd].command, buf, length))
|
||||
break;
|
||||
@@ -242,13 +260,13 @@ ACMD(do_gmote)
|
||||
return;
|
||||
}
|
||||
|
||||
action = &soc_mess_list[act_nr];
|
||||
action = &soc_mess_list[act_nr];
|
||||
|
||||
if (!action->char_found)
|
||||
*arg = '\0';
|
||||
|
||||
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");
|
||||
return;
|
||||
}
|
||||
@@ -257,7 +275,7 @@ action = &soc_mess_list[act_nr];
|
||||
send_to_char(ch, "%s\r\n", action->not_found);
|
||||
return;
|
||||
} 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);
|
||||
return;
|
||||
}
|
||||
|
||||
857
src/act.wizard.c
857
src/act.wizard.c
File diff suppressed because it is too large
Load Diff
77
src/aedit.c
77
src/aedit.c
@@ -22,7 +22,7 @@
|
||||
|
||||
/* local utility functions */
|
||||
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);
|
||||
/* used in aedit parse */
|
||||
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);
|
||||
|
||||
|
||||
|
||||
/* Utils and exported functions. */
|
||||
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);
|
||||
|
||||
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].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].others_found)?soc_mess_list[i].others_found:"#"));
|
||||
((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].char_found) ? soc_mess_list[i].char_found : "#"),
|
||||
((soc_mess_list[i].others_found) ? soc_mess_list[i].others_found : "#"));
|
||||
fprintf(fp, "%s", convert_from_tabs(buf));
|
||||
|
||||
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].not_found)?soc_mess_list[i].not_found:"#"),
|
||||
((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].vict_found) ? soc_mess_list[i].vict_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].others_auto) ? soc_mess_list[i].others_auto : "#"));
|
||||
fprintf(fp, "%s", convert_from_tabs(buf));
|
||||
|
||||
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].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].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].vict_body_found) ? soc_mess_list[i].vict_body_found : "#"));
|
||||
fprintf(fp, "%s", convert_from_tabs(buf));
|
||||
|
||||
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].others_obj_found)?soc_mess_list[i].others_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 : "#"));
|
||||
fprintf(fp, "%s", convert_from_tabs(buf));
|
||||
}
|
||||
|
||||
@@ -256,7 +255,7 @@ static void aedit_save_to_disk(struct descriptor_data *d)
|
||||
}
|
||||
|
||||
/* 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 char_data *ch = d->character;
|
||||
@@ -294,7 +293,7 @@ static void aedit_disp_menu(struct descriptor_data * d)
|
||||
grn, nrm,
|
||||
cyn, action->min_level_char,
|
||||
grn, nrm,
|
||||
cyn, (action->hide?"HIDDEN":"NOT HIDDEN"),
|
||||
cyn, (action->hide ? "HIDDEN" : "NOT HIDDEN"),
|
||||
grn, nrm, cyn,
|
||||
action->char_no_arg ? action->char_no_arg : "<Null>",
|
||||
grn, nrm, cyn,
|
||||
@@ -327,7 +326,7 @@ static void aedit_disp_menu(struct descriptor_data * d)
|
||||
}
|
||||
|
||||
/* The main loop. */
|
||||
void aedit_parse(struct descriptor_data * d, char *arg)
|
||||
void aedit_parse(struct descriptor_data *d, char *arg)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -337,7 +336,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
|
||||
case 'y':
|
||||
case 'Y':
|
||||
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);
|
||||
|
||||
/* 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 */
|
||||
write_to_output(d, "Do you wish to save your changes? : ");
|
||||
OLC_MODE(d) = AEDIT_CONFIRM_SAVESTRING;
|
||||
} else cleanup_olc(d, CLEANUP_ALL);
|
||||
} else
|
||||
cleanup_olc(d, CLEANUP_ALL);
|
||||
break;
|
||||
case 'n':
|
||||
write_to_output(d, "Enter action name: ");
|
||||
@@ -434,7 +434,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
|
||||
return;
|
||||
case '2':
|
||||
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, "Enter choice: ");
|
||||
@@ -442,7 +442,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
|
||||
return;
|
||||
case '3':
|
||||
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, "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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
return;
|
||||
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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
return;
|
||||
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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
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"
|
||||
"[OLD]: %s\r\n"
|
||||
"[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;
|
||||
return;
|
||||
@@ -579,7 +579,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
|
||||
return;
|
||||
|
||||
case AEDIT_ACTION_NAME:
|
||||
if (!*arg || strchr(arg,' ')) {
|
||||
if (!*arg || strchr(arg, ' ')) {
|
||||
aedit_disp_menu(d);
|
||||
return;
|
||||
}
|
||||
@@ -590,7 +590,7 @@ void aedit_parse(struct descriptor_data * d, char *arg)
|
||||
break;
|
||||
|
||||
case AEDIT_SORT_AS:
|
||||
if (!*arg || strchr(arg,' ')) {
|
||||
if (!*arg || strchr(arg, ' ')) {
|
||||
aedit_disp_menu(d);
|
||||
return;
|
||||
}
|
||||
@@ -778,7 +778,7 @@ ACMD(do_astat)
|
||||
|
||||
one_argument(argument, arg);
|
||||
|
||||
if(!*arg) {
|
||||
if (!*arg) {
|
||||
send_to_char(ch, "Astat which social?\r\n");
|
||||
return;
|
||||
}
|
||||
@@ -846,4 +846,3 @@ static int aedit_find_command(const char *txt)
|
||||
return (cmd);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
17
src/utils.h
17
src/utils.h
@@ -59,17 +59,17 @@ struct time_info_data *mud_time_passed(time_t t2, time_t t1);
|
||||
void prune_crlf(char *txt);
|
||||
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 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 );
|
||||
size_t file_sizeof( FILE *file );
|
||||
int file_numlines( FILE *file );
|
||||
IDXTYPE atoidx( const char *str_to_conv );
|
||||
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);
|
||||
size_t file_sizeof(FILE *file);
|
||||
int file_numlines(FILE *file);
|
||||
IDXTYPE atoidx(const char *str_to_conv);
|
||||
char *strfrmt(char *str, int w, int h, int justify, int hpad, int vpad);
|
||||
char *strpaste(char *str1, char *str2, char *joiner);
|
||||
void new_affect(struct affected_type *af);
|
||||
int get_class_by_name(char *classname);
|
||||
char * convert_from_tabs(char * string);
|
||||
int count_non_protocol_chars(char * str);
|
||||
char *convert_from_tabs(char *string);
|
||||
int count_non_protocol_chars(char *str);
|
||||
char *right_trim_whitespace(const char *string);
|
||||
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; \
|
||||
if (temp) \
|
||||
temp->next = (item)->next; \
|
||||
} \
|
||||
|
||||
}
|
||||
/* Connect 'link' to the end of a double-linked list
|
||||
* The new item becomes the last in the linked list, and the last
|
||||
* pointer is updated.
|
||||
|
||||
Reference in New Issue
Block a user