Re: Help with guilds and multiclassing.

From: Mikael Andersson (
Date: 04/11/03

>To make your code a bit faster, don't put the skill_num check inside
>the loop. I assume you set unused classes to CLASS_UNDEFINED. Then
>try this approach:

>int found = FALSE, i;

>if (skill_num < 1) {
>send_to_char(ch, "no such skill!\r\n");

>for (i = 0;i < MAX_MULTICLASSES && !found; i++) {

>if (GET_CLASS_LEVEL(ch, i) >=
>spell_info[skill_num].min_level[(int) GET_CLASS(ch, i)])
>found = TRUE;

>if (!found) {
>send_to_char(ch, "You can't learn that %s!\r\n", SPLSKL(ch));

>[do stuff here ; i and skill_num are valid]

Thanx :) it works to practice now... but what about the guards... they still
don't want to let anyone through...  this is how that part of the code looks
like, note that i have tried to loop through all of the multiclass slots...
/* Allow the people of the guild through. */
      if (!IS_NPC(ch) && GET_CLASS(ch, 0) == guild_info[i].pc_class)
another thing... i am having trouble casting spells with my mortal, i typ
and see armor at very good, and cure light at very good... but it says you
know of that spell...
this is how that part of the code looks like in do_cast
for (i = 0; i < MAX_MULTICLASSES && !can_cast; i++) {
    /* save cpu time */
    if (GET_CLASS(ch, i) == CLASS_UNDEFINED)
    if (GET_CLASS_LEVEL(ch, i) > SINFO.min_level[(int) GET_CLASS(ch, i)])
      can_cast = TRUE;
thanx for your time

I'm having the same problem... help would be nice :)

MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/26/03 PDT