I have finished adding multi classes to my mud, and now I am trying to
add a command players can use to set their second class. This is what I
got so far:
ACMD(do_dual)
{
skip_spaces(&argument);
one_argument(argument, buf);
/* Check to see if they already have a second class */
if (GET_SECOND_CLASS(ch) != CLASS_UNDEFINED) {
send _to_char("You already are multi-classed!\r\n", ch);
return; }
/* Check to see if they entered a argument */
if (!*buf) {
send_to_char("What would you like to multi-class too?\r\n", ch);
return; }
/* 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. **
/* I tried to use a case statement like this, but it didn't work...
switch (buf) {
case 'mage':
GET_SECOND_CLASS(ch) = 0;
break;
case 'cleric':
GET_SECOND_CLASS(ch) = 1;
break;
case 'thief':
GET_SECOND_CLASS(ch) = 2;
break;
case 'warrior':
GET_SECOND_CLASS(ch) = 3;
break;
default:{
send_to_char("Options: warrior, mage, cleric, thief\r\n",
ch);
return; }
}
*** Does anyone have ideas on how I can get this to work? ***/
GET_SECOND_EXP(ch) = 1; // Initalize second class
GET_SECOND_LEVEL(ch) =1; // parameters.
}
I got it to work in do_set by using this case structure:
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.
Also I would like to this command to only be used in one particular
room, anyone got ideas on how I can do this?
Thanks! - Shaw
+------------------------------------------------------------+
| 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