On Sat, 14 Sep 1996, Mud Admin wrote:
> This lead me to wonder if it were possible to toggle affections at my own
> descretion on mobs and PCs. Say via the set command. Right now, with
> undead as a race, I can just set <victim> <race>.
After reading this I thought it might be usefull as well and did up a quick
command for it... I'll include it here if anyone wants to use it or base
their own implementation off it... its pretty simple...
--snip--
ACMD(do_aff)
{
struct char_data *victim;
char arg2[MAX_INPUT_LENGTH];
int aff;
/**
This next madness is because search_block() forces lower on the
first arg, but does nothing to the list it searches to match it
**/
char *aff_names[] =
{ "blind", "invis", "det-align", "det-invis", "det-magic", "sense-life",
"watwalk", "sanct", "group", "curse", "infra", "poison", "prot-evil",
"prot-good", "sleep", "!track", "UNUSED", "UNUSED", "sneak", "hide",
"UNUSED", "charm",
/* add new affect names here, they MUST be before the "\n" */
"\n"
};
two_arguments(argument, arg, arg2);
if (!*arg || !*arg2) {
send_to_char("Usage: aff <ch> <aff>\r\n", ch);
return;
}
if (!(victim = get_char_vis(ch, arg))) {
send_to_char(NOPERSON, ch);
return;
}
aff = search_block(arg2, aff_names, FALSE);
if (aff < 0) {
send_to_char("Unknown AFF.\r\n", ch);
return;
}
sprintf(buf, "(GC) %s set %s's %s %s.\r\n", GET_NAME(ch),
GET_NAME(victim), affected_bits[aff],
ONOFF(!IS_SET(AFF_FLAGS(victim), (1 << aff))));
mudlog(buf, NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE);
TOGGLE_BIT(AFF_FLAGS(victim), (1 << aff));
send_to_char(OK, ch);
}
--snip--
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://cspo.queensu.ca/~fletcher/Circle/list_faq.html |
+-----------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/18/00 PST