On Sun, 2 Nov 1997, sjm wrote:
> /* Set their second class <warrior, mage, cleric or thief> */
> GET_SECOND_CLASS(ch) = 0; //** I need help here. This line will**
> //** set their second class to mage. **
If you want someone's 2nd class to be undefined, set it to -1. Or better
yet... do: GET_SECOND_CLASS(ch) = CLASS_UNDEFINED.
I don't see the point of putting this line in this function because their
second class REALLY should be set to CLASS_UNDEFINED when the character
is created in nanny() in interpreter.c.
> /* I tried to use a case statement like this, but it didn't work...
> switch (buf) {
[snip]
> }
Won't work. You can't switch a string of characters. You can switch. I'm
kind of surprised this even got past the compiler....
> case 49:
> if ((i = parse_class(*val_arg)) == CLASS_UNDEFINED) {
> send_to_char("That is not a class.\r\n", ch);
> return;
> }
> GET_SECOND_CLASS(vict) = i;
> break;
>
> So the command: <set buba second_class thief> works just fine.
>
You're on the right track here.... Try this:
i = parse_class(*buf);
if (i == CLASS_UNDEFINED) {
send_to_char("That is not a class.\r\n", ch);
return;
}
GET_SECOND_CLASS(vict) = i;
> Also I would like to this command to only be used in one particular
> room, anyone got ideas on how I can do this?
Make it a special procedure and assign it to a mob that is a trainer or
some-such, and make the command a do_not_here type command.
John Evans <evansj@hi-line.net>
May the source be with you.
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST