Re: NEWBIE and not so NEWBIE

From: ShadowLord (dkoepke@california.com)
Date: 05/13/96


On Sun, 12 May 1996, corey hoitsma wrote:

[or all NEWBIE] :)

> First off, I'm trying to add color to the say and gt stuff..
> But when someone says something, it doesn't test the target
> ppl/persons color level, but the person who is saying/gt'ing it.
> What would I use instead of ch? vict?

	There is no victim to 'say'.  What it does is use "act".  There's
a few ways about going about changing the do_say code or other code to get
the effect you want, the first and easiest is to just do:

  struct char_data *tch; /* at the beginning */

  /* instead of the act(buf, FALSE, ch, 0, 0, TO_ROOM); */
  for (tch = world[ch->in_rom].people; tch; tch = tch->next_in_room) {
    sprintf(buf,  "$n says, '%s%s%s'", QCYN, argument, QNRM);
    act(buf, FALSE, ch, 0, tch, TO_VICT);
  }

	The next way is to add more "$" codes so that "$1=QBLU",
"$2=QGRN", etc.  After doing that to the act code, just replace the old
sprintf from do_say with:

  sprintf(buf, "$n says, '$3%s$7'", argument);

	And 'act' would interpret the $-codes independantly.  Remember,
though, this is slightly harder than the first mentions one.

	The hardest (but still not very hard) is on-the-fly color, which
I'll not explain here, but is very easy to do (I've got it doing all kinds
of neat things -- flashing, backgrounds, etc.)

> 
> Secondly, how do you deal with remorts?
> I know that muds have it so that when you remort, you can pick
> a special class for remorts only.. how do you gauge that?

	They get to level 31, give them the command REMORT, have the one
argument to REMORT be the name of a remort class, set level to 1 again,
and there they go again :)  Something like:

/* written off the top of my head */
bool class_remort[NUM_CLASSES] = {
  FALSE,		/* mage */
  FALSE,		/* cleric */
  FALSE,		/* thief */
  FALSE,		/* warrior */
  TRUE,			/* paladin [can remort because TRUE] */
  TRUE,			/* druid ["] */
  FALSE			/* ranger */
};

ACMD(do_remort)
{
  char arg [MAX_INPUT_LENGTH];
  int i;

  extern char *pc_class_names[NUM_CLASSES];

  one_argument(argument, arg);

  if (GET_LEVEL(ch) > LVL_IMMORT) {
    send_to_char("Only level 31 immortals can remort.\r\n", ch);
    return;
  }

  if ((i = search_block(arg, pc_class_names, FALSE)) < 0) {
    send_to_char("Remort to what class?\r\n", ch);
    for (i = 0; i < NUM_CLASSES; i++)
      if (class_remort[i])
        send_to_char(pc_class_names[i], ch);
    send_to_char("Usage: remort <class>\r\n", ch);
  } else if (!class_remort[i])
    send_to_char("That's not a remort class.\r\n", ch);
  else if (GET_CLASS(ch) == i) 
    send_to_char("You are that class!\r\n", ch);
  else {
    GET_CLASS(ch) = i;
    GET_LEVEL(ch) = 1;
    GET_EXP(ch) = 1;
    send_to_char(OK, ch);
  }
}

	With the above code, if the class is set TRUE in class_remort then
it's a remort class and the person can type "remort <the-classes-name>" to
remort to it.  The command table entry for do_remort should be:

  {"remort", do_remort, POS_DEAD, LVL_IMMORT, 0 },

	Sorry if that's the wrong table entry format, I don't use the same
command table as stock CircleMUD.

> 
> Thirdly, with spells, I noticed that when you cast an area spell, or do
> an area skill, it doesn't touch the characters, only the mobs, how would
> I test to see if the person was in the group with that other person?
> (Oh boy! I think I just found out!) Anyways, where would I change this?
> (Once I figure out how to test it).

	Look at the do_group code, it goes through whom is in the group to
display the group members status.



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