I had the stock and production code opened side by side and accidentally copied the stock code haha.
Code:
const char *ACTNULL = "<NULL>";
#define CHECK_NULL(pointer, expression) \
if ((pointer) == NULL) i = ACTNULL; else i = (expression);
/* higher-level communication: the act() function */
void perform_act(const char *orig, struct char_data *ch, struct obj_data *obj,
const void *vict_obj, const struct char_data *to)
{
char k[20];
const char *i = NULL;
char lbuf[MAX_STRING_LENGTH], *buf, *j;
bool uppercasenext = FALSE;
buf = lbuf;
for (;;) {
if (*orig == '$') {
switch (*(++orig)) {
case 'r': /* get random number */
sprintf(k, "%i", rand_number(1, 9999999));
i = k;
break;
case 'c': /* get character art */
i = get_art(ch);
break;
case 'C': /* get victim art */
i = get_art((struct char_data *) vict_obj);
break;
case 'z': /* affects */
sprintf(k, " %ld", AFF_FLAGS(ch));
if (AFF_FLAGGED(to, AFF_DETECT_ALIGN)) {
if (IS_EVIL(ch))
strcat(k, " evil"); //heebie orig: strcpy - overwrote affects
else if (IS_GOOD(ch))
strcat(k, " good");
} //heebie -- adding invis/sanc/hide/eth mist blend/aura tags for iface apr28, 2012
if (AFF_FLAGGED(ch, AFF_INVISIBLE))
strcat(k, " invis");
if (AFF_FLAGGED(ch, AFF_SANCTUARY))
strcat(k, " sanc");
if (AFF_FLAGGED(to, AFF_SENSE_LIFE))
if (AFF_FLAGGED(ch, AFF_HIDE))
strcat(k, " hidden");
if (AFF_FLAGGED(ch, AFF_MIST))
strcat (k, " mist");
i = k;
break;
case 'Z': /* affects victim */
sprintf(k, " %ld", AFF_FLAGS((struct char_data *) vict_obj));
if (AFF_FLAGGED(to, AFF_DETECT_ALIGN)) {
if (IS_EVIL((struct char_data *) vict_obj))
strcat(k, " evil");
else if (IS_GOOD((struct char_data *) vict_obj))
strcat(k, " good");
} //heebie -- adding invis/sanc/hide/eth mist blend/aura tags for iface apr28, 2012
if (AFF_FLAGGED((struct char_data *) vict_obj, AFF_INVISIBLE))
strcat(k, " invis");
if (AFF_FLAGGED((struct char_data *) vict_obj, AFF_SANCTUARY))
strcat(k, " sanc");
if (AFF_FLAGGED(to, AFF_SENSE_LIFE))
if (AFF_FLAGGED((struct char_data *) vict_obj, AFF_HIDE))
strcat(k, " hidden");
if (AFF_FLAGGED((struct char_data *) vict_obj, AFF_MIST))
strcat (k, " mist");
i = k;
break;
case 'l': /* get position of character */
sprinttype(GET_POS(ch), position_types, k, sizeof(k));
i = k;
break;
case 'L': /* get position of victim */
sprinttype(GET_POS((const struct char_data *) vict_obj), position_types, k, sizeof(k));
i = k;
break;
case 'x': /* get the real name */
i = PC_PERS(ch,to);
break;
case 'X': /* get the real name */
CHECK_NULL(vict_obj, PC_PERS((const struct char_data *) vict_obj, to));
break;
case 'i': /* get the mob unique id number */
sprintf(k,"%i", GET_MOB_UNIQID(ch));
i = k;
break;
case 'I': /* get the mob unique id number */
sprintf(k,"%i", GET_MOB_UNIQID((const struct char_data *) vict_obj));
i = k;
break;
case 'n': /* get the name or description */
i = PERS(ch, to);
break;
case 'N': /* get the name or description */
CHECK_NULL(vict_obj, PERS((const struct char_data *) vict_obj, to));
break;
case 'm': /* him, her */
i = HMHR(ch);
break;
case 'M': /* him, her */
CHECK_NULL(vict_obj, HMHR((const struct char_data *) vict_obj));
break;
case 's': /* his, hers */
i = HSHR(ch);
break;
case 'S': /* his, hers */
CHECK_NULL(vict_obj, HSHR((const struct char_data *) vict_obj));
break;
case 'e': /* he, she */
i = HSSH(ch);
break;
case 'E': /* he, she */
CHECK_NULL(vict_obj, HSSH((const struct char_data *) vict_obj));
break;
case 'h': /* health */
sprintf(k,"%i", GET_HIT_PERCENT(ch));
i = k;
break;
case 'H': /* health */
sprintf(k,"%i", GET_HIT_PERCENT((const struct char_data *) vict_obj));
i = k;
break;
case 'o': /* object name */
CHECK_NULL(obj, OBJN(obj, to));
break;
case 'O': /* object name */
CHECK_NULL(vict_obj, OBJN((const struct obj_data *) vict_obj, to));
break;
case 'p': /* object short description */
CHECK_NULL(obj, OBJS(obj, to));
break;
case 'P': /* object short description */
CHECK_NULL(vict_obj, OBJS((const struct obj_data *) vict_obj, to));
break;
case 'a': /* object adjective lowercase */
CHECK_NULL(obj, SANA(obj));
break;
case 'A': /* object adjective lowercase */
CHECK_NULL(vict_obj, SANA((const struct obj_data *) vict_obj));
break;
case 'T':
CHECK_NULL(vict_obj, (const char *) vict_obj);
break;
case 'F':
CHECK_NULL(vict_obj, fname((const char *) vict_obj));
break;
/* uppercase previous word */
case 'u':
for (j=buf; j > lbuf && !isspace((int) *(j-1)); j--);
if (j != buf)
*j = UPPER(*j);
i = "";
break;
/* uppercase next word */
case 'U':
uppercasenext = TRUE;
i = "";
break;
case '$':
i = "$";
break;
default:
log("SYSERR: Illegal $-code to act(): %c", *orig);
log("SYSERR: %s", orig);
i = "";
break;
}
while ((*buf = *(i++)))
{
if (uppercasenext && !isspace((int) *buf))
{
*buf = UPPER(*buf);
uppercasenext = FALSE;
}
buf++;
}
orig++;
} else if (!(*(buf++) = *(orig++))) {
break;
} else if (uppercasenext && !isspace((int) *(buf-1))) {
*(buf-1) = UPPER(*(buf-1));
uppercasenext = FALSE;
}
}
//*(--buf) = '\r';
//*(++buf) = '\n';
//*(++buf) = '\0';
write_to_output(to->desc, "%s\r\n", CAP(lbuf));
}