Re: Affections on Score

From: Raf (
Date: 08/14/99

On Sat, 14 Aug 1999, Jeremy Glover wrote:

> I've been trying for awhile now (unsuccessfully) to make it so when players
> type score, all the spells they are affected by show up, along with the
> duration.  I just basically wanted it in the same format as in the "stat"
> command (under act.wizard.c) that imms get.
> Thanks,
> -JAG

Its mainly cut and paste from do_stat_char(), but heres a command
anyway... It can also be used by immo's as 'affects <person>'.
I leave it up to you to add the relevant interpreter.c and cmd.h entries.

 struct affected_type *aff;
 struct char_data *target;

 one_argument(argument, arg);

 if ((!*arg) || GET_LEVEL(ch) < LVL_GOD)
  target = ch;

 else if (!(target = get_char_vis(ch, arg)))
  target = ch;

 else if (IS_NPC(target))
  target = ch;

 sprintf(buf, "&y%s %s affected by:&n \r\n", (target == ch) ? "You" : GET_NAME(target),
         (target == ch) ? "are" : "is");

 send_to_char(buf, ch);

 if (target->affected)
  for (aff = target->affected; aff; aff = aff->next)
   *buf2 = '\0';
   sprintf(buf, "(%3dhr) %s%-21s%s ", aff->duration + 1,
           CCCYN(ch, C_NRM), spells[aff->type], CCNRM(ch, C_NRM));
   send_to_char(strcat(buf, "\r\n"), ch);
  } // end of for loop
 } // end of if
} // end of function

Have fun...


Standard disclaimer:
If it doesnt work, fix it. Dont bug me. If it breaks your mud, kick yourself
for not making backups. If it causes armageddon, hide.

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 12/15/00 PST