Improved parse_gen_groups 1.0
                         Code by Dennis Reichel
 		    (dennis@starlifter.reichel.net)

Notes: I found this code on the ROM Mailing list, and since it 
appears to fit almost perfectly into Ember, I thought I'd put it up
on the site for all to enjoy.  I HAVE NOT tested this to see if it 
works yet, and I probably never will (the MUD I am associated with
re-did the skill system and fixed this in a different way).  If it 
helps you make your decision on whether to use this code or not, the 
older code that is used to show where the new code should be placed 
is IDENTICLE to the code in the EmberMUD version of parse_gen_groups.

Install Notes: The function parse_gen_groups can both be found in 
the file SKILLS.C.  The new code is marked with "++" signs, so
REMEMBER TO REMOVE THE ++ SIGNS and any other NON-ESSENTIAL CODE 
before installing.  This appears to be a pretty easy install.

-= Rindar (clogar@concentric.net)


                                * * * * 


There is a problem arising when, for instance, a player creating a 
mage and customizing will add maledictions, then add mage default 
(which contains maledictions)  He is charged the CP for maledictions, 
and then charged again for the mage default.

Realizing his mistake, he may drop maledictions, causing the removal
of that group, even though he is entitled to it by virtue of knowing
mage default.

This would also occur when selecting the sword skill, then selecting 
weaponsmaster.

I have added the following code to parse_gen_groups in skills.c,
apparently correcting this problem, and causing no ill effects.
I was able to duplicate this behavior in stock Rom24b4 code.

This code may be freely used, etc...   Please inform me if there are 
any problems - yes, it might be better to remove the nested skills or
groups as this is detected, or even to tell the player what skill or 
group is to be removed. I just ran out of ambition at this point :)


    if (group_table[gn].rating[ch->class] < 1)
    {
        send_to_char("That group is not available.\n\r",ch);
        return TRUE;
    }

++    /* If this is broken, please mail dennis@realms.reichel.net :-) */    
++    for ( i=0; group_table[gn].spells[i] != NULL ; i++)
++   {
++      if ( group_lookup( group_table[gn].spells[i] ) == -1 )
++          continue; 
++      if ( ch->pcdata->group_known[group_lookup( group_table[gn].spells[i])] )
++      {
++          send_to_char("That group contains groups you already know.\n\r",ch);
++          send_to_char("Please \"drop\" them if you wish to gain this one.\n\r",ch);
++          return TRUE;
++      }
++  }

++  for ( i=0; group_table[gn].spells[i] != NULL ; i++)
++  {
++      if ( skill_lookup( group_table[gn].spells[i] ) == -1 )
++          continue; 
++      if ( ch->gen_data->skill_chosen[skill_lookup( group_table[gn].spells[i])]  )
++      {
++          send_to_char("That group contains skills/spells you already know.\n\r",ch);
++          send_to_char("Please \"drop\" them if you wish to gain this one.\n\r",ch);
++          return TRUE;
++      }
++  }
                
    sprintf(buf,"%s group added\n\r",group_table[gn].name);
    send_to_char(buf,ch);


Dennis
<dennis@starlifter.reichel.net>




 =============================================================================
/   ______ _______ ____   _____   ___ __    _ ______    ____  ____   _____   /
\  |  ____|__   __|  _ \ / ____\ / _ \| \  / |  ____|  / __ \|  _ \ / ____\  \
/  | |__     | |  | |_| | |     | |_| | |\/| | |___   | |  | | |_| | |       /
/  | ___|    | |  | ___/| |   __|  _  | |  | | ____|  | |  | |  __/| |   ___ \
\  | |       | |  | |   | |___| | | | | |  | | |____  | |__| | |\ \| |___| | /
/  |_|       |_|  |_|  o \_____/|_| |_|_|  |_|______|o \____/|_| \_|\_____/  \
\                                                                            /
 ============================================================================

------------------------------------------------------------------------------
ftp://ftp.game.org/pub/mud      FTP.GAME.ORG      http://www.game.org/ftpsite/
------------------------------------------------------------------------------

 This file came from FTP.GAME.ORG, the ultimate source for MUD resources.

------------------------------------------------------------------------------